Packet Switching and X.25 Networks. Page 16
• the receiver is acknowledging all eight frames, or
• the receiver has not received any of the eight frames and is just
“reminding” the sender.
This confusion is obviously not acceptable so no more frames can be
sent. The sender can send an RR—in this case with N(R) of 4—to
“remind” the receiver that some acknowledgement is required. Indeed
many implementations regularly exchange RR frames to verify that both
ends of the link are up and running.
The number of frames that can be outstanding awaiting
acknowledgement is referred to as the Window, and this is normally
seven as shown. Note that the window may be say set to three, but the
N(R) and N(S) values still cycle with modulo eight. When all the frames
allowed by the window are awaiting acknowledgement, then the window
is said to be closed or full. When some frames can still be sent the window
is said to be open
X.25 frames only have a three-bit field for N(R) and N(S) so windows
of greater than seven are not possible. An extended format of the frame
has a larger field and allows the values to cycle to 127 with a
corresponding increase in possible window sizes. The extended format is
of most use in satellite links where the time delays mean that many frames
may be in transit at one time.
The flag byte and bit stuffing No matter which of the possible 256 values
is chosen for the flag byte, it is clear that this imposes a limitation on
what can appear in the frame. If the flag value appears in the data portion
of an Info frame then this will terminate the frame and it can never be
transmitted. This problem is avoided by selecting the flag byte to be hex
7E, and by the process of bit stuffing. In binary the flag byte appears as
0111 1110
It therefore contains a string of six contiguous 1 bits. Bit stuffing takes
the frame before transmission and, whenever there is a string of five bits,
a 0 bit is “stuffed” in after them. There can therefore never be a string of
six 1 bits in the frame, and thus there is no confusion over flag bytes and
frame bytes. This is shown in Fig. 1.15.
Note that every sequence of five 1 bits is bit-stuffed whether or not it
is followed by a 1, so that on reception every bit-stuffed zero is reliably
removed. Note also that, though the frame is an exact number of bytes,
after bit stuffing this may no longer hold true, so during transmission the
frame is simply a string of bits.
At the receiver the reverse process to bit stuffing takes place. The flag
bytes are removed from the bit stream leaving the “stuffed” frame. The
bit string is then scanned and whenever five 1 bits are found the following
0 bit is stripped-off. The bit-stripping process results in the original
frame—a whole number of bytes—being restored.

