Introduction to SLP, the Service Location Protocol
One of the key concepts of SLP is the notion of service. A service is anything that a user or a computer can consume or use to perform something: RPC-style services (including web services and Java's Remote Method Invocation), mail servers, networked printers, etc. SLP defines how these services can be advertised by the service providers, and how services can be discovered without knowing their network address. SLP defines the architecture to make the discovery and advertisement reliable, scalable and interoperable between different operative systems and platforms.
ServiceURLs and ServiceTypes
In SLP, a service is identified by a ServiceURL and a language string. The ServiceURL is a URI that contains enough information to locate, connect to and consume that particular service. For example, if a service exposes the ability to perform REST-like commands at this URL:
http://myhost:8080/commands
then the service can be represented by this ServiceURL:
service:http://myhost:8080/commands
Note the service: prefix used by ServiceURLs.
A ServiceURL is composed by the ServiceType (service:http), the host (myhost), the port (8080), the path (/commands). In this example a client can use the ServiceURL information to connect to the service that exposes the REST-like commands functionality.
ServiceTypes are a way of grouping similar services together. A ServiceType specifies the type of the service but does not tell where the service is located.
A ServiceURL also carries the information about the lifetime of the service. The lifetime is how long the service will be available for use. For more information about ServiceURLs, RFC 2609 is the master source.
In SLP, a service has scopes, a list of case-insensitive strings, that are used to group similar services together. This grouping is purely a logical grouping decided by the party that provides the service. For example, a service can be provided under the DEFAULT scope.
In SLP, a service has attributes, a map of key/value(s) that specify additional information about the service. For example, a service can have these attributes:
name=CommandsExecutor description=A service that executes commands provided by remote clients requiresLogin=false
Thus, a complete definition of the example service is:
ServiceURL: URI: service:http://myhost:8080/commands
lifetime: 10800 seconds (3 hours)
Language: en
Scopes: DEFAULT
Attributes: name=CommandsExecutor
description=A service that executes commands provided by remote clients
requiresLogin=false
ServiceAgents, UserAgents and DirectoryAgents
The SLP standard defines three major entities, called ServiceAgent, UserAgent and DirectoryAgent.
The ServiceAgent is the entity that advertises one or more services. A ServiceAgent allows you to register new services, deregister existing services, and modify attributes of registered services.
ServiceAgents emit notifications when a service is registered or deregistered. Interested clients (such as UserAgents) can subscribe as listeners for these notifications, so that they can be notified when a new service is registered or when a service is deregistered.
UserAgent is the entity that discovers services on the network on behalf of a client. UserAgent allows clients to specify the ServiceType, scope, attributes or language of the services to find. UserAgent discovers matching services in the network, and returns the matching services to the client. Among the information returned to the client is the ServiceURL of the service, that allows the client to contact the service directly.
DirectoryAgent is the entity that provides scalability to SLP. DirectoryAgent is a cache for services; ServiceAgents register their services with DirectoryAgents, and UserAgents contact DirectoryAgents to get a list of matching services.
Take a look at the examples.


[ Edit This Page ]