Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Link LAYER Chapter 3. Services provided to network layer Unacknowledged connectionless service: Ethernet Acknowledged connectionless service: WiFi.

Similar presentations


Presentation on theme: "Data Link LAYER Chapter 3. Services provided to network layer Unacknowledged connectionless service: Ethernet Acknowledged connectionless service: WiFi."— Presentation transcript:

1 Data Link LAYER Chapter 3

2 Services provided to network layer Unacknowledged connectionless service: Ethernet Acknowledged connectionless service: WiFi Acknowledged connection-oriented service: Telephone

3 Framing a)breaking up the bit stream into discrete frames b)compute a checksum for each frame c)Include the checksum in the frame when it is transmitted d)Recomputing the checksum when the frame is received. e)Comparing the recomputed and included checksums. f)Taking proper actions Frame recognition techniques: 1. Byte count. 2. Flag bytes with byte stuffing. 3. Flag bits with bit stuffing. 4. Physical layer coding violations

4 o Byte count o the byte count method is rarely used by itself

5 o Flag bytes + Byte stuffing o Same byte is sent before and after each fram. o If flag is occurred in frame data: o Byte stuffing : escape byte before the flag

6 o Flag bytes + bit stuffing o 01111110 or 0x7E is used as flag byte o If 5 consecutive 1s occurred in frame data: o bit stuffing : a 0 bit is inserted after them. o Used in USB, and ZigBee protocols.

7 o Coding violation o use 1 out of 16 unused codes in 4B/5B coding for the flag. o Long Preamble o Use a long preamble (e.g. 72 bits in 802.11) to allow the receiver to be synchronic with the sender.

8 Error Detection & Correction a)error-correcting codes also FEC (Forward Error Correction) b)error-detecting codes Error types: 1. Isolated single bit errors 2. Error bursts: harder to correct Also done in other layers. 8

9 Error Correcting Codes a)Block code: r check bits are computed solely as a function of the m data bits b)systematic code: the m data bits are sent directly, along with the check bits c)linear code: the r check bits are computed as a linear function of the m data bits  total length of a block = n = m + r : (n,m) code or n-bit codeword  code rate = m/n : 0.5-1 typically  Hamming distance: The number of bit positions in which two codewords differ  To reliably detect d errors, you need a distance d + 1 code  to correct d errors, you need a distance 2d + 1 code XOR

10 Error correction codes  0000000000, 0000011111, 1111100000, 1111111111  Above code has a distance of 5 : it can correct double errors or detect quadruple errors  0000000111  0000011111  For correcting all single bit errors in an m bit code:

11 Hamming code Bit position 1234567891011121314151617181920 Encoded data bits p1p2d1p4d2d3d4p8d5d6d7d8d9d10d11p16d12d13d14d15 Pari ty bit cove rage p1XXXXXXXXXX p2XXXXXXXXXX p4XXXXXXXXX p8XXXXXXXX p16XXXXX

12 convolutional code Is not a block code. Depends on the previous bits in stream. The number of previous bits on which the output depends is called the constraint length. Used in GSM, Satellite, and 802.11. NASA convolutional code of r = 1/2 and k = 7 Is not systematic Decoding is done with Viterbi algorithm that finds the input code with maximum likelihood to produce the observed code.

13 Reed-Solomon code Is based on fitting a polynomial to a number of points and then detect errors where some points do not fit to the curve. (255, 233) code is widely used. Can correct up to 16 symbol errors, so a 128 bit error burst can be corrected. Have strong error-correction properties, particularly for burst errors. Used for DSL, cable, satellite, and on CDs, DVDs, and Blu-ray discs. Often used in combination with convolutional code to provide good protection against both single and burst errors. LDPC (Low-Density Parity Check) code invented by Gallagher, 1962. Works with matrix manipulation. have excellent error-correction abilities. Used in digital video broadcasting, 10 Gbps Ethernet, power-line networks, and the latest version of 802.11

14 Error Detecting Codes 1.Parity  1 bit per code block. Can find single errors.  Interleaving: n+1 bit error bursts may pass undetected.  the probability of a bad block being accepted: n k

15 2. checksum 16-bit Internet checksum is a sum of the message bits divided into 16-bit words. The Internet checksum is computed in one’s complement arithmetic. 10101001 00111001 -------- --- Sum 11100010 Checksum: 00011101 10101001 00111001 00011101 ------------ Sum 11111111 Complement 00000000 means that the pattern is O.K.

