Lecture Four
Lecture Four
Lecture Four
Senait G. (MSc.)
16/03/2023
Lecture outline
Data link layer overview
Flow and error control
Flow control
Error detection
Error correction
Physical layer
Multiplexing and switching
Data-link layer
Data-link layer is responsible for implementation of point-to-
point flow and error control mechanism.
Flow Control
When a data frame (Layer-2 data) is sent from one host to another over
a single medium, it is required that the sender and receiver should
work at the same speed.
That is, sender sends at a speed on which the receiver can process
and accept the data.
What if the speed (hardware/software) of the sender or receiver
differs?
If sender is sending too fast the receiver may be overloaded,
(swamped) and data may be lost.
Two types of mechanisms can be deployed to control the flow:
Stop and Wait
This flow control mechanism forces the sender after transmitting a data frame
to stop and wait until the acknowledgement of the data-frame sent is received.
Sliding Window
In this flow control mechanism, both sender and receiver agree on the number of
data-frames after which the acknowledgement should be sent.
As we learnt, stop and wait flow control mechanism wastes resources, this
protocol tries to make use of underlying resources as much as possible.
Data Transmission Error Detection and Correction
The duration of noise in Burst Error is more than the duration of noise in Single-
Bit.
Burst Errors are most likely to occur in Serial Data Transmission.
The number of affected bits depends on the duration of the noise and data rate.
Error Detection
The detection of errors caused by noise or other impairments
during transmission from the transmitter to the receiver.
The receiver should detect the error before accepting the entire message.
Error detection means to decide whether the received data is
correct or not without having the original message.
To detect the error the sender should send some extra bits with the
original data called redundant bits
2 >=d+r+1
r
We observe from the above figure that the bit positions that includes 1
in the first position are 1, 3, 5, 7.
Now, we perform the even-parity check at these bit positions.
The total number of 1 at these bit positions corresponding to r1
is even, therefore, the value of the r1 bit is 0.
Determining r2 bit
The r2 bit is calculated by performing a parity check on the bit
positions whose binary representation includes 1 in the second
position.
We observe from the above figure that the bit positions that includes
1 in the second position are 2, 3, 6, 7.
we perform the even-parity check at these bit positions.
The total number of 1 at these bit positions corresponding to r2
is odd, therefore, the value of the r2 bit is 1.
Determining r4 bit
The r4 bit is calculated by performing a parity check on the bit positions
whose binary representation includes 1 in the third position.
We observe from the above figure that the bit positions that includes 1
in the third position are 4, 5, 6, 7.
Now, we perform the even-parity check at these bit positions.
The total number of 1 at these bit positions corresponding to r4 is even,
therefore, the value of the r4 bit is 0.
Data transferred is given below:
Suppose the 4th bit is changed from 0 to 1 at the receiving
end, then parity bits are recalculated.
R1 bit
The bit positions of the r1 bit are 1,3,5,7