850 likes | 1.02k Views
Data Link Level Design Issues. Services provided to Network Layer Framing Error control Flow control. Services provided to Network Layer. Host 1. Host 2. Layer 4. Layer 4. Layer 3. Layer 3. Actual Data Path. Layer 2. Virtual Data Path. Layer 2. Layer 1. Layer 1.
E N D
Data Link Level Design Issues • Services provided to Network Layer • Framing • Error control • Flow control
Services provided to Network Layer Host 1 Host 2 Layer 4 Layer 4 Layer 3 Layer 3 Actual Data Path Layer 2 Virtual Data Path Layer 2 Layer 1 Layer 1 Physical Medium
Most Common Services • Unacknowledged connectionless service • Very low error rate • Voice traffic • Acknowledged connectionless service • Frame arrived safely • Good for wireless (unreliable) channels • Acknowledged connection oriented service • Reliable stream of ordered frames • Three phases -connection, data flow, disconnect
Placement of Data Link Protocol ROUTER Routing Processor Link Layer Processor 2 Data link protocol 2 2 2 2 2 3 3 Frames Packets Transmission line to a router
Framing • Character count - obsolete • Starting and ending characters, with character stuffing (see next slide) • Starting and ending flags, with bit stuffing(see following slide) • Physical layer coding violations
Character Stuffing (Transparency to User) Stuffed character Actual data sequence Beginning of frame End of frame DLE STX DLE DLE ETX DLE ETX User data Frame The first of two DLE characters is always a stuff-delete
Bit Stuffing (Transparency to User) Stuffed bit Beginning of frame Actual data sequence End of frame 01111110 01111110 011111010 User data Frame A “0” following five “1’s” is always deleted
Error control Physical layer coding violations
Error Control • Automatic Repeat Request (ARQ) • Error detecting codes • Positive acknowledgement(ACK) • Negative acknowledgement(NACK) • Timeout • Delay sensitivity • Forward Error Correction • Error correcting codes • Delay insensitive • Much more overhead required
Link-by-Link vs End-to-End Error Control There’s a tradeoff
N links p = Probability of error on a single link M = Single message transmission time Link-by-line acknowledgement Average no. link retransmissions=1/(1-p) Average message transmission time per link=M/(1-p) Average message transmission time N links = NM/(1-p) End-to-end acknowledgement Probability no error end-to-end=(1-p)N Probability at least one error end-to-end=q=1- (1-p)N Average no. end-to-end retransmissions=1/(1-q)= (1-p)-N Average transmission time, end-to-end = M (1-p)-N Assumption of negligible propagation delay
Link-by-link 3 links Link-by-link 10 links End-to-end 3 links End-to-end 10 links Normalized transmission time Link error probability
Flow control • Closed loop controls • Sliding window • Open loop • Leaky bucket
Redundancy Encoding • Block codes • (n,k) code n= codeword length, k=Information bits • ASCII (8,7) code • Parity bits • ASCII “e” 10100110 Parity bit • Hamming distance-number of different places • Convolutional Codes • Difference in path lengths • Viterbi decoding
Augmented Hamming Code extra parity bit over all other bits
Hamming Distance and Error Correction Number of places codewords differ Example-six bit codewords Hamming Distance Two Codeword 1- 001101 Codeword 2- 101001
n bit codeword - vertex on an n dimensional cube Number of edges tranversed from one point to another =Hamming distance between codewords Codewords Intermediate vertices Distance = 5
Distances and error correction and detection Single Error Detecting Code-Distance two Codewords Vertex Single-error correcting or double-error detecting Distance three Single-error correcting and double-error detecting Distance four
Distance and Correcting and Detecting Capability D=Number of detectable errors C=Number of correctable errors m = Minimum distance between codewords Received n bits not a codeword Received n bits closest to one codeword Examples: (7,4) Hamming code m =3 D= 2 and C=1 Augmented Hamming (8,4) code m =4, D=3 and C =1
Forward Error Correction Pe=P(Single bit in error) Independence from bit to bit
Code Efficiency n bit codeword - vertex on an n dimensional cube An efficient code packs the code “densely” Code point n nearest neigbors
Code point n-1 nearest neighbors of adjacent point
Packing the cube efficiently Number of vertices at distance I from a codeword Number of vertices at distance C or less Vertices belong to codeword Number of code points Lower bound on number of vertices Equality for Perfect code
Implementation of Coding and Decoding In digital hardware, naturally Cyclic codes-every codeword a cyclic shift of another eg Hamming code codewords 1,3,4,6,8,10 and cyclic shifts 3 - 0011010 13 - 1101000 Cyclic codes represented by a polynomial Each code has a unique generator polynomial-G(x) e.g. For (7,4) Hamming, G(x)=
Quotient Divisor Remainder
Forming a codeword from k information bits 1) D(x) - k-1 degree polynomial representing data 2) Form xn-kD(x) (n-1 degree) 3) Divide xn-kD(x) by G(x) , save remainder R(x) 4) Form codeword C(x)= xn-kD(x) +R(x) Mathematical justification Codeword is a multiple of G(x) If not an error has occurred.
Example 1110(14) to be transmitted-D(x)= x3+ x2+ x Multiplication by x3 gives x6+ x5+ x4 Remainder after division by x3+ x2+1 is x C(x)=x6+ x5+ x4+ x1110010(14) Error in transmission channel error 1111010 Received x6+ x5+ x4+ x3 + x /x3+ x2+1R(x)= x3
Encoder Implementation Divider Circuit Remainder - R(x) D(x) Input Sequence n-k tic delay D(x)+ R(x) D(x)
Generating Polynomials of Cyclic Codes Standards for Error Detection
Burst Error Capabilities of CRC Codes Transmitted C(x) Received C(x) + E(x) Channel error E(x) Because of error C(x) + E(x) is not divisible by G(x) E(x)/G(x)=R(x) ModG(x)
If (x+1) a factor of G(x) odd number of errors • All double errors • All bursts of length < r+1
Interleaving for Burst Errors k2 codewords each (n1 k1) n1 n1 n1 (n2 - k2 )parity bits n1 Imagined rearrangement n1 Error burst Additional Storage and Processing n2 -k2 n2 -k2 Turbo codes n2 -k2
Convolutional codes Example(3,1) code + output input 110100 T T 111 100 010 110 011 001 000 +
Trellis Representations State Input Next state 00 01 10 11 000 111 00 01 10 11 001 110 011 100 010 101
Viterbi Algorithm-shortest path shortest path-Hamming distance Trellis codes-Euclidian distance
Configurations conv encoder block encoder block decoder VA CHAN Correction block encoder Error detection CHAN NACK Detection
Unrestricted Simplex Transmitter Packet from Network Layer Form Frame Data Link Layer Source Machine Physical Layer
Elementary Data Link Protocols(3.3) Basic Link Level Frame Flag Frame Header Info CKSM Flag Frame header Three fields User Data Formed into a Packet and Passed to Network Layer Kind Seq ACK
Dealing with an Unreliable Channel • Timeout routines • Sequence number in Frames
Unrestricted Simplex Receiver • Wakeup • Remove frame from Physical level buffer • Form packet and Pass to Network Layer • Go back to sleep
Simplex Stop-and Wait Flow Control Problem • Infinite processor speed or infinite buffer not needed • Inserting maximum delay too conservative • ACK to sender is solution (Data in one direction only) • Transmitter • Fetch packet from network level • Form frame • Frame stored in transmit buffer until ACK received • Transmitted after ACK • Receiver • Remove frame from Physical level buffer • Form packet and Pass to Network Layer • Return ACK