What is Character Count ?
This method uses a field in the header to specify the number of characters in the frame. When the data link layer at the destination sees the character count,it knows how many characters follow, and hence where the end of the frame is. The disadvantage is that if the count is garbled by a transmission error, the destination will lose synchronization and will be unable to locate the start of the next frame. So, this method is rarely used.#include<stdio.h> #include<string.h> #include<math.h> main() { int ssize,rsize; char str[20]; printf("Enter the string:"); gets(str); ssize=strlen(str); printf("\nSize of the string send by the sender:%d",ssize); printf("\nEnter the size received by the receiver:"); scanf("%d",&rsize); if(ssize == rsize) printf("Hence the frame ends at %d",rsize); else printf("\nThere's an error"); }
OUTPUT:

No comments:
Post a Comment