Framing in Data Link Layer

     The data Link Layer is one of the important layers in the OSI reference model. Framing is one of the most important functions of the data link layer. The data Link Layer is responsible for reliable data transfer between two adjacent nodes in the network. The data link layer divides the data received from the network layer into manageable units called a frame. So, while framing the data link layer takes a packet from the network layer encapsulates those packets into the frame, and adds some control information in the form of headers and trailers. If the size of the data frame becomes too large, to manage, the data link layer further divides the packet into small-sized frames to make flow control and error control more efficient.

 

      To help you understand better let me use the diagram to explain the concept of framing.

     Here L3 data is network layer data in the form of packets, to make small-size frames for efficient data transmission L3 data is divided into two small units of data called data frames. Each frame is encapsulated with a header and trailer.  These frames are given to a physical layer, the physical layer converts bits into signal and then transmit the message or data through the transmission medium.  the physical layer at the receiver side decodes these signals to bitstream and this bitstream is given to a data link layer.  

 

      Bitstream needs to be packed into frames in such a way that the data link layer understands the correct boundaries of each frame, i.e., where framework one ends and where the beginning of frame two is.  It is important because each frame is checked for flow control and error control independently. But there is no way to understand the frame boundaries, i.e., the start and end of frames. There is no such indicator that will indicate the start point and endpoint of frames. So, it is necessary to add delimiters between the frames that will indicate the start point and endpoint of each frame transmitted.

     Therefore, the sender’s data link layer will insert delimiters between the data frames which will indicate the start point and endpoint of frames to be transmitted.  

     The point is what indicator will be used by the senders’ Data Link Layer to indicate the start of the frame and end of the frame.  Everything that is transmitted is in the form of 1’s and 0’s. The data Link Layer will choose a special pattern of 1’s and 0’s to indicate the start point and endpoint of each frame.   A special pattern will be inserted between each pair of frames to be transmitted that pattern is called a flag, So the frame at the data link layer will have 5 fields:

     The first field is the start indicator flag followed by the header, then the payload, followed by the trailer, and followed by the stop indicator or end indicator flag.       

 

     Here flags are frame delimiters signaling the start of the frame and the end of the frame.  The header will contain the address of the source and destination; the payload contains the actual message to be transmitted and the trailer contains a piece of control information for error detection and correction.

Types of Framing in Data link layer

There are basically 2 types of framing.

  1. fixed size framing and
  2. variable size framing.

     In fixed framing the size of the frame is fixed and therefore there is no need to insert frame delimiters between the frames.

     for example, if the size of the frame is chosen to be 53 bytes receivers’ data link layer understands the boundaries of each frame because the receivers’ data link layer knows that each frame is 53 bytes. Hence, we will be able to detect the boundaries of each frame.  So, in fixed-size framing, there is no need to define the boundaries of each frame to be transmitted the size itself can be used as a delimiter. An example of fixed-size framing is ATM cells, where each frame is of fixed size the frames are called cells in an ATM network.

In variable-size framing the size of the frame can vary which means there is a need to define the beginning of the frame and the end of the frame. There is a need to explicitly insert an indicator that will indicate the start point and end point of each frame.

Types of Variable Size Framing

There are 2 types of variable-size framing approaches.

  1. character-oriented framing and
  2. bit-oriented framing

     In character-oriented framing the data to be transmitted is considered as a sequence of characters from one of the available data formats. In the case of the bit-oriented approach, the data to be transmitted is considered as a bit stream.

error: Content is protected !!