In: Computer Science
<Bit Stuffing Question>
a) The following message is to be sent by a host running a protocol
with starting and ending flags
and bit stuffing. The starting and ending flags are both 01111110
and they have not yet been
added.
0111111011111011110011111100111111000000111110101111110
What is the message actually sent (after bit stuffing and after
adding the starting and ending flags)?
b) Suppose the bit pattern shown above is received by a host
running the bit stuffing protocol.
That is, this is the actual message that has been received after
bit stuffing and after adding the
starting and ending flags. How many frames are being received? What
is the actual content of
each frame before the flags are added and the bits are stuffed?
a)
Answer :
01111110011111010111110011110011111010011111010000001111100101111101001111110.
This is the message sent actually from the sender side after adding starting and ending flag and bit stuffing.
Given that the starting and ending flag is 01111110 and also we done bit stuffing
Bit Stuffing : To Secure our Transmitting data(message) the Data Link Layer uses the framing concept which is called as Bit Stuffing. Bit Stuffing is one of the mechanism of inserting one or more bits into a message by breaking the sequence of the message. In Bit Stuffing, if five consecutive 1 bits are encountered, then the sender appends the extra 0 bit to the data. This extra stuffed bit is removed from the receiver side to get the original message.
b) Two frames are being received.
The Actual content of the each frame after removing the starting and ending flags and also bit stuffing is
1111111110 00000111111
In the given data 01111110 is the starting flag after that we have five consecutive 11111 so next 0 is removed after 11110 then we have the ending flag 01111110. In the Next frame again we have the starting flag followed by 0000011111 and 0 is removed(stuffed bit) next 1 bit followed by ending flags.