0% found this document useful (0 votes)
18 views15 pages

VND Openxmlformats-Officedocument Wordprocessingml Document&rendition 1-1

The document discusses data link layer design issues. It summarizes that the data link layer has functions like providing an interface to the network layer, dealing with transmission errors, and regulating data flow. It encapsulates network packets into frames for transmission. The data link layer can provide unacknowledged connectionless service, acknowledged connectionless service, or acknowledged connection-oriented service to the network layer. Error control involves sending acknowledgements and using timers to ensure reliable delivery. Flow control regulates the transmission rate to prevent receivers from being overwhelmed. Error correction codes like Hamming codes are used to detect and correct transmission errors.

Uploaded by

dhanushreebv0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views15 pages

VND Openxmlformats-Officedocument Wordprocessingml Document&rendition 1-1

The document discusses data link layer design issues. It summarizes that the data link layer has functions like providing an interface to the network layer, dealing with transmission errors, and regulating data flow. It encapsulates network packets into frames for transmission. The data link layer can provide unacknowledged connectionless service, acknowledged connectionless service, or acknowledged connection-oriented service to the network layer. Error control involves sending acknowledgements and using timers to ensure reliable delivery. Flow control regulates the transmission rate to prevent receivers from being overwhelmed. Error correction codes like Hamming codes are used to detect and correct transmission errors.

Uploaded by

dhanushreebv0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

UNIT - 3

Data Link Layer Design Issues


The data link layer has a number of specific functions it can
carry out. These functions include
1. Providing a well-defined service interface to the network
layer.
2. Dealing with transmission errors.
3. Regulating the flow of data so that slow receivers are not
swamped by fast senders.

To accomplish these goals, the data link layer takes the packets
it gets from the network layer and encapsulates them into
frames for transmission. Each frame contains a frame header, a
payload field for holding the packet, and a frame trailer, as
illustrated in Fig. 3-1.
Services Provided to the Network Layer
The function of the data link layer is to provide services to the
network layer.
The principal service is transferring data from the network layer
on the source machine to the network layer on the destination
machine.
The data link layer can be designed to offer various services.
The actual services offered can vary from system to system.
Three reasonable possibilities that are commonly provided are
1. Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service

Unacknowledged connectionless service consists of having the


source machine send independent frames to the destination
machine without having the destination machine acknowledge
them. No logical connection is established beforehand or
released afterward. If a frame is lost due to noise on the line,
no attempt is made to detect the loss or recover from it in the
data link layer. This class of service is appropriate when the
error rate is very low so that recovery is left to higher layers. It
is also appropriate for real-time traffic, such as voice, in which
late data are worse than bad data. Most LANs use
unacknowledged connectionless service in the data link layer.
acknowledged connectionless service. When this service is
offered, there are still no logical connections used, but each
frame sent is individually acknowledged. In this way, the sender
knows whether a frame has arrived correctly. If it has not
arrived within a specified time interval, it can be sent again.
This service is useful over unreliable channels, such as wireless
systems.

the most sophisticated service the data link layer can provide to
the network layer is connection-oriented service. With this
service, the source and destination machines establish a
connection before any data are transferred. Each frame sent
over the connection is numbered, and the data link layer
guarantees that each frame sent is indeed received.
Furthermore, it guarantees that each frame is received exactly
once and that all frames are received in the right order. With
connectionless service, in contrast, it is conceivable that a lost
acknowledgement causes a packet to be sent several times and
thus received several times. Connection-oriented service, in
contrast, provides the network layer processes with the
equivalent of a reliable bit stream

