🎓 BookMCQ
← Back to 11. Data Link Control (DLC)

📝 HDLC bit stuffing and framing (23 MCQs)

Maintaining Frame Boundaries in a Bit Stream

HDLC uses the eight-bit flag 01111110 to mark the beginning and end of a frame. Because the same bit pattern might otherwise occur within the frame contents, HDLC applies bit stuffing to maintain transparency. This procedure ensures that payload and control bits cannot accidentally be interpreted as a flag during normal frame scanning, preserving receiver synchronization throughout the frame transfer and subsequent FCS check.

Inserting a Zero After Five Consecutive Ones

After the sender has formed the frame and calculated its FCS, it examines the bits between the flags. Whenever five consecutive 1 bits occur in this content, it inserts a 0 immediately afterward. The receiver reverses the operation by removing a 0 that directly follows five consecutive 1 bits before checking the FCS.

Receiver Synchronization and Destuffing

The receiver monitors the incoming bit stream for the flag pattern. Once a frame begins, it counts consecutive 1 bits in the frame content. When five are followed by an inserted 0, it discards that zero and continues reconstructing the original bits. A detected flag ends the frame, after which the receiver checks the FCS.

Stuffing a Run of Six Data Bits Equal to One

Consider six consecutive 1 bits within an HDLC frame. The sender transmits the first five, inserts a 0, then transmits the sixth 1. The resulting sequence is 1111101 rather than six uninterrupted ones. The receiver removes the inserted zero and recovers the original six data bits, preserving frame transparency across the entire link.

Why Bit Stuffing Is Not an Error-Correction Method

Bit stuffing protects the framing pattern; it does not correct damaged payload bits. The FCS performs error detection after the receiver removes stuffed bits. Similar byte-stuffing procedures are used on octet-oriented links, but HDLC's synchronous bit-oriented framing operates on individual bits. These methods solve transparency problems at different data granularities.

Clarifying the Scope of Stuffed Bits

'The zero inserted by stuffing is part of the payload' is false because the receiver removes it. 'The flag itself is stuffed' is incorrect; the flags delimit the frame and stuffing applies to the content between them. 'Bit stuffing corrects transmission errors' confuses transparency with error detection and recovery, which are separate link functions.

Tracing HDLC Stuffing by Hand

For examinations, scan the frame content from left to right, count consecutive ones, and insert a zero after each group of five before continuing. Do not apply stuffing to the opening or closing flags. On reception, remove only the zero that follows five consecutive ones, then verify the FCS over the reconstructed frame.

HDLC Flag and Bit-Stuffing Terms

  • Flag - The bit pattern 01111110.
  • Bit stuffing - Inserts zero after five consecutive ones.
  • Destuffing - Removes the inserted transparency zero.
  • Transparency - Prevents data imitating frame flags.
  • FCS - Checks reconstructed frame integrity.
  • Bit stream - Continuous sequence of transmitted bits.
7
Easy
10
Medium
6
Hard

📝 All HDLC bit stuffing and framing MCQs

Q1. Which of the following best defines framing in the data link layer?

A.Error detection
B.Grouping bits into frames ✅
C.Routing
D.Encryption
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Framing is the process of organizing a stream of bits into distinct units called frames, allowing the receiver to recognize where each logical packet begins and ends. This grouping enables higher‑layer protocols to interpret the transmitted data correctly, distinguishing it from raw bit streams.

Q2. What is the primary purpose of a flag sequence in byte‑oriented framing?

A.Indicate start/end of frame ✅
B.Synchronize clocks
C.Provide error correction
D.Compress data
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A flag sequence, such as 01111110, marks the boundaries of a frame so that the receiver can detect where a frame starts and ends. Without a unique delimiter, the receiver could not differentiate payload data from control information, leading to loss of frame integrity.

Q3. If a communication link uses bit stuffing with a flag pattern of 01111110, what is the effect on the transmitted bit stream when the payload contains the sequence 0111110?

A.Extra bit inserted after five consecutive 1s ✅
B.No change
C.Flag is interpreted as end of frame
D.Payload is truncated
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Bit stuffing inserts a non‑information bit after five consecutive 1s to prevent the payload from mimicking the flag pattern. When the payload includes 0111110, the transmitter adds a 0 after the five 1s, ensuring the flag remains unique and the receiver does not mistake data for a delimiter.

Q4. Suppose a network switches from character‑oriented to bit‑oriented framing while keeping the same physical‑layer bitrate. How does this change likely affect the frame error‑detection overhead?

A.Increases overhead due to larger flags
B.Decreases overhead because of fewer escape characters ✅
C.No change
D.Error detection becomes impossible
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Bit‑oriented framing typically uses shorter flag sequences and eliminates the need for escape characters that character‑oriented schemes require. Consequently, the amount of extra bits dedicated to delimiting frames is reduced, lowering the overall overhead associated with error detection and frame control.

