IPX / SPX Packet Structures =========================== The following information, taken from the 'C Interface for DOS' manual, plus other sources, details packet formats for IPX and SPX as used across Novell NetWare networks. Structures ========== The structure of an IPX packet is identical to the structure of a Xerox Network Standard (XNS) packet. The packet consists of a 30-byte header followed by 0 to 546 bytes of data. The minimum packet size is 30 bytes (the header only) and the maximum packet size is 576 bytes. The contents and structure of the data portion are entirely the responsibility of the application using IPX and can take any format. IPX Packet Header ================= The IPX Header is defined as follows : ** checkSum ** length * transportControl * packetType **** destination.network ****** destination.node ** destination.socket **** source.network ****** source.node ** source.socket 'checkSum' contains a dummy check sum of the packet contents and is always set by IPX to 0xFFFF. 'length' contains the length of the complete IPX packet (30 to 576 bytes) and is set by IPX. NetWare internetwork routers use the 'transportControl' field to monitor the number of routers that a packet has crossed. The packets are discarded by the sixteenth router they encounter. IPX sets this field to zero before sending the packet. The 'packetType' field identifies the type of service offered or required by the packet. Xerox has defined the following packet types : 0 Unknown Packet Type 1 Routing Information Packet (RIP) 2 Echo Packet 3 Error Packet 4 Internet Datagram Protocol (IDP) Packet = IPX Packet 5 Sequenced Packet Protocol (SPP) Packet = SPX Packet Novell has also defined the following packet types : 16-31 Experimental Protocols 17 NetWare Core Protocol (NCP) Packet 20 NetBIOS Name Packet 104 NDS NCP The 'network' field identifies the network address of the source or target application. The 'node' contains the 6 byte number that uniquely identifies the LAN board within the target or source network station (or node). The 'socket' field contains the socket address which identifies a process within a node. SPX Packet ========== An SPX Packet consists of a 42-byte 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. The contents and structure of the data are entirely the responsibility of the application using SPX and can take any format. SPX Packet Header ================= The SPX Header consists of an IPX Header (30 bytes) and seven additional fields as follows : * connectionControl * dataStreamType ** sourceConnectionID ** destConnectionID ** sequenceNumber ** acknowledgeNumber ** allocationNumber SPX sets all fields in the SPX Header except the destination address when a call to the 'SPXEstablishConnection' function is made. The connectionControl field controls the bidirectional flow of data across an SPX connection. The following bits are defined : 7 SYSTEM_PACKET 6 ACKNOWLEDGEMENT_REQUIRED 5 RESERVED 4 END_OF_MESSAGE 3 2 1 0 The 'dataStream' field indicates the type of data included in the packet. Values of 0x00 through 0xFD can be defined by the client and are ignored bye SPX. A value of 0xFE indicates and end-of-connection packet. When a client makes a call to terminate an active connection, SPX will generate an End-of-Connection packet. This packet is then delivered to the connection partner as the last message on the connection. A value of 0xFF indicates an End-of-Connection-Acknowledgement packet. SPX generates an End-of-Connection-Acknowledgement automatically. It is marked as a system packet and not delivered to the partner clients. The values 0xFE and 0xFF are reserved for use by SPX in connection maintenance and should not be used by an application. The 'sourceConnectionID' and 'destConnectionID' fields specify the connection identification number assigned to the SPX connection by the source node and destination node respectively. The 'sequenceNumber' field keeps a count of packets exchanged in one direction on the connection. Each side of the connection keeps its own count. The number wraps to 0x0000 after reaching 0xFFFF. Since SPX manages this field, client processes need not be concerned with it. The 'acknowledgeNumber' field indicates the next packet that an SPX connection expects to receive. The values in both fields increment for 0x0000 to 0xFFFF then wrap to zero. The 'allocationNumber' (in conjunction with the acknowledgeNumber) indicates the number of outstanding packet receive buffers available for a given SPX connection. It is used by SPX to implement flow control between communicating applications. IPXPACK.TXT Marcus Williamson Novell Consulting (Europe) Duesseldorf, Germany 71333,1665