Data Link Layer Design Issues
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.
Relationship between packets and frames.
2.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. On the source machine is an entity, call it a process, in the network
layer that hands some bits to the data link layer for transmission to the destination. The job of
the data link layer is to transmit the bits to the destination machine so they can be handed over
to the network layer there
(a) Virtual communication. (b) Actual communication.
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.
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.
2.2 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 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. for
breaking the bit stream up into frames, various methods have been devised.
1. Character count.
2. Flag bytes with byte stuffing.
3. Starting and ending flags, with bit stuffing.
4. Physical layer coding violations.
1. Character count.
The first framing method uses a field in the header to specify the number of characters in the
frame. When the data link layer at the destination sees the character count, it knows how many
characters follow and hence where the end of the frame is.
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.
Relationship between packets and frames.
2.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. On the source machine is an entity, call it a process, in the network
layer that hands some bits to the data link layer for transmission to the destination. The job of
the data link layer is to transmit the bits to the destination machine so they can be handed over
to the network layer there
(a) Virtual communication. (b) Actual communication.
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.
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.
2.2 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 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. for
breaking the bit stream up into frames, various methods have been devised.
1. Character count.
2. Flag bytes with byte stuffing.
3. Starting and ending flags, with bit stuffing.
4. Physical layer coding violations.
1. Character count.
The first framing method uses a field in the header to specify the number of characters in the
frame. When the data link layer at the destination sees the character count, it knows how many
characters follow and hence where the end of the frame is.