Frames are the units of digital transmission, particularly in computer networks and telecommunications. Frames are comparable to the packets of energy called photons in the case of light energy. Frame is continuously used in Time Division Multiplexing process.
Framing is a point-to-point connection between two computers or devices consists of a wire in which data is transmitted as a stream of bits. However, these bits must be framed into discernible blocks of information. Framing is a function of the data link layer. It provides a way for a sender to transmit a set of bits that are meaningful to the receiver. Ethernet, token ring, frame relay, and other data link layer technologies have their own frame structures. Frames have headers that contain information such as error-checking codes.
At the data link layer, it extracts the message from the sender and provides it to the receiver by providing the sender’s and receiver’s addresses. The advantage of using frames is that data is broken up into recoverable chunks that can easily be checked for corruption.
Problems in Framing –
Types of framing – There are two types of framing:
1. Fixed size – The frame is of fixed size and there is no need to provide boundaries to the frame, the length of the frame itself acts as a delimiter.
2. Variable size –
In this, there is a need to define the end of the frame as well as the
beginning of the next frame to distinguish. This can be done in two
ways:
1. Character/Byte Stuffing: Used when frames consist of characters. If data contains ED then, a byte is stuffed into data to differentiate it from ED.
Let ED = “$” –> if data contains ‘$’ anywhere, it can be escaped using ‘\O’ character.
–> if data contains ‘\O$’ then, use ‘\O\O\O$'($ is escaped using \O and \O is escaped using \O).
Disadvantage – It is very costly and obsolete method.
2. Bit Stuffing:
Let ED = 01111 and if data = 01111
–>
Sender stuffs a bit to break the pattern i.e. here appends a 0 in data = 0111
0
1.
–>
Receiver receives the frame.
–>
If data contains
0111
01, receiver removes the 0 and reads the data.
Examples –
–> 011
0 100011
0 11
0 0
–> 1100
1 0100
1 1