Download presentation
Presentation is loading. Please wait.
Published byElla Atkins Modified over 8 years ago
1
Data Link Control Layer General Concepts Rudra Dutta ECE/CSC 570 - Fall 2010, Section 001, 601
2
Copyright Fall 2010, Rudra Dutta, NCSU2 Data Link Layer Perspective Second of the OSI layers Utilizes (unreliable) bitpipe Provides service to Networking layer Equipments: switch, bridge, … PDUs: “Frames”
3
Copyright Fall 2010, Rudra Dutta, NCSU3 Data Link Layer Services Services Provided to the Network Layer – Framing Logical bit groupings – more use at higher layers – Error Control Error control overlaps with physical layer DLC – retransmission strategies – Flow Control Matches dissimilar endpoint processing speeds Slow receiver should not be swamped by fast sender Also a backward error correction mechanism – Optionally, mediate contention for shared medium Such as Ethernet
4
Copyright Fall 2010, Rudra Dutta, NCSU4 Utilizing Unreliable Bitpipe Sometimes sender sends bits, sometime not Bitpipe can sometime lose bits, or “manufacture” bits How does the receiver (receiving DLC) know when bits are being received, and when not? – Must create own (DLC layer) convention (protocol) about transmission of bits – Start with preamble, end with conclusion – Creates logical groups at DLC layer - “frames” – Also serves as logical groups to encapsulate higher layer PDUs Higher layers want service in multiple-byte chunks Logical units determined by the logic of the higher layers Frame delineation - must start with (and end with) an easily recognizable set of bits that are unlikely to arise randomly due to noise
5
Copyright Fall 2010, Rudra Dutta, NCSU5 Framing with FLAGs FLAG is a distinctive bit pattern – Such as 01111110 (01 6 0) – Must not appear inside data
6
Copyright Fall 2010, Rudra Dutta, NCSU6 Bit Stuffing Bit stuffing method – Delineate by pattern of many bits – Prevent pattern from occurring in data by few bits – Must be completely reversible, i.e. destuffable
7
Copyright Fall 2010, Rudra Dutta, NCSU7 Ethernet Frame Source address Dest. address Type... Payload FCS SFD Preamble 10101011 10101010 (7 times)
8
Copyright Fall 2010, Rudra Dutta, NCSU8 Error Control Errors happen Dual concerns from a communication POV Detection – Can at least catch errors – ARQ strategies may come in Correction (FEC) – Better if we can – Sometimes essential due to link characteristics Involves error codes – Coding, not encryption
9
Copyright Fall 2010, Rudra Dutta, NCSU9 Flow Control Potential data generation and transmission may be faster than consumption – Receiver might be “overwhelmed” Fast sender, slow receiver – At E2E layer (transport, or app) – NOT at DLC/Phy level – Working communication Must be matched at that level Realistically, must stop and wait during transmission – Channel idle for some fraction of time – Possible to proactively use some of this time – Windowed flow control DLC PHY DLC PHY NET R D DLC PHY NET TRNS APP
10
Copyright Fall 2010, Rudra Dutta, NCSU10 Flow Control and Error Control Flow control if sender “gets ahead” of receiver, must retransmit Error control may need to retransmit because of error in channel as well – Error must be detected – Only non-erroneous copy at the sender – Receiver must request a repeat – Automatic Repeat ReQuest But – sender needs to know – “Three armies problem” – Requests must sometimes be implicit
11
Copyright Fall 2010, Rudra Dutta, NCSU11 The Three Army Problem Acknowledgements are needed But may not be available Hence requests must sometimes be implicit – ARQ strategies - later
12
Error Control
13
Copyright Fall 2010, Rudra Dutta, NCSU13 Error Control Errors happen Dual concerns from a communication POV Detection – Can at least catch errors – ARQ strategies may come in Correction (FEC) – Better if we can – Sometimes essential due to link characteristics We shall discuss – Simple block codes – Many others: BCH, Convolution: Viterbi, Turbo, …
14
Copyright Fall 2010, Rudra Dutta, NCSU14 Fundamental Concepts - Redundancy Some data is actual data for error control – Note: Could be data + metadata from other POV – More data introduced expressly for the purpose of error control – “Metadata” for error control – Data and metadata must be distinguished Usually a framing issue – Metadata introduces overhead – Only data is “useful” outside error control DataECC
15
Copyright Fall 2010, Rudra Dutta, NCSU15 Fundamental Concepts - Rate Overhead “rate” of a coding scheme – Rate of useful data per encoded data, < 1.0 Higher rate is more efficient Unfortunately, less likely to be good coding Expressed as a ratio of bits – Over long periods, if not constant N bitsM bits
16
Copyright Fall 2010, Rudra Dutta, NCSU16 Fundamental Concepts – Block If a coding scheme always codes n bits to n+m bits, – We speak of n bit blocks that are independently coded – The code is called a block code Alternative – “stream” type coding – Convolution
17
Copyright Fall 2010, Rudra Dutta, NCSU17 Fundamental Concepts - Distance Data given to error control can be anything – 2 n “datawords” – For each, a unique m bit code – “Codeword” (encoded data) is n+m bits Hamming distance is a measure of strength d min = number of bit corruptions that can fool the code > t for t-bit error detection > 2t for t-bit error correction
18
Copyright Fall 2010, Rudra Dutta, NCSU18 Efficient Use of Rate Lower rate means more overhead bits – But does not necessarily translate into higher distance Choosing appropriate codewords “smartly” can increase distance 0 00, 1 10 (does not increase robustness) 0 00, 1 11 (does) n = 1, m = 1 n = 2, m = 1 00 01 10 11 ?
19
Copyright Fall 2010, Rudra Dutta, NCSU19 Simple Repeat Correction is possible, but rate suffers “k out of 2k-1” kind of voting process E.g., if each bit is sent seven times, – 1 bit blocks – 2 1 datawords (‘0’ and ‘1’) – Only 2 valid codewords (‘0000000’ and ‘1111111’) – Hamming distance is 7 – d min is 7 if only detection is attempted – 4 if correction is attempted from any seven-bit combination – Intermediate strategies possible What is the probability of a bit being misinterpreted?
20
Copyright Fall 2010, Rudra Dutta, NCSU20 Parity XOR all bits of the message Append the resultant bit to the word (m = 1) Detects all single bit errors, however long the word – In fact, all odd number of bits errors – Can not correct Unfortunately, chances of errors increases Coder s 1 s 2 … s n s 1 s 2 … s n c c = s 1 s 2 … s n, the modulo-2 sum
21
Copyright Fall 2010, Rudra Dutta, NCSU21 Horizontal and Vertical Parity Arrange message bits in a grid Parity bits for each row, each column Detects all single, double, triple errors Some but not all quadruple errors – Which ones? What fraction of them? Message = [ s ij ] c i = s i1 s i2 … s ip r j = s 1j s 2j … s qj s 11 s 12 s 13 s 14 c1c1 s 21 s 22 s 23 s 24 c2c2 s 31 s 32 s 33 s 34 c3c3 s 41 s 42 s 43 s 44 c4c4 r1r1 r2r2 r3r3 r4r4 c p q n = pqm = p + q + 1
22
Copyright Fall 2010, Rudra Dutta, NCSU22 CRC – Polynomial View Message polynomial u(x) = u 0 + u 1 x + u 2 x 2 + … + u n-1 x n-1 CRC polynomial r(x) = r 0 + r 1 x + r 2 x 2 + … + r m-1 x m-1 Code polynomial c(x) = u(x) x m + r(x) u r
23
Copyright Fall 2010, Rudra Dutta, NCSU23 CRC as Remainder of a Division Divisible by g Generator polynomial : g(x) = 1 + g 1 x + … + g m-1 x m-1 + x m Encoding Rule: u(x) x m r(x) = Rem { ----------------- } g(x)
24
Copyright Fall 2010, Rudra Dutta, NCSU24 Long Division Example Remainder n=3 and m=3 g(x) = 1 + x 2 + x 3 u(x) = 1 + x 2 c(x) = ? x 3 + x 2 + 1 x 5 + x 3 x 5 + x 4 + x 2 x 4 + x 3 + x 2 x 4 + x 3 + x x 2 + x
25
Copyright Fall 2010, Rudra Dutta, NCSU25 Summary DLC - framing, flow control, error control – Optionally medium access Error control – Metadata must be added to enable error detection/correction – May be integrated with encoding of data – overlap with physical layer – Block codes Encapsulates error detection/correction largely within DLC and physical layers
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.