Lesson 04
Lesson 04
W.C.Deshapriya
Data Link Layer
● Responsible for transport of packets received from the
network layer.
▪ Checksum
▪ Cyclic Redundancy Check (CRC)
▪ Parity Check
▪ Hamming Code
Detection of errors in frame transmission
▪ Checksum
i. Before transmission, the sender divides the data into fixed-size
blocks (e.g., 16 or 32 bits).
ii. Calculate the block’s sum and total sum of the frame.
iii. The sum is complemented (inverted) - complemented value is the
checksum.
iv. Transmit checksum with original frame.
Detection of errors in frame transmission
▪ Cyclic Redundancy Check (CRC)
i. Before transmission, the sender adds a sequence of zeros to the
data in the frame.
ii. The number of zeros is equal to the length of the CRC code (e.g., 32
bits for CRC-32).
Detection of errors in frame transmission
▪ Parity Check
i. Even Parity: The number of 1s in the data (including the parity bit)
should be even.
ii. Odd Parity: The number of 1s in the data (including the parity bit)
should be odd.
iii. The parity bit is added to the data to ensure the total number of 1s
matches the chosen parity (even or odd).
▪ Parity bit calculation
1 2 3 4
Detection of errors in frame transmission
▪ Hamming Code
i. Hamming Code is an error-detection and correction method used
to detect and correct single-bit errors and detect two-bit errors in
frame transmission.
Control the flow of frames
● Broadcast vs. Point-to-Point
● Normally original Ethernet LAN’s were broadcast
● WAN’s were P2P
• It was developed to
minimize the no of
collisions occurring when
two or more stations send
their signals over a data link
layer.
CSMA/CD vs. CSMA/CA
● Both protocols for transmission that operate in the Medium Access Control Layer.
● Mechanisms
▪ Checksum
▪ Cyclic Redundancy Check (CRC)
▪ Parity Check
▪ Hamming Code
Error Correction
● Mechanisms
●FEC: Forward Error Correction
● FEC is used when it is important to mitigate latency variation than to
avoid errors
● Ex: Voice, video transmission
Framing for Ethernet network - IEEE 802.3