What is the character count? Explain with an example?

Data link layer translates the physical layer's raw bit stream into discrete messages called frames. The key challenge is determining how a frame can be transmitted so the receiver can recognize the start and end of each frame.

Frame Delimitation Techniques

The techniques used to identify frame boundaries are:

  • Character count − Uses a header field to specify frame length
  • Flag byte with byte stuffing − Uses special delimiter bytes
  • Starting and ending flag with bit stuffing − Uses bit-level delimiters
  • Encoding violation − Uses invalid signal patterns as delimiters

Character Count Method

The character count framing method uses a field in the frame header to specify the number of characters (or bytes) in the entire frame, including the count field itself. When the data link layer at the destination reads this count, it knows exactly how many characters follow and can determine where the frame ends.

Character Count Framing Structure 5 1 2 3 4 Frame 1: Count=5 5 5 6 7 8 Frame 2: Count=5 6 9 0 1 2 3 Frame 3: Count=6 Count Field Data Field

Example: Normal Operation

Consider data sequence: 1 2 3 4 5 6 7 8 9 0 1 2 3

This data is divided into three frames:

Frame Count Data Total Characters
Frame 1 5 1, 2, 3, 4 5 (including count)
Frame 2 5 5, 6, 7, 8 5 (including count)
Frame 3 6 9, 0, 1, 2, 3 6 (including count)

Problem with Character Count

The major disadvantage of character count is its vulnerability to transmission errors. If the count field itself gets corrupted, the receiver loses synchronization and cannot determine frame boundaries correctly.

Example: Error in Count Field

If the count field in Frame 2 gets corrupted from 5 to 7:

  • Frame 1: Correctly received as count=5, data=[1,2,3,4]
  • Frame 2: Incorrectly interpreted as count=7, reads [5,6,7,8,6,9] (takes data from next frame)
  • Frame 3: Starts with remaining data, causing complete desynchronization

Advantages and Disadvantages

Advantages Disadvantages
Simple implementation No error recovery mechanism
Efficient use of bandwidth Single error destroys frame synchronization
No special delimiter characters needed Difficult to resynchronize after errors

Conclusion

Character count is a simple framing method that uses a header field to specify frame length. However, its vulnerability to count field corruption makes it unsuitable for unreliable transmission media, leading to the adoption of more robust framing techniques in modern networks.

Updated on: 2026-03-16T23:36:12+05:30

13K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements