Posts

Showing posts from January, 2021

Byte Stuffing | Framing Methods

Image
 Implement the data link layer framing methods such as character, character-stuffing and bit stuffing. Experiment No:1(a): BYTE T STUFFING Hardware Requirements:   Intel based Desktop PC:RAM of 1GB Software Requirement:   Turbo C / Turbo C++ Theory In byte stuffing (or character stuffing), a special byte usually called  the escape character (ESC) [ predefined bit pattern] is added to the data section of the frame when there is a character with the same pattern as the flag. Whenever   the receiver encounters the ESC , it   removes it  from the data section and   treats the next character as data, not a delimiting flag . What happens if the data contains one or more escape characters followed by a flag? The receiver removes the escape character but keeps the flag, which is incorrectly interpreted as the end of the frame. To solve this problem, the escape characters that are part of the data must also be marked by another escape character. SOURCE COD...

Bit Stuffing program in C| Framing Methods

Image
Implement the data link layer framing methods such as character, character-stuffing and bit stuffing. Experiment No:1(a): BIT STUFFING Hardware Requirements: Intel based Desktop PC:RAM of 1GB Software Requirement: Turbo C / Turbo C++ Theory: Bit stuffing is the new technique which allows data frames to contain an arbitrary number if bits and allow character code with an arbitrary no. of bits per character. Each frame begins and ends with special bit pattern, 01111110, called a flag byte. Whenever the sender’s data link layer encounters five consecutive 1’s in the data, it automatically stuffs/ Append /Add 0 bit into outgoing bit stream. SOURCE CODE:   #include<stdio.h> #include<string.h> void main() { int a[20],b[30],i,j,k,count,n; printf("Enter frame length:"); scanf("%d",&n); printf("Enter input frame (0's & 1's only):"); for(i=0;i<n;i++) scanf("%d",&a[i]); i=0; count=1; j=0; ...

Search related post on google