Download presentation
Presentation is loading. Please wait.
1
Data Link Control Layer General Concepts
Rudra Dutta CSC 401- Fall 2011, Section 001
2
Data Link Layer Perspective
Second of the OSI layers Utilizes (unreliable) bitpipe Provides service to Networking layer Equipments: switch, bridge, … PDUs: “Frames” We want to understand: Descriptive Frame structures, protocols (Ethernet, WiFi, WiMax) Algorithmic Frame delineation, error detection, ARQ, MAC (CSMA-CD, CSMA-CA), transparent bridging Copyright Fall 2011, Rudra Dutta, NCSU
3
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 Copyright Fall 2011, Rudra Dutta, NCSU
4
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 Copyright Fall 2011, Rudra Dutta, NCSU
5
Framing with FLAGs FLAG is a distinctive bit pattern
Such as (0160) Must not appear inside data Copyright Fall 2011, Rudra Dutta, NCSU
6
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 Copyright Fall 2011, Rudra Dutta, NCSU
7
Example FLAG is ‘0160’ Rule: “Stuff a ‘0’ after any occurrence of ‘015’ in the bit string transmitted.” in SDU Rule: “Copy bits as received into the frame. If the last 6 bits to be seen were ‘015’, then discard the next bit if it is a ‘0’, otherwise copy as usual. If the last 8 bits to be copied were ‘0160’, recognize it as a frame-delimiting FLAG.” copied Copyright Fall 2011, Rudra Dutta, NCSU
8
Ethernet Frame ... 10101010 (7 times) Source address Dest. address
Type FCS Preamble SFD ... Payload Copyright Fall 2011, Rudra Dutta, NCSU
9
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 Copyright Fall 2011, Rudra Dutta, NCSU
10
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 D APP R TRNS NET NET DLC DLC DLC PHY PHY PHY Copyright Fall 2011, Rudra Dutta, NCSU
11
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 Copyright Fall 2011, Rudra Dutta, NCSU
12
The Three Army Problem Acknowledgements are needed
But may not be available Hence requests must sometimes be implicit ARQ strategies - later Copyright Fall 2011, Rudra Dutta, NCSU
13
Error Control
14
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, … Copyright Fall 2011, Rudra Dutta, NCSU
15
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 Data ECC Copyright Fall 2011, Rudra Dutta, NCSU
16
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 bits M bits Copyright Fall 2011, Rudra Dutta, NCSU
17
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 Copyright Fall 2011, Rudra Dutta, NCSU
18
Fundamental Concepts - Distance
Data given to error control can be anything 2n “datawords” For each, a unique m bit code “Codeword” (encoded data) is n+m bits Hamming distance is a measure of strength dmin = number of bit corruptions that can fool the code > t for t-bit error detection > 2t for t-bit error correction Copyright Fall 2011, Rudra Dutta, NCSU
19
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 ? Copyright Fall 2011, Rudra Dutta, NCSU
20
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 21 datawords (‘0’ and ‘1’) Only 2 valid codewords (‘ ’ and ‘ ’) Hamming distance is 7 dmin 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? Copyright Fall 2011, Rudra Dutta, NCSU
21
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 s1 s2 … sn s1 s2 … sn c c = s1 + s2 + … + sn , the modulo-2 sum Copyright Fall 2011, Rudra Dutta, NCSU
22
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? p s11 s12 s13 s14 c1 s21 s22 s23 s24 c2 s31 s32 s33 s34 c3 s41 s42 s43 s44 c4 r1 r2 r3 r4 c q Message = [ sij] ci = si1 + si2 + … + sip rj = s1j + s2j + … + sqj n = pq m = p + q + 1 Copyright Fall 2011, Rudra Dutta, NCSU
23
CRC – Polynomial View Message polynomial
u(x) = u0 + u1x + u2x2 + … + un-1 xn-1 CRC polynomial r(x) = r0 + r1x + r2x2 + … + rm-1 xm-1 Code polynomial c(x) = u(x) xm + r(x) r u Copyright Fall 2011, Rudra Dutta, NCSU
24
CRC as Remainder of a Division
Generator polynomial : g(x) = 1 + g1x + … + gm-1xm-1 + xm Encoding Rule: u(x) xm r(x) = Rem { } g(x) Divisible by g Copyright Fall 2011, Rudra Dutta, NCSU
25
Long Division Example n=3 and m=3 g(x) = 1 + x2 + x3 u(x) = 1 + x2
c(x) = ? x3 + x2 + 1 x x3 x5 + x x2 x4 + x3+ x2 x4 + x x Remainder x2 + x Copyright Fall 2011, Rudra Dutta, NCSU
26
Summary DLC - framing, flow control, error 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 Copyright Fall 2011, Rudra Dutta, NCSU
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.