Overview¶
The HDLC controller supports the following frames:
DATA (I-frame with Poll bit)
ACK (S-frame Receive Ready with Final bit)
NACK (S-frame Reject with Final bit)
Each DATA frame must be positively or negatively acknowledged using
respectively an ACK or NACK frame. The highest sequence number is 7. As a
result, when sending a DATA frame, the expected acknowledgment sequence number
is seq_no + 1 % MAX_SEQ_NO with MAX_SEQ_NO = 8.

The number of DATA frames that can be sent before receiving the first
acknowledgment is determined by the window parameter of
HDLController. Its
default value is 3.
If the FCS field of a received frame is not valid, an NACK will be sent back with the same sequence number as the one of the corrupted frame to notify the sender about it:

For each DATA frame sent, a timer is started. If the timer ends before receiving any corresponding ACK and NACK frame, the DATA frame will be sent again:

The default timer value is 2 seconds and can be changed using the
sending_timeout parameter of HDLController.