The Gateway to Computer Science Excellence
+9 votes
388 views

in Computer Networks by Loyal (8.5k points) | 388 views
+2
3....
+1

Stuff bit pattern :01110
dataFrame :1011101111011111110
After stuffing 1011010110110110111110: 3Bit stuffing

0
Change ur comment to answer @saxena0612
0

@saxena0612 are you stuffing a 0 after every 2 1's ???

0
there is a controversy regarding stuffing....some textbook says that stuff after (n-1) occurrences of 1 and some says like the way Saxena have done...plz clarify if possible
+1
Yes as we know in bit stuffing , we stuff '0' if we have a '0' in a data followed by (n-1) 1's so as to remove the confusion with delimiter pattern which contains a '0' followed by n 1's..
0
so is it 3 ? I also do the stuffing after 2 1's.

One more thing is stuff bit pattern added at start and end of data frame while transmiting.I think it is added at end of frame but not sure if it is added at start of frame.Please clarify ?
0

if we stuff 0 after every 2 1's then, Flag Delimeter must be 01110.

And in the data to be transmitted, 0 must be stuff after every occurrence of "11".

But what concept you are following @saxena0612. ????

0
he follows the concept of stuffing 0 aftr every occurence of 011..
+1
Yes stuff bit pattern is at the start of the frame as [email protected] here delimiter is "01110" so if we stuff 0 after three 0's then it would create confusion whether it belongs to delimiter or not..Hence to remove this ambiguity we need to stuff 0's whenever we have a '0' followed by 2 1's , not merely after 2 1's anywhere ; it must be preceded by a zero..
0

1

Stuff bit pattern :01110 
dataFrame :1011101111011111110 
After stuffing 1011010110110110111110: 3Bit stuffing

After stuffing 101101011011 - here it forms 011 so why not adding a zero after this?

0
@habibkhan sir thank you for clearing the doubt....
0
aish...we dont do stuffing over stuffing...one time stuffing ensures that whenever the receiver will get 011 followed by 0 it will remove zero by itself

2 Answers

+5 votes
Best answer

Flag : 01110

Data Frame: 1011101111011111110 

Data after bit stuffing: 1011010110110011011011010

or your reference find the following screenshot from the book:

by Boss (43.2k points)
selected by
0
Thanx @manu00x for correction.
Even in RFC which is standard  they also do the stuffing like this:
Good Read : https://tools.ietf.org/rfc/rfc935.txt
+3 votes

Stuff bit pattern :01110 
dataFrame :1011101111011111110 
After stuffing 1011010110110110111110: 3Bit stuffing

[Edit: I didn`t cover the edge case where stuffing 0 also ruining the pattern thus updated answer is correct i.e
Data after bit stuffing: 1011010110110011011011010 Thanks @ manu00x for information ]

by Boss (11.7k points)
edited by
0

this answer is not correct, a 0 will be stuffed after each two 1's. for your reference find the following screenshot from the book:

0

@ manu00x is this excerpt from Forouzan ?

0
I exactly don't remember, i read from many books, but i am sure that it's not from Forozuan, but it's either from Tanenbaum or Kurose,that is I am sure!
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,666 questions
56,138 answers
193,704 comments
93,494 users