📝 PPP framing byte stuffing (13 MCQs)
Byte Stuffing for Transparent PPP Frame Delimitation
PPP byte stuffing provides transparency in asynchronous point-to-point links by preventing data octets from being mistaken for frame delimiters. PPP uses the Flag sequence 0x7E at the beginning and end of a frame. When the same value, or the escape value 0x7D, occurs in the information field, the sender transforms it before transmission so the receiver can identify the original data without confusing it with framing control.
Reserved Octets and the PPP Escape Mechanism
The asynchronous PPP frame retains its Address, Control, Protocol, Information, and Frame Check Sequence fields, with Flag octets delimiting the frame. Byte stuffing applies to the transmitted contents between the flags. The escape octet 0x7D marks a following transformed byte; the transformation normally XORs that byte with 0x20. The Async-Control-Character-Map can also require selected control characters to be escaped.
Sender and Receiver Operations During Byte Stuffing
Before sending an asynchronous frame, the transmitter checks its contents for reserved octets and characters selected by the configured control-character map. It inserts 0x7D and sends the following octet XORed with 0x20. The receiver removes the escape octet, reverses the XOR operation, reconstructs the original frame, and then checks its Frame Check Sequence.
Hexadecimal Conversion of Flag and Escape Characters
Suppose the information field contains 0x7E. The sender transmits it as 0x7D 0x5E because 0x7E XOR 0x20 equals 0x5E. If the information contains 0x7D, it becomes 0x7D 0x5D. The receiver reverses each transformation, restoring the original octets while preserving the 0x7E flag as a frame boundary before passing reconstructed payload upward.
Relationship Between Byte Stuffing, Framing and Error Detection
Byte stuffing allows PPP to carry arbitrary binary information over asynchronous serial links while retaining recognizable frame boundaries. It complements the Protocol field, which identifies the encapsulated network-layer payload, and the Frame Check Sequence, which detects transmission errors. Stuffing provides framing transparency; it does not itself correct errors, encrypt data, or guarantee reliable delivery.
Technical Misconceptions About PPP Byte Stuffing
'Every PPP link uses byte stuffing' is incorrect because synchronous PPP uses bit-oriented framing and bit stuffing. 'The escape octet is removed without changing the next byte' is incorrect because the receiver also reverses the XOR transformation. 'Stuffing detects corrupted data' is incorrect because error detection is performed by the Frame Check Sequence.
Applying PPP Escape Transformations in Examinations
Be able to identify the 0x7E flag and 0x7D escape octet, apply the XOR 0x20 transformation, and reverse it at reception. Trace examples containing both reserved values and distinguish escaped data from frame delimiters. Also compare asynchronous byte stuffing with synchronous bit stuffing, and explain the separate role of the Frame Check Sequence.
PPP Byte Stuffing and Framing Terminology
- Flag - Marks a frame boundary.
- Escape octet - Prefixes a transformed byte.
- XOR - Bitwise exclusive OR operation.
- ACCM - Map of control bytes to escape.
- Transparency - Prevents payload resembling framing flags.
- FCS - Detects frame transmission errors.
📝 All PPP framing byte stuffing MCQs
Q1. What does “character-oriented framing” primarily use to delimit frames?
📖 Explanation: The definition of character‑oriented (or byte‑oriented) framing states that frames are separated by special character sequences such as flag bytes. This makes option B the correct choice, while the other options describe different framing or error‑checking mechanisms.
Q2. If a protocol removes its unique start‑delimiter byte from the stream, what immediate effect occurs on frame detection?
📖 Explanation: Eliminating the start delimiter eliminates the explicit marker that tells the receiver where a frame begins, so frames cannot be reliably distinguished. This cause‑effect relationship makes option B correct; the other options do not follow logically.
Q3. Which statement best contrasts character‑oriented and bit‑oriented framing regarding overhead?
📖 Explanation: Character‑oriented framing only inserts extra bytes when the delimiter occurs, whereas bit‑oriented framing may insert bits for stuffing regardless of data content. Therefore option B accurately captures the overhead difference; the other statements misrepresent the mechanisms.
Q4. A network uses a unique start delimiter to mark frames. How should a receiver detect a corrupted frame?
📖 Explanation: The standard approach is to compute a CRC (or similar check) over the payload and compare it with the transmitted value placed after the delimiter. This reliably signals corruption, making option B correct; the other methods are ineffective for detecting payload errors.
Q5. A protocol escapes any occurrence of the delimiter byte inside the payload. What is the primary impact on bandwidth?
📖 Explanation: Escaping delimiter bytes inserts extra escape characters whenever the delimiter appears, thus adding overhead and reducing effective bandwidth. The other options either contradict the added overhead or describe unrelated effects.
Q6. Why does bit‑oriented framing generally outperform character‑oriented framing in noisy environments?
📖 Explanation: Bit stuffing adds only a single extra bit when a prohibited pattern occurs, resulting in less overhead than byte stuffing, which may add whole bytes. Less overhead means fewer bits that can be corrupted, giving bit‑oriented framing an advantage in noisy settings.
Q7. Designing a hybrid scheme that combines byte‑stuffing and bit‑stuffing primarily aims to achieve which benefit?
📖 Explanation: A hybrid approach leverages the strengths of both methods: byte‑stuffing handles ASCII‑friendly delimiters while bit‑stuffing efficiently encodes arbitrary binary patterns. This flexibility improves handling of mixed data types, making option C the most appropriate benefit.
Q8. In a stream where the flag byte is 0x7E and the escape byte is 0x7D, how is a data byte 0x7E transmitted?
📖 Explanation: When the data byte equals the flag, it must be escaped. The escape byte 0x7D is sent followed by the original byte XOR‑ed with 0x20, yielding 0x5E. Hence the transmitted sequence is 0x7D 0x5E, which corresponds to option C.
Q9. Assuming random payload data, which protocol typically yields lower average overhead: byte‑stuffing or bit‑stuffing?
📖 Explanation: With random data, the probability of encountering a delimiter byte is higher than encountering the specific bit pattern that triggers bit stuffing. Consequently, bit‑stuffing inserts fewer extra symbols on average, giving it lower overhead than byte‑stuffing.
Q10. Why is placing the CRC after the frame delimiter preferable in variable‑size framing?
📖 Explanation: When bit‑oriented framing is used, stuffing may insert extra bits after the delimiter. By positioning the CRC after the delimiter (and after any stuffing), the CRC calculation includes the exact transmitted bits, preserving integrity despite stuffing. Hence option B correctly describes the advantage.
Q11. If a receiver mistakenly treats an escaped delimiter as a real delimiter, what is the most likely result?
📖 Explanation: Misinterpreting an escaped delimiter causes the receiver to think the frame ended early, leading to loss of the remaining payload and a shift in the parsing of following frames. This misalignment persists until a new proper delimiter restores synchronization, matching option C.
Q12. How do synchronous and asynchronous character‑oriented framing differ regarding start/stop bits?
📖 Explanation: In asynchronous transmission, each byte is framed by start and stop bits, allowing the receiver to recover timing independently. Synchronous framing, by contrast, transmits a continuous stream synchronized to a shared clock, eliminating per‑byte start/stop bits. Thus option B captures the key distinction.
Q13. In a network where some links support only bit‑oriented framing, how should a gateway handle incoming character‑oriented frames?
📖 Explanation: The gateway must translate the byte‑oriented delimiters into a bit‑oriented representation, typically by applying bit‑stuffing so that the delimiter pattern can be recognized in the bit stream. This conversion enables the frame to traverse links that only understand bit‑oriented framing, making option C correct.