Data link layer – Framing

In the data link layer, framing is the process of adding a header and a trailer to a group of bits to form a frame. The frame defines the beginning and the end of a packet or a frame, enabling the receiving device to identify where a packet or frame begins and ends.

There are three common types of framing used in the data link layer:

  1. Character-Oriented Framing: Character-oriented framing involves framing a message, by appending a start and stop character to it. The start and stop characters are usually control characters and are used to indicate the beginning and end of a frame.
  2. Bit-Oriented Framing: In bit-oriented framing, a special bit pattern is added to the beginning and end of each frame to indicate the beginning and end of the frame. This bit pattern is known as a flag.
  3. Byte-Oriented Framing: Byte-oriented framing involves the use of a header and trailer for each frame. The header contains control information such as the source and destination addresses, while the trailer contains error detection and correction information.

In data communication, framing refers to the process of dividing a data stream into separate data packets or frames so that it can be transmitted reliably across a communication channel.

There are several methods for framing, including:

  1. Character Count: In this method, the length of the data packet is specified in the header of the packet, and the receiving end knows how many characters to expect.
  2. Byte Stuffing: This method involves adding an extra byte to the data packet when a special character appears in the data. The extra byte signals the end of the data packet.
  3. Bit Stuffing: In this method, a special pattern of bits is inserted into the data stream whenever a particular bit pattern is encountered. The receiving end removes the special pattern to extract the original data.
  4. Flag Bytes: In this method, special bytes called flag bytes are added to the beginning and end of each data packet to mark the start and end of the packet.

The choice of framing method depends on the requirements of the specific application and the characteristics of the communication channel.

In the data link layer of the OSI model, a frame is the unit of communication, which is composed of several parts:

  1. Preamble: It is a series of bits that is used to signal the beginning of a frame and to synchronize the receiver’s clock with the transmitter’s clock.
  2. Destination Address: It is the address of the device to which the frame is being sent.
  3. Source Address: It is the address of the device that is sending the frame.
  4. Length/Type: It is the number of bytes in the data field or a code that identifies the protocol being used.
  5. Data: It is the actual data being transmitted.
  6. Frame Check Sequence (FCS): It is a four-byte field that is used to check the integrity of the data. It is calculated at the sender and checked at the receiver.

The above-mentioned components of the frame are common in most of the data link layer protocols. However, some protocols may have additional fields depending on their specific requirements.

3 thoughts on “Data link layer – Framing”

  1. Pingback: IEEE Standards

  2. Pingback: ALOHA

  3. Pingback: OSI - Physical Layer

Leave a Comment

Your email address will not be published. Required fields are marked *