CNE Lec3 Chapter3-DataLinkLayer (Reading)
CNE Lec3 Chapter3-DataLinkLayer (Reading)
Chapter 3
Application
Responsible for delivering frames of
Transport
information over a single link
Network
• Handles transmission errors and
Link
regulates the flow of data
Physical
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Data Link Layer Design Issues
• Frames »
• Possible services »
• Framing methods »
• Error control »
• Flow control »
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Frames
Network
Link
Virtual data path
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Possible Services
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Framing Methods
• Byte count »
• Flag bytes with byte stuffing »
• Flag bits with bit stuffing »
• Physical layer coding violations
− Use non-data symbol to indicate frame
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Framing – Byte count
Expected
case
Error
case
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Framing – Byte stuffing
Frame
format
Need to escape
extra ESCAPE
bytes too!
Stuffing
examples
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Framing – Bit stuffing
Data bits
Transmitted bits
with stuffing
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Control
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Flow Control
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Detection and Correction
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Correction – Hamming code
(11, 7) Hamming code adds 4 check bits and can correct 1 error
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Correction – Convolutional codes
…111 … 0 1 1
1 0 1
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Detection – Parity (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Detection – Checksums
Properties:
• Improved error detection over parity bits
• Detects bursts up to N errors
• Detects random errors with probability 1-2N
• Vulnerable to systematic errors, e.g., added zeros
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Detection – CRCs (1)
Adds bits so that transmitted frame viewed as a polynomial
is evenly divisible by a generator polynomial
Start by adding
0s to frame
and try dividing
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Detection – CRCs (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Elementary Data Link Protocols
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Link layer environment (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Link layer environment (2)
Link layer protocol implementations use library functions
• See code (protocol.h) for more details
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Example Data Link Protocols
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Packet over SONET
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
PPP (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
PPP (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
ADSL (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
End
Chapter 3
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011