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

Unit - 2 ( Part- 1 )

The document discusses various elementary data link protocols, including simplex protocols, stop-and-wait protocols for error-free and noisy channels, and sliding window protocols such as Go-Back-N and Selective Repeat. It explains the mechanics of these protocols, their advantages, and limitations, as well as the concept of piggybacking for efficient acknowledgment in data transmission. The document emphasizes the importance of error control and flow control in reliable data communication.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Unit - 2 ( Part- 1 )

The document discusses various elementary data link protocols, including simplex protocols, stop-and-wait protocols for error-free and noisy channels, and sliding window protocols such as Go-Back-N and Selective Repeat. It explains the mechanics of these protocols, their advantages, and limitations, as well as the concept of piggybacking for efficient acknowledgment in data transmission. The document emphasizes the importance of error control and flow control in reliable data communication.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

UNIT - II

Elementary data link protocols: simplex protocol, A simplex stop and wait protocol for
an error-free channel, A simplex stop and wait protocol for noisy channel.

Sliding Window protocols: A one-bit sliding window protocol, A protocol using Go-Back-
N, A protocol using Selective Repeat, Example data link protocols.

Medium Access sub layer: The channel allocation problem, Multiple access protocols:
ALOHA, Carrier sense multiple access protocols, collision free protocols. Wireless LANs,
Data link layer switching
2.1 ELEMENTARY DATA LINK PROTOCOLS
2.1.1 Simplex Protocol:
It is very simple. The sender sends a sequence of frames without even thinking about the
receiver. Data are transmitted in one direction only. Both sender & receiver always ready.
Processing time can be ignored. Infinite buffer space is available. And best of all, the
communication channel between the data link layers never damages or loses frames. This
thoroughly unrealistic protocol, which we will nickname ‘‘Utopia,’’ .The utopia protocol is
unrealistic because it does not handle either flow control or error correction.
The Simplex protocol is a communication protocol used in the data link layer of the OSI
(Open Systems Interconnection) model. It is a unidirectional protocol, meaning that data can
only flow in one direction between the sender and receiver.
In Simplex communication, the sender is responsible for transmitting data, while the receiver
can only receive data and cannot send any data back. This makes Simplex communication
suitable for applications where data transfer occurs in one direction only, such as
broadcasting or monitoring systems.
The Simplex protocol does not provide any acknowledgment or error-checking mechanisms.
Once the sender transmits the data, it assumes that it has been successfully received by the
receiver. If an error occurs during transmission, the Simplex protocol does not provide any
means to detect or correct it.
An example of the Simplex protocol in action is a television broadcast and radio broadcast.
Simplex communication is not commonly used in modern data communication systems, as
most applications require bidirectional communication and the ability to detect and correct
errors. Instead, protocols such as half-duplex and full-duplex are more commonly used,
which allow for two-way communication and provide error detection and correction
mechanisms.

2.1.2 A Simplex Stop-and-Wait Protocol for an Error-Free Channel


Protocols in which the sender sends one frame and then waits for an acknowledgement before
proceeding are called stop-and-wait.
It is still simple. The sender sends one frame and waits for feedback from the receiver. When
the ACK arrives, the sender sends the next frame It is Stop-and-Wait Protocol because the
sender sends one frame, stops until it receives confirmation from the receiver (okay to go
ahead), and then sends the next frame. We still have unidirectional communication for data
frames, but auxiliary ACK frames (simple tokens of acknowledgment) travel from the other
direction. We add flow control to our previous protocol.

2.1.3 A Simplex Stop-and-Wait Protocol for a Noisy Channel