Framing
To provide service to the network layer, the data link layer
must use the service provided to it by the physical layer. What
the physical layer does is accept a raw bit stream and attempt
to deliver it to the destination. This bit stream is not
guaranteed to be error free. The number of bits received may
be less than, equal to, or more than 140 the number of bits
transmitted, and they may have different values. It is up to the
data link layer to detect and, if necessary, correct errors. The
usual approach is for the data link layer to break the bit stream
up into discrete frames and compute the checksum for each
frame. When a frame arrives at the destination, the checksum
is recomputed. If the newly-computed checksum is different
from the one contained in the frame, the data link layer knows
that an error has occurred and takes steps to deal with it (e.g.,
discarding the bad frame and possibly also sending back an
error report).
Error Control
Suppose that the sender just kept outputting frames without
regard to whether they were arriving properly. This might be
fine for unacknowledged connectionless service, but would
most certainly not be fine for reliable, connection-oriented
service.
The usual way to ensure reliable delivery is to provide the
sender with some feedback about what is happening at the
other end of the line. Typically, the protocol calls for the
receiver to send back special control frames bearing positive or
negative acknowledgements about the incoming frames. If the
sender receives a positive acknowledgement about a frame, it
knows the frame has arrived safely. On the other hand, a
negative acknowledgement means that something has gone
wrong, and the frame must be transmitted again.
An additional complication comes from the possibility that
hardware troubles may cause a frame to vanish completely
(e.g., in a noise burst). In this case, the receiver will not react at
all.
This possibility is dealt with by introducing timers into the data
link layer. When the sender transmits a frame, it generally also
starts a timer. The timer is set to expire after an interval long
enough for the frame to reach the destination, be processed
there, and have the acknowledgement propagate back to the
sender. Normally, the frame will be correctly received and the
acknowledgement will get back before the timer runs out, in
which case the timer will be canceled.
However, if either the frame or the acknowledgement is lost,
the timer will go off, alerting the sender to a potential problem.
The obvious solution is to just transmit the frame again.
Flow Control
Another important design issue that occurs in the data link
layer (and higher layers as well) is what to do with a sender that
systematically wants to transmit frames faster than the receiver
can accept them. This situation can easily occur when the
sender is running on a fast (or lightly loaded) computer and the
receiver is running on a slow (or heavily loaded) machine. The
sender keeps pumping the frames out at a high rate until the
receiver is completely swamped. Even if the transmission is
error free, at a certain point the receiver will simply be unable
to handle the frames as they arrive and will start to lose some.
Two approaches are commonly used. In the first one, feedback-
based flow control, the receiver sends back information to the
sender giving it permission to send more data or at least telling
the sender how the receiver is doing. In the second one, rate-
based flow control, the protocol has a built-in mechanism that
limits the rate at which senders may transmit data, without
using feedback from the receiver.

Error Correction
Error Correction codes are used to detect and correct the errors when data is
transmitted from the sender to the receiver.

Error Correction can be handled in two ways:

o Backward error correction: Once the error is discovered, the receiver requests
the sender to retransmit the entire data unit.
o Forward error correction: In this case, the receiver uses the error-correcting
code which automatically corrects the errors.
Error correction code :

Hamming code :

This was given by R.W Hamming

This is used to identify and correct only single bit


errors.
Encoding a message by Hamming Code
The procedure used by the sender to encode the message encompasses the following
steps −
 Step 1 − Calculation of the number of redundant bits.
 Step 2 − Positioning the redundant bits.
 Step 3 − Calculating the values of each redundant bit.
Once the redundant bits are embedded within the message, this is sent to the user.

Step 1 − Calculation of the number of redundant bits.


If the message contains m𝑚number of data bits, r𝑟number of redundant bits are added
to it so that m𝑟 is able to indicate at least (m + r+ 1) different states. Here, (m + r)
indicates location of an error in each of (𝑚 + 𝑟) bit positions and one additional state
indicates no error. Since, r𝑟 bits can indicate 2r𝑟 states, 2r𝑟 must be at least equal to
(m + r + 1). Thus the following equation should hold 2r ≥ m+r+1

Step 2 − Positioning the redundant bits.


The r redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4, 8, 16 etc. They
are referred in the rest of this text as r1 (at position 1), r2 (at position 2), r3 (at position
4), r4 (at position 8) and so on.

Step 3 − Calculating the values of each redundant bit.


The redundant bits are parity bits. A parity bit is an extra bit that makes the number of
1s either even or odd. The two types of parity are −
 Even Parity − Here the total number of bits in the message is made even.
 Odd Parity − Here the total number of bits in the message is made odd.
Each redundant bit, ri, is calculated as the parity, generally even parity, based upon its
bit position. It covers all bit positions whose binary representation includes a 1 in the
ith position except the position of ri. Thus −
 r1 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the least significant position excluding 1 (3, 5, 7, 9, 11 and so on)
 r2 is the parity bit for all data bits in positions whose binary representation includes
a 1 in the position 2 from right except 2 (3, 6, 7, 10, 11 and so on)
 r3 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the position 3 from right except 4 (5-7, 12-15, 20-23 and so on)

Decoding a message in Hamming Code


Once the receiver gets an incoming message, it performs recalculations to detect errors
and correct them. The steps for recalculation are −
 Step 1 − Calculation of the number of redundant bits.
 Step 2 − Positioning the redundant bits.
 Step 3 − Parity checking.
 Step 4 − Error detection and correction