16 3. CRC (Cyclic Redundancy Check)  also known as a polynomial code  110001 represents:  addition and subtraction are identical to XOR.  the sender and receiver agree upon a generator polynomial G(x)  the frame must be longer than the generator polynomial  append a CRC to the end of the frame in such a way that the checksummed frame is divisible by G(x).  the receiver divides the received frame by G(x). If there is a remainder, there has been a transmission error.

17 CRC algorithm 1.Let r be the degree of G(x). Append r zero bits to the low-order end of the frame so it now contains m + r bits and corresponds to the polynomial x^r M(x). 2.Divide the bit string corresponding to G(x) into the bit string corresponding to x^r M(x), using modulo 2 division. 3.Subtract the remainder (which is always r or fewer bits) from the bit string corresponding to x^r M(x) using modulo 2 subtraction. The result is the checksummed frame to be transmitted. Call its polynomial T(x).  The algorithm can catch all 1 bit errors.  Can catch most 2 bit errors.  Can catch all odd number of inverted bits.  a polynomial code with r check bits will detect all burst errors of length ≤ r.

18 CRC example If error burst longer than r + 1 bits occurs the probability of a bad frame getting through unnoticed is ½^r IEEE802 CRC: 18

19 Elementary Data Link Protocols Definitions and Procedures required for a typical data link protocol. Provided in protocol.h

20 Utopian Simplex protocol

21 Simplex stop-and-wait protocol for error free

22 Simplex stop-and-wait protocol for noisy channel Also ARQ (Automatic Repeat reQuest) or PAR (Positive Acknowledgement with Retransmission)

23 Sliding Window Protocols 23 In full duplex links – ack frames can be sent along with data frames separated by kind field. –They can be delayed to be sent over a data frame using the ack field. Also called piggybacking. sending window: the set of sequence numbers the sender is permitted to send receiving window : the set of frames the receiver is permitted to accept A sliding window of size 1, with a 3-bit sequence number

24 One bit sliding window protocol 24

25 One bit sliding window protocol 25 Wasted bandwidth due to bad timing. (simultaneous transmissions)

26 Go-Back-N protocol a)The sender transmits up to w frames before blocking, instead of 1 (pipelining) b)Leads to better BW utilization c)BD=(bandwidth-delay product)/(frame size) d)To keep the channel full : w=2BD+1 Example: bandwidth = 50 kbps one-way transit time = 250 msecw=26 frame size = 1000 bits 26

27 Pipeline error recovery a) Receivers window = 1 b) receiver window > 1 (selective repeat) 27

28 Go-Back-N protocol 28

29 Go-Back-N protocol 29

30 Multiple timer implementation using a linked list 30

31 Selective Repeat Protocol 31

32 Selective Repeat Protocol 32

33 Receiver’s window size problem 33 The window size = (MAX SEQ + 1)/2

34 PPP (Point-to-Point Protocol) a)Over SONET 1. A framing method that unambiguously delineates the end of one frame and the start of the next one. It also handles error detection. 2. A link control protocol for bringing lines up, testing them, negotiating options. This protocol is called LCP (Link Control Protocol). 3. Negotiate network-layer options, by having a different NCP (Network Control Protocol) for each network layer supported. 34

35 a)HDLC (High-level Data Link Control) frame format is chosen but with byte stuffing rather than bit stuffing. b)HDLC provides reliable transmissions while PPP provides both reliable and unnumbered mode, which resembles connectionless unacknowledged service. c)All PPP frames begin with the HDLC flag byte of 0x7E (01111110) d)0x7E in payload is escaped by replacing 0x7D 0x5E. e)Payload is scrambled for synchronization. 35 Bcast addr. Unnumbered frame Payload protocol: 0---- : IP frame 1----: LCP or NCP frame 1500 bytes max

36 Setting a PPP link up or down 36

37 Home work assignment StudentAssigned problems 14827372371529384638 221285117291228816 326382539424263248 427404922422346385 51641212414461113205 6195341533742222148 749325130314247381741 82921261141443840427 95132174431402842752 1048431838 452 2927 1112331953412410263446 124053222511237393228 1335394649324844817 1419114162383071040 151112847281613203231 161403711462537474418 174721945532916103720 183917403822048149 192615384249534255027 2071427195028535 30 21223521372594211734 22372373051412850436 2327344833206404824 38321813188141636 2521832482892343361


Download ppt "Data Link LAYER Chapter 3. Services provided to network layer Unacknowledged connectionless service: Ethernet Acknowledged connectionless service: WiFi."

Similar presentations


Ads by Google