Simplex Stop – and – Wait protocol for noisy channel is data link layer protocol for data
communications with error control and flow control mechanisms. It is popularly known as
Stop – and –Wait Automatic Repeat Request (Stop – and –Wait ARQ) protocol. It adds error
control facilities to Stop – and – Wait protocol.
This protocol takes into account the facts that the receiver has a finite processing speed and
that frames may get corrupted while transmission. If data frames arrive at the receiver’s end
at a rate which is greater than its rate of processing, frames can be dropped out. Also, frames
may get corrupted or entirely lost when they are transmitted via network channels. So, the
receiver sends an acknowledgment for each valid frame that it receives. The sender sends the
next frame only when it has received a positive acknowledgment from the receiver that it is
available for further data processing. Otherwise, it waits for a certain amount of time and then
resends the frame.
 Sender Side − At the sender side, a field is added to the frame to hold a sequence
number. If data is available, the data link layer makes a frame with the certain
sequence number and sends it. The sender then waits for arrival of acknowledgment
for a certain amount of time. If it receives a positive acknowledgment for the frame
with that sequence number within the stipulated time, it sends the frame with next
sequence number. Otherwise, it resends the same frame.
 Receiver Side − The receiver also keeps a sequence number of the frames expected
for arrival. When a frame arrives, the receiver processes it and checks whether it is
valid or not. If it is valid and its sequence number matches the sequence number of
the expected frame, it extracts the data and delivers it to the network layer. It then
sends an acknowledgement for that frame back to the sender along with its sequence
number.

Flow Diagram
The following flow diagram depicts communication via simplex stop – and – wait ARQ
protocol for noisy channel
2.2 SLIDING WINDOW PROTOCOLS
Sliding window protocols are data link layer protocols for reliable and sequential delivery of
data frames. The sliding window is also used in Transmission Control Protocol.
In this protocol, multiple frames can be sent by a sender at a time before receiving an
acknowledgment from the receiver. The term sliding window refers to the imaginary boxes to
hold frames. Sliding window method is also known as windowing.
Working Principle
In these protocols, the sender has a buffer called the sending window and the receiver has
buffer called the receiving window.
The size of the sending window determines the sequence number of the outbound frames. If
the sequence number of the frames is an n-bit field, then the range of sequence numbers that
can be assigned is 0 to 2𝑛−1. Consequently, the size of the sending window is 2𝑛−1. Thus in
order to accommodate a sending window size of 2𝑛−1, a n-bit sequence number is chosen.
The sequence numbers are numbered as modulo-n. For example, if the sending window size
is 4, then the sequence numbers will be 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, and so on. The number of
bits in the sequence number is 2 to generate the binary sequence 00, 01, 10, 11.
The size of the receiving window is the maximum number of frames that the receiver can
accept at a time. It determines the maximum number of frames that the sender can send
before receiving acknowledgment.
Example
Suppose that we have sender window and receiver window each of size 4. So the sequence
numbering of both the windows will be 0,1,2,3,0,1,2 and so on. The following diagram shows
the positions of the windows after sending the frames and receiving acknowledgments.
2.2.1 A One-Bit Sliding Window Protocol
A one-bit sliding window protocol is a simple form of sliding window protocol that allows
for reliable data transmission in the data link layer. It is also known as the Stop-and-Wait
protocol because the sender transmits a single frame and waits for an acknowledgment before
sending the next frame.
Here's how the one-bit sliding window protocol works:
Sender (S) sends a frame with a sequence number to the receiver (R).
Receiver (R) receives the frame and sends back an acknowledgment (ACK) to the sender.
Upon receiving the acknowledgment, the sender advances the sequence number and sends the
next frame.
If the receiver detects an error in the received frame, it discards the frame and does not send
an acknowledgment.
The sender times out waiting for an acknowledgment and retransmits the same frame.
Upon receiving a duplicate frame, the receiver discards it and sends an acknowledgment for
the previously received frame.
The sender receives the acknowledgment and can proceed to send the next frame.
The process continues as the sender and receiver continue to exchange frames and
acknowledgments in a stop-and-wait fashion.
The one-bit sliding window protocol ensures reliable data transmission but has a lower
efficiency compared to protocols with larger window sizes. It introduces a significant delay
since the sender has to wait for the acknowledgment before sending the next frame.
2.2.2 A protocol using Go-Back-N
Go-Back-N protocol, also called Go-Back-N Automatic Repeat reQuest, is a sliding window
protocol used in the data link layer of a computer network. It provides reliable and sequential
delivery of frames from the sender to the receiver. The protocol is designed to handle frame
loss and retransmissions efficiently.
In Go-Back-N protocol, the size of the sender window is 2m-1, where m represents the
number of bits used for assigning sequence numbers for frames. The receiving window size is
always 1.
Here's how the Go-Back-N protocol works:
1. Sender-side:
 The sender divides the data into frames and assigns a unique sequence number
