Compression Header
IPX compression should be negotiated by some means (eg. IPXCP or IPXWAN). Each end must negotiate the desired options, such as the maximum number of concurrent connections which will be maintained in each direction. Once IPX compression is negotiated, all IPX packets sent over that link have a CIPX header added to the beginning of the packet. The CIPX header is variable in length.
The one octet CIPX header is added even when a regular IPX packet is sent over the link. By including the CIPX header on every packet, we support the ability to run CIPX over various WAN links as if it were a normal IPX packet. It does not rely on any new link specific packet demultiplexing.
Implementations of this compression protocol must maintain send and receive tables indicating the state of each connection. The original header for each connection is stored in a "slot". Typically, each client-server connection will use a separate slot. Both sides keep a copy of the full IPX header corresponding to each slot. The sending side (compressor) uses this information to determine the fields that have changed. The receiving side (decompressor) uses this information to reconstruct the original packet header.
The CIPX packet header specifies the type of the packet and any options for that packet. The minimum CIPX header is one octet in length.
7 6 5 4 3 2 1 0
+---+---+---+---+---+---+---+---+
| | | | | | | | |
+---+---+---+---+---+---+---+---+
^ ^ ^ ^ ^ ^ ^ ^
| | | | | | | |
| | | | |___|___|___|___ Packet Type
| | | | 0 Compressed
| | | | 1 Regular
| | | | 3 Confirmed Initial
| | | | 5 Confirm
| | | | 7 Unconfirmed Initial
| | | | 9 Reject
| | | | 11-15 Reserved
| | | |
|__ |__ |__ |___________________ Packet Type Dependent Flags
FLAGS OCTET
As can be seen above, the low order bits specify the packet type. All Compressed packets have a lowest bit of zero. The other packet types are odd numbers.
Note that the Flags octet MUST NOT contain the value 0xFF. This is necessary to distinguish the CIPX flags octet from a normal IPX header with a 0xFFFF checksum field. It is important to be able to recognize a normal IPX header regardless of the state of compression. It is possible with some link layer protocols such as X.25 Permanent Virtual Circuits that one end of the link may fail and start sending regular IPX packets without the CIPX header. CIPX implementations MUST recognize this situation and renegotiate the use of CIPX.
Each packet type has associated flag bits, which are called Packet Type Dependent Flags. Different packet types have different Packet Type Dependent Flags. All bits that are reserved or are not specified must be set to zero.
Since none of the packet types other than Compressed currently uses any of the flag bits, the packet type field could easily be expanded. Any future expansion must ensure that at least one of the bits in the Flags octet remains zero so the value cannot be 0xFF.