Step 1 − Calculation of the number of redundant bits


Using the same formula as in encoding, the number of redundant bits are ascertained.
2r ≥ m + r + 1 where m is the number of data bits and r is the number of redundant bits.

Step 2 − Positioning the redundant bits


The r redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4, 8, 16 etc.

Step 3 − Parity checking


Parity bits are calculated based upon the data bits and the redundant bits using the
same rule as during generation of c1,c2 ,c3 ,c4 etc. Thus
c1 = parity(1, 3, 5, 7, 9, 11 and so on)
c2 = parity(2, 3, 6, 7, 10, 11 and so on)
c3 = parity(4-7, 12-15, 20-23 and so on)

Step 4 − Error detection and correction


The decimal equivalent of the parity bits binary values is calculated. If it is 0, there is no
error. Otherwise, the decimal value gives the bit position which has error. For example,
if c1c2c3c4 = 1001, it implies that the data bit at position 9, decimal equivalent of 1001,
has error. The bit is flipped to get the correct message.

Error Detection :
Polynomial checksum.

Noiseless Channel

An ideal channel in which no frames are lost, duplicated or


corrupted is regarded as Noiseless Channel.

- Simplest/ simpler protocol


- Stop and wait Protocol.
Noisy Channels

Consider the normal situation of a communication channel


that makes errors. Frames may be either damaged or lost
completely.
- Stop and wait Automatic Repeat Request.
- Sliding window protocol
 Go back N ARQ

 Selective repeat.

Simplest Protocol

 In simplest protocol, there is no flow control and error control mechanism. It is


a unidirectional protocol in which data frames travel in only one direction (from
sender to receiver).
 Also, the receiver can immediately handle any received frame with a
processing time that is small enough to be negligible.
 The protocol consists of two distinct procedures :a sender and 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 number or
acknowledgements are used here.

Stop and Wait Protocol

 The simplest retransmission protocol is stop-and-wait.


 Transmitter (Station A) sends a frame over the communication line and then
waits for a positive or negative acknowledgement from the receiver (station B).
 If no error occurs in the transmission, station B sends a positive
acknowledgement (ACK) to station A.
 Now, the transmitter starts to send the next frame. If frame is received at
station B with errors, then a negative acknowledgement(NAK) is sent to station
A. In this case, station 'A' must retransmit the old packet in a new frame.
 There is also a possibility that the information frames or ACKs may get lost.
 Then, the sender is equipped with a timer. If no recognizable acknowledgement
is received when the timer expires at the end of time out interval, the same
frame is sent again.
 The sender which sends one frame and then waits for an acknowledgement
before process is known as stop and wait.

1. Stop and Wait Automatic Repeat Request


 In a noisy communication channel, if a frame is damaged in transit, the
receiver hardware will detect this when it computes the checksum.
 If a damaged frame is received, it will be discarded and transmitter will
retransmit the same frame after receiving a proper acknowledgement.
 If the acknowledgement frame gets lost and data link layer on 'A' eventually
times out. Not having received an ACK, it assumes that its data frame was lost
or damaged and sends the frame containing packet 1 again. This duplicate
frame also arrives at data link layer on 'B', thus part of file will be duplicated
and protocol is said to be failed.

SLIDING WINDOW PROTOCOL

The sliding window is a technique for sending multiple


frames at a time. It controls the data packets between the
two devices where reliable and gradual delivery of data
frames is needed. It is also used in TCP (Transmission
Control Protocol).

In this technique, each frame has sent from the sequence


number. The sequence numbers are used to find the
missing data in the receiver end. The purpose of the
sliding window technique is to avoid duplicate data, so it
uses the sequence number.
Types of Sliding Window Protocols
The Sliding Window ARQ (Automatic Repeat reQuest) protocols
are of two categories −

 Go – Back – N ARQ
Go – Back – N ARQ provides for sending multiple frames
before receiving the acknowledgment for the first frame. It
uses the concept of sliding window, and so is also called
sliding window protocol. The frames are sequentially
numbered and a finite number of frames are sent. If the
acknowledgment of a frame is not received within the
time period, all frames starting from that frame are
retransmitted.
 Selective Repeat ARQ
This protocol also provides for sending multiple frames
before receiving the acknowledgment for the first frame.
However, here only the erroneous or lost frames are
retransmitted, while the good frames are received and
buffered.

Difference between the Go-Back-N ARQ and


Selective Repeat ARQ

You might also like