Subscribe by Email

Sunday, March 14, 2010

Framing in Data Link Layer

The data link layer detects the number of bits transmitted by physical layer to be error free. The approach used is 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 this checksum is different from the one obtained in the frame, the data link layer knows that an error has occurred and takes steps to deal with.
There are three different types of framing, each of which provides a way for the sender to tell the receiver where the block of data begins and ends:
- Byte-oriented framing : Computer data is normally stored as alphanumeric characters that are encoded with a combination of 8 bits (1 byte). This type of framing differentiates one byte from another.
- Bit-oriented framing : This type of framing allows the sender to transmit a long string of bits at one time.
- Clock-based framing : In a clock-based system, a series of repetitive pulses are used to maintain a constant bit rate and keep the digital bits aligned in the data stream.

The following methods are commonly used for calculating the check sum :
- Character Count : It uses a field in the header to specify the number of characters in the frame. When data link layer at destination sees the character count, it knows how many characters follow, and hence where the end of frame is. The disadvantage with this method is that the count can be garbled by a transmission error.

- Character stuffing : This method gets around the problem of resynchronization after an error. Each frame starts with the ASCII character sequence DLE(Data Link Escape) STX(Start of Text) and end with the sequence DLE ETX(End of Text). If the destination loses track of frame boundaries, all it has to do is to look for DLE STX or DLE ETX. Problem occurs when binary data such as object programs or floating point numbers are transmitted. Solution to this problem is to have sender's data link layer insert an ASCII DLE character just before each accidental DLE character in the data. The data link layer on receiving end removes the DLE before the data is given to the network layer. This is called character stuffing. A disadvantage of using this framing method is that it is closely tied to 8-bit characters.

No comments:

Facebook activity