0% found this document useful (0 votes)
22 views

Chapter-3-Data Link Contro Protocols

The document discusses protocols in the data link layer. It begins by describing the data link layer and its roles, including framing data, flow control, error control, addressing, and access control. It then discusses specific protocols like the simplest protocol, stop-and-wait protocol, and stop-and-wait automatic repeat request (ARQ) protocol. The stop-and-wait ARQ protocol improves on the basic stop-and-wait protocol by adding error control using techniques like sequence numbers and timeouts to address issues of lost or delayed data and acknowledgments.

Uploaded by

Aron Abraha
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Chapter-3-Data Link Contro Protocols

The document discusses protocols in the data link layer. It begins by describing the data link layer and its roles, including framing data, flow control, error control, addressing, and access control. It then discusses specific protocols like the simplest protocol, stop-and-wait protocol, and stop-and-wait automatic repeat request (ARQ) protocol. The stop-and-wait ARQ protocol improves on the basic stop-and-wait protocol by adding error control using techniques like sequence numbers and timeouts to address issues of lost or delayed data and acknowledgments.

Uploaded by

Aron Abraha
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 51

Chapter 3

Data Link Control


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

and incoming data.


 The data link layer is further divided into two sub-layers:

 Logical Link Control (LLC)


 deals with multiplexing, the flow of data among applications and

other services,
 responsible for providing error messages and acknowledgments

as well.
 Media Access Control (MAC)
 MAC sublayer manages the device’s interaction, responsible for

addressing frames, and also controls physical media access.

3.2
3-1 FRAMING
• The packet received from the Network layer is known as a frame in

the Data link layer.


• At the sender’s side, DLL receives packets from the Network layer

and divides them into small frames, then, sends each frame bit-by-bit

to the physical layer.


• It also attaches some special bits (for error control and addressing) at

the header and end of the frame.


• At the receiver’s end, DLL takes bits from the Physical layer

organizes them into the frame, and sends them to the Network layer.

3.3
3-2 FLOW AND ERROR CONTROL

The most important responsibilities of the data link


layer are flow control, error control, addressing, and
access Control. Collectively, these functions are
known as data link control.

Topics discussed in this section:


Flow Control
Error Control
Addressing
Access Control

3.4
Note

If the receiver’s receiving speed is lower than the sender’s


sending speed, then this can lead to an overflow in the receiver’s
buffer and some frames may get lost. So, it’s the responsibility of
DLL to synchronize the sender’s and receiver’s speeds and
establish flow control between them.
Flow control refers to a set of procedures used to
restrict the amount of data
that the sender can send before
waiting for acknowledgment.

3.5
Note

• Data can get corrupted due to various reasons like noise,


attenuation, etc. So, it is the responsibility of the data link
layer, to detect the error in the transmitted data and correct
it using error detection and correction techniques
respectively.
• DLL adds error detection bits into the frame’s header, so
that receiver can check received data is correct or not.
• It adds reliability to physical layer by adding mechanisms
to detect and retransmit damaged or lost frames.
Error control in the data link layer is based on
automatic repeat request(ARQ), which is the
retransmission of data.
3.6
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

Protocols in Data link layer


•There are various protocols in the data link layer, which are as follows:
Synchronous Data Link Protocol (SDLC)

High-Level Data Link Protocol (HDLC)

Serial Line Interface Protocol (SLIP)for encoding

Point to Point Protocol (PPP)

Link Access Procedure (LAP)

Link Control Protocol (LCP)

Network Control Protocol (NCP)


3.8
3-3 PROTOCOLS

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

Let us first assume we have an ideal channel in which


no frames are lost, duplicated, or corrupted. We
introduce two protocols for this type of channel.

Topics discussed in this section:


Simplest Protocol
Stop-and-Wait Protocol

3.11
3-5 Simplest Protocol

• involves the direct transfer of data from the source to the

destination without any intermediate processing.


• Here, channel is assumed to be noise-free
• So a simple protocol could consist of sending one bit at a time,

with no error correction or flow control mechanisms in place.


• The simplest protocol does not have any mechanisms for

controlling the flow of data or detecting and correcting errors,


• The protocol assumes that the receiver is always ready to

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

Figure 11.7 shows an example of communication using


this protocol. It is very simple. The sender sends a
sequence of frames without even thinking about the
receiver. To send three frames, three events occur at the
sender site and three events at the receiver site. Note that
the data frames are shown by tilted boxes; the height of
the box defines the transmission time difference between
the first bit and the last bit in the frame.

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

Figure 11.9 shows an example of communication using


this protocol. It is still very simple. The sender sends one
frame and waits for feedback from the receiver. When the
ACK arrives, the sender sends the next frame.

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

next packet. This problem occurs due to the lost data.

In this case, two problems occur:


