The Data Link Layer 1. Data Link Layer Design Issues
The Data Link Layer 1. Data Link Layer Design Issues
• It uses a field in the header to specify the number of bytes in the frame.
• Once the header information is being received it will be used to determine end of the frame.
• Trouble with this algorithm is that when the count is incorrectly received the destination will get out of
synch with transmission.
– Destination may be able to detect that the frame is in error but it does not have a means how
to correct it.
• This methods gets around the boundary detection of the frame by having each appended by the
frame start and frame end special bytes.
• If they are the same (beginning and ending byte in the frame) they are called flag byte.
• If the actual data contains a byte that is identical to the FLAG byte (e.g., picture, data stream, etc.) the
convention that can be used is to have escape character inserted just before the “FLAG” character.
• This methods achieves the same thing as Byte Stuffing method by using Bits (1) instead of Bytes (8
Bits).
• It was developed for High-level Data Link Control (HDLC) protocol.
• Each frames begins and ends with a special bit patter:
– 01111110 or 0x7E <- Flag Byte
– Whenever the sender’s data link layer encounters five consecutive 1s in the data it
automatically stuffs a 0 bit into the outgoing bit stream.
– USB uses bit stuffing.
Bit stuffing. (a) The original data. (b) The data as they appear on the line.
(c) The data as they are stored in the receiver’s memory after destuffing.
• Many data link protocols use a combination of presented methods for safety. For example in Ethernet
and 802.11 each frame begin with a well-defined pattern called a preamble.
Error Control:
• After solving the marking of the frame with start and end the data link layer has to handle eventual
errors in transmission or detection.
– Ensuring that all frames are delivered to the network layer at the destination and in proper
order.
• Unacknowledged connectionless service: it is OK for the sender to output frames regardless of its
reception.
• Reliable connection-oriented service: it is NOT OK.
• Reliable connection-oriented service usually will provide a sender with some feedback about what is
happening at the other end of the line.
– Receiver Sends Back Special Control Frames.
– If the Sender Receives positive Acknowledgment it will know that the frame has arrived
safely.
• Timer and Frame Sequence Number for the Sender is Necessary to handle the case when there is no
response (positive or negative) from the Receiver .
Flow Control:
• Important Design issue for the cases when the sender is running on a fast powerful computer and
receiver is running on a slow low-end machine.
• Two approaches:
1. Feedback-based flow control
2. Rate-based flow control
Feedback-based Flow Control:
• Receiver sends back information to the sender giving it permission to send more data, or
• Telling sender how receiver is doing.
Rate-based Flow Control:
• Built in mechanism that limits the rate at which sender may transmit data, without the need for
feedback from the receiver.