Q5. In a protocol that uses length‑field framing, if the length field is corrupted to indicate a size twice the actual payload, what is the most probable consequence for the receiver?

A.It will discard the frame
B.It will read into the next frame ✅
C.It will request retransmission
D.It will treat extra bits as padding
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: When the length field overstates the payload size, the receiver will continue reading bits beyond the intended end of the current frame, mistakenly incorporating bits from the subsequent frame into the current one. This misalignment typically propagates errors until a new correct delimiter or length field restores synchronization.

Q6. When employing byte stuffing, why does the presence of the pattern 01111110 within the payload necessitate the insertion of a stuffing bit?

A.To prevent misinterpretation as a flag ✅
B.To increase transmission speed
C.To synchronize clocks
D.To encrypt data
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The flag 01111110 serves as a unique delimiter. If the payload contains the same pattern, the receiver could falsely identify the payload as a frame boundary. Inserting a stuffing bit after the pattern breaks the delimiter sequence, ensuring that only the intended flag is recognized as a frame delimiter.

Q7. If a sender uses a variable‑length frame with a delimiter '01111110' and the receiver experiences a bit slip causing a shift by one bit, what is the most likely impact on frame boundaries?

A.Frames will be correctly identified
B.Delimiter may be missed leading to frame loss ✅
C.All frames will be merged
D.No impact
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A bit slip displaces the alignment of bits, so the receiver may fail to detect the exact delimiter pattern. Missing the delimiter causes the receiver to treat subsequent bits as part of the same frame, resulting in loss of the intended frame boundaries and potential data corruption.

Q8. Compare byte‑oriented (character) framing and bit‑oriented framing. Which statement accurately reflects a key advantage of bit‑oriented framing?

A.Simpler hardware implementation
B.More efficient use of bandwidth due to less overhead ✅
C.Easier to debug manually
D.Requires fewer synchronization bits
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Bit‑oriented framing uses concise flag sequences and does not require escape characters for every special byte, reducing the number of extra bits transmitted. This efficiency translates into higher effective bandwidth, especially when payloads contain many consecutive ones, making bit‑oriented schemes more economical than byte‑oriented alternatives.

Q9. Which of the following best differentiates synchronous framing from asynchronous framing?

A.Use of start/stop bits
B.Fixed‑size frames
C.Dependence on clock synchronization ✅
D.Inclusion of error detection codes
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Synchronous framing relies on a shared clock between sender and receiver, allowing continuous streams of bits without start/stop bits. In contrast, asynchronous framing inserts start and stop bits for each character, enabling independent clocking but incurring additional overhead.

Q10. Evaluate the impact of using a larger flag sequence (e.g., 8 bits) versus a smaller one (e.g., 4 bits) on frame synchronization reliability.

A.Larger flag reduces reliability
B.Larger flag improves reliability but adds overhead ✅
C.No effect
D.Smaller flag always better
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A longer, more distinctive flag reduces the probability that random data will mimic the delimiter, enhancing synchronization reliability. However, each frame must transmit the extra flag bits, increasing overhead. Designers balance the trade‑off between robustness and efficiency when selecting flag length.

Q11. When choosing between length‑field framing and delimiter‑based framing for a high‑latency link, which factor should be prioritized?

A.Minimal header size
B.Ease of error detection
C.Ability to recover from lost frames ✅
D.Compatibility with legacy systems
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: High latency amplifies the cost of retransmitting large amounts of data. Length‑field framing provides explicit size information, enabling the receiver to quickly detect missing or corrupted frames and request retransmission. This capability to recover from lost frames is crucial for maintaining reliability over long‑delay paths.

Q12. Contrast the error detection capabilities of CRC appended to frames versus parity bits within the payload. Which provides superior detection of multiple‑bit errors?

A.Parity bits
B.CRC ✅
C.Both equal
D.Neither detects multiple‑bit errors
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A Cyclic Redundancy Check (CRC) uses polynomial division to generate a checksum that can detect burst errors and multiple‑bit flips far more reliably than a single parity bit, which only identifies an odd number of bit errors. Therefore, CRC offers stronger protection against complex error patterns.

Q13. In a scenario where frames are transmitted over a noisy channel with frequent bit errors, which framing method (bit stuffing, byte stuffing, or length‑field) is most resilient to error propagation, and why?

A.Bit stuffing because errors affect only one frame
B.Byte stuffing due to larger delimiters
C.Length‑field because errors are isolated ✅
D.All equally resilient
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Length‑field framing defines the exact size of each frame, so a bit error within the payload does not alter the boundaries of subsequent frames. In contrast, stuffing methods rely on delimiters that, if corrupted, can cause the receiver to misinterpret frame limits, leading to error propagation across multiple frames.

Q14. If a frame's payload size is 1500 bytes and the framing overhead adds 4 bytes of flag and 2 bytes of CRC, what is the total frame size?

