Framing in Computer Networks
The Data Link Layer breaks the bit stream into discrete frames and computes 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.
Framing Methods
- Character Count Method
- Starting and Ending Characters, with Character Stuffing
- Starting and Ending Flags, with Bit Stuffing
In this method, a field in the header specifies 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. However, this method is rarely used due to its susceptibility to synchronization issues caused by transmission errors.
In this method, each frame starts with a FLAG and ends with a FLAG. The starting flag is DLE STX (Data Link Escape Start of Text), and the ending flag is DLE ETX (Data Link Escape End of Text). For example:
Ex 1. The given Data: ABRFCXDGJHKK12435ASBGXRR
The data will be sent as: DLE STX ABRFCXDGJHKK12435ASBGXRR DLE ETX
In this method, every frame starts with a flag 01111110. If there are five consecutive ones in the data, a zero will be stuffed. For example:
Ex. The given data is: 01111000011111110101001111110 01111101100