making connections www

61
Making Connections Making Connections © Prof. Aiman Hanna © Prof. Aiman Hanna Department of Computer Science Department of Computer Science Concordia University Concordia University Montreal, Canada Montreal, Canada

Upload: robinpt

Post on 06-Sep-2015

240 views

Category:

Documents


1 download

DESCRIPTION

Making Connections Www

TRANSCRIPT

  • Making Connections Prof. Aiman HannaDepartment of Computer Science Concordia University Montreal, Canada

  • C ommunication Carriers & DevicesThe Telephone NetworkConnects 100s of millions of usersCalls are routed first to the local office (local exchange or central office) Calls within the same area code can be made through direct connectionsOther calls are routed depending on the destinationPrivate Branch Exchange (PBX) computer is used to route telephone calls within a company or organization Figure 4.2 Telephone Network

  • C ommunication Carriers & DevicesCellular PhonesA geographic region is divided into cells each with a base station. A cellular phone is a two-way radio capable of communicating with the base station

    The cell phone may be within more than one boundary, however it communicates with the base station from where the signal is stronger

    Base stations communicate with a MTSO (Mobile Telephone Switching Office), which connects to the regular telephone network

    Receiving a cell call is more complex

  • C ommunication Carriers & DevicesCellular PhonesFigure 4.3 Cellular Grid

  • C ommunication Carriers & DevicesCellular PhonesFigure 4.4 Cellular Phone Communication

  • C ommunication Carriers & DevicesFacsimile (Fax) MachinesA paper sheet is divided into a dot matrix; each dot (Pixel) is so tiny (200 dots per inch, 40,000 dots per square inch)

    Each dot is a bit: 1 if dot is white, 0 if black

    8.5x11 inches paper would produce 3,740,000 dots, and it takes 2 minutes (approx.) at the rate of 33.6 bps

    Fax machines use Data Compression schemes; instead of sending dot by dot, the fax groups the dots and defines binary representation of them using fewer bits

  • T ransmission ModesDefines the way in which a bit group travels from device to another

    Also defines whether bits travel in both directions simultaneously or must take turns

    Different transmission modes exist:Serial & ParallelAsynchronous, Synchronous & IsochronousSimplex, Half-Duplex & Full-Duplex

  • T ransmission Modes (continue...)Serial & Parallel Transmission Parallel transmission sends bits of a byte simultaneously on separate wires; used between PC and printerOnly recommended for short distances due to sync problemsSerial transmission uses one wire, and can be used for long distance communication; cheaper, more reliable but slowerFigure 4.7 Parallel & Serial transmission

  • T ransmission Modes (continue...)Asynchronous, Synchronous & Isochronous Transmission These are ways to provide serial communication Asynchronous transmission:Bits are divided into small groups, usually bytes, and sent independentlyThe receiver never knows when the bits will arriveFor example, typing keyboard charactersTypical byte-oriented input-output; that is data is transmitted one byte at a timeA start bit is needed to alert the receive that some data is coming; otherwise the first few bit may get lost by the time the receiver detect and reacts to data reception Similarly, a stop bit is needed

  • T ransmission Modes (continue...)Asynchronous, Synchronous & Isochronous Transmission Figure 4.8 Asynchronous CommunicationOverhead is 2/8 = 25%

    Figure 4.9 Asynchronous Transmission of ASCII Digits 321 using NRZ Coding

  • T ransmission Modes (continue...)Asynchronous, Synchronous & Isochronous Transmission Synchronous transmission:Allows transmission of larger bit groupsCharacters are grouped into a Data Frame (simply Frame) them be transmitted as a wholeA generic data frame has the following pieces:SYN: unique bit pattern that alert the receiver of frame arrivalAlso used to ensure the receivers sampling rate and the consistency of the arrival rateThe receiver can then synchronize itself to the rate at which bits arriveControl: these bits may include the following elementsSource addressDestination address: Needed if frame needs to go through different nodes before reaching the destination Data: Actual number of data bytesSequence Number: Used to assemble frames at the destination in case they arrive out of orderFrame Type: Distinguished by some protocols Error: Error checking bitsEnd: End-of-frame bits

  • T ransmission Modes (continue...)Asynchronous, Synchronous & Isochronous Transmission Synchronous transmission:Much faster and has small overhead, howeverLarger frames require higher buffering; they may also occupy the link for longer timeFigure 4.10 Synchronous Transmission Frame

  • T ransmission Modes (continue...)Asynchronous, Synchronous & Isochronous Transmission Isochronous transmission:With asynchronous & synchronous data do not necessarily arrive at a fixed rateTime between different synchronous frames may vary (asynchronous nature!) Errors may force the frame to be reset, which affects the transfer rate furtherFor some applications, such as file transfer, that is fine since correct information is more important than delaysIsochronous transmission is used to ensure a fixed transmission rate without gaps in between

  • T ransmission Modes (continue...)Simplex, Half-Duplex & Full-Duplex Communication

    Figure 4.11 Simplex, Half-Duplex & Full-Duplex communication

  • I nterface StandardCommunication may not occur even if both parties are using the same mechanisms!For example, if both send at the same time, no information may reach any of them if one is not ready to listen then information is also lostHence, communication must be guided by protocolsData Terminal Equipment (DTE), such as PCs, do not communicate directly; rather they communicate to Data Communication Equipment (DCE), such as a modem, which connect to the networkThe connection between DTE & DCE is called DTE-DCE InterfaceFigure 4.12 DTE-DCE Interface

  • I nterface Standard (continue...)EIA-232 Interface (RS-25 Serial Port)RS232: 25-line cable with 25-pin connector (DB25).Every line has a function; for example:Pin 1: protective ground Pin 2: Transmit date DTE DCEPin 22: Ring Indicator; indicates DCE is receiving a ringing signal (when modem receives a call)

    RS-232 Connector

  • I nterface Standard (continue...)EIA-232 Interface (RS-232 Serial Port)Figure 4.14 Sending & Receiving over RS-232

  • I nterface Standard (continue...)EIA-232 SubsetDriven by economics and actual user needs, some vendors only implemented a part of the interface using only 9 circuits instead of 25 (9-bin connectors)RS-232 Subset 9-bin Connector

  • I nterface Standard (continue...)Null ModemSometimes, it is needed to connect two computers directlyA first attempt to establish connection is plug in the wire to both endsThis however wont work; Why? Same circuit in each end is expected to perform the same functionality; for example send/send or receive/receive One solution in such case is to use a null modemThe null modem can be simply a cableFigure 4.15 Null Modem

  • I nterface Standard (continue...)X.21 InterfaceUses 15-bin interfaceDefined as a digital signaling interfaceControl information are changed in a different way than RS-25The standard requires more logic circuits (intelligence) in the DTE & DCE that can interpret control sequence & reduce the number of connecting circuitsC (control) & I (indication) state infoT (transmit) & R (receive) data or control info

  • I nterface Standard (continue...)X.21 InterfaceFigure 4.16 Sending & Receiving over an X.21 Connection

  • I nterface Standard (continue...)Universal Serial Bus (USB)Not long ago, we had to deal with Serial ports, Parallel ports, Special connections for Game controllers, Key-boards, Mice, etc.

    USB was the proper replacements to those many connectors

    Very flexible in connecting many different devices

    Has 7-bit addressing schemes to reference the devices, which enables connections to 127 (excluding the DTE host itself)

  • I nterface Standard (continue...)Universal Serial Bus (USB)Figure 4.17 Connecting USB Devices

  • I nterface Standard (continue...)Universal Serial Bus (USB)USB cable contains 4 wires: 2 wires for data carrying signal in modified NRZ (0 changing, 1 same)The other two wires provide low-amplitude power source to USB devicesUSB 1.1 at 12 Mbps, USB 2.0 at 480 Mbps.Limited to 4.5 meters; if longer, there is no guarantee of electrical signal integrity Figure 4.19 USB Cable & PlugsFigure 4.18 USB Wires

  • I nterface Standard (continue...)Universal Serial Bus (USB)Operates on Master/Slave mode, where the host is the master

    USB Frame: 1-milisecond slice of time.

    During this 1-ms time frame, packets are sent (packet is a group of bits)

    All devices are clock synchronized in respect to a frame

    The synchronization is not done by a common clock; rather by the host sending a special packet at the beginning of each frame

    This special packet indicates that a new frame is beginning

  • I nterface Standard (continue...)Universal Serial Bus (USB)USB defines 4 different transmission types:Control Transfer Bulk Transfer Interrupt Transfer Isochronous Transfer Control Transfer: USB devices are hot pluggable Once plugged, the host queries the device to determine its type & bit rateThe devices responds the host assigns an address to that deviceOnce this is done, the device is connected and can receive commands from the host such as requesting their status or initiating data exchange

  • I nterface Standard (continue...)Universal Serial Bus (USB)Bulk Transfer: Some USB devices, such as scanners & digital cameras, transfer large amount of data (bulk transfer)

    Error detection is performed and the packet may have to be resent

    Reliable transfer, but no guarantee of timely transferMany devices might be doing bulk transfer at the same time, which may result in errors/retransmission hence, no guarantee on delivery time

  • I nterface Standard (continue...)Universal Serial Bus (USB)Interrupt Transfer: The world interrupt here is not that proper!

    USB devices hold the information until the host asks for them, which is literally Polling

    The major advantage here is avoiding the complexity involved with the interrupt system/protocol

    For example, if the host sets its polling time to the keyboard at 50 frames (each 50 ms), then it can get up to 20 characters each second

  • I nterface Standard (continue...)Universal Serial Bus (USB)Isochronous Transfer: For some real-time devices, such as microphones and speakers, steady transfer rate is significant

    The host can guarantee data rate for those devices by reserving a part of each frame for them

    As with most real-time systems, error detections do not occur here; it is simply not needed

  • I nterface Standard (continue...)Universal Serial Bus (USB)USB Packets Several exchange of packets could take place during a single frame Packet types: Token, Data, HandshakeAll packets have SYN and PID (packet ID)SYN is a bit pattern that forces the receiving device to synchronize its clock with the sender and adjust their receiving bit ratePID identifies the packet type SOF indicates the Start o Frame

  • I nterface Standard (continue...)Universal Serial Bus (USB)USB Packets IN & OUT packets represent a request from the host to initiate data transferAddress is a 7-bit address that identifies the device to be usedCRC (Cyclic Redundancy Check) is used for error detection If errors occur, a NAK is sent to the hostSome devices may have more than one address; for example a game controller with multiple buttons would have multiple addresses associated with them. The endpoint is needed to identify the exact source or destination of the data within the device. For example, a game controller may have many buttons sending or receiving different information. Each of these buttons will be indicated by an endpoint

  • I nterface Standard (continue...)Universal Serial Bus (USB)USB Packets

    Figure 4.20 USB Frames & Packets

  • I nterface Standard (continue...)FireWireFireWire (Apple), i.Link (Sony)Share common characteristics with USBProvide a speed of 400Mbps (USB provides 12Mbps, USB 2.0 provides 480 Mbps Can be used with many devices, but the main focus is on multimedia devices, especially with digital video applicationConnects multiple devices using Daisy Chain, which means many devices can be connected in sequence and there is no need for a hubDevices have one or more FireWire port, so they can also act as regenerators/repeaters

  • I nterface Standard (continue...)FireWireFigure 4.21 Connecting FireWire Devices

  • I nterface Standard (continue...)FireWireUses 6 wires (2 twisted pairs TPA & TPB + 2 wires for power source)Uses Data Strobe EncodingTPA uses some form of NRZ, where 1 is high, 0 is lowThis is however error-prone due to mis-synchronization with the sender clockThe sender sends a strobe signal over TPB, which stays constant whenever the data change from 1 to 0 and vise versaThe receiver gets both TPA & TPB signals and by XORing them, it can create the exact sender clockThis is a bit like Manchester Encoding, with one great difference; the baud rate is the same as the bit rate, so there is no double BW utilizationThe only cost here is one additional twisted pair

  • I nterface Standard (continue...)FireWireFigure 4.22 Data Strobe Encoding

  • I nterface Standard (continue...)Multiple FireWire BusesUSB uses Master/Slave protocol whereas FireWire uses peer-to-peer protocol Devices may be daisy chained together to form a bus groupFigure 4.23 Multiple FireWire Buses

  • I nterface Standard (continue...)Multiple FireWire BusesFireWire supports two communication modes: Asynchronous, Isochronous

    Asynchronous Communication:Involves exchange & acknowledgmentSend a packet Wait for a ACK or NACKIsochronous Transfer:With this mode, FireWire guarantee that data is sent at a steady rate; there is no waiting for ACKs or resending of packets

  • I nterface Standard (continue...)FireWire ArbitrationSince there is no master host, what happens if two devices attempt to send at the same time Devices are configured in a tree hierarchy, with one device at the root; each device selects an ID based on its location in the treeThe root device acts an arbiter; when devices under it wish to transfer, the root decides which one gets the bus based on some form of priority This process is only part of the arbitration, and it works with some arbitration methods: Fairness Arbitration, and Urgent Arbitration

  • I nterface Standard (continue...)FireWire ArbitrationFairness arbitration: Fairness interval allows all competing devices to access the bus once. No device monopolizes the bus; the fairness interval starts again after all devices that wish to send use the bus onceUrgent arbitration allows the devices to be prioritized within a fairness interval (asynchronous packets interval)Root device has the highest priority among all in the groupTo guarantee Isochronous transmission, the root device acts as a Cycle master. Each cycle starts with a cycle-start-packet, which marks the start of an Isochronous cycleStarting the Isochronous cycle regularly guarantees Isochronous transmission

  • I nterface Standard (continue...)FireWire ArbitrationFigure 4.23 FireWire Arbitration

  • M ultiplexingIt is possible to connect each device of a network directly to that network, however each of these connection carries its costAlternatively, multiplexing can be used A multiplexer, or mux, routes transmission from multiple sources to a single destination Multiplexer

  • M ultiplexing (continue...)Frequency-Division Multiplexing (FDM)Used with analog signals; a common uses are TV & radioThe available BW is divided into separate ranges or channelsEach device shares a part of the available BW, a channel, and keeps that portion at all times

    Figure 4.27 Amplitude Modulation

  • M ultiplexing (continue...)Frequency-Division MultiplexingThe modulated signals from all inputs are combined into as a single, more complex analog signalThe channels themselves are separated by a guard bandFigure 4.29 FDM

  • M ultiplexing (continue...)Time-Division Multiplexing (TDM)Used with digital signalsTDM keeps the signals physically distinct but logically packages them together The optimal performance is achieved when the combined input rate is equal to the output rateA faster combined input rate would result in signals being dropped and a slower input rate would results in frames that are partially full so the channels are underused

    Figure 4.30 TDM

  • M ultiplexing (continue...)Statistical Time-Division MultiplexingIn practice, it may not be possible to keep input & output rates the same Keeping the frame size fixed would simply the protocol but underutilize the channels An alternative is to use Statistical Multiplexer, sometimes called Concentrator Since the order in one frame is not the guaranteed, a more complex logic is there to resolve the frame correctly

    Figure 4.31 Statistical TDM

  • M ultiplexing (continue...)Wave-Division MultiplexingSimilar to FDM, but based on optics Potential bit rate is 1000 Gbps (Tera bps)Light consists of several wavelengths (refer to spectrum of frequencies)Prism spreads the light into different colors (to different wavelengths)Each source can operate at a specific wavelength All signals are combined before transmission, and separated at the receiver

    Figure 4.32 Light Reflecting through a PrismFigure 4.33 Wave-Division Multiplexing

  • D igital CarriersT1A standard used for long-distance communication Uses TDM to combine many voice channels into one DS1 frameT1 refers to the circuit, DS1 refers to the signalDS1 frame has 24 channels of 8 bits each, and one framing bit for synchronization Figure 4.34 DS1 Frame

  • D igital Carriers (continue...)T18-bit voice samples are taken from each of the 24 channels at a rate of 8000 samples per second Each sample occupies one slot in the DS1 frameThe receiving mux extract the bits from each slot and route them to the appropriate destination (the voice is heard at the other side) Figure 4.34 T1 Carrier System

  • D igital Carriers (continue...)T1T1 rate:8-bit sample * 8000 samples/second 64 KbpsTo support this rate, T1 must transmit a DS1 frame each 1/8000 seconds must transmit 8000 * 193 bits each second Date rate of 1.544 MbpsThis rate is considered slow compared to optical fiber capabilitiesThat is the reason there are other carriers with more channels and faster bit rateT1 is not only used for voice communication; other companies lease phone lines to transfer digital information between computersNorth American Communication Carriers

    Carrier Digital Signal No.No. of ChannelsBit Rate, MbpsT1DS1241.544T2DS2966.312T3DS367244.736T4DS44,032274.176

  • C ontention ProtocolsAccess to the medium from many entry points is called contentionUnless controlled, contention may lead to fatal problemsContention protocols are used to avoid such problemsFigure 4.39 No Contention ProtocolFigure 4.40 Stop-and-Go Access Protocol

  • C ontention Protocols (continue...)Aloha ProtocolsEarliest contention protocol in 1970s by Univ. of Hawaii, called Pure ALOHASeveral stations to central station (Menehune) by radio communicationf1 for broadcast, f2 (different frequency than f1) for ACKAny station can transmit; if collision then wait random timeFigure 4.41 Aloha System

  • C ontention Protocols (continue...)Slotted Aloha ProtocolsAny overlap in signals, even a small one, would force retransmissionHence, a minimal safe period to transmit two signals is 2T (T is time period)So, to allow a device to transmit, you should reserve 2T for thatNot to waste such time, Slotted Aloha is usedDevices can only send at the beginning of each slotFigure 4.42 Transmission Using Pure Aloha & Slotted Aloha

  • C ontention Protocols (continue...)Slotted Aloha ProtocolsSlotted Aloha has a higher success rate than Pure AlohaHowever, with increased traffic, the different may not be that significant Figure 4.43 Success Rate for Pure Aloha & Slotted Aloha

  • C ontention Protocols (continue...)Carrier Sense Multiple Access Protocols (CSMA)Sense the medium at the beginning of a slot, send if the medium is free, else wait for next slotp-persistent CSMA:Continue to sense the active medium If free, send with a probability p (0 < p 1)p=0 never transmits (wait again) ;p=1 always transmits (collision chances are higher)

    Nonpersistent CSMA: check periodically, if free send else wait for one time slot and check again

    Figure 4.44 Success Rate for CSMA & Aloha Protocols

  • C ontention Protocols (continue...)Collision Detection (CD)Instead of sending entire frame then discover that collision has occurred when no ack is received, sense the medium for collision and stop transmitting if occurs This will avoid the medium from being unusable during collision Commonly used with CSMA called CSMA/CD

    Figure 4.45 Collision with and without Detection

  • C ontention Protocols (continue...)Collision Detection (CD)Two issues worth considering:Frame sizeDistanceFrame Size: The frame has to be of a minimum size so the device can detect collision before it finishesIf too large, a device can monopolize the mediumSo, how small should a frame be?Depends on the maximum time it takes to detect collision

  • C ontention Protocols (continue...)Collision Detection (CD)Example: Assume:10 Mbps bit rate,

    Largest distance between two devices is 2 KM

    Signal propagate at a rate of 200 meter/sec

    To propagate 2 KM it takes 10 sec

    To propagate 4 KM (worst case, go & come back), we need 20 sec

    Rate of 10 Mbps is the same as 10 bits each sec In 20 sec we have 200 bits or 200/8 = 25 bytes

    This is the minimum size a frame can be so CD can be made

  • C ontention Protocols (continue...)Collision Detection (CD)The other issue with CD is distanceFor example CD does not work well with satellite since the time needed to travel back and forth between ground and satellite is too big due to the large distance

    Binary exponential back-off algorithm Varies the waiting time before sending again if collision occurred If first collision then wait 0, or 1 slotsSecond collision then wait randomly for 0, 1, 2, or 3 slots............................If n successive collisions then wait for random # of slots between 0 and 2n-1, when n > 16 give-up and signal to higher layer!

  • C ontention Protocols (continue...)Token PassingInstead of sending whenever it wishes, a device will take turns in sending with the other onesCapture token to send data frameIf data then remove token and transmit data frame; else pass token to neighborOnly sender can put the token back on ring after receiving it backOne frame per tokenAdvantage: contention is much controlled than the previous protocolsDisadvantages: All devices must be knownComplexity (what happen if the token is lost or if the device that has control over it fails)

  • C ontention Protocols (continue...)Token Passing

    Figure 4.46 Token Ring Network

    1) These notes are Aiman Hanna. All copyrights reserved. For more information please e-mail to: [email protected]. 2) These notes are also based on: Understanding Communications and Networking, 3e by William A. Shay, published by Thomson, ISBN 0-534-38317-3. These notes still totally enforce all copyrights for Shay/Thomson. For more information on these rights, please refer to the original publication of the book. 3) VERY IMPORTANT: These notes are neither complete nor sufficient to study for the course. They are merely given as a guidance for your study and to help you following what is covered. You should NEVER depend solely on these notes for your study.

    Any use of these notes that results in violation of any of the copyrights indicated above is strictly prohibited.Data Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaNotes: 0) Whatever is the connector or device, the bottom-line is transmitting/receiving bits

    1) USB was the work of 7 companies (IBM, Compaq, Intel, Microsoft, Northern Telecom, DEC & NEC)2) Can connect devices directly or through a hub (a level-1 device that regenerates & repeats the signal from one connection over other connections)Data Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman HannaData Communications & Computer Networking, by: Aiman Hanna