5:50: It took me a while to understand the computer just ignore or throws away the stuffed bit and looks for the next bit after the stuff bit to determine the bit pattern. You added two addition padded bits into the sequence (orange bits). The computer is really looking for a bit pattern like "11111" and the next bit is either a 0 or 1. If its a 1, it means its the start or the end of the frame. If its a "0", then that bit gets ignored because its stuffed and the next bit actually represents what the next bit value should be.
@@abhinowyt8564 There would be no point in using bit stuffing in your example because your flag byte is too short and the data would look the same. Its like saying your flag bit is "01111110" and your data is "01111110". There is no way the computer can tell difference with bit stuffing. The key is to use a long enough byte or series of bits such that its unique to identify the start and stop flags. The alternate method is to use Byte stuffing where you include an escape character (ESC) to differentiate the flag pattern in the data from the start and ending flags.
@@abhinowyt8564 Just to clarify also, with HDLC the "01111110" sequence is used as the flag bit sequence (six 1's). The bit stuffing in HDLC checks for 5 consecutive "1" bits. If its a flag bit, it would send a "1" after the 5 bits. If its a data bit, it would always send a "0" bit as the next bit to ensure the flag big is unique and will never occur in the data stream. Technically, in your example, if you set the bit stuffing to be after two "1"s, it can be used. The flag bit would be sent as "01110" and the data bits would be "01101011010". Notice in the data stream, you never have a "111" sequence since that would be converted to "1101" with an extra "0" bit stuffed in between to differentiate from the flag bit. However, in the real world, that generates an excessive amount of extra bits and is not efficient.
For every bitstuffing problem, do we have to everytime put 0 in the position of 6th 1or it depends on flag byte.. For eg if flag byte was 0111110 so do we have to put 0 in the 5th position of data or here also we will put 0 in the 6th location..... If you reply i will subscribe :)
No, that is not how it works. You don't always add a bit to every 5th position. You only add if its a data bit and the pattern is a series of five "1" bits like "11111". It looks for a sequence of five "1" bits "11111" and evaluates the next bit to determine if it is a stuffed bit. If the next bit after this pattern of five "1" bits is a "1", it means its a flag for the start or the end frame. However, if the next bit is a "0", then it knows the bit was stuffed and ignores that bit during the un-stuffing process. The next bit after the stuffed bit would be added to the frame as a data bit. For instance, the bit sequence "00111111" (8 bits) would look like "001111101" (9 bits), and a bit sequence "00111110" (8 bits) would look like "001111100" (9 bits). That second to last bit is stuffed and its not included in the frame sequence during the un-stuffing process.
Nice dear keep it upp
5:50: It took me a while to understand the computer just ignore or throws away the stuffed bit and looks for the next bit after the stuff bit to determine the bit pattern. You added two addition padded bits into the sequence (orange bits). The computer is really looking for a bit pattern like "11111" and the next bit is either a 0 or 1. If its a 1, it means its the start or the end of the frame. If its a "0", then that bit gets ignored because its stuffed and the next bit actually represents what the next bit value should be.
This cleared an important doubt! Thanks! :")
what if Flag byte is "01110" and data is "011101110"
@@abhinowyt8564 There would be no point in using bit stuffing in your example because your flag byte is too short and the data would look the same. Its like saying your flag bit is "01111110" and your data is "01111110". There is no way the computer can tell difference with bit stuffing. The key is to use a long enough byte or series of bits such that its unique to identify the start and stop flags. The alternate method is to use Byte stuffing where you include an escape character (ESC) to differentiate the flag pattern in the data from the start and ending flags.
@@ahndeux Thank you for the Clarification !!
@@abhinowyt8564 Just to clarify also, with HDLC the "01111110" sequence is used as the flag bit sequence (six 1's). The bit stuffing in HDLC checks for 5 consecutive "1" bits. If its a flag bit, it would send a "1" after the 5 bits. If its a data bit, it would always send a "0" bit as the next bit to ensure the flag big is unique and will never occur in the data stream.
Technically, in your example, if you set the bit stuffing to be after two "1"s, it can be used. The flag bit would be sent as "01110" and the data bits would be "01101011010". Notice in the data stream, you never have a "111" sequence since that would be converted to "1101" with an extra "0" bit stuffed in between to differentiate from the flag bit. However, in the real world, that generates an excessive amount of extra bits and is not efficient.
Good explanation
Very nice &clear ❤️
Nyc expalanation
how we can do bit stuffing or it just happening automatically at data link layer?
For every bitstuffing problem, do we have to everytime put 0 in the position of 6th 1or it depends on flag byte.. For eg if flag byte was 0111110 so do we have to put 0 in the 5th position of data or here also we will put 0 in the 6th location.....
If you reply i will subscribe :)
No, that is not how it works. You don't always add a bit to every 5th position. You only add if its a data bit and the pattern is a series of five "1" bits like "11111".
It looks for a sequence of five "1" bits "11111" and evaluates the next bit to determine if it is a stuffed bit. If the next bit after this pattern of five "1" bits is a "1", it means its a flag for the start or the end frame. However, if the next bit is a "0", then it knows the bit was stuffed and ignores that bit during the un-stuffing process. The next bit after the stuffed bit would be added to the frame as a data bit. For instance, the bit sequence "00111111" (8 bits) would look like "001111101" (9 bits), and a bit sequence "00111110" (8 bits) would look like "001111100" (9 bits). That second to last bit is stuffed and its not included in the frame sequence during the un-stuffing process.
Tq madam
Who is clicking the mouse 😂😂
Can the value of the flag be changed or it is fixed-01111110???? Kindly answer
Changed as per the question we can set the flaf
can you explain hdlc
Can't understand
Second time see clear
code?
what if Flag byte is "01110" and data is "011101110"
5 1's bit is mandatory
if that was the case then but stuffing would’ve been done after two 1’s and so it becomes ‘011010’
hindi nahi aati h aapko kya