Elementary Data Link Protocols
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.
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.