Chapter-3-Data Link Contro Protocols
Chapter-3-Data Link Contro Protocols
3.1
Data Link Layer
receives the information in the form of packets from the
Network layer
Its major role is to ensure error-free transmission of information.
responsible for encoding, decode and organizing the outgoing
other services,
responsible for providing error messages and acknowledgments
as well.
Media Access Control (MAC)
MAC sublayer manages the device’s interaction, responsible for
3.2
3-1 FRAMING
• The packet received from the Network layer is known as a frame in
and divides them into small frames, then, sends each frame bit-by-bit
organizes them into the frame, and sends them to the Network layer.
3.3
3-2 FLOW AND ERROR CONTROL
3.4
Note
3.5
Note
Addressing
•The data link layer encapsulates the source and destination’s MAC address/
physical address in the header of each frame to ensure node-to-node delivery. MAC
address is the unique hardware address that is assigned to the device while
manufacturing.
Access Control
•When multiple devices share the same communication channel there is a high
probability of collision, so it’s the responsibility of DLL to check which device has
control over the channel and CSMA/CD and CSMA/CA can be used to avoid
3.7
Note
Now let us see how the data link layer can combine
framing, flow control, and error control to achieve the
delivery of data from one node to another. The
protocols are normally implemented in software by
using one of the common programming languages.
3.9
Figure 3.1 Taxonomy of protocols discussed in this chapter
3.10
3-4 NOISELESS CHANNELS
3.11
3-5 Simplest Protocol
3.12
process any data frames sent by the sender immediately.
Figure 3.2 The design of the simplest protocol with no flow or error control
3.13
Algorithm 3.1 Sender-site algorithm for the simplest protocol
3.14
Algorithm 3.2 Receiver-site algorithm for the simplest protocol
3.15
Example 3.1
3.16
Figure 3.3 Flow diagram for Example 11.1
3.17
3-6 Stop-and Wait Protocol
The primitives of stop and wait protocol are:
Sender side
•Rule 1: Sender sends one data frame at a time.
•Rule 2: Sender sends the next frame only when it receives the acknowledgment of the previous
packet.
Therefore, the idea of stop and wait protocol in the sender's side is very simple, i.e.,
• send one packet at a time, and do not send another packet before receiving the
acknowledgment.
Receiver side
•Rule 1: Receive and then consume the data frame.
•Rule 2: When the data frame is consumed, receiver sends the acknowledgment to the sender.
Therefore, the idea of stop and wait protocol in the receiver's side is also very simple, i.e.,
•consume the packet, and once the packet is consumed, the acknowledgment is sent. This is
3.18
known as a flow control mechanism.
Figure 3.4 Design of Stop-and-Wait Protocol
3.19
Example 3.2
3.20
Figure 3.5 Flow diagram for Example 11.2
3.21
Disadvantages of Stop and Wait protocol
3-6 Stop-and Wait Protocol
The following are the problems associated with a stop and wait protocol:
1.Problems occur due to lost data
Suppose the sender sends the data and the data is lost. The receiver is waiting for the data for a
long time. Since the data is not received by the receiver, so it does not send any
acknowledgment. Since the sender does not receive any acknowledgment so it will not send the
3.22
3-6 Stop-and Wait Protocol
2. Problems occur due to lost acknowledgment
Suppose the sender sends the data and it has also been received by the receiver. On receiving the
packet, the receiver sends the acknowledgment. In this case, the acknowledgment is lost in a
network, so there is no chance for the sender to receive the acknowledgment. There is also no
chance for the sender to send the next packet as in stop and wait protocol, the next packet cannot
3.23
3-6 Stop-and Wait Protocol
3. Problem due to the delayed data or acknowledgment
Suppose the sender sends the data and it has also been received by the receiver. The receiver
then sends the acknowledgment but the acknowledgment is received after the timeout period on
the sender's side. As the acknowledgment is received late, so acknowledgment can be wrongly
3.24
3-7 NOISY CHANNELS
3.25
3-8 Stop-and Wait ARQ
• Stop and Wait ARQ is an improved and modified version of Stop and Wait protocol. The
above 3 problems of the stop-and –Wait Protocol: lost data, lost Ack and delayed data and
Ack) are resolved by Stop and Wait for ARQ (Automatic Repeat Request) that does both error
• Stop and wait ARQ includes the following three extra elements.
3.26
3-8 Stop-and Wait ARQ
3.27
3-8 Stop-and Wait ARQ
3. Delayed Acknowledgement: This is resolved by introducing sequence numbers for
acknowledgement also.
2) Receiver B, after receiving the data frame, sends an acknowledgement with sequence number 1
3.28
3-8 Stop-and Wait ARQ
Useful Terms:
•Propagation Delay: Amount of time taken by a packet to make a physical journey from one
router to another router.
3.29
Note
3.30
Note
In Stop-and-Wait ARQ, we use sequence numbers to
number the frames.
Stop and wait ARQ is a one bit sliding window protocol where-
=1+1
=2
3.31 Thus,
Simple Implementation: It does not require complex algorithms or hardware components, making it an inexpensive and
3-8 Stop-and Wait ARQ
efficient option.
Error Detection: detects errors and If an error is detected, the receiver sends a negative acknowledgment (NAK) to the
Reliable: The receiver cannot move on to the next data packet until it receives the current one.
Flow Control: used for flow control, where the receiver can control the rate at which the sender transmits data.
Low Efficiency: it requires the sender to wait for an acknowledgment from the receiver before sending the next data
packet. This results in a low data transmission rate, especially for large data sets.
High Latency: introduces additional latency in the transmission of data, as the sender must wait for an acknowledgment
before sending the next packet. This can be a problem for real-time applications such as video streaming or online
gaming.
Limited Bandwidth Utilization: does not utilize the available bandwidth efficiently, as the sender can transmit only one
data packet at a time. This results in underutilization of the channel, which can be a problem in situations where the
Limited Error Recovery: has limited error recovery capabilities. If a data packet is lost or corrupted, the sender must
3.32
• The Go-Back-N protocol is a data link layer and transport layer protocol and send
3-9 Go-Back-NARQ
data frames reliably and sequentially.
'N' =size of the sender window. The sender sends frames in sequential order. The receiver can only
buffer one frame at a time since the size of the receiver window is equal to 1, but the sender can
buffer N frames.
How it works
• The sender's window has a size of 3 or Go-Back-3.
• The sender has sent out packets 0, 1, and 2.
• The receiver is now anticipating packet 1 after acknowledging packet 0.
3.33
3-9 Go-Back-NARQ
• Since it's waiting for the packet with sequence number 1, the receiver will ignore
3.34
3-9 Go-back-NARQ
Issue
The key benefit of the Go-Back-N is that it is easy to implement and performs well when
only a small number of segments are lost. However, the performance rapidly falls when
3.35
3-10 Selective Repeat ARQ
• The sender sends several frames specified by a window size even without the need to wait for
3.36
Explanation
3-10 Selective Repeat ARQ
Step 1 − Frame 0 sends from sender to receiver and set timer.
Step 2 − Without waiting for acknowledgement from the receiver another frame, Frame1 is sent by
Step 3 − In the same way frame2 is also sent to the receiver by setting the timer without waiting for
previous acknowledgement.
Step 4 − Whenever sender receives the ACK0 from receiver, within the frame 0 timer then it is closed
Step 5 − whenever the sender receives the ACK1 from the receiver, within the frame 1 timer then it is
Step 6 − If the sender doesn’t receive the ACK2 from the receiver within the time slot, it declares
timeout for frame 2 and resends the frame 2 again, because it thought the frame2 may be lost or
damaged.
•.
3.37
Note
specific goals.
3.38
3-12 MULTIPLEXING
the bandwidth needs of the devices, the link can be shared. Multiplexing
Frequency-Division Multiplexing
3.40
Figure 3.9 Categories of multiplexing
3.41
3-13 Frequency division Multiplexing
• Frequency division multiplexing (FDM) is a technique of multiplexing which
transmission.
• Total bandwidth is divided to a set of frequency bands that do not overlap.
• The frequency bands are separated from one another by strips of unused
3.43
Note
3.44
3-13 Frequency division Multiplexing-Application
3.45
• 3-14Time-division
Time division multiplexing
Multiplexing (TDM) is a method of putting multiple data
streams in a single signal by separating the signal into many segments, each
timing.
• In frequency division multiplexing
• all the signals operate at the same time with different frequencies,
• but in time-division multiplexing,
• all the signals operate with the same frequency at different times.
3.46
Figure 3.11 TDM
3.47
Note
3.48
Note
of the link is n times faster, and the unit duration is n times shorter.
3.49
1. Synchronous TDM:
•The
3-14timeTime
slots division Multiplexing
are pre-assigned and fixed.
•This slot is even given if the source is not ready with data at this time.
•In this case, the slot is transmitted empty. It is used for multiplexing digitized voice streams.
3.50
3-14 Time division Multiplexing
2. Asynchronous (or statistical) TDM:
•The slots are allocated dynamically depending on the speed of the source or their ready state.
•It dynamically allocates the time slots according to different input channels’ needs, thus saving
the channel capacity.
3.51