The datalink layer Flashcards
Role of the datalink layer
The Data Link Layer is responsible for:
- Framing
- Error handling
- Flow control
What is a frame
Its is the transmitted element in Data Link layer . A frame is regarded either as a block of bytes, or as a sequence of bits
Framing (to frame)
- The sender assembles/breaks an incoming sequence of packets (from network layer) into frames
- The receiver does the opposite
Framing extraction
The receiver must determine the first and last bit/byte of the frame so that the frames can then be extracted
Byte count
- Payload is transmitted as a variable length block of bytes preceded by a byte count
- this method uses a field in the header to specify the number of bytes in the frame
Data transparency problem
It may happen that the flag byte occurs in the data .
This would cause the protocol software to incorrectly assume that the frame was finished at that point
Solution to data transparency problem
insert a special escape byte (ESC) just before each ‘‘accidental’’ flag byte in the data. This is known as Byte stuffing
Redundant data
In the data link layer, redundant data refers to extra bits added to the data being transmitted to detect and correct errors. This helps to improve the reliability of the communication.
Error detection techniques
- Parity bit
- Checksums
- Cyclic Redundancy Check (CRC)
Flow control protocol
It controls the sending of transmission frames at a faster pace than they can be accepted e.g. Simple Stop and Wait Protocol
Stop and Wait protocol
- Sender sends one data frame
- Receiver receives the data frame and send an acknowledgment
- Sender receives the Acknowledgment and sends the next data frame
Disadvantages of stop and wait protocol
- Slow
- Cannot be used in noisy channel
Problems with stop and wait protocol
- Damaged frame
- Lost data frame
3.Lost ACK
Timeout problem with Stop and wait protocol
- If it is too long, (A) will wait unnecessarily long before
retransmission, causing the link to be idle - if it is too short, the protocol may fail due to the
occurrence of duplicate ACKs.
Automatic Repeat ReQuest Protocols
- A group of error control protocols incorporated with stop and wait flow control protocol for transmission of data over a noisy or unreliable network
- They provide automatic retransmission of frames that are corrupted or lost during transmission