to each frame.
 The sender maintains a sending window that represents the range of sequence
numbers for frames that can be sent without waiting for acknowledgments.
 When a frame is sent, the sender starts a timer to track the acknowledgment.
 The sender continues to send frames within the window until it reaches the
end of the sending window or all frames have been sent.
 If an acknowledgment is received within the timeout period, the sender
advances the window and sends the next set of frames. Otherwise, the sender
retransmits all frames within the window.
2. Receiver-side:
 The receiver maintains a receiving window that indicates the range of
expected sequence numbers.
 When a frame is received, the receiver checks if its sequence number is the
expected one.
 If the frame's sequence number is as expected, it is accepted, and the receiver
sends an acknowledgment.
 If an out-of-order frame is received, it is discarded, and the receiver does not
send an acknowledgment.

3. Retransmissions:
 If the sender does not receive an acknowledgment within the timeout period, it
assumes that frames have been lost and retransmits all frames within the
current window.
 The receiver, upon receiving duplicate frames, discards them but still sends an
acknowledgment for the last correctly received frame.
 Upon receiving a duplicate acknowledgment, the sender retransmits all frames
within the current window.
The Go-Back-N protocol offers simplicity and efficiency by allowing the sender to send
multiple frames before waiting for acknowledgments. However, it may result in unnecessary
retransmissions if a single frame is lost, as all subsequent frames within the window will be
retransmitted.
Overall, Go-Back-N provides reliable data transmission in the data link layer, ensuring the
sequential delivery of frames from the sender to the receiver.
2.2.3 A protocol using Selective Repeat
The go-back-n protocol works well if errors are less, but if the line is poor it wastes a lot of
bandwidth on retransmitted frames. An alternative strategy, the selective repeat protocol, is to
allow the receiver to accept and buffer the frames following a damaged or lost one. Selective
Repeat attempts to retransmit only those frames that are actually lost (due to errors) :
 Receiver must be able to accept frames out of order.
 Since receiver must release frames to higher layer in order, the receiver must be able
to buffer some packets.
Retransmission requests :
 Implicit – The receiver acknowledges every good frame, frames that are not ACKed
before a time-out are assumed lost or in error. Notice that this approach must be used
to be sure that every packet is eventually received.
 Explicit – An explicit NAK (selective reject) can request retransmission of just one
frame. This approach can expedite the retransmission but is not strictly needed.
 One or both approaches are used in practice.
Selective Repeat Protocol (SRP) : This protocol(SRP) is mostly identical to GBN protocol,
except that buffers are used and the receiver, and the sender, each maintains a window of
size. SRP works better when the link is very unreliable. Because in this case, retransmission
tends to happen more frequently, selectively retransmitting frames is more efficient than
retransmitting all of them. SRP also requires full-duplex link. backward acknowledgements
are also in progress.
 Sender’s Windows ( Ws) = Receiver’s Windows ( Wr).
 Window size should be less than or equal to half the sequence number in SR protocol.
This is to avoid frames being recognized incorrectly. If the size of the window is
greater than half the sequence number space, then if an ACK is lost, the sender may
send new packets that the receiver believes are retransmissions.
 Sender can transmit new frames as long as their number is with W of all unACKed
packets.
 Sender retransmit un-ACKed packets after a timeout – Or upon a NAK if NAK is
employed.
 Receiver ACKs all correct packets.
 Receiver stores correct packets until they can be delivered in order to the higher layer.
 In Selective Repeat ARQ, the size of the sender and receiver window must be at most