•Sender waits for an infinite amount of time for an acknowledgment.
•Receiver waits for an infinite amount of time for a data.

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

be sent until the acknowledgment of the previous packet is received.

In this case, one problem occurs:

Sender waits for an infinite amount of time for an acknowledgment.

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

considered as the acknowledgment of some other data packet.

3.24
3-7 NOISY CHANNELS

Although the Stop-and-Wait Protocol gives us an idea


of how to add flow control to its predecessor, noiseless
channels are nonexistent. We discuss three protocols
in this section that use error control.

Topics discussed in this section:


Stop-and-Wait Automatic Repeat Request
Go-Back-N Automatic Repeat Request
Selective Repeat Automatic Repeat Request

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

control and flow control.

• Stop and wait ARQ includes the following three extra elements.

3.26
3-8 Stop-and Wait ARQ

1. Time Out 2. Sequence Number (Data)

3.27
3-8 Stop-and Wait ARQ
3. Delayed Acknowledgement: This is resolved by introducing sequence numbers for

acknowledgement also.

Working of Stop and Wait for ARQ:

1) Sender A sends a data frame or packet with sequence number 0.

2) Receiver B, after receiving the data frame, sends an acknowledgement with sequence number 1

(the sequence number of the next expected data frame or packet)

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.

Propagation Delay = (Distance between routers) / (Velocity of propagation)


•RoundTripTime (RTT) = Amount of time taken by a packet to reach the receiver + Time taken
by the Acknowledgement to reach the sender
•TimeOut (TO) = 2* RTT
•Time To Live (TTL) = 2* TimeOut. (Maximum TTL is 255 seconds)

3.29
Note

Error correction in Stop-and-Wait ARQ is done by


keeping a copy of the sent frame and retransmitting
of the frame when the timer expires.

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-

Sender window size = 1

Receiver window size = 1

Thus, in stop and wait ARQ,

Minimum number of sequence numbers required

= Sender Window Size + Receiver Window Size

=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

sender, indicating that the data needs to be retransmitted.

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.

Disadvantages of Stop and Wait ARQ :

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

available bandwidth is limited.

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.

Packet 1 is lost somewhere in the network.

3.33
3-9 Go-Back-NARQ
• Since it's waiting for the packet with sequence number 1, the receiver will ignore

every packet the sender delivered after packet one.


• On the sender's side, a retransmission timer is set to expire.
• The sender will re-transmit all packets from one up to N, which is 3.

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

there is numerous packet loss.

3.35
3-10 Selective Repeat ARQ
• The sender sends several frames specified by a window size even without the need to wait for

individual acknowledgement from the receiver as in Go-Back-N ARQ.


• The retransmitted frame is received out of sequence.
• Only the lost or error frames are retransmitted, whereas correct frames are received and buffered.
• The receiver while keeping track of sequence numbers buffers the frames in memory and sends

NACK for only frames which are missing or damaged.

• The sender will send/retransmit a packet for which NACK is received.

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

sender by setting the timer for it.

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

and sent to the next frame, frame 3.

Step 5 − whenever the sender receives the ACK1 from the receiver, within the frame 1 timer then it is

closed and sent to the next frame, frame 4.

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

Bandwidth utilization is the wise use of

available bandwidth to achieve

specific goals.

Efficiency can be achieved by multiplexing.

3.38
3-12 MULTIPLEXING

Whenever the bandwidth of a medium linking two devices is greater than

the bandwidth needs of the devices, the link can be shared. Multiplexing

is the set of techniques that allows the simultaneous transmission of

multiple signals across a single data link. As data and

telecommunications use increases, so does traffic.

Topics discussed in this section:

Frequency-Division Multiplexing

Synchronous Time-Division Multiplexing

Statistical Time-Division Multiplexing


3.39
Figure 3.8 Dividing a link into channels

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

means combining more than one signal over a shared medium.


• In FDM, signals of different frequencies are combined for concurrent

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

frequencies called the guard bands, to prevent overlapping of signals.


• The modulated signals are combined together using a multiplexer (MUX) in

the sending end.


• The combined signal is transmitted over the communication channel.
• At the receiving end, the individual signals are extracted from the combined
3.42 signal by the process of demultiplexing (DEMUX).
Figure 3.10 Frequency-division multiplexing

3.43
Note

FDM is an analog multiplexing technique that combines analog signals.

3.44
3-13 Frequency division Multiplexing-Application

• In the first generation of mobile phones, FDM was used.


• The use of FDM in television broadcasting
• FDM is used to broadcast FM and AM radio frequencies.

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

having a very short duration.


• Each individual data stream is reassembled at the receiving end based on the

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.

TDM is of the following types:

3.46
Figure 3.11 TDM

3.47
Note

TDM is a digital multiplexing technique for combining several low-rate

channels into one high-rate one.

3.48
Note

In synchronous TDM, the data rate

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

You might also like