16.2 How SLP Works

User Agents and Service Agents interact on behalf of client applications and network services to dynamically locate network services. The following interactions are discussed in this section:

16.2.1 SLP with a User Agent, Service Agent, and No Directory Agent

Figure 16-1 illustrates how Service Agents and User Agents interact without a Directory Agent in the network. When a network application is started, it registers its service URL and attributes with the Service Agent. The Service Agent stores a copy of the service information in its local service cache. The Service Agent remains silent, meaning that the service is not multicast or broadcast on the network.

Figure 16-1 SLP User Agent and Service Agent Interaction

When a client application queries the User Agent for a network service, the User Agent in search of service information multicasts a Service Request. The Service Agent receives the Service Request and consults its local service cache to see if it holds a service matching the criteria of the Service Request. If so, the Service Agent containing the requested service information unicasts a Service Reply to the User Agent.

If multiple Service Agents reply, the User Agent combines the results before returning them to the client application. This same scenario occurs for Service Type and Attribute Requests. When the network service is terminated, it deregisters its service with the Service Agent, which deletes the service from its local service cache. The Service Agent remains silent.

16.2.2 SLP with a User Agent, Service Agent, and Directory Agent

Figure 16-2 illustrates how Service Agents and User Agents interact with Directory Agents to advertise and locate network services. When a network application is started, it registers its service URL and attributes with the Service Agent. The Service Agent maintains its own copy of the service information and then unicasts a Service Registration (that has the new service information) to the Directory Agent. The Directory Agent saves the service information in its local service cache.

Figure 16-2 SLP Directory Agent Interaction

When a client application queries the User Agent for a network service, the User Agent in search of service information unicasts a Service Request to the Directory Agent. The Directory Agent returns a Service Reply that has the requested service URLs or an indication that no requested services are available. The same scenario is repeated by the User Agent and Directory Agent for Service Type Requests and Attributes Requests.

When the network service is terminated, it deregisters its service with the Service Agent, which deletes the service from its local service cache and then sends a Service Deregister request to the Directory Agent. The Directory Agent then deletes the indicated service from its service cache.