This study deals with algorithms for achieving reliable, efficient communication of whole units of information called frames
The data link layer uses the services of the physical layer below it to send and
receive bits over (possibly unreliable) communication channels that may lose data.
To accomplish these goals, the data link layer takes the packets it gets from the network
layer and encapsulates them into frames for transmission
The data link layer can be designed to offer various services. The actual services that are offered vary from protocol to protocol. Three reasonable possibilities that we will consider in turn are:
Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service.
In an unacknowledged connectionless service, there is no feedback about whether or not a frame was received correctly by its destination. If the receiver does receive a frame without errors, it simply processes the payload and discards the rest of the frame. If the receiver detects any errors in the frame, it silently drops the frame and never informs the sender.
An acknowledged connectionless service provides all the benefits of an unacknowledged connectionless service but also requires the sender to retransmit lost frames. This means that the sender must keep track of which frames have been sent so far and which ones still need to be transmitted. When the receiver receives a frame, it checks the sequence number to see if it matches what it expects; if so, it acknowledges receipt of the frame using another message back to the sender. Otherwise, it ignores the frame.
The next step up in terms of reliability is 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 or been lost. 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. 802.11 (WiFi) is a good example of this type of link
layer service.
Unacknowledged connectionless service consists of having the source machine send independent frames to the destination machine without having themachine acknowledge them. Ethernet is a good example of a data link layer that provides this class of service. No logical connection is established beforehand or released afterward. If a frame
Getting back to our services, 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.
Often the same byte, called a flag byte, is used as both the starting and ending delimiter.
The data link layer on the receiving end removes the escape bytes before
giving the data to the network layer. This technique is called byte stuffing.
This bit stuffing is analogous to byte stuffing, in which an escape byte is stuffed into the outgoing character stream before a flag byte in the data.
Many data link protocols use a combination of these methods for safety. A
common pattern used for Ethernet and 802.11 is to have a frame begin with a
well-defined pattern called a preamble. This pattern might be quite long (72 bits is typical for 802.11) to allow the receiver to prepare for an incoming packet.
Tw o 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.
The other is to include only enough redundancy to allow the receiver to deduce that an error has occurred (but not which error) and have it request a retransmission. The former strategy uses error-correctingcodes and the latter uses error-detectingcodes. The use of error-correcting codes is often referred to as FEC (Forward Error Correction).
Sometimes, the location of an error will be known, perhaps because the physical layer received an analog signal that was far from the expected value for a 0 or 1 and declared the bit to be lost. This situation is called an erasure channel.