What Is Framing And Its Types In Computer Networks?
Programming students often ask these questions. To understand their answer one needs to understand the concept of computer networks.
Computer networks consist of multiple layers. The data is filtered and becomes more synchronised at each level of the computer network.
Before the physical layer comes the data link layer. This layer is very crucial for the computer network as it defines the format of the data received.
While learning about the data link layer, one common term that you will come across is Framing. Framing is done to transfer the data digitally.
Now the question is, how does it work?
The process has multiple parts and types. So, to understand each type and method of framing in the computer network, keep reading this post.
What Is Framing In Computer Networks?
Before anything else, let’s begin with understanding what Framing is.
Framing in computer networks is defined as the process of establishing an end-to-end link between the receiver and the sender. Framing is one of the most important functions performed at the data link layers as it gives you the way to transfer the information between the interlinked devices.
So, the main function of transmitting data between multiple devices is done with framing. In this process, frames are used to transfer or receive the data. This layer will first receive data packets from previous layers and then convert those packets into frames.
However, in case the frame is larger in size, the packet is then further divided into multiple smaller frames. Moreover, frames of small sizes are easier to manage and maintain the flow of control and control errors.
The layer also uses bits to ensure that every frame can be easily distinguished from the other. It includes entering a character into a box to separate the information.
Components Of A Frame
In the framing process, frames are used to transfer the data. These frames comprise four parts which include payload field, flag, trailer, and header. Each part of the frame carries different information. It is as follows:
Header: This field of your frame contains the destination and the source address of the data.
Trailer: This field contains error correction and error detection bits.
Flag: This field indicates the starting and ending points of a specific frame.
Payload field: In this field, the actual message that the sender has sent is present.
Two Kinds Of Framing In Computer Network
By now, you are well aware of what frames are, what all is present in a frame and what is framing. Now, let’s discuss how framing is done at the link layer.
Framing in the computer network is done in two ways. These types depend on the length of the frame the layer uses. Therefore, the framing process is divided into two types:
- Variable sized framing
- Fixed sized framing
Here is an explanation of both.
Fixed Size Framing
As the name suggests, here the size of the frame will be fixed. In this type of framing in computer networks, one does not need to define any boundaries to indicate the ending or the beginning of the frame. In the fixed size framing, the frame’s length is only the delimiter.
Such types of frames are used in WAN and ATMs. Besides its wide application, one disadvantage of using the fixed size framing is that the internal fragmentation issue may occur if there is a difference between the frame size and data size.
However, the only solution to this problem is padding. In this process, the bits of characters take up the empty space in the data field.
Variable Sized Framing
In the variable-sized framing in computer networks, frames of variable sizes are used. Moreover, In this type, there is a need to find out a way to describe the beginning and the ending point of the given frame. Such a type of framing method is utilized in LAN.
To define the boundaries of a frame, two methods are employed. They are:
- Length field: This field is utilized to define the size of the given field. This method is utilized in Ethernet.
- End Delimiter: To check the size or indicate the end of a specific frame, a sequence is required. This pattern is used in token rings.
However, one problem with this method is that the delimiter may be present within the data. To resolve that problem, two methods can be used. They are:
- Byte stuffing or character-oriented approach
- Bit stuffing or Bit-oriented approach
Byte Stuffing
In byte stuffing, an additional byte is added if there is an escape character or a flag present in the message.
In this method, the sender will send the frame with added bits and your receiver machine will receive the frame. It will then delete all the added bits and convert that data into the original message.
Bit Stuffing
Many routing algorithms in the computer networks and protocols utilize a unique 8-bit sequence 01111110 as a delimiter to indicate the end and the beginning of the given frame. In this process, the bit stuffing process is performed at the sender’s end and the removal process is done at the receiver’s end.
For instance, if there are five 1s and one 0 after it, you will have to stuff 0. After that, when it will be received, 0 will be removed.
Let’s have a look over routing algorithm…
What is a routing algorithm?
The routing algorithm basically defines a specific path for the data to be transferred from the source point to the destination in the computer network.
By using a routing algorithm the network or internet traffic is channeled in a particular direction so that it can reach the users.
After laying out the path for the data to find its destination it can choose from many different directions to carry the data packets.
Conclusion
Before sending the data to the physical layer, the data is first divided into different frames at the data link layer. Framing in computer networks is an important process to identify the actual format of the data.
A computer network and its properties are a vast concept related to the transmission of data packets to the destination point in the router.
Moreover, depending on the frame size, there are two types of framing methods. Each method has its own application.
However, the process must be performed with proper protocols to ensure that each station finds out the right starting and ending point of the frame.