610 likes | 749 Views
Communication Networks & Protocols . Making Connections. © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada. C ommunication Carriers & Devices. The Telephone Network Connects 100s of millions of users
E N D
Communication Networks & Protocols Making Connections © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada
Communication Carriers & Devices The Telephone Network • Connects 100s of millions of users • Calls are routed first to the local office (local exchange or central office) • Calls within the same area code can be made through direct connections • Other calls are routed depending on the destination • Private Branch Exchange (PBX) computer is used to route telephone calls within a company or organization Figure 4.2 – Telephone Network
Communication Carriers & Devices Cellular Phones • A 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
Communication Carriers & Devices Cellular Phones Figure 4.3 – Cellular Grid
Communication Carriers & Devices Cellular Phones Figure 4.4 – Cellular Phone Communication
Communication Carriers & Devices Facsimile (Fax) Machines • A 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 Modes • Defines 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 & Parallel • Asynchronous, Synchronous & Isochronous • Simplex, 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 printer • Only recommended for short distances due to sync problems • Serial transmission uses one wire, and can be used for long distance communication; cheaper, more reliable but slower Figure 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 independently • The receiver never knows when the bits will arrive • For example, typing keyboard characters • Typical byte-oriented input-output; that is data is transmitted one byte at a time • A 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 Communication Overhead 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 groups • Characters are grouped into a Data Frame (simply Frame) them be transmitted as a whole • A generic data frame has the following pieces: • SYN: unique bit pattern that alert the receiver of frame arrival • Also used to ensure the receiver’s sampling rate and the consistency of the arrival rate • The receiver can then synchronize itself to the rate at which bits arrive • Control: these bits may include the following elements • Source address • Destination address: Needed if frame needs to go through different nodes before reaching the destination • Data: Actual number of data bytes • Sequence Number: Used to assemble frames at the destination in case they arrive out of order • Frame Type: Distinguished by some protocols • Error: Error checking bits • End: End-of-frame bits
T ransmission Modes (continue...) Asynchronous, Synchronous & Isochronous Transmission • Synchronous transmission: • Much faster and has small overhead, however • Larger frames require higher buffering; they may also occupy the link for longer time Figure 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 rate • Time between different synchronous frames may vary (asynchronous nature!) • Errors may force the frame to be reset, which affects the transfer rate further • For some applications, such as file transfer, that is fine since correct information is more important than delays • Isochronous 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-Duplexcommunication
I nterface Standard • Communication 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 lost • Hence, communication must be guided by protocols • Data 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 network • The connection between DTE & DCE is called DTE-DCE Interface Figure 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 DCE • Pin 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 Subset • Driven 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 Modem • Sometimes, it is needed to connect two computers directly • A first attempt to establish connection is plug in the wire to both ends • This however won’t 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 modem • The null modem can be simply a cable Figure 4.15 – Null Modem
I nterface Standard (continue...) X.21 Interface • Uses 15-bin interface • Defined as a digital signaling interface • Control information are changed in a different way than RS-25 • The standard requires more logic circuits (intelligence) in the DTE & DCE that can interpret control sequence & reduce the number of connecting circuits • C (control) & I (indication) state info • T (transmit) & R (receive) data or control info
I nterface Standard (continue...) X.21 Interface Figure 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 devices • USB 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.18 – USB Wires Figure 4.19 – USB Cable & Plugs
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 rate • The devices responds the host assigns an address to that device • Once 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 transfer • Many 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, Handshake • All 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 rate • PID 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 transfer • Address is a 7-bit address that identifies the device to be used • CRC (Cyclic Redundancy Check) is used for error detection • If errors occur, a NAK is sent to the host • Some 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...) FireWire • FireWire (Apple), i.Link (Sony) • Share common characteristics with USB • Provide 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 application • Connects multiple devices using Daisy Chain, which means many devices can be connected in sequence and there is no need for a hub • Devices have one or more FireWire port, so they can also act as regenerators/repeaters
I nterface Standard (continue...) FireWire Figure 4.21 – Connecting FireWire Devices
I nterface Standard (continue...) FireWire • Uses 6 wires (2 twisted pairs TPA & TPB + 2 wires for power source) • Uses Data Strobe Encoding • TPA uses some form of NRZ, where 1 is high, 0 is low • This is however error-prone due to mis-synchronization with the sender clock • The sender sends a strobe signal over TPB, which stays constant whenever the data change from 1 to 0 and vise versa • The receiver gets both TPA & TPB signals and by XORing them, it can create the exact sender clock • This 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 utilization • The only cost here is one additional twisted pair
I nterface Standard (continue...) FireWire Figure 4.22 – Data Strobe Encoding
I nterface Standard (continue...) Multiple FireWire Buses • USB uses Master/Slave protocol whereas FireWire uses peer-to-peer protocol • Devices may be daisy chained together to form a bus group Figure 4.23 – Multiple FireWire Buses
I nterface Standard (continue...) Multiple FireWire Buses • FireWire supports two communication modes: Asynchronous, Isochronous • Asynchronous Communication: • Involves exchange & acknowledgment • Send a packet Wait for a ACK or NACK • Isochronous 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 Arbitration • Since 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 tree • The 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 Arbitration • Fairness 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 once • Urgent arbitration allows the devices to be prioritized within a fairness interval (asynchronous packets interval) • Root device has the highest priority among all in the group • To 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 cycle • Starting the Isochronous cycle regularly guarantees Isochronous transmission
I nterface Standard (continue...) FireWire Arbitration Figure 4.23 – FireWire Arbitration
M ultiplexing • It is possible to connect each device of a network directly to that network, however each of these connection carries its cost • Alternatively, 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 & radio • The available BW is divided into separate ranges or channels • Each 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 Multiplexing • The modulated signals from all inputs are combined into as a single, more complex analog signal • The channels themselves are separated by a guard band Figure 4.29 – FDM
M ultiplexing (continue...) Time-Division Multiplexing (TDM) • Used with digital signals • TDM 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 rate • A 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 Multiplexing • In 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 Multiplexing • Similar 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 Prism Figure 4.33 – Wave-Division Multiplexing
D igital Carriers T1 • A standard used for long-distance communication • Uses TDM to combine many voice channels into one DS1 frame • T1 refers to the circuit, DS1 refers to the signal • DS1 frame has 24 channels of 8 bits each, and one framing bit for synchronization Figure 4.34 – DS1 Frame
D igital Carriers (continue...) T1 • 8-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 frame • The 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...) T1 • T1 rate: • 8-bit sample * 8000 samples/second 64 Kbps • To 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 Mbps • This rate is considered slow compared to optical fiber capabilities • That is the reason there are other carriers with more channels and faster bit rate • T1 is not only used for voice communication; other companies lease phone lines to transfer digital information between computers North American Communication Carriers