Direct Link Networks: Building Blocks (2.1), Encoding (2.2), Framing (2.3) ECPE/CS 5516: Computer Networks Originally by Scott F. Midkiff (ECpE) Modified by Marc Abrams (CS) Virginia Tech courses.cs.vt.edu/~cs5516
Physical layer Lecture Topics Examples of direct links (2.1) Data encoding (2.2) Point-to-point protocols Framing (2.3) CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-2
2.1: Hardware Building Blocks CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-3
Links at Physical Layer Physical media for links: Twisted pair Coaxial cable Optical fiber Radio waves Infrared Media + Electronics + Optics = media properties CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-4
Physical Layer Properties Bit encoding: How is information -- 1 s and 0 s -- encoded? Full-duplex versus half-duplex operation Full-duplex: data in both directions simultaneously Half-duplex: data in one direction at a time Data rate: How much info can be sent in unit of time? Extent: What s max link length for reliable operation? CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-5
Link Examples Service Category 5 twisted pair 50-ohm coax (Thinwire) 75-ohm coax (Thickwire) Multimode fiber Single-mode fiber Bandwidth 10-1000 Mbps 10-100 Mbps 10-100 Mbps 100 Mbps 100-2400 Mbps Distances 100 m 200 m 500 m 2 km 40 km CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-6
Examples of Leased Links Service ISDN (B-channel) T1 (DS1) T3 (DS3) STS-3 (OC-3) STS-12 (OC-12) STS-24 (OC-24) STS-48 (OC-48) Bandwidth 64 Kbps 1.544 Mbps 44.736 Mbps 155.251 Mbps 622.080 Mbps 1.244160 Gbps 2.488320 Gbps CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-7
Links to Homes Service POTS ISDN xdsl CATV Bandwidth 28.8-56 Kbps 64-128 Kbps 16Kbps-55Mbps 20-40 Mbps CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-8
2.2: Encoding CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-9
Encoding Encoding determines how information is represented by electrical, optical, or electromagnetic signal Node Adaptor signal information Adaptor Node CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-10
Example of Encoding The most intuitive Non-return to Zero (NRZ) 1 1 0 0 1 0 1 0 Encode 1 as high voltage level, 0 as low Others: Non-return to zero inverted (NRZI) Manchester Block codes, e.g. 4B/5B CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-11
Physical Layer Bit Pipe Physical layer defines signal levels and timing to deliver bit stream to Data Link layer Signal bandwidth determines data rate limit Timing errors Noise or distortion can lead to errors in timing Sender and receiver clocks may differ -- drift CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-12
Physical Layer Bit Pipe Physical layer defines signal levels and timing to deliver bit stream to Data Link layer Signal bandwidth determines data rate limit Timing errors Noise or distortion can lead to errors in timing Sender and receiver clocks may differ -- drift CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-12
Physical Layer Bit Pipe Physical layer defines signal levels and timing to deliver bit stream to Data Link layer Signal bandwidth determines data rate limit Timing errors Noise or distortion can lead to errors in timing Sender and receiver clocks may differ -- drift 10111010001 CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-12
Physical Layer Bit Pipe Physical layer defines signal levels and timing to deliver bit stream to Data Link layer Signal bandwidth determines data rate limit Timing errors Noise or distortion can lead to errors in timing Sender and receiver clocks may differ -- drift 10111010001??11???00?1 CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-12
Asynchronous vs. Synchronous Transmission CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-13
Asynchronous Transmission (1) Each transmission is synchronized A start bit begins, stop bit ends transmission Line stays in an idle state until next start bit Samples timed from beginning of start bit Used in applications where performance can be reduced to reduce costs Modems PC serial ports NRZ encoding: start 1 1 0 0 1 0 1 0 stop idle start T/2 T CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-14
Asynchronous Transmission (2) Physical layer can provide characters (n-bit units) to Data Link layer idle idle n bits n bits n bits CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-15
Asynchronous Transmission (3) Advantages Simple timing mechanism Inherent character framing Adapts to different data rates (idle serves as fill) Disadvantages Timing errors can occur if line is noisy (e.g., missed start bit) Overhead for stop and start bits CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-16
Synchronous Transmission (1) Used for high data rates, including T1 and or interoffice digital transmission lines Information is sent continuously Receiver & repeater maintain synchronization between incoming signaling rate and local sample clock Idle or fill characters inserted if line is idle Signal transitions (high-to-low or positive-to-negative) enable clock recovery, or synchronization Some minimum occurrence of signal transitions are needed to maintain synchronization (Why?) CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-17
Why Frequent Signal Transitions Needed Long strings of 0 s or 1 s cause problems. Receiver synchronizes clock on 0-1 transitions. No transitions = no synchronization Receiver averages signal it receives to determine hi vs. low signal. No transitions = incorrect average. NRZ encoding is bad. Solutions CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-18
Solutions: Ensuring Signal Transitions Manchester encoding: Sender XOrs local clock w/ NRZ encoded data, producing hi/low transitions for every bit But doubles rate at which signal is transmitted Dedicated timing bits Use some bit transmissions just for timing Example: Dataphone Digital Service Use every one bit out of eight to guarantee a signal transition Example: Synchronous modems Periodically insert a SYNC character CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-19
Ensuring Signal Transitions (2) Bit insertion Use bit transmissions for timing only when needed by inserting timing bits into data bit stream HDLC bit stuffing 01111110 indicates end of a data block (for framing) Six consecutive 1 s must not be sent as data (may be mistaken as end of a data block) Sender inserts a 0 after every string of five consecutive 1 s; receiver must strip a 0 after five consecutive 1 s Disadvantage: extra bits = extra delay CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-20
Ensuring Signal Transitions (3) Data scrambling Similar to encryption/decryption Prevents transmission of repetitive patterns With high probability, prevents long strings of 0 s (or 1 s) that would not have signal transitions CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-21
Point-to-Point Protocols and Links (1) Point-to-point protocols involve exactly two peer entities or modules that are connected by some link Modules must interact to ensure proper transfer of information using link Module at Node A Link Module at Node B CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-22
Point-to-Point Protocols and Links (2) For example, link may be: Physical link (e.g. RS-232 is a point-to-point protocol) Virtual bit pipe (e.g. at data link layer) A connection or virtual connection (e.g. at transport or session layer) CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-23
Data Link Control -- DLC (1) For each point-to-point link in a network re are two data link control (DLC) peer modules, one at each end DLC modules use a distributed algorithm to transfer packets Received from and delivered network layer Usual objective is to deliver packets in order of arrival (from network layer) without errors or repeated packets CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-24
Data Link Control -- DLC (2) DLC modules must use unreliable virtual bit pipe provided by physical layer Network DLC Physical Network DLC Physical CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-25
DLC must: Data Link Control -- DLC (3) Detect errors (using redundancy bits) Request retransmission if data is lost (using automatic repeat request -- ARQ) Perform framing (detect packet start and end) Support initialization and disconnection operations CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-26
Data Link Control -- DLC (4) These functions require that extra bits be added to packet to be transmitted Header bits are added to front of each each packet Trailer bits are added to rear of each packet header, packet from upper layer (service data unit), and trailer form a frame header service data unit frame trailer CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-27
2.3 Framing CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-28
Frame Format Packet from upper layer is Service data unit (SDU) Frame (header, network layer packet, and trailer) is protocol data unit (PDU) Note that DLC does not care what is in network layer packet and physical layer does not care what is in frame generated by data link layer header service data unit frame trailer CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-29
Framing (1) We have assumed that DLC knows where a frame begins and ends This is not automatic due to Continuous transmission of one frame after another Idle fill characters in synchronous bit pipes No transmission in asynchronous bit pipes CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-30
Framing (2) Framing is process of deciding start and end of successive frames Byte-oriented or character-based framing Bit-oriented framing -- flags Length fields Clock based framing CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-31
Character-Based Framing (1) Special characters are used to indicate idle fill (ASCII SYN), start of text (STX), and end of text (ETX) SYN = 0001 0110 (16H) STX = 0000 0010 (02H) Data Link layer extracts frame boundaries 00010110 00010110 00000010... frame SYN SYN STX header packet ETX CRC SYN CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-32
Character-Based Framing (2) If packet data is arbitrary it may contain control characters, so transparent mode must be used based on DLE (data link escape) character DLE STX is start of transparent mode DLE ETX ends text DLE DLE needed if DLE is in packet data Problems: Excessive framing overhead Error may cause premature ETX detection Error may alter ETX so that end of frame is missed CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-33
Bit-Oriented Framing -- Flags (1) Character-based framing: Use full characters as flags DLE STX and DLE ETX Bit-oriented framing: Use bit patterns as flags to reduce overhead of character-based framing 01111110 = 01 6 0 is usual flag six consecutive 1 s indicates end of frame to receiving DLC CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-34
Problem with 01111110 Flag So if we use 01111110 as flag and the actual data contains 01111110 What do we do? CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-35
Bit-Oriented Framing -- Flags (2) Sender uses bit stuffing to eliminate any string of six 1 s in data. Receiver strips off stuffed bits Sender inserts 0 after five consecutive 1 s in data Example (one 0 is inserted): Original frame: 00111001111111011 Transmitted: 001110011111011011 Receiver strips off one 0 after five consecutive 1 s CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-36
Framing with Length Fields (1) There are two aspects to framing: Detecting end of idle fill -- can be done by transmitting a special character (e.g. SYN) or a constant bit stream (e.g. all 1 s) that is interrupted when frame begins Detecting end of frame -- can be done by sending length information (e.g. number of bytes in frame) in header SYN SYN length packet CRC SYN header frame CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-37
Framing with Length Fields (2) Brute force: Need Ølog 2 K max ø bits for frame size K max More efficient encodings: If only certain frame sizes possible, fewer bits needed Ex: just 2 bits if all packets are of length a, b, c, or d If some lengths more likely than others, assign most likely lengths shorter codes But brute force = faster, simpler implementations CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-38
Framing with Length Fields (3) Errors can corrupt length field, causing receiver to look for CRC in wrong place! Frame accepted with probability 2 -L (L is length of CRC) If length field's corrupted, how do you find start of next frame? CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-39
Framing with Length Fields (3) Possible (partial) solutions: Use extra CRC over a fixed length header, but synchronization is still needed Embed length field in trailer of previous frame Use a longer CRC to reduce probability of acceptance Use fixed-length frames and pass job off to a higher layer CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-40
Should frames be Large or small? Some Choices Fixed size or variable size? What are the pros/cons? CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-41
Maximum Frame Size (1) Large maximum frame size is good Reduces transmission overhead for framing and header information (not critical for high data rates) Reduces frame processing load (important for high data rates) Short maximum frame size is good Can reduce delay variance and packetization delay (Think of trucks vs. cars on I81) Allows pipelining over multiple links to reduce delay CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-42
Maximum Frame Size (2) Link 1 Link 2 Link 3 D (short frames) D (long frames) Pipelining over multiple links CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-43
Fixed Frame Lengths Could require all frames to be same length Don't need bits for length field or framing flags. Do need padding if a packet doesn't completely fill frame. Small fixed length frames Reduces need for padding Reduce latency for stream data, e.g. packetized voice CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-44
Example of Fixed Frame Lengths Asynchronous Transfer Mode (ATM) Frames (called cells) are fixed at 53 bytes 48-byte data field plus 5-byte header Simplifies high-speed switching Supports voice and video that demand low latency Reduces variance in delay CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-45
You should now be able to Describe role of a point-to-point protocol and direct links in a network Describe and compare different encoding schemes Describe and compare basic framing techniques, citing limitations CS/ECPE 5516 (1/31/00) Direct Link Networks: 2.1, 2.2, 2.3-46