Skip to main content

Byte stuffing and piggybacking

Short answer

Byte stuffing uses a FLAG byte to delimit frames, and an ESC byte before any FLAG or ESC in data to preserve transparency. Piggybacking attaches acknowledgements to outgoing data frames in bidirectional communication, avoiding separate ACK frames and saving bandwidth.

What is meant by byte stuffing technique? What is piggy backing?

Byte stuffing

Byte (character) stuffing is a framing technique in which each frame is delimited by a special FLAG byte at the start and end. If the FLAG pattern appears inside the data, the sender inserts a special ESC (escape) byte before it. The same is done if ESC itself appears in the data. The receiver removes the ESC byte it finds before a FLAG or ESC and takes the next byte as data. This keeps data transparent.

 Data     : A  FLAG  B  ESC  C
 Stuffed  : FLAG A ESC FLAG B ESC ESC C FLAG

Used in PPP and in byte-oriented protocols.

Piggybacking

Piggybacking is a technique in bidirectional (full-duplex) communication where an acknowledgement for received frames is attached to the next outgoing data frame instead of being sent as a separate ACK frame. The ACK field is in the data frame header.

Advantages: better use of bandwidth and fewer frames. If no data is ready to send, the receiver waits a short time for outgoing data and then sends a separate ACK to avoid a timeout at the sender. It is used in sliding window protocols.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Networks and Security chapter 3 questions →