Starting from:

$30

DCF255-Lab 4 Bit Stuffing Solved

This lab you will write a program which duplicates the work of the data link layer.  When data is send from the network layer, the data link layer checks to ensure that the value 7E does not exist in the string of bits.  It runs a program called bit stuffing when it checks each bit and after 5 consecutive ‘1’ bits, it adds a ‘0’. After bit stuffing, the data link layer then attaches the flags to delimit synchronous communication ‘01111110’ to the beginning and end of the frame.  The frame is then sent to the physical layer for encoding and transport.

Program  Specifications:

You can write your program in any scripting or programming language you are comfortable with.

Create an array of the following characters ‘011111101111110’
Assume this is the data sent to the data link layer from the network layer. Notice that the combination of 0s and 1s conflicts with the synchronous flag.
Set up a loop to count the number of 1s and if there are 5 1s in sequence, insert a 0 into the data stream.  Notice the data stream will require 2 ‘stuffed’ bits.
After bit stuffing append the flag to the front and end of the data stream.
Print you output (colour is optional) but the your program output should be similar to the screen shot below.
Show the data stream before stuffing with the number of characters in the array
Show the data stream after stuffing with the number of characters in the array
 Show the synchronous frame with the flag delimiters appended.

More products