Search code examples
networkingdata-link-layerbitstuffing

bit stuffing example


I'm going over an example that reads

Bit Stuffing. Suppose the following bit string is received by the data link layer from the network layer: 01110111101111101111110. What is the resulting string after bit stuffing? Bold each bit that has been added.

Answer:

0111011110111110011111010
               ^      ^  

How is this answer reached? My understanding is that bit stuffing works by inserting a certain sequence of bits (known as a flag value) at the beginning and end of a frame. What I don't get is:

  1. We aren't told the flag value!
  2. We aren't told how big a frame is, so how do we know where to put the flag?

Aditional Information: I think this network is Ethernet.

Aditional Information 2: The bit flag is 01111110

Honestly I think I understand but isn't the answer incomplete because they didn't add the flag 01111110 to the end or beginging? They just took care of when that pattern of bits appeared in the message.

Other example: here they do it too.


Solution

  • Consider: 0111011110111110*0111110*10

    After it finds a 0 and then five consecutive 1 bits it stuffs with a 0. This assumes 0 bit stuffing which is common.