A.1504
B.1506 ✅
C.1502
D.1510
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The total size equals payload (1500 bytes) plus flag overhead (4 bytes) and CRC (2 bytes), yielding 1500 + 4 + 2 = 1506 bytes.

Q15. How does the concept of framing support the principle of encapsulation in the OSI model?

A.By encrypting data
B.By packaging bits into identifiable units for the next layer ✅
C.By routing packets
D.By managing physical media
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Encapsulation requires each layer to add its own header or trailer. Framing creates distinct units (frames) that contain both payload and control information, allowing the data link layer to pass a well‑defined packet to the network layer, thereby preserving layer boundaries and modular communication.

Q16. Apply the principle of bit synchronization to explain why a data link layer must add a start flag to each frame.

A.To mark the beginning for synchronization ✅
B.To increase throughput
C.To reduce error rates
D.To compress data
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A start flag provides a known bit pattern that the receiver can lock onto, establishing timing alignment for the subsequent bits. This synchronization ensures that the receiver samples each incoming bit at the correct instant, preventing drift and guaranteeing accurate interpretation of the frame's contents.

Q17. Synthesize a framing strategy for a protocol that must support both real‑time video (low latency) and bulk file transfer (high reliability). Which combination best meets both requirements?

A.Fixed‑size frames with CRC
B.Variable‑size frames with length field and CRC ✅
C.Byte‑stuffed frames with small delimiters
D.Bit‑stuffed frames with large delimiters
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Variable‑size frames allow the protocol to adjust payload length, minimizing latency for small video packets while still supporting large data blocks. Adding a length field gives precise size information, and appending a CRC ensures integrity, thus balancing the competing needs of speed and reliability.

Q18. Explain why using a unique delimiter that does not appear in the payload is essential for delimiter‑based framing.

A.Preventing frame boundary ambiguity ✅
B.Increasing transmission speed
C.Simplifying error correction
D.Allowing compression
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: If the delimiter appears within the payload, the receiver may falsely interpret payload data as the end of a frame, causing premature termination and loss of subsequent data. A unique delimiter guarantees that only intentional flag sequences delineate frames, preserving the integrity of the transmitted information.

Q19. Given a scenario where frames can be lost due to congestion, how can framing be combined with flow‑control mechanisms to ensure reliable delivery?

A.By sending frames without acknowledgment
B.By embedding sequence numbers within frames and using ACKs ✅
C.By increasing frame size
D.By disabling framing
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Sequence numbers uniquely identify each frame, enabling the receiver to acknowledge correctly received frames and request retransmission of missing ones. Flow‑control protocols such as Stop‑and‑Wait or Sliding Window use these acknowledgments to regulate the sender's rate, preventing overflow and ensuring that all frames eventually arrive.

Q20. If a frame uses a start flag of 01111110 and the transmitter inadvertently flips the first 0 to 1, what is the most likely immediate effect on the receiver's frame detection?

A.Receiver treats the flag as data
B.Receiver fails to detect start of frame ✅
C.Receiver detects a false start flag
D.No effect
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Changing the leading 0 to 1 destroys the unique flag pattern, so the receiver cannot recognize the intended start delimiter. As a result, the receiver will treat the incoming bits as part of an ongoing frame or discard them, leading to a failure to correctly identify the frame boundary.

Q21. Consider a protocol that employs both bit stuffing and a length field. If a bit error occurs within the length field causing it to be off by one byte, how does this affect subsequent frame parsing?

A.Only the current frame is corrupted
B.All following frames are misaligned until resynchronization ✅
C.Receiver discards the frame and continues correctly
D.Error is corrected automatically
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: An incorrect length value makes the receiver read too many or too few bits for the current frame, causing the start of the next frame to be offset. This misalignment propagates to subsequent frames until the receiver encounters a valid delimiter or length field that allows it to regain proper synchronization.

Q22. When comparing the overhead of bit stuffing versus byte stuffing for a payload containing many consecutive 1s, which statement is accurate?

A.Bit stuffing adds fewer extra bits than byte stuffing ✅
B.Byte stuffing adds fewer extra bits
C.Both add the same amount
D.Neither adds extra bits
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Bit stuffing inserts a single extra bit after each run of five consecutive 1s, whereas byte stuffing must insert an entire escape byte each time a special byte appears. For payloads with long runs of 1s, bit stuffing therefore introduces less additional data than byte stuffing, reducing overhead.

Q23. Which of the following is a direct consequence of using a delimiter that is too short (e.g., 2 bits) in a noisy environment?

A.Increased chance of false frame boundaries ✅
B.Reduced transmission time
C.Improved error detection
D.Simpler hardware design
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Short delimiters are more likely to be replicated inadvertently by random noise or data patterns, causing the receiver to mistake ordinary bits for frame boundaries. This increases the probability of false starts or ends, leading to corrupted frames and higher error rates in noisy channels.

🔗 Related Topics (MCQs)