The TCP protocol does not attach significance to datagram boundaries, so a protocol must be layered over a TCP session to convey record boundary information. The Record Boundary Preservation protocol implements a 6-byte record header that specifies the amount of data following and indicates whether that data should be considered the final part of a logical record. Table 1 describes the format and contents of the record header.
Table 1 |
Record Header Format |
Byte |
Description |
Byte 0 |
Protocol identifier. This byte must contain the value 0xD7. |
Byte 1 |
Protocol identifier. This byte must contain the value 0x4A. |
Bytes 2 and 3 |
Payload length, in bytes, not including the header. Byte 2 contains the most significant byte of the length; byte 3 contains the least significant byte. |
Byte 4 |
"More data" flag. This byte must contain one of the following values:
- 0x00--Indicates that this record is the final part of the data unit.
- 0x01--Indicates that this record is not the final part of the data unit.
|
Byte 5 |
Must contain the value 0x00. |
When a router configured with RBP receives an X.25 call that matches a configured X.25 RBP map, the router attempts to open a TCP connection to the specified TCP destination. Each TCP session is mapped to one X.25 virtual circuit. If the TCP session is established, then X.25 data packets received from the caller are combined into logical records as indicated by use of the X.25 M-bit, and the contents of the data packets are forwarded to the TCP destination. The boundaries of these records are preserved by the record header.
The router will not split an X.25 data packet across multiple records unless the data packet exceeds the configured maximum record size; however, TCP will segment the data stream at arbitrary byte boundaries in accordance with TCP specifications.
X.25 data packets with the M-bit set may be combined as long as the resulting record does not exceed the configured maximum record size or, if a maximum record size was not configured, the maximum datagram size for the X.25 interface. The "more data" flag in the record header will reflect the value of the M-bit in the final X.25 data packet. This process of combining packets results in a series of zero or more records whose "more data" flag is set to the value 1 followed by a record whose "more data" flag is set to 0.
Incoming X.25 calls with the "delivery confirmation" bit (D-bit) set will be answered with the D-bit set. However, since the router is the endpoint of the X.25 circuit, X.25 data packets will be acknowledged as soon as their contents have been passed to the TCP connection without waiting for an acknowledgment for the TCP data, regardless of the value of the D-bit. TCP data will be acknowledged as soon as it has been converted to X.25 data packets.
The router will not send Receiver Not Ready (RNR) packets on the X.25 circuit; flow control will be accomplished by withholding acknowledgment.
The following situations will cause the X.25 circuit to be cleared (for an SVC) or reset (for a PVC) and the TCP connection to be closed: receipt of a data packet with the "qualified" bit (Q-bit) set; receipt of any packet type other than data, Receiver Ready (RR), or RNR; or a restart or lower-layer reset on the X.25 interface. When the circuit is cleared or reset, any data not yet passed to the TCP connection will be discarded.
When the router receives the records from the TCP session, it strips the record header and, on the basis of the information in the record header, reassembles the records into X.25 data packets. The data is interpreted as a fixed-length header followed by a variable-length payload whose length is specified in the record header. If the protocol ID or flag field in the header is invalid, the TCP connection will be closed and the X.25 circuit will be cleared or reset. The payload length may be greater than the X.25 packet size and need not be a multiple of the X.25 packet size.
A record that has the "more data" flag set will be logically combined with following records until a record that has the "more data" flag cleared is received. This process results in a sequence of maximum-sized X.25 data packets, each with the M-bit set, followed by an X.25 data packet containing the remaining data that does not have the M-bit set. The router will not wait for an entire record to be received before sending a maximum-size X.25 data packet.
As the records are reassembled into X.25 data packets, the packets are forwarded to the corresponding X.25 circuit.
The router will not set the D-bit or Q-bit on X.25 data packets being sent over circuits that are configured with RBP.
Data received by a router from a TCP session will be buffered while waiting for the other connection to be established. If the connection attempt fails, the data will be discarded. When a TCP connection is closed, the X.25 circuit will be cleared or reset, and any data not yet sent on the X.25 circuit will be discarded.