Figure 2.
6 Data link layer
2.1
Note
The data link layer is responsible for moving
frames from one hop (node) to the next.
2.2
Figure 2.7 Hop-to-hop delivery
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
2.15
2.16
2.17
2.18
2.19
2.20
2.21
2.22
2.23
2.24
2.25
2.26
2.27
2.28
2.29
2.30
2.31
2.37
2.38
2.39
2.40
2.41
2.42
2.43
2.44
Error Detection and
Correction
• Types of Errors
• Detection
• Correction
Basic concepts
Networks must be able to transfer data from one
device to another with complete accuracy.
Data can be corrupted during transmission.
For reliable communication, errors must be detected
and corrected.
Error detection and
correction are implemented either at
the data link layer or the transport
layer of the OSI model.
Types of Errors
Single-bit error
Burst error
The term burst error means that two or more
bits in the data unit have changed from 1 to 0 or
from 0 to 1.
Burst errors does not necessarily mean that the
errors occur in consecutive bits, the length of
the burst is measured from the first corrupted bit
to the last corrupted bit. Some bits in between
may not have been corrupted.
Burst error is most likely to happen in serial
transmission since the duration of noise is normally
longer than the duration of a bit.
The number of bits affected depends on the data rate
and duration of noise.
Example:
If data is sent at rate = 1Kbps then a noise of 1/100 sec
can affect 10 bits.(1/100*1000)
If same data is sent at rate = 1Mbps then a noise of
1/100 sec can affect 10,000 bits.(1/100*106)
Error detection
Error detection means to decide whether the received
data is correct or not without having a copy of the
original message.
Error detection uses the concept of redundancy, which
means adding extra bits for detecting errors at the
destination.
Redundancy
Four types of redundancy checks are used
in data communications
Vertical Redundancy Check
VRC
Performance
It can detect single bit error
It can detect burst errors only if the total number of errors is odd.
Longitudinal Redundancy Check
LRC
Performance
LRC increases the likelihood of detecting
burst errors.
If two bits in one data units are damaged
and two bits in exactly the same positions in
another data unit are also damaged, the
LRC checker will not detect an error.
Find the LRC for the data blocks 01110111 10101001 01101001
Original Message
10101011 11101001 11110000 00011011
10101010 and determine the data that is transmitted?
LRC method ?
10101001
00011101
01110111
10101001
01101001
10101010
00011101
VRC and LRC
Checksum
At the sender
The unit is divided into k sections, each of n bits.
All sections are added together using one’s complement to get the
sum.
The sum is complemented and becomes the checksum.
The checksum is sent with the data
At the receiver
The unit is divided into k sections, each of n bits.
All sections are added together using one’s complement to get the
sum.
The sum is complemented.
If the result is one/zero, the data are accepted: otherwise, they are
rejected.
Performance
The checksum detects all errors involving an odd
number of bits.
It detects most errors involving an even number of
bits.
If one or more bits of a segment are damaged and
the corresponding bit or bits of opposite value in a
second segment are also damaged, the sums of those
columns will not change and the receiver will not
detect a problem.
Error Correction
It can be handled in two ways:
1) receiver can have the sender retransmit the entire data unit.
2) The receiver can use an error-correcting code, which automatically
corrects certain errors.
Cyclic Redundancy Check
CRC
Cyclic Redundancy
Check
• Given a k-bit frame or message, the transmitter
generates an n-bit sequence, known as a frame
check sequence (FCS), so that the resulting
frame, consisting of (k+n) bits, is exactly divisible
by some predetermined number.
• The receiver then divides the incoming frame by
the same number and, if there is no remainder,
assumes that there was no error.
1110010101000
Divisor : 1101
Binary Division
Polynomial
Polynomial and Divisor
Standard Polynomials
1. Data unit 1011000 is divided by 1011.Solve with
CRC
remainder 000
2. Unit /Data 1001 and divisor 1011
Answer :- remainder 110
Qua. 1010
3. Find the CRC 1110010101 with the divisor
X3+X2+1?
Single-bit error
correction
To correct an error, the receiver reverses the
value of the altered bit. To do so, it must know
which bit is in error.
Number of redundancy bits needed
• Let data bits = m
• Redundancy bits = r
Total message sent = m+r
The value of r must satisfy the following relation:
2r ≥ m+r+1
Error Correction
Hamming Code
P1 = d3 d5 d7
P2 = d3 d6 d7
P3 = d5 d6 d7
P1 = D3 D5 D7 = 1 1 1 = ODD NUMBER = 1 CORRECT
P2 = D3 D6 D7 = 1 1 1 = ODD NUMBER = 0 ( IT MUST BE ONE ) INCORRECT
P4 = D5 D6 D7 = 1 1 1 = ODD NUMBER = 0 (IT MUST BE ONE ) INCORRECT
IF THE 7 BIT HAMMING CODE WORD RECEVIED BY A RECEVIER IS
1011011.Assuming the even parity state weather the received code word is
correct or wrong .If wrong locate the bit having error.
P1 = D3 D5 D7 = 1 1 1 = ODD NUMBER = 1 CORRECT
P2 = D3 D6 D7 = 1 1 1 = ODD NUMBER = 0 ( IT MUST BE ONE ) INCORRECT
P4 = D5 D6 D7 = 1 1 1 = ODD NUMBER = 0 (IT MUST BE ONE ) INCORRECT
P1 = 011= even number = incorrect
P2 = 001= odd number = correct
p4-=101 = even number = incorrect
Hamming Code
Hamming Code
Example of Hamming Code
Single-bit error
Error
Detection