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

📝 Framing techniques in data link layer

Why the Data Link Layer Divides Bits into Frames

The data link layer receives a network-layer packet as a unit of data, but the physical medium carries a continuous stream of bits. Framing divides that stream into recognizable blocks so the receiver can identify each unit's beginning and end. A frame commonly contains a header, payload, and trailer, allowing addressing, control, and error checking to accompany the packet for processing.

One possible approach is to separate frames using time gaps or periods of silence. However, transmission and timing variations can make these gaps unreliable, and networks do not generally guarantee that they will remain unchanged. Therefore, data link protocols use identifiable length fields, delimiters, or special coding patterns to establish frame boundaries.

Length Fields, Delimiters and Transparency Methods

Common framing approaches include character count, flag delimiters with byte or character stuffing, starting and ending flags with bit stuffing, and physical-layer coding violations. These are the four traditional framing methods commonly discussed in computer networking. Each method uses a different technique to help the receiver identify frame boundaries.

In the character count method, a field in the frame header specifies the number of characters or bytes belonging to the frame. The receiver reads this value and counts the specified number of units to locate the frame boundary. For example, if consecutive frames have lengths of 5, 7, and 4 bytes, their count fields indicate how many bytes the receiver should process for each frame. However, if a count value is corrupted, the receiver may incorrectly interpret the boundary and lose synchronization with subsequent frames.

In traditional character stuffing, special character sequences identify the beginning and end of a frame. The sequence DLE STX marks the start, while DLE ETX marks the end. If a DLE character occurs within the actual data, the sender inserts an additional DLE before it. The receiver removes this extra character during destuffing, ensuring that data is not mistaken for a frame boundary.

Another approach uses starting and ending flag patterns with bit stuffing. HDLC, for example, uses the eight-bit flag pattern 01111110 to mark frame boundaries. Whenever the sender encounters five consecutive 1s in the bitstream being protected, it inserts a 0 bit. The receiver removes this inserted zero after detecting the specified sequence of five consecutive ones, recovering the original data.

Physical-layer coding violations use signal patterns or code combinations that are not normally used to represent data. These reserved patterns can identify frame boundaries without inserting additional bits or bytes into the payload. For example, in a hypothetical encoding scheme where a 1 is represented by a high-low pair and a 0 by a low-high pair, low-low and high-high combinations could be reserved for control purposes.

Delimiter-based methods require data transparency so that payload data cannot be mistaken for a frame boundary. Byte or character stuffing inserts escape characters before reserved data characters, while bit stuffing inserts a zero after five consecutive 1s. These additional characters or bits are removed by the receiver before the original data is delivered.

Recognizing Frame Starts and Ends at the Receiver

The receiver examines incoming bits or bytes according to the chosen framing rule. A length-based method reads the count field and processes the indicated number of bytes; a delimiter method searches for reserved flag or control sequences and removes any transparency characters. The receiver then checks the frame fields and trailer, where applicable, before delivering the payload to the network layer.

For example, if a character-count field indicates that a frame contains 7 bytes, the receiver counts those bytes to determine where the frame ends. If the count is incorrectly received as 9, it may consume bytes belonging to the next frame, causing synchronization problems. In delimiter-based methods, recognizable start and end patterns can help the receiver locate frame boundaries again when synchronization is lost, provided the delimiters are received correctly.

In character stuffing, the receiver distinguishes frame-control sequences from data by examining the DLE characters and removes the additional DLE inserted by the sender. In bit stuffing, it removes the zero inserted after five consecutive 1s. These processes are called destuffing and restore the original payload before delivery.

PPP Byte Stuffing Protects a Flag Byte in Data

PPP uses 0x7E as its frame flag and 0x7D as its control escape. In octet-stuffed framing, a data byte 0x7E is sent as 0x7D followed by 0x5E, because the original value is XORed with 0x20. The receiver removes the escape and reverses that transformation, recovering the original payload byte before frame delivery.

This is an example of byte stuffing in PPP, but it is different from the traditional DLE-based character-stuffing method. Both techniques prevent reserved control values from being mistaken for frame boundaries, although they use different escape conventions and encoding rules.

Framing Supports Reliable Interpretation of Link Traffic

Without clear frame boundaries, a receiver could combine data from adjacent transmissions or interpret payload bits as control information. Framing works with MAC addressing, frame check sequences, and medium-access rules to support local delivery. Different technologies choose different frame formats, so an Ethernet frame, an HDLC frame, and a PPP frame are not interchangeable.

Common Errors When Comparing Framing Methods

