For the following two (2) questions, assume that the link layer uses the flag bits with bit stuffing approach for framing, with the following details:
The beginning and end of a data frame are indicated by the special flag bits 01111110 (i.e., 0x7E).
To handle accidental occurrence of the flag bits within the data, a 0 bit is stuffed every time 5 consecutive 1s are found in the data.
For simplicity, assume that no other header/trailer information is added to the data.
1. The following bit stream represents data that needs to be framed by the link layer on the sender’s side. Derive the resultant bit stream by adding necessary flag bits and performing bits stuffing.
0111110001010011111111100101111111111110
2. The following bit stream represents data received by the link layer of a computer. For simplicity, assume that there are no errors in the bit stream. Retrieve the original data from this received bit stream.
01111110010111101111101100101001111101101111110