one-half of 2^m.
Compare and contrast stop and wait, go back N, and selective repeat
Properties Stop and Wait ARQ Go Back N ARQ Selective Repeat ARQ
Sender window size 1 N N
Receiver Window size 1 1 N
Minimum Sequence 2 N+1 2N
number
Efficiency 1/(1+2*a) N/(1+2*a) N/(1+2*a)
Type of Individual Cumulative Individual
Acknowledgement
Supported order at In-order delivery only In-order delivery only Out-of-order delivery
the Receiving end as well
Number of 1 N 1
retransmissions in
case of packet drop
Transmission Type Half duplex Full duplex Full duplex
Implementation Low Moderate Complex
difficulty

Piggybacking:
Piggybacking is the technique of delaying outgoing acknowledgment and attaching it to the
next data packet.
When a data frame arrives, the receiver waits and does not send the control frame
(acknowledgment) back immediately. The receiver waits until its network layer moves to the
next data packet. Acknowledgment is associated with this outgoing data frame. Thus the
acknowledgment travels along with the next data frame. This technique in which the outgoing
acknowledgment is delayed temporarily is called Piggybacking.
Efficiency can be improved using selective repeat sliding window protocol and also by
making use of full-duplex transmission. Full Duplex transmission is a transmission that
happens with the help of two half-duplex transmissions which helps in communication in
both directions. Full Duplex Transmission is better than both simplex and half-duplex
transmission modes.
Piggybacking is a process of attaching the acknowledgment with the data packet to be sent.
Piggybacking concept is explained below: Suppose there is two-way communication between
two devices A and B. When the data frame is sent by A to B, then device B will not send the
acknowledgment to A until B does not have the next frame to transmit. And the delayed
acknowledgment is sent by the B with the data frame. The method of attaching the delayed
acknowledgment with sending the data frame is known as piggybacking.
Figure: Working of piggybacking
How Piggybacking is Done?
1. Suppose there are two computers, named X and Y which are connected over an IP
network. And computers X and Y use SCTP(Stream Control Transmission Protocol)
protocol for communication between them.
2. The packet is sent by X to Y. X will wait for the acknowledgment(response) and it
will send the next packet after receiving the acknowledgment.
3. Same will be done by node Y for communication in the other direction.
4. If piggybacking is not supported, then the sent packet response only contains the
SCTP-ACK chunk.
5. In the piggybacking protocol, a data packet is sent by X to the Y. And node Y before
sending the acknowledgment, will wait for the user DATA and after receiving the
user packet within a time frame, both(user DATA and ACK) is sent by the Y in a
single network message.
6. Message is processed in two separate chunks at node X, the first one is the ACK
chunk and the other one is the user DATA chunk.
7. Bandwidth is saved by this but this will lead to some delay in the transmission of data.
Advantages of Piggybacking
1. The major advantage of piggybacking is the better use of available channel
bandwidth. This happens because an acknowledgment frame needs not to be sent
separately.
2. Usage cost reduction.
3. Improves latency of data transfer.
Disadvantages of Piggybacking
1. The disadvantage of piggybacking is the additional complexity.
2. If the data link layer waits long before transmitting the acknowledgment (blocks the
ACK for some time), the frame will rebroadcast.
Example Data Link Protocols:
Within a single building, LANs are widely used for interconnection, but most wide-area
network infrastructure is built up from point-to-point lines. We will examine the data link
protocols found on point-to-point lines in the Internet in two common situations.
The first situation is when packets are sent over SONET optical fiber links in wide-area
networks.
The second situation is for ADSL links running on the local loop of the telephone network at
the edge of the Internet. These links connect millions of individuals and businesses to the
Internet.
The Internet needs point-to-point links for these uses, as well as dial-up modems, leased
lines, and cable modems, and so on. A standard protocol called PPP (Point-to-Point Protocol)
sis used to send packets over these links.

You might also like