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

Elementary Data Link Protocols

Uploaded by

IT sacwc
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Elementary Data Link Protocols

Uploaded by

IT sacwc
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Elementary Data Link Protocols

Protocols in the data link layer are designed so that this layer can perform its basic functions:
framing, error control and flow control. Framing is the process of dividing bit - streams from
physical layer into data frames whose size ranges from a few hundred to a few thousand
bytes. Error control mechanisms deals with transmission errors and retransmission of
corrupted and lost frames. Flow control regulates speed of delivery and so that a fast sender
does not drown a slow receiver.
When a frame arrives at the receiver, the hardware computes the checksum. If the checksum
is incorrect , the data link layer is so informed (event = cksum_err). • If the inbound frame
arrived undamaged, the data link layer is also informed (event = frame_arrival) so that it can
acquire the frame for inspection using from_physical_layer.
As soon as the receiving data link layer has acquired an undamaged frame, it checks the
control information in the header, and if everything is all right, passes the packet portion to
the network layer. Under no circumstances is a frame header ever given to a network layer. •
There is a good reason why the network layer must never be given any part of the frame
header: to keep the network and data link protocols completely separate.
Following slide shows some declaration common to many data link protocols:
• Five data structures are defined there:
1. boolean, 2. seq_nr, 3. packet, 4. frame_kind, 5. frame.
• A boolean is an enumerated type and can take on the values true and false. • A seq_nr is a
small integer used to number the frames. These sequence numbers run from 0 up to and
including MAX_SEQ, which is defined in each protocol needing it. • A packet is the unit of
information exchanged between the network layer and the data link layer on the same
machine, or between network layer peers. • In our model it always contains MAX_PKT
bytes, but more realistically it would be of variable length.
A frame is composed of four fields: kind, seq, ack, and info, the first three of which contain
control information and the last of which may contain actual data to be transferred. • These
control fields are collectively called the frame header. • The kind field tells whether there are
any data in the frame.
The procedures to_network_layer and from_network_layer are used by the data link layer to
pass packets to the network layer and accept packets from the network layer, respectively. •
Note that from_physical_layer and to_physical_layer pass frames between the data link layer
and physical layer.
• In most of the protocols, we assume that the channel is unreliable and loses entire frames
upon occasion. • To be able to recover from such calamities, the sending data link layer must
start an internal timer or clock whenever it sends a frame. • If no reply has been received
within a certain predetermined time interval, the clock times out and the data link layer
receives an interrupt signal.
What are elementary data link layer protocols?

Elementary Data Link protocols are classified into three categories, as given below −
 Protocol 1 − Unrestricted simplex protocol
 Protocol 2 − Simplex stop and wait protocol
 Protocol 3 − Simplex protocol for noisy channels.
Let us discuss each protocol one by one.

Unrestricted Simplex Protocol


Data transmitting is carried out in one direction only. The transmission (Tx) and receiving
(Rx) are always ready and the processing time can be ignored. In this protocol, infinite buffer
space is available, and no errors are occurring that is no damage frames and no lost frames.
The Unrestricted Simplex Protocol is diagrammatically represented as follows −

This thoroughly unrealistic protocol, which we will nickname ''utopia,'' is shown in the
following:
• The protocol consists of two distinct procedures, a sender and a receiver. • The sender runs
in the data link layer of the source machine, and the receiver runs in the data link layer of the
destination machine. • No sequence numbers or acknowledgements are used here, so
MAX_SEQ is not needed. • The only event type possible is frame_arrival (i.e., the arrival of
an undamaged frame).
• The sender is in an infinite while loop just pumping data out onto the line as fast as it can. •
The body of the loop consists of three actions: 1. Go fetch a packet from the network layer,
2. Construct frame using the variables, 3. Send the frame on its way. Only the info field of
the frame is used by this protocol, because the other fields have to do with error and flow
control and there are no errors or flow control restrictions here.
The receiver is equally simple. Initially, it waits for something to happen, the only possibility
being the arrival of an undamaged frame. • Eventually, the frame arrives and the procedure
wait_for_event returns, with event set to frame_arrival.

Simplex Stop and Wait protocol


In this protocol we assume that data is transmitted in one direction only. No error occurs; the
receiver can only process the received information at finite rate. These assumptions imply
that the transmitter cannot send frames at rate faster than the receiver can process them.
The main problem here is how to prevent the sender from flooding the receiver. The general
solution for this problem is to have the receiver send some sort of feedback to sender, the
process is as follows −
Step1 − The receiver send the acknowledgement frame back to the sender telling the sender
that the last received frame has been processed and passed to the host.
Step 2 − Permission to send the next frame is granted.
Step 3 − The sender after sending the sent frame has to wait for an acknowledge frame from
the receiver before sending another frame.
This protocol is called Simplex Stop and wait protocol, the sender sends one frame and waits
for feedback from the receiver. When the ACK arrives, the sender sends the next frame.
The Simplex Stop and Wait Protocol is diagrammatically represented as follows −

• Following gives an example of a simplex stop-and wait protocol:


Unlike in protocol 1, the sender must wait until an acknowledgement frame arrives before
looping back and fetching the next packet from the network layer. • The sending data link
layer need not even inspect the incoming frame: there is only one possibility. The incoming
frame is always an acknowledgement.
• The only difference between receiver1 and receiver2 is that after delivering a packet to the
network layer, receiver2 sends an acknowledgement frame back to the sender before entering
the wait loop again. • Because only the arrival of the frame back at the sender is important,
not its contents, the receiver need not put any particular information in it.
• Protocols in which the sender waits for a positive acknowledgement before advancing to
the next data item are often called PAR(Positive Acknowledgement with Retransmission) or
ARQ (Automatic Repeat Request).

Simplex Protocol for Noisy Channel


Data transfer is only in one direction, consider separate sender and receiver, finite processing
capacity and speed at the receiver, since it is a noisy channel, errors in data frames or
acknowledgement frames are expected. Every frame has a unique sequence number.
After a frame has been transmitted, the timer is started for a finite time. Before the timer
expires, if the acknowledgement is not received , the frame gets retransmitted, when the
acknowledgement gets corrupted or sent data frames gets damaged, how long the sender
should wait to transmit the next frame is infinite.
The Simplex Protocol for Noisy Channel is diagrammatically represented as follows −

You might also like