13.1-13.2 Structure and Encoding of TPDUs: Validity and Structure
13. STRUCTURE AND ENCODING OF TPDUs
13.1 Validity
Table 8 specifies those TPDUs which are valid for each class and the code for each TPDU.
KEY: xxxx (bits 4-1): used to signal the CDT (set to 0000
in classes 0 and 1)
zzzz (bits 4-1): used to signal CDT in classes 2, 3,
4 set to 1111 in class 1
NF: Not available when the non explicit
flow control option is selected.
NRC: Not available when the receipt
confirmation option is selected.
NOTE - These codes are already in use in related protocols defined by standards oganizations other than CCITT/ISO.
+-------------------------------------------------------------+
| | Validity within | | |
| | classes | see | Code |
| |-------------------| Clause| |
| | 0 | 1 | 2 | 3 | 4 | | |
|-----------------------|-------------------|-------|---------|
|CR Connection Request | x | x | x | x | x | 13.3 |1110 xxxx|
|-----------------------|---|---|---|---|---|-------|---------|
|CC Connection Confirm | x | x | x | x | x | 13.4 |1101 xxxx|
|-----------------------|---|---|---|---|---|-------|---------|
|DR Disconnect Request | x | x | x | x | x | 13.5 |1000 0000|
|-----------------------|---|---|---|---|---|-------|---------|
|DC Disconnect Confirm | | x | x | x | x | 13.6 |1100 0000|
|-----------------------|---|---|---|---|---|-------|---------|
|DT Data | x | x | x | x | x | 13.7 |1111 0000|
|-----------------------|---|---|---|---|---|-------|---------|
|ED Expedited Data | | x | NF| x | x | 13.8 |0001 0000|
|-----------------------|---|---|---|---|---|-------|---------|
|AK Data Acknowledgement| |NRC| NF| x | x | 13.9 |0110 zzzz|
|-----------------------|---|---|---|---|---|-------|---------|
|EA Expedited Data | | x | NF| x | x | 13.10 |0010 0000|
|Acknowledgement | | | | | | | |
|-----------------------|---|---|---|---|---|-------|---------|
|RJ Reject | | x | | x | | 13.11 |0101 zzzz|
|-----------------------|---|---|---|---|---|-------|---------|
|ER TPDU Error | x | x | x | x | x | 13.12 |0111 0000|
|-----------------------|---|---|---|---|---|-------|---------|
| | | | | | | - |0000 0000|
| |---|---|---|---|---|-------|---------|
|not available | | | | | | - |0011 0000|
| (see note) |---|---|---|---|---|-------|---------|
| | | | | | | - |1001 xxxx|
| |---|---|---|---|---|-------|---------|
| | | | | | | - |1010 xxxx|
+-------------------------------------------------------------+
Table 8. TPDU code
13.2 Structure
All the transport protocol data units (TPDUs) shall contain an integral number of octets. The octets in a TPDU are numbered starting from 1 and increasing in the order they are put into an NSDU. The bits in an octet are numbered from 1 to 8, where bit 1 is the low-ordered bit.
When consecutive octets are used to represent a binary number, the lower octet number has the least significant value.
NOTE - When the encoding of a TPDU is represented using a diagram in this clause, the following representation is used:
- a) octets are shown with the lowest numbered octet to the left, higher numbered octets being further to the right;
- b) within an octet, bits are shown with bit 8 to the left and bit 1 to the right.
TPDUs shall contain, in the following order:
- a) the header, comprising:
- the length indicator (LI) field;
- the fixed part;
- the variable part, if present;
- b) the data field, if present.
This structure is illustrated below:
octet 1 2 3 4 ... n n+1 ... p p+1 ...end
+---+-------------+--------------+-----------+
| LI| fixed part | variable part| data field|
+---+-------------+--------------+-----------+
<--------------- header ------>
13.2.1 Length indicator field
This field is contained in the first octet of the TPDUs. The length is indicated by a binary number, with a maximum value of 254 (1111 1110). The length indicated shall be the header length in octets including parameters, but excluding the length indicator field and user data, if any. The value 255 (1111 1111) is reserved for possible extensions. If the length indicated exceeds the size of the NS-user data which is present, this is a protocol error.
13.2.2 Fixed part
13.2.2.1 General
The fixed part contains frequently occurring parameters including the code of the TPDU. The length and the structure of the fixed part are defined by the TPDU code and in certain cases by the protocol class and the formats in use (normal or extended). If any of the parameters of the fixed part have an invalid value, or if the fixed part cannot be contained with the header (as defined by LI) this is a protocol error.
NOTE - In general, the TPDU code defines the fixed part unambiguously. However, different variants may exist for the same TPDU code (see normal and extended formats).
13.2.2.2 TPDU code
This field contains the TPDU code and is contained in octet 2 of the header. It is used to define the structure of the remaining header. This field is a full octet except in the following cases:
1110 xxxx Connection Request
1101 xxxx Connection Confirm
0101 xxxx Reject
0110 xxxx Data Acknowledgement
where xxxx (bits 4-1) is used to signal the CDT.
Only those codes defined in 13.1 are valid.
13.2.3 Variable part
The variable part is used to define less frequently used parameters. If the variable part is present, it shall contain one or more parameters.
NOTE - The number of parameters that may be contained in the variable part is indicated by the length of the variable part which is LI minus the length of the fixed part.
Each parameter contained within the variable part is structured as follows:
Bits 8 7 6 5 4 3 2 1
Octets +------------------------------------+
n+1 | Parameter Code |
|------------------------------------|
n+2 | Parameter Length |
| Indication (e.g. m) |
|------------------------------------|
n+3 | |
| Parameter Value |
n+2+m | |
+------------------------------------|
-
The parameter code field is coded in binary;
NOTE - Without extensions, it provides a maximum number of 255 different parameters. However, as noted below, bits 8 and 7 cannot take every possible value, so the practical maximum number of different parameters is less. Parameter code 1111 1111 is reserved for possible extensions of the parameter code.
-
The parameter length indication indicates the length, in octets, of the parameter value field.
NOTE - The length is indicated by a binary number, m, with a theoretical maximum value of 255. The practical maximum value of m is lower. For example, in the case of a single parameter contained within the variable part, two octets are required for the parameter code and the parameter length indication itself. Thus, the value of m is limited to 248. For larger fixed parts of the header and for each succeeding parameter, the maximum value of m decreases.
-
The parameter value field contains the value of the parameter identified in the parameter code field.
-
No parameter codes use bits 8 and 7 with the value 00.
-
The parameters defined in the variable part may be in any order. If any parameter is duplicated then the later value shall be used. A parameter not defined in this International Standard shall be treated as a protocol error in any received TPDU except a CR TPDU; in a CR TPDU it shall be ignored. If the responding transport entity selects a class for which a parameter of the CR TPDU is not defined, it may ignore this parameter, except the class and option, and alternative protocol class parameters which shall always be interpreted. A parameter defined in this International Standard but having an invalid value shall be treated as a protocol error in any received TPDU except a CR TPDU. In a CR TPDU it shall be treated as a protocol error if it is either the class and option parameter or the alternative class parameter or the additional option parameter; otherwise it shall be either ignored or treated as a protocol error.
13.2.3.1 Checksum Parameter (Class 4 only)
All TPDU types may contain a 16-bit checksum parameter in their variable part. This parameter shall be present in a CR TPDU and shall be present in all other TPDUs except when the non use of checksum option is selected.
Parameter Code: 1100 0011
Parameter Length: 2
Parameter Value: Result of checksum algorithm. This algorithm
is specified in 6.17.
13.2.4 Data Field
This field contains transparent user data. Restrictions on its size are noted for each TPDU.