DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Developing applications over IPX/SPX using TLI

SPX packet structure

An SPX packet consists of a 42-byte SPX header followed by 0 to 534 bytes of data. The minimum packet size is 42 bytes (the header only) and the maximum size is 576 bytes (header plus 534 bytes of data). In special cases, larger data packets can be sent.

The content and structure of the packet's data portion are entirely the responsibility of the application using SPX and can follow any format.

Some of the fields in the header are byte order sensitive and the data must be sent in high-to-low order. See ``Network byte ordering'' for more information.

The SPX header consists of an IPX header and seven additional fields. ``SPX packet header'' describes the fields in an SPX header.

When the application is establishing a connection with SPX, it must pass the destination address to SPX. After the connection has been established, the application does not need to set any fields in the header. The SPX driver automatically sets all fields to the appropriate values.

An application can define a value for one field in the header: the ``Data stream type'' field. Because there is no standard for its use, using this field is not recommended.

SPX packet header

Offset Field Type* Byte order
0 Checksum uint8 [2] high-to-low
2 Length uint8 [2] high-to-low
4 Transport control uint8 N/A
5 Packet type uint8 N/A
6 Destination address ipxAddr_t structure N/A
18 Source address ipxAddr_t structure N/A
30 Connection control uint8 N/A
31 Data stream type uint8 N/A
32 Source connection ID uint8 [2] high-to-low
34 Destination connection ID uint8 [2] high-to-low
36 Sequence number uint8 [2] high-to-low
38 Acknowledge number uint8 [2] high-to-low
40 Allocation number uint8 [2] high-to-low

*
A uint8 is an unsigned char.

The fields in the SPX packet header are:


Checksum
The SPX driver sets this field to 0xFFFF. This value specifies that the checksum is not used.

Length
The SPX driver sets this field to the length of the complete SPX packet (42 to 576 bytes).

Transport control
The SPX driver sets this field to 0 before sending the packet. Each router increments the field before sending the packet on. If the packet passes through 16 routers, the 16th router discards the packet.

Packet type
The SPX driver automatically fills in this field.

Destination address
The application must set this field when the application is establishing an SPX connection. The destination address is a 12-byte ipxAddr_t structure. See ``IPX addresses'' for more about the ipxAddr_t structure.

Source address
The SPX driver fills in this field with the source address of the sender. The source address is a 12-byte ipxAddr_t structure. See ``IPX addresses'' for more about the ipxAddr_t structure.

Connection control
SPX sets this field to indicate whether the packet is a system or application packet.

Data stream type
SPX sets this field to indicate the type of data found in the packet. SPX uses 0xFE to indicate an End-of-Connection packet and 0xFF to indicate an End-of-Connection-Acknowledgment. All other values in this field are ignored by SPX.

Source connection ID
SPX sets this field to the connection identification number that it assigned to the local transport endpoint.

Destination connection ID
SPX sets this field to the connection identification number that it assigned to the remote transport endpoint.

Sequence number
SPX sets this field to the number of packets exchanged in one direction on the connection. Each side of the connection keeps its own count. The number wraps to 0x0 after reaching 0xFFFF.

Acknowledge number
SPX sets this field to indicate the sequence number of the next packet SPX expects to receive. SPX drops any packet with a sequence number less than the specified acknowledge number (the packet is a duplicate). When SPX receives a duplicate packet, SPX re-sends its acknowledgment of the duplicate packet.

Allocation number
SPX uses this field to implement flow control between communicating applications. SPX only sends packets until the local sequence number equals the allocation number of the remote partner. The allocation number minus the acknowledge number indicates the number of listen buffers outstanding in one direction on the connection.

Next topic: Initializing SPX
Previous topic: Connection requests

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003