Assume that the link layer uses the flag bytes with byte stuffing approach for framing, with the following details: The beginning of a data frame is indicated by the special flag bytes: START The end of a data frame is indicated by the special flag bytes: FIN The special escape bytes STH are used for escaping accidental occurrences of either the flag bytes or the escape bytes within the data. The following byte stream represents data that needs to be framed by the link layer on the sender’s side. Derive the resultant byte stream by adding necessary flag bytes and performing byte stuffing.
original data: ITISHOWYOUSTARTTHATRULYCHANGESTHINGS
--> "ITISHOWYOU" tiil this part of data is fine, after that there is START, So you should add escape byte STH.
--> Till here data after stuffing is ITISHOWYOUSTHSTART. (bold part is stuffed)
--> After that "THATRULYCHANGE" till this part is fine, now you see STH in the data, So you should add escape
byte STH before it.
--> Till here data after stuffing is ITISHOWYOUSTHSTARTTHATRULYCHANGESTHSTH. (bold part is stuffed).
--> After "INGS" is fine so add it at the end. So, total data after stuffing is :
"ITISHOWYOUSTHSTARTTHATRULYCHANGESTHSTHINGS"
--> Bold ones are the stuffed bytes.
Note: If you have any doubts please comment.
It will be great help If you like.
Assume that the link layer uses the flag bytes with byte stuffing approach for framing, with...