'A frame is simply a fixed number of bits' is incorrect because frame length may vary. 'Stuffed bits are user data' is false because the receiver removes them before delivery. 'A delimiter alone guarantees error-free reception' is also incorrect; a frame may have clear boundaries yet still contain corrupted bits that require an error-detection check.

Another common misconception is that character count and delimiter-based methods work in the same way. Character count uses a length field to determine how many characters or bytes belong to a frame, whereas delimiter-based methods use reserved patterns to mark boundaries. A corrupted count field can cause the receiver to lose synchronization, while recognizable delimiters can help it locate a subsequent frame.

Traditional DLE-based character stuffing should also not be confused with PPP byte stuffing. Both protect reserved control characters in data, but traditional character stuffing uses DLE STX, DLE ETX, and duplicated DLE characters, whereas PPP uses its own flag and escape-byte values.

What to Trace in Framing Questions

Identify the boundary method, the field that indicates length, and any reserved flag or escape pattern. For character count, check how many bytes the count field specifies and consider what happens if that value is corrupted. For character stuffing, identify DLE STX, DLE ETX, and any additional DLE characters inserted into the data.

For PPP byte stuffing, show which reserved data bytes are escaped and apply the specified XOR transformation. For bit stuffing, insert a zero after five consecutive 1s and remove it at reception. For example, the data sequence 01111110 becomes 011111010 after bit stuffing. The receiver removes the inserted zero to recover 01111110. Keep transparency processing separate from the frame check sequence, which detects corruption.

For physical-layer coding violations, identify which signal patterns are reserved and how the receiver recognizes them as control information rather than ordinary data.

Frame Boundary and Transparency Terms

  • Frame - Link-layer data unit.
  • Delimiter - Marks a frame boundary.
  • Character count - Specifies the number of characters or bytes in a frame.
  • Byte stuffing - Escapes reserved bytes to prevent them from being mistaken for control information.
  • Character stuffing - Inserts an additional control character, such as DLE, before reserved characters in the data.
  • Bit stuffing - Inserts a zero after five consecutive 1s.
  • Flag pattern - A reserved bit sequence, such as 01111110, that marks frame boundaries.
  • DLE - Data Link Escape character used in traditional character stuffing.
  • Physical-layer coding violation - Uses reserved or invalid signal patterns to indicate control information.
  • Transparency - Prevents payload data from being interpreted as frame-control information.
  • Destuffing - Removes inserted escape characters or bits at the receiver.
  • Length field - Specifies the frame size.
  • Frame Check Sequence (FCS) - A field used for detecting transmission errors.

8
Easy
10
Medium
7
Hard

📝 All Framing techniques in data link layer MCQs

Q1. What is the primary purpose of framing in the data link layer?

A.To encrypt data
B.To synchronize clocks
C.To delineate packet boundaries ✅
D.To route packets
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Framing provides clear start and end markers for each packet, allowing the receiver to separate successive data units and process them correctly. This delineation is essential for reliable node‑to‑node communication and for higher‑layer protocols to interpret the payload accurately.

Q2. Which of the following is a common flag pattern used to indicate the start and end of a frame in bit‑oriented protocols?

A.1111110 ✅
B.10101010
C.11110000
D.1111
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The pattern 01111110 (0x7E) is widely adopted as a flag in bit‑oriented protocols such as HDLC. It serves as a unique delimiter that the receiver can recognize to mark the boundaries of a frame, ensuring proper synchronization and separation of transmitted data.

Q3. In byte‑oriented (character) framing, which character is typically used as a flag?

A.SOH
B.STX ✅
C.ETX
D.ESC
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: STX (Start of Text) is commonly employed as a flag in byte‑oriented framing schemes. It signals the beginning of a data segment, allowing the receiver to know where the payload starts. Using a distinct control character simplifies detection and reduces the chance of accidental flag occurrences within the payload.

Q4. If a communication link uses bit stuffing, what will happen when the transmitted data contains a sequence of six consecutive 1s?

A.A 0 will be inserted after the fifth 1 ✅
B.Transmission will be aborted
C.The receiver will interpret as a flag
D.No change
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Bit stuffing inserts a 0 after five consecutive 1s to prevent the accidental creation of the flag pattern. When six 1s appear, the algorithm inserts a 0 after the fifth 1, breaking the run and preserving the integrity of the flag detection mechanism.

Q5. Suppose a frame is corrupted such that the flag pattern appears inside the payload. How does the receiver correctly distinguish the actual frame boundary?

A.By counting bits
B.By using bit stuffing ✅
C.By ignoring the flag
D.By resetting the link
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: When the flag pattern occurs within the payload, the sender has applied bit stuffing to insert a 0 after five consecutive 1s. The receiver removes any stuffed 0s, restoring the original data and ensuring that only the un‑stuffed flag sequence is treated as a true frame delimiter.

