Title: ITC242
1ITC242 Introduction to Data CommunicationsWeek
10Topic 16 Data link control
2Last Week
- Data Transmission
- Describe the difference between analogue and
digital signals - Transmission impairments attenuation and noise
affect signal quality - Shannons formula provides a theoretical estimate
of maximum channel capacity
3Last Week
- Data Communication Fundamentals
- The difference between analogue and digital
transmission - Digital and analogue encoding techniques
- ASK, FSK, PSK
- NRZ-L, NRZI, Manchester, Differential Manchester
- Asynchronous transmission
- Synchronous transmission
4Topic 16 Data link control
- Learning Objectives
- Describe flow control and error control
5Flow Control
- Necessary when data is being sent faster than it
can be processed by receiver - Computer to printer is typical setting
- Can also be from computer to computer, when a
processing program is limited in capacity
6TCP Flow Control
- receive side of TCP connection has a receive
buffer
- speed-matching service matching the send rate to
the receiving apps drain rate
- app process may be slow at reading from buffer
7TCP Flow control how it works
- Rcvr advertises spare room by including value of
RcvWindow in segments - Sender limits unACKed data to RcvWindow
- guarantees receive buffer doesnt overflow
- (Suppose TCP receiver discards out-of-order
segments) - spare room in buffer
- RcvWindow
- RcvBuffer-LastByteRcvd - LastByteRead
8Error Control Process
- All transmission media have potential for
introduction of errors - All data link layer protocols must provide method
for controlling errors - Error control process has two components
- Error detection
- Error correction
9Error Detection Parity Bits
- Bit added to each character to make all bits add
up to an even number (even parity) or odd number
(odd parity) - Good for detecting single-bit errors only
- High overhead (one extra bit per 7-bit
character12.5)
10Error Detection
- EDC Error Detection and Correction bits
(redundancy) - D Data protected by error checking, may
include header fields - Error detection not 100 reliable!
- protocol may miss some errors, but rarely
- larger EDC field yields better detection and
correction
otherwise
11Parity Checking
Two Dimensional Bit Parity Detect and correct
single bit errors
Single Bit Parity Detect single bit errors
0
0
12Internet checksum (review)
- Goal detect errors (e.g., flipped bits) in
transmitted packet (note used at transport layer
only)
- Receiver
- compute checksum of received segment
- check if computed checksum equals checksum field
value - NO - error detected
- YES - no error detected. But maybe errors
nonetheless?
- Sender
- treat segment contents as sequence of 16-bit
integers - checksum addition (1s complement sum) of
segment contents - sender puts checksum value into UDP checksum
field
Complement 1011010100111101
1011101101010101 1000111100001100 0100101011000010
0110011001100000 0101010101010101 1011101110110101
0110011001100000 0101010101010101 1000111100001100
1111111111111111
13Error Detection Cyclic Redundancy Check (CRC)
- Data in frame treated as a single binary number,
divided by a unique prime binary, and remainder
is attached to frame - 17-bit divisor leaves 16-bit remainder, 33-bit
divisor leaves 32-bit remainder - For a CRC of length N, errors undetected are 2-N
- Overhead is low (1-3)
14Checksumming Cyclic Redundancy Check
- view data bits, D, as a binary number
- choose r1 bit pattern (generator), G
- goal choose r CRC bits, R, such that
- ltD,Rgt exactly divisible by G (modulo 2)
- receiver knows G, divides ltD,Rgt by G. If
non-zero remainder error detected! - can detect all burst errors less than r1 bits
- widely used in practice (802.11 WiFi, ATM)
15CRC Example
- Want
- D.2r XOR R nG
- equivalently
- D.2r nG XOR R
- equivalently
- if we divide D.2r by G, want remainder R
D.2r G
R remainder
16Error Correction
- Two types of errors
- Lost frame
- Damaged frame
- Automatic Repeat reQuest (ARQ)
- Error detection
- Positive acknowledgment
- Retransmission after time-out
- Negative acknowledgment and retransmission