Understanding ISO 4335: HDLC Frame Structure and Control Field Formats
ISO 4335 – HDLC
Reference Standard
ISO 3309 and ISO 4335
HDLC Frame Structure: Fields
Length | Field |
---|---|
1 or n octets | Address |
1 or 2 octets | Control |
n octets | Optional Information |
2 octets | Frame Control Sequence |
HDLC Frame Structure: Address Field
Reference Standard
ISO 3309
The address field identifies a frame as either a command or a response. A command frame contains the address of a station to which the command is being sent. A response frame contains the address of the station sending the frame.
Address Field Basic Mode (Octet 1)
Bits 1 – 8 | Address Field Basic Mode in Octet 1 |
a a a a a a a a | 1 octet – value 0 to 255 |
Address Field Extended (Octets 1 to n)
Bits 1 – 8 | Address Field Extended in Octets 1 to n |
0 a a a a a a a | Octet 1 (bit 1 = 0) |
0 a a a a a a a | Octet i (bit 1 = 0) |
1 a a a a a a a | Last Octet n (bit 1 = 1) |
Frame Structure: Control Field
Reference Standard
ISO 4335
The control field contains a command or a response, and sequence numbers where applicable.
Three types of control field formats are used to perform:
- Numbered information transfer with I format
- Numbered supervisory functions with S format
- Unnumbered control functions with U format
I Format
The control field Information format is either for basic (modulo 8) operation or for extended (modulo 128) operation:
Basic Operation: I Format
1st Octet: | |||
Bit 1 | 0 | ||
Bits 2-4 | N(S) | Transmitter send sequence number | |
Bit 5 | P | Poll bit when issued as a command (1 = Poll) | |
Bits 6-8 | N(R) | Transmit receive sequence number | |
Bit 1 | Command | Response | Frame Designation |
0 | I | Information |
Extended Operation: I Format
1st Octet: | |||
Bit 1 | 0 | ||
Bits 2-8 | N(S) | Transmitter send sequence number | |
Bit 1 | Command | Response | Frame Designation |
0 | I | Information |
2nd Octet: | ||
Bit 1 | P | Poll bit when issued as a command (1 = Poll) |
Bits 2-8 | N(R) | Transmit receive sequence number |
S Format
The control field Supervisory format is either for basic (modulo 8) operation or for extended (modulo 128) operation:
The encoding values of the two S bits included in the first octet of the control field are listed and ordered according to their hexadecimal code.
Basic Operation: S Format
1st Octet: | ||
Bits 1-2 | 1 0 | |
Bits 3-4 | S S | S: supervisory function bit |
Bit 5 | P/F | Poll bit when issued as a command Final bit when issued as a response (1 = Poll/Final) |
Bits 6-8 | N(R) | Transmit receive sequence number |
Bits 3-4 = SS | Command | Response | Frame Designation |
0 0 | RR | RR | Receive Ready |
0 1 | RNR | RNR | Receive Not Ready |
1 0 | REJ | REJ | Reject |
1 1 | SREJ | SREJ | Selective Reject |
Extended Operation: S Format
1st Octet: | ||
Bits 1-2 | 1 0 | |
Bits 3-4 | S S | S: supervisory function bit |
Bits 5-8 | X X X X | X: reserved and set to 0 |
Bits 3-4 = SS | Command | Response | Frame Designation |
0 0 | RR | RR | Receive Ready |
0 1 | RNR | RNR | Receive Not Ready |
1 0 | REJ | REJ | Reject |
1 1 | SREJ | SREJ | Selective Reject |
2nd Octet: | ||
Bit 1 | P/F | Poll bit when issued as a command Final bit when issued as a response (1 = Poll/Final) |
Bits 2-8 | N(R) | Transmit receive sequence number |
S Format: Hex Codes
Octet Code | Type | C/R | Frame Designation |
---|---|---|---|
x1 | RR | C/R | Receive Ready |
x9 | RNR | C/R | Receive Not Ready |
x5 | REJ | C/R | Reject |
xD | SREJ | C/R | Selective Reject |
Note: Hexadecimal code corresponds to b8-b1.
U Format
The control field Unnumbered format is either for basic (modulo 8) operation or for extended (modulo 128) operation:
The encoding values of the five M bits included in the first octet of the control field are listed and ordered according to their hexadecimal code or their type (mnemonic).
Basic Operation: U Format
1st Octet: | ||
Bits 1-2 | 1 1 | |
Bits 3-4 | M M | M: modifier function bit |
Bit 5 | P/F | Poll bit when issued as a command Final bit when issued as a response (1 = Poll/Final) |
Bits 6-8 | M M M | M: modifier function bit |