Q6. If a network switches from byte stuffing to bit stuffing, which of the following effects is most likely?

A.Increased overhead due to extra bits
B.Reduced latency
C.Higher susceptibility to synchronization errors
D.Elimination of flag collisions ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Bit stuffing removes the need for an escape character, so the original flag pattern cannot appear unintentionally. This eliminates the possibility of flag collisions caused by the payload containing the flag byte, improving the robustness of delimiter detection.

Q7. A protocol employs a 7‑bit flag 0111110. During transmission, the sender encounters a payload containing the bit sequence 0111110. Explain how the protocol ensures the receiver does not mistake this sequence for a flag.

A.Insert a 0 after five consecutive 1s ✅
B.Invert the bits
C.Use a checksum
D.Transmit twice
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The protocol applies bit stuffing: after five consecutive 1s, it inserts a 0. This breaks the flag pattern within the payload, so the receiver, after removing stuffed bits, sees the original data and does not confuse it with the genuine flag delimiter.

Q8. Consider two adjacent nodes where node A uses a flag of 0x7E and node B expects a flag of 0x7E. If node B experiences a clock drift causing a bit slip, which framing error is most likely to be detected?

A.Flag loss
B.Flag duplication
C.Bit stuffing error
D.Checksum mismatch ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Clock drift can cause the receiver to mis‑align bits, leading to an incorrect calculation of the frame check sequence (FCS). The mismatch is detected as a checksum error, whereas the flag itself may still be recognized, making the checksum mismatch the most probable symptom.

Q9. When a frame is transmitted using a synchronous framing method, what is the primary consequence if the receiver's clock is not synchronized?

A.Frames are still correctly decoded
B.Bit errors increase ✅
C.Frames are discarded
D.No impact
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Synchronous framing relies on a shared timing reference. If the receiver's clock drifts, bits may be sampled at incorrect intervals, causing bit errors that corrupt the payload or delimiter detection, potentially leading to retransmission or frame rejection.

Q10. If a frame delimiter is 0x7E and the data contains 0x7E, what technique is typically applied to avoid ambiguity?

A.Padding
B.Bit stuffing
C.Byte stuffing ✅
D.CRC
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Byte stuffing inserts an escape character before any occurrence of the delimiter byte within the payload. This ensures that the receiver can differentiate between a true delimiter and a data byte that matches the delimiter pattern, preserving frame integrity.

Q11. Compare bit stuffing and byte stuffing in terms of overhead when transmitting a payload consisting mostly of zeros.

A.Bit stuffing adds more overhead
B.Byte stuffing adds more overhead ✅
C.Both add equal overhead
D.Neither adds overhead
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: When the payload is dominated by zeros, bit stuffing rarely inserts extra bits because runs of five 1s are uncommon. Byte stuffing, however, adds an escape byte each time the flag byte appears, even if it is rare, resulting in higher overhead relative to the zero‑heavy payload.

Q12. Evaluate the impact of using a longer flag pattern (e.g., 16 bits) on frame synchronization reliability.

A.Improves reliability ✅
B.Degrades reliability
C.No effect
D.Increases throughput
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A longer, more distinctive flag reduces the probability that random data will accidentally replicate the delimiter, thereby lowering false‑positive detections. This enhances synchronization reliability, especially on noisy links, though it may slightly increase the frame overhead.

Q13. Differentiate between synchronous and asynchronous framing regarding timing requirements.

A.Synchronous requires shared clock, asynchronous does not ✅
B.Asynchronous requires shared clock
C.Both require same timing
D.Neither uses clocks
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Synchronous framing assumes that transmitter and receiver share a common clock, allowing continuous bit streams without start/stop bits. Asynchronous framing inserts start and stop bits for each character, enabling independent clocks but incurring additional overhead for timing alignment.

Q14. Given a link that transmits 1,000 bits per frame and uses bit stuffing with an average stuffing rate of 1 per 5 data bits, calculate the approximate overhead percentage.

A.0.05
B.0.1
C.0.15 ✅
D.0.2
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The payload of 1,000 bits would generate roughly 1,000/5 = 200 stuffed bits. Total transmitted bits become 1,200, so the overhead is 200/1,200 ≈ 16.7%, which is closest to 15% among the options.

Q15. Which framing method is most suitable for a high‑speed, low‑latency link where the payload size varies widely?

