Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX IP Address and Client Management Administrator’s Guide: HP-UX 11i v2, HP-UX 11i v3 > Chapter 1 Overview

SLP Overview

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

The Service Location Protocol (SLP) framework simplifies the discovery and use of network resources such as printers, web servers, fax machines, video cameras, file systems, backup devices (tape drives), databases, directories, mail servers, and calendars.

Typically, in order to locate services on the network, users of network applications are required to supply the host name or network address of the machine that supplies a desired service. SLP eliminates the need for a user to know the name of a network host supporting a service offered by the network.

The user is required to specify the following details pertaining to the desired service:

  • Type of the desired service

  • A set of attributes that describe the service

Based on this information, SLP resolves the network address of the host that supports the service. It uses Uniform Resource Locators (URLs) to locate the services. See “SLP Attributes” for more information.

SLP facilitates the following:

  • Client application requests for network service location information

  • Advertisement of services

  • Segregation of services and users into logical or functional groups

  • Managed recovery from primary server failures

SLP implementation on HP-UX is based on OpenSLP Version 0.8.0, developed by Caldera Systems, Inc.

This section containes the following topics:

Salient Features

This section describes the salient features of SLP.

Dynamic Service Tracking

When service instances like printers or fax machines are added to a network, they are quickly visible to clients. When they are removed from the network, they are no longer visible to the clients. You can describe a service by configuring values for the attributes that are possible for that service. Clients can detect the entry and exit of services faster.

For example, you can describe a printer as a PostScript® printer, a printer that has blue paper available, or a printer on the same floor as the user’s office. You can track a service by specifying the values of the attributes if services are replaced or removed from the network; user agents discover alternate or replicated servers and continue to operate.

Ease of Administration

You do not need to configure clients to find new services or to remove services when they are no longer available.

Ease of Development

SLP’s well-defined APIs and protocol semantics allow service developers to rapidly provide network services.

SLP Components

The SLP framework comprises the following agents and processes:

User Agent

The User Agent (UA) issues a service request on behalf of the client application, specifying the characteristics of the service that the client requires. The user agent can directly issue a multicast request to Service Agents.

Service Agent

The Service Agent (SA) works on behalf of one or more services to advertise the service on the network. Service agents advertise their service through service agent advertisements. In the absence of Directory Agents (DAs), the SA responds to multicast requests sent by the User Agents. If a DA is available, the SA registers and, optionally, withdraws services with DAs that support its scopes. All the network services are grouped together by using scopes that indicate a particular location, administrative grouping, and proximity in a network topology or any other category. For more information about scopes, see “Assigning Scopes”.

The HP-UX implementation of SLP includes a Service Agent Server, with which the services register their service information. Therefore, instead of having multiple individual Service Agents running on a host, there is only one Service Agent Server advertising multiple services.

Directory Agent

The Directory Agent (DA) is an optional SLP agent that maintains a cache of service advertisements sent by the SA. The DA provides this information to the clients that are trying to discover the services. A DA sends periodic unsolicited advertisements through which SAs and UAs discover the DA within shared scopes.

UDP and Multicast Ports

SLP uses UDP and multicast ports in the following scenarios:

  • SLP uses multicast ports for discovering Directory Agents and for issuing requests to Service Agents by default.

  • SLP listens on port 427.

  • SLP uses UDP for service request messages by the User Agents. However, in the following cases, a TCP connection is required:

    • The User Agent issues requests larger than the path MTU (largest packet size when communicating with a remote machine).

    • The Service Agent sends replies larger than the path MTU, and User Agents are not configured to accept the replies with the OVERFLOW flag set (this flag enables the UA to only make use of the truncated reply or to reformulate the request to limit the reply).

    • Directory Agents must be able to respond to UDP and TCP requests.

SLP Architecture

The SLP architecture, at its most basic level, includes the following players in a typical service location problem:

  • A client or user that is searching for a service to satisfy particular requirements or that requires information on the characteristics of a particular service.

  • A server or service provider that is advertising a service having particular characteristics.

At the simplest level, an architecture for service location must provide a way for the UA to obtain a set of services having particular characteristics from SAs advertising those services. The information provided by SAs describing services is called a service advertisement.

A service advertisement is a URL and a collection of attribute-list pairs that describe a service. All service advertisements have a valid lifetime. Upon expiry of this lifetime, the service advertisements become invalid, unless they are reregistered.

Service advertisements characterize an instance of a service through a collection of attributes that describe the service. One of those attributes is the type of service being offered, known as the service type. The service type attribute describes a class of services that share the same attributes. It also includes information about what protocol clients must use when contacting the service.

The service advertisement also contains another important piece of information: the service access point, which helps the UA to access the service. Normally, the service access point encapsulates the machine’s host name or IP address and perhaps a port number.

Figure 1-6 illustrates SLP architecture for a network.

Figure 1-6 SLP Architecture

SLP Architecture

In Figure 1-6, SAs contain service advertisements describing the services they represent. The advertisement consists of service type, attributes, and service access point. UAs transmit queries to the network about what services their clients require. The SAs intercept these queries and return the service access point information if the query matches the service type and attributes of the services they represent. The UA clients then utilize the services through the service access point information.

SLP Attributes

Attributes in SLP are transmitted in text string lists. The lists contain parenthesized expressions assigning an attribute tag to a value or a set of values. The syntax for the attribute string list is as follows:

attrlist = *WS attr-assign *WS / *WS attr-assign *WS “,”
           ; attrlist

Attributes are formed into a list consisting of comma-separated expressions. The assignment expressions contain the attribute tag, followed by "=", followed by a comma-separated list of one or more values. An example of attribute list is as follows:

(submission day=wednesday),new_copy,(month=1,2,3,4,5,6)

In this list, the submission day is assigned a string value of wednesday; the month attribute is assigned a list of integer values. The new_copy attribute is a keyword attribute and is not part of an attribute assignment expression. SAs send attribute lists in this format to DAs in response to a UA request for attribute values.

Discovering a Directory Agent

Following are the different ways in which UAs and SAs find DAs:

  • Active DiscoveryIn active DA discovery, the UA and the SA send a multicast SLP request to the network. The service type of the request is directory-agent, and the query is empty. If the client wants to discover all DAs within its multicast radius, it does not include any scope in the service request. DAs are required to reply with their service URLs and the scopes that they support. The response to the service request message, however, is not a service reply, but rather a DA advertisement. The service URL of a DA includes the host name or IP address of the DA as shown in the following examples:

    service:directory-agent://test.org	service:directory-agent://15.10.20.2
  • Passive Discovery In passive DA discovery, DAs multicast periodic unsolicited advertisements of their services in case any SAs or UAs fail to receive the initial advertisement sent by the DAs.

  • Using DHCP Options for SLP DA A host that uses DHCP may use it to obtain a DA’s IP address. The DHCP options, SLP Directory Agent, and SLP Service Scope can be used to discover the DA.

Figure 1-7 illustrates how active and passive DA discovery work.

Figure 1-7 Active and Passive DA Discovery

Active and Passive DA Discovery

The UA and SA at the top of the figure have initiated active discovery by multicasting a service request (SrvRqst) with service type service:directory-agent. The DA at the bottom of the figure responds by unicasting a DA advertisement (DAAdvert) with its URL and the list of scopes that it supports. At the bottom of the figure, the DA periodically multicasts a DAAdvert with its URL and scope list. The UA and SA listen on port 427 for the unsolicited DAAdvert and add the DA to their list of active DAs.

How SLP Works

Consider the example of a user who needs to use the printer services on a network. The following series of events occur at the server and the client side:

  1. A printer initializes and registers its URL with the SA and the DA server.

  2. Service Agents register current attribute information periodically, allowing User Agents to ascertain their status and other characteristics.

  3. The client queries for a printer service with particular attributes, such as a PostScript printer, including the scope information.

  4. The client then connects to the printer with the chosen attribute values within the scope defined and processes the print instruction.

Figure 1-8 illustrates this process.

Figure 1-8 Protocol Transactions - Schematic Representation

Protocol Transactions - Schematic Representation
SLP Files

Table 1-20 describes the files used by SLP.

Table 1-20 SLP Files

Name and UsageLocation
Configuration file - to configure slpd/etc/slp.conf
Registration file/etc/slp.reg
Pid file/var/run/slpd.pid
Default log file/var/log/slp.log
SLP daemonslpd
Script to start, stop, restart slpd, and also to dump the database.slpdc
Library callslibslp
Error codesSLPError

 

SLP Messages

SLP is a string protocol. Every SLP message consists of a header and a body. The body contains both string and binary fields. All the SLP messages are prefixed by a common header. The header contains the type, length, and other related information about the message.

Table 1-21 describes the SLP message types.

Table 1-21 Message Types

Message TypeAbbreviationUsage
Service Type RequestSrvTypeRqstUAs send this message to SAs and DAs to request the types of services available.
Service Type ReplySrvTypeRplySAs and DAs send these messages to the UAs in response to their requests. These contain the service types requested by the client.
DA AdvertisementDAAdvertDAs send this message to the SAs and UAs to make them aware of their whereabouts.
SA AdvertisementSAAdvertSAs send this message to the UAs to make them aware of their whereabouts.
Service AcknowledgeSrvAckDAs send an acknowledge message to SAs in response to their SrvReg and SrvDeReg messages.
Attribute RequestAttrRqstUAs send this message to SAs and DAs to request the attributes of a service.
Attribute ReplyAttrRplySAs and DAs send this message to UAs in response to theirAttrRqst message. This contains the list of attributes of a requested service.
Service RegistrationSrvRegSAs send this message to register their services with DAs.
Service DeregistrationSrvDeRegSAs send this message to DAs if they no longer want to make a service available, causing the advertisement to be removed from the DA immediately.

 

Assigning Scopes

A scope is a cluster of services that allows the services to be associated with a set of users administratively. A scope indicates a particular location, administrative grouping, and proximity in a network topology or any other category. SAs and DAs are always assigned a scope string. The UA is normally assigned a scope string, through which it discovers that particular group of services. This allows a network administrator to provide the desired service to users. If the UA is configured with no scope, it discovers all available scopes and allows the client application to issue requests for any service available on the network.

There are no hard and fast rules for the assignment of scopes. They may be assigned by geographical location or by logical or administrative groupings. For example, you can assign the administrative scope of “Marketing” to a scanner. It is also possible for the same scanner to be advertised within the local scope “Engineers,” if all engineers must have access to the resource as well.

Following is an example of how to configure scopes:.

   # Scopes to use for this agent
   net.slp.useScopes=corp,eng

You can use scopes for the physical location of services. You can also use a physical location attribute within a particular service with scopes.

Following is an example of expanded scope associated with a service:

    # Scopes to use for this agent
    net.slp.useScopes=Building-5, Building-12

This configuration allows services to be advertised to users that are in the Building-5 scope, as well as to users that are assigned to Building-12 scope. This is a logical configuration for physically dependent services, such as scanners or printers.

SLP APIs

Table 1-22 describes the APIs that the SLP software contains.

Table 1-22 SLP APIs

APIUsage
SLPReg()Registers a service URL and associated service attributes with SLP.
SLPDeReg()Deregisters a registered service.
SLPFindSrvs()Finds services based on service type or attributes.
SLPFindAddrs()Obtains a list of attributes for services registered with SLP.
SLPFindSrvTypes()Obtains a list of the types of services that are registered with SLP.

 

The slpd Daemon

The slpd daemon process acts as either a DA or an SA server. Service processes on a host register their service advertisements with slpd. These service processes contain an SA client library that communicates with slpd, acting as the SA server. slpd forwards all service registrations and withdrawals to DAs and times out invalid or expired service advertisements.

The SLP library (libslp.sl) provides the UA functionality on a per-process basis without the need to communicate with slpd running on local machines. This means that in certain cases, you do not have to load the SLP daemon on every machine. This helps to minimize the overhead for SLP for those machines that need only UA capabilities.

slpd must be running on all the machines that need to register services. In other words, slpd is required on all machines that run applications and make calls to either SLPReg() orSLPDeReg() APIs.

slpd accepts registration requests for services from SAs and maintains this information internally. It shares this information with clients represented by their UAs when queried. In addition, slpd allows older applications that are not SLP-enabled to advertise the services offered by them. You can use the -r option to specify the file that contains static registrations. By default, slpd reads static registrations from the file /etc/slp.reg.

You need to run slpd in order to make the registrations for the /etc/slp.reg file available to other machines. Additionally, slpd must be running for automatic DA and scope discovery to work correctly. If slpd is not running, then DAs and scopes can be discovered only via DHCP or the /etc/slp.conf file.

NOTE: In the absence of a standard DHCP API, discovery via DHCP is currently not supported. slpd is not required if a machine requests only services. In other words, slpd is not required on machines if a call is never made to SLPReg() or SLPDeReg(). Additionally, slpd is not needed on a machine if either manual or DHCP type of DA or scope discovery is sufficient.
Startup Options

You can invoke slpd with various options. Run the following command on the command line to invoke slpd:

slp [-d] [-c config file] [-r registration file] [-l log file] [-p pid file]

Table 1-23 contains the list of command-line options that SLP supports at startup.

Table 1-23 Startup Options

Option

Description
[-d]Prevents detaching from the controlling tty.

[-c config file]

Specifies the file that slpd uses to read configuration information. The default configuration file is /etc/slp.conf.

[-r registration file]Specifies the file that slpd reads to obtain static registrations. The default registration file is /etc/slp.reg.
[-l log file]Specifies the file that receives slpd log messages. The default log file is /var/log/slpd.log.
[-p pid file]Specifies the file that holds the slpd process ID. The default pid file is /var/run/slpd.pid.

 

You can use the slpdc script to start, stop, and restart slpdcand also to dump the database. Table 1-24 contains the list of commands that slpdc supports.

Table 1-24 slpdc Commands

Command

Description
slpdc startStarts slpd.The command line options to be passed to slpd can be specified as: slpdc <options>
slpdc stopStops slpd.
slpdc restartRestarts slpd.
slpdc dumpDumps the database.

 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.