Export page to Open Document format View page as slide show

Service Discovery

Service Discovery

  • Needed for finding available services
  • Can be initiated by
    • Customer
      • What is available? Is there something interesting available
    • Application
      • Is there service available I can use?
    • Middleware
      • Where can I find similar service that we just got disconnected?

Finding services in wireless world

  1. Device discovery
    • Find out what devices surround us and can provide access to services
  2. Service discovery
    • See what is available
    • Before a service is used it has to be found
  3. Service selection

Device discovery

  • Manners of locating physical devices we intend to communicate with?
    • Touch (NFC), point at it (Infrared), send/query it (RF), …
  • Device discovery finds physical devices, service discovery finds Apps
    • Prior to finding a service the device has to be found
    • Service discovery may also provide address to service providing device

Service discovery

  • Tries to answer
    • What types of services are available
    • Where are certain services
    • What is required from client to use the service
    • How to contact the service
  • Can aid in configuration issues
    • All needed information is gained via service discovery to use the device/service
    • Mobile users using mobile service cannot be forced to do configurations manually
    • Mobility has no place for pre-installed drivers?

Service discovery ...

  • Service may have sub-types
    • High resolution printer is subtype of printer
  • Dynamic service status update
    • Service may come & go / once in a life-time
  • Eventing
    • Asynchronous notifications of changes in service condition
  • Garbage collection
    • Get rid of out-of-date data from service catalogs

Operational modes

  • 2 SD operational modes
    1. Discovery of services on demand
      • Word processor needs to use a printer
      • Digital camera requires more light
      • John wants to find multi-player games
    2. Service browsing
      • Client can browse through list of available services

General service discovery architecture

  • Client
    • Conducts the service discovery
  • Catalog
    • Contains information about services
  • Server
    • Contains the service
    • Informs the catalog about the service

General service discovery operation

  • Setup
    1. Service is started
    2. Service contacts catalog informing it is available (register)
  • Service discovery
    1. Client finds catalog
      • Either to predifined address / using broadcasting (e.g. device discovery)
    2. Client sends request
      • About location of the certain service & parameters to use it
      • List of available service
    3. Catalog responds with the service location & necessary parameters or a list of services
    4. Client contacts the service with the gained parameters

Service discovery protocols

  • Bluetooth SDP
    • For Bluetooth PAN services
  • Service location protocol (SLP)
    • IETF standard for IP based networks
  • JINI
    • Java based solution
  • Universal Plug 'n' Play
    • For hardware discovery
  • Universal description, discovery & intergration (UDDI)
    • Web services
  • Concerns
    • Do services & client support same SDPs?
      • Bridging between different protocols exist
    • Do service & client use same catalog?


  • IETF standard
    • RFC 2608-SLPv2 specification, RFC 2609-Service templates, RFC 2614-SLP APIs
  • 3 entities
    1. Service agent (SA)
      • Advertises the service & its parameters
    2. User agent (UA)
      • Find the service for the client program
    3. Directory agent (DA)
      • Cache information about services
      • Optional
  • Services have different scopes
    • Public services - visible to all e.g. public printers
    • Private services - visible to specific devices e.g. research lab printer
  • API defined for C & Java

SLP on the run

  • Service discovery without the DA
    1. UA sends multicast message stating the service it requires
      • msg: service type & esential characters of the service
    2. SAs respong with unicast messages
  • Service discovery with DA
    • Service registers themselves to DA
    • Client sends unicast request to DA not multicast
      • DA may be statically configured to client
      • DA location maybe gained through DHCP
      • DA is a service so multicast request for DA can be issued
    • Reduces amount of traffic required
    • Reduces the load on services
    • Extends discovery over the multicast perimeter

Service URL

  • Naming convention in SLP
    • Service URL service: service type : site url path
      • Service at the beginning → we have a service URL (not HTTP, FTP, etc)
      • Service type → identifies the type of service
        • Special naming authorities identifiable along with service type
        • dot separated e.g. type.naming.authority
      • site url path → defines way to access the actual service
        • Format is defined on service template used