A.Byte stuffing
B.Bit stuffing
C.Fixed‑size framing
D.Length‑field framing ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Length‑field framing incorporates a size indicator at the beginning of each frame, allowing the receiver to know exactly how many bits to read regardless of payload variability. This avoids the extra bits introduced by stuffing techniques and supports rapid processing on high‑speed links.

Q16. Assume two protocols: Protocol X uses a 1‑byte flag and byte stuffing; Protocol Y uses a 7‑bit flag and bit stuffing. If the average payload length is 200 bytes, which protocol yields lower total transmitted bits?

A.Protocol X ✅
B.Protocol Y
C.Both equal
D.Cannot determine
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Protocol X adds only two flag bytes (16 bits) and occasional escape bytes, while Protocol Y adds two 7‑bit flags (14 bits) but incurs roughly 20 % extra bits due to bit stuffing (≈320 bits). Consequently, Protocol X transmits far fewer bits overall.

Q17. In a system that uses a length field to indicate frame size, what error is most likely if the length field is corrupted?

A.Frame is truncated ✅
B.Frame repeats
C.Flag misinterpretation
D.No effect
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A corrupted length field causes the receiver to read an incorrect number of bits, usually resulting in a truncated frame where the payload ends prematurely, leading to loss of data and possible subsequent frame misalignment.

Q18. Contrast the error detection capabilities of framing methods that use CRC versus those that rely solely on flag detection.

A.CRC provides stronger detection ✅
B.Flag detection is stronger
C.Both equal
D.Neither detects errors
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: CRC computes a checksum over the entire frame, detecting many error patterns, including burst errors, whereas flag‑only methods only detect misplaced delimiters. Therefore, CRC‑based framing offers significantly more robust error detection.

Q19. If a protocol combines bit stuffing with a CRC, how does the presence of bit stuffing affect the CRC calculation?

A.CRC must be computed after stuffing ✅
B.CRC computed before stuffing
C.Bit stuffing does not affect CRC
D.CRC is irrelevant
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The CRC is calculated over the exact bit sequence that will be transmitted, which includes any stuffed bits. This ensures that the receiver, after removing stuffed bits, can recompute the CRC on the original data and verify integrity correctly.

Q20. Apply the principle of framing to explain how a receiver can recover the original data when multiple frames are received back‑to‑back without idle time.

A.By using flags to mark boundaries ✅
B.By timing gaps
C.By checksum only
D.By source address
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: When frames follow one another continuously, the receiver relies on the predefined flag pattern that marks the start and end of each frame. By detecting these delimiters, it can separate the concatenated bit stream into distinct frames and then extract the original payload from each.

Q21. Explain why framing is essential for flow‑control mechanisms such as sliding window protocols.

A.Frames provide sequence numbers ✅
B.Frames enable error correction
C.Frames define timing
D.Frames reduce bandwidth
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Sliding window protocols need to know which bits belong to which transmission unit. Framing supplies sequence numbers and delimiters, allowing the sender and receiver to manage outstanding frames, acknowledge specific packets, and adjust the window size based on acknowledged data.

Q22. Synthesize a scenario where both bit stuffing and length‑field framing are used together. What advantage does this hybrid approach provide?

A.Reduces overhead
B.Improves synchronization and length verification ✅
C.Eliminates errors
D.Simplifies hardware
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Combining bit stuffing with a length field ensures that the receiver can both detect frame boundaries reliably (through stuffing) and verify the exact payload size (via the length field). This dual protection improves synchronization accuracy while allowing quick validation of frame completeness.

Q23. Given a noisy channel where burst errors are common, which framing technique combined with error detection offers the most robust protection, and why?

A.Byte stuffing with parity
B.Bit stuffing with CRC ✅
C.Length field with checksum
D.Flag delimiting without CRC
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Bit stuffing prevents false flag occurrences, and a CRC provides strong detection of burst errors across the entire frame. Together, they minimize both delimiter confusion and error‑masking, offering superior resilience compared to simpler parity or checksum schemes.

Q24. How does the choice of flag pattern affect the probability of accidental flag occurrence in random data?

A.Longer, more unique patterns reduce probability ✅
B.Shorter patterns reduce probability
C.Pattern length does not matter
D.Random data never contains flags
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A flag with more bits (e.g., 16‑bit pattern) has a dramatically lower chance of appearing randomly in the payload, thereby reducing false‑positive detections. This makes the framing more reliable, especially on links with high data entropy.

Q25. If a network employs adaptive framing that switches between bit stuffing and length fields based on traffic load, what decision criteria should be used to select the appropriate method?

A.Payload size variance
B.Link bandwidth
C.Error rate
D.All of the above ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Adaptive framing must consider multiple factors: when payloads are small

🔗 Related Topics (MCQs)