|
|
SAP is implemented using Novell's IPX datagram protocol. The SAP information for querying or broadcasting servers becomes the data portion of the IPX packet.
Some of the fields in the packet are byte-order sensitive, and the data must be sent in high-to-low byte order. See ``Network byte ordering'' for more information.
The structure of a SAP packet is described in ``Fields in a SAP packet''.
Offset | Field | Type* | Byte order |
0 | IPX header | uint8[30] | N/A |
30 | SAP operation | uint16 | high-to-low |
32 | SAP data | varies | |
|
SAP query packets are used to determine the identities of servers on the network. Client applications for SCO IPX/SPX use SAP queries to obtain the addresses of available servers. With the address, the client application can establish a session with a server.
Application servers usually do not use SAP queries. However, if the application server needs to establish a session with another server, the application server would use a SAP query to obtain the address of another server.
The structure of a SAP query packet is described in ``SAP query packet structure''.
SAP query packet structure
Offset | Field | Type* | Byte order |
0 | IPX header | uint8[30] | N/A |
30 | SAP query type | uint16 | high-to-low |
32 | Server Type | uint16 | high-to-low |
|
A General Service Query (SAP_GSQ 0x0001) is used to query all local servers and routers. The query can be for any server or for a server of a particular type.
A Nearest Server Query (SAP_NSQ 0x0003) is used to query for the nearest server. The query can be for all servers or for all servers of a particular type.
There are two types of SAP responses: a General Service Response and a Nearest Server Response. Each type of response packet has a SAP response type and at least one SAP SIS (Server Information Structure). The packet can have up to seven SISs.
The structure of a SAP response packet is described in ``SAP response packet structure''.
Offset | Field | Type* | Byte order |
0 | IPX header | uint8[30] | N/A |
30 | Response type | uint16 | high-to-low |
32 | Server Information Structures | SIS[7] | high-to-low |
|
The General Service Response packet
is sent to answer a General Service Query packet.
SAPD responds to all General Service Query packets
on behalf of all SCO IPX/SPX servers
and all application servers that use SAPD.
The Nearest Server Response packet is sent to answer a Nearest Server Query packet. This packet usually contains just one SIS. SAPD finds the nearest server of the requested type. If SAPD determines it is the best source for information about the server, it responds to the query.
Each Server Information Structure contains information for a particular advertising server. The structure of an SIS is described in ``The format of a Server Information Structure''.
The format of a Server Information Structure
Offset | Field | Type* | Byte order |
0 | Server type | uint16 | high-to-low |
2 | Server name | char[48] | N/A |
50 | Server IPX address | uint8[12] | high-to-low |
62 | Intermediate networks | uint16 | high-to-low |
|
Periodic broadcast packets are used to advertise that a service is available and to remove services that are no longer available. When a server first comes up, it sends out one of these packets to let the SAP agents know that its services are now available. The SAP agents use this first broadcast to add the server to their Server Information tables and to echo the new server information to all their networks.
The server then sends out a periodic broadcast every 60 seconds to let the SAP agents know that its services are still available. SAP agents use these broadcasts to keep their Server Information tables up-to-date. Any server or service that does not send a broadcast for 3 minutes is presumed to be ``down''. That server's information is then removed from the SAP agent's table, and the SAP agent sends out a broadcast indicating that the server is down.
When a server is going down, the server sends a broadcast packet with the ``Intermediate networks'' field set to 16. This value signals SAP agents to remove that server from their tables.
A Periodic Broadcast packet has the same format as a General Service Response packet. See ``SAP response packets'' for more information. The fields in a Periodic Broadcast packet are:
``An application server's address'' illustrates such an application server loaded on a SCO IPX/SPX server.
An application server's address
Using the values given in
``An application server's address'',
the application server would set the server IPX
address in its Periodic Broadcast packets to:
Server network: 0x00D0C000
Server node: 0x000000000001
Server socket: 0x4002