Hello Friends, In this blog post(Framing methods for framing in the Data link layer) I am going to let you know about the framing using the data link layer and various methods used in framing in computer networking.
Inside this blog post(Framing methods for framing in the Data link layer), we are going to let you know about What is framing in the data link layer? What are framing and its methods? What are the types of framing? What are the protocols of the data link layer?
What is framing and its methods?
The data link layer uses the service provided by the physical layer and provides service to the network layer. The physical layer accepts a raw bitstream and attempts to deliver it to the destination. This bitstream is not insured to be error-free.
A number of bits received may be less than, equal to, or more than the number of bits transmitted and they may have different values. It is up to the data link layer to detect and, if essential, correct errors.
Generally, the data link layer breaks the bitstream up into discrete frames(Framing) and computes the checksum for each frame. After arriving at a frame 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 happened and takes steps to deal with it.
It is not an easy task to break the bitstream up into frames(Framing). One approach to obtain this framing is to insert time gaps between frames, much like the spaces between words in ordinary text. But, the networks rarely make any guarantees about timing.
There it is possible these gaps might be squeezed out or other gaps might be inserted during transmission.
What are the types of framing?
This is very much risky to count on timing to mark the start and end of each frame. Therefore, other techniques have been devised. There are four techniques –
Flag Bytes with byte stuffing
Starting and ending flags, with bit stuffing.
Physical layer coding violation.
In the first framing technique, a field is used in the header to specify the number of characters in the frame. By seeing the character count at the destination, the data link layer knows how many characters follow and hence where the end of the frame is. Fig 1 shows this technique for four frames of sizes 5,5,8 and 8 characters respectively.
The difficulty with this algorithm is that the count can be garbled by a transmission error. For example, if the character count of 5 in the second frame of fig 1 becomes a 7, the destination will get out of synchronization and will be unable to locate the start of the next frame. Due to this reason, the character count technique is rarely used anymore.
The second farming technique gets around the problem of resynchronization after an error by having each frame begin with the ASCII character sequence DLE STX and end with the sequence DLE ETX.
In this manner, when destination ever loses track of the frame boundaries, all have to do is look for DLE STX and DLE ETX characters to figure out where it is.
This technique has a serious problem when binary data as object programs of floating-point numbers, are being transmitted. It may easily occur that the characters for DLE STX or DLE ETX happen in the data, that will interfere with the framing.
One approach to overcome this problem is to have the sender’s data link layer insert an ASCII DLE character just before each ‘accidental’ DLE character in the data.
At the receiving end, the data link layer removes the DLE before the data are given to the network layer.
This technique is known as character stuffing. Therefore a framing DLE STX or DLE ETX can be differentiated from one in the data is always doubled.
An example data stream before stuffing, after stuffing and after destuffing is shown in fig2. This framing method has the disadvantage that it is closely tied to the use of 8-bit characters in general and the ASCII character code in particular.
As networks developed, the disadvantage of embedding the character code length in the framing mechanism became more and more obvious. Therefore, a new technique has to be developed to permit arbitrary sized characters.
In the new technique, data frames are permitted to contain an arbitrary number of bits and character codes with an arbitrary number of bits per character are permitted.
It works like this. Each frames starts and ends with a special bit pattern, 0111110, known as the flag byte.
Whenever the sender’s data link layer encounters five consecutive ones in the data, it automatically stuffs a 0 bit into the outgoing bitstream.
In the bit stuffing, the boundary between two frames can be unambiguously identified by a flag pattern.
Therefore, if the receiver loses track of where it is, all it has to do is scan the input for flag sequences, because they can only take place at frame boundaries and never within the data.
The last technique of framing is only useful to networks in which the encoding on the physical medium contains some redundancy. As an example, some LANs encode 1 bit of data by using 2 physical bits. Generally, high – low pair is used for 1 and low – high pair is used for 0.
The combination of low -low and high -high are not used for data. The scheme means that each data bit has a transition in the middle, making it easy for the receiver to locate the bit boundaries.
This use of invalid physical codes is part of the 802 LAN.
In this blog post(Framing methods for framing in the Data link layer), we have gone through What is framing in the data link layer? What are framing and its methods? What are the types of framing? What are the protocols of the data link layer? framing that is done on the data link layer is of how many types.
In the case of any queries, you can write to us at [email protected] we will get back to you ASAP.
Hope! you would have enjoyed this post about Framing methods for framing in the Data link layer.
Please feel free to give your important feedbacks in the comment section below.
Have a great time! Sayonara!