5. The Protocol
The protocol specified by this memo is identical to the protocol for ISO transport class 0, with the following exceptions:
- for testing purposes, initial data may be exchanged during connection establishment
- for testing purposes, an expedited data service is supported
- for performance reasons, a much larger TPDU size is supported
- the network service used by the protocol is provided by the TCP
The ISO transport protocol exchanges information between peers in discrete units of information called transport protocol data units (TPDUs). The protocol defined in this memo encapsulates these TPDUs in discrete units called TPKTs. The structure of these TPKTs and their relationship to TPDUs are discussed in the next section.
5.1 Primitives
The mapping between the TCP service primitives and the service primitives expected by transport class 0 is quite straight-forward:
network service TCP
--------------- ---
CONNECTION ESTABLISHMENT
N-CONNECT.REQUEST open completes
N-CONNECT.INDICATION listen (PASSIVE open)
finishes
N-CONNECT.RESPONSE listen completes
N-CONNECT.CONFIRMATION open (ACTIVE open)
finishes
DATA TRANSFER
N-DATA.REQUEST send data
N-DATA.INDICATION data ready followed by
read data
CONNECTION RELEASE
N-DISCONNECT.REQUEST close
N-DISCONNECT.INDICATION connection closes or
errors
Mapping parameters is also straight-forward:
network service TCP
--------------- ---
CONNECTION RELEASE
Called address server's IP address
(4 octets)
Calling address client's IP address
(4 octets)
all others ignored
DATA TRANSFER
NS-user data (NSDU) data
CONNECTION RELEASE
all parameters ignored
5.2 Connection Establishment
The elements of procedure used during connection establishment are identical to those presented in [ISO8073], with three exceptions.
In order to facilitate testing, the connection request and connection confirmation TPDUs may exchange initial user data, using the user data fields of these TPDUs.
In order to experiment with expedited data services, the connection request and connection confirmation TPDUs may negotiate the use of expedited data transfer using the negotiation mechanism specified in [ISO8073] (e.g., setting the "use of transport expedited data transfer service" bit in the "Additional Option Selection" variable part). The default is not to use the transport expedited data transfer service.
In order to achieve good performance, the default TPDU size is 65531 octets, instead of 128 octets. In order to negotiate a smaller (standard) TPDU size, the negotiation mechanism specified in [ISO8073] is used (e.g., setting the desired bit in the "TPDU Size" variable part).
To perform an N-CONNECT.REQUEST action, the TS-peer performs an active open to the desired IP address using TCP port 102. When the TCP signals either success or failure, this results in an N-CONNECT.INDICATION action.
To await an N-CONNECT.INDICATION event, a server listens on TCP port 102. When a client successfully connects to this port, the event occurs, and an implicit N-CONNECT.RESPONSE action is performed.
NOTE: In most implementations, a single server will perpetually LISTEN on port 102, handing off connections as they are made.
5.3 Data Transfer
The elements of procedure used during data transfer are identical to those presented in [ISO8073], with one exception: expedited data may be supported (if so negotiated during connection establishment) by sending a modified ED TPDU (described below). The TPDU is sent on the same TCP connection as all of the other TPDUs. This method, while not faithful to the spirit of [ISO8072], is true to the letter of the specification.
To perform an N-DATA.REQUEST action, the TS-peer constructs the desired TPKT and uses the TCP send data primitive.
To trigger an N-DATA.INDICATION action, the TCP indicates that data is ready and a TPKT is read using the TCP read data primitive.
5.4 Connection Release
To perform an N-DISCONNECT.REQUEST action, the TS-peer simply closes the TCP connection.
If the TCP informs the TS-peer that the connection has been closed or has errored, this indicates an N-DISCONNECT.INDICATION event.