Service URL E.g.

  • service:printer:lpr:printer.lut.fi/color service:mud.mygames:tcp:
  • service:image-service.test:images.com/;format=JPEG;resolution=1024×768

Service types in SLP

  • Is used to match the requests and the services
  • Abstract service type defines the basic type
  • Subclasses are used to refine the abstract type to concrete type
  • Service template defines the format how the access to this type of service is transmitted
  • For each service type there a service template that defines how to interpret the rest of the message

Service templates

  • The actual format for accessing service and show the parameters.
  • e.g. defines the url path of service URL
  • Has five parts
    • 1 Template type defines the service type this template is for template-type=service type.NamingAuthority template-type=printer
    • 2 Template version * version of template template-version=0.0
  • 3 Description of template
    • * Human readable description of service template-description = This service lets you print everything
  • 4 template url syntax
    • The actual format of url path using augmented backus naur form (ABNF)
template-url-syntax = url path
url path=";ports=" list of ports
list of ports = port /port "," list of ports
port = 1*DIGIT
  * if no url path is not used then
template-url-syntax = url path= ;
  • 5. specification of attributes
    • defines the attributes that for the service type.
    • includes name of attribute, type of attribute, human readable block
writeable= boolean X
#whether the disk service is readonly or not
maxlinelenght=integer 80
#what is the maximum size per line of text to be stored
  • The fields are separated with an empty line

Example template

template-type = printer:raw-tcp
template-version = 1.0
template-description =
 The printer:raw-tcp: URL describes a transparent bidirectional communication channel for printing. Print data, status, messages, 
 etc is written or read by opening a TCP connection to the port in the service URL. How data is formatted and sent across the 
 connection is decided by the printing client and the printer service and is not defined by this template.
url-path = ippurl / lprurl / raw-tcp-url

; This template adds 'raw-tcp-url' to the url-path

; definition in the 'printer' service template.
; 'ippurl' and 'lprurl' as defined in the 'printer'
; service template.
raw-tcp-url = "raw-tcp://" hostport
; raw-tcp URLs don't have a path section.
hostport = host ":" port
; raw-tcp doesn't have a well-known port assigned by
; IANA. The port must therefor be specified in all
; raw-tcp URLs.
; 'host' and 'port' is as defined in the 'printer'
; service template.
ieee-1284-device-id = STRING L O

Bluetooth SDP

  • Search services on Bluetooth communication area
  • List of services offered by devices are stored in service records
    • Service records are maintained by SDP server
    • Only one SDP server per device
  • Services catergorised in classes
    • Describes the broader category general e.g. printer, color printer, …
    • Uniqely identified by 128-bit UUID
    • Service may be member of multiple classes
    • Profiles have their own classes
  • Service attributes define service characteristics

General discovery process

  • 1st inquiry to find devices in proximity
    • Not neccesary if services are requested from a single specific device
  • Then connection for each device id formed to request services
    • SearchServiceRequest
      • Find the service of interest
      • ServiceSearchResponse give the record of searched
    • ServiceAttributeRequest
      • Find the service with certain attributes
    • ServiceSearchAttributeRequest
      • Combines the aforementioned tasks

Service attributes

  • Describe essential characteristics of service
    • Attribute - 16bit unsigned interger
    • Attribute value - several data types supported
  • 2 essential attributes
    1. ServiceRecordhandle
      • Uniquely identifies the service on given device
    2. Service ClassIDList
      • List of class identifiers that the service belongs
      • Starts with most relevant

Other attributes

  • Defined for specific service classes
  • ServiceID is globally Unique identifier for service (UUID)
  • ProtocolDescriptorList
    • Defines the set of protocols to use for accessing the service
    • Important protocol parameters also provided

SDPTOOL on Linux

  • SDP → App conducting Bluetooth type service discovery
  • Searching a service
    • sdptool search OPUSH
  • Browse services
    • sdptool browse
    • Browses what services are around - can be targeted to certain device
      • sdptool browse bdaddr
Last modified: 2014/02/03 21:10