RFC for enablement of slpd on openbmc

Patrick Williams patrick at stwcx.xyz
Thu Oct 20 08:32:22 AEDT 2016

On Wed, Oct 19, 2016 at 11:19:26PM +0530, Ratan Gupta wrote:
> *Enabling SLP Server on openBMC*
> What is SLP
> =======
> Service Location Protocol (SLP) is a protocol that provides a framework 
> to allow networking applications to discover the existence, location, 
> and configuration of networked services in enterprise networks.
> openSLP is widely accepted in the industry

What are the aspects of SLP that are requirements for the intended
use-case?  SLP as a protocol has both direct query and an optional
"directory" implementation that aggregates SLP results.  In your
experience is that necessary or used?

What is the anticipated size footprint of using openSLP?  The RFC
doesn't seem that significant, so if we do not need the directory aspect
might it be more beneficial to write a small daemon ourself to give SLP
responses rather than trying to mold openSLP to fit our needs?

I'm certainly not advocating avoiding using existing open source.  But,
with there not being an update to openSLP since 2013 and all the aspects
we are going to have to work around below, I'm wondering on the benefit.

> What do we need to do?
> ==============
> 1) Bring SLP(OpenSLP) in image:- Write the bitbake recipe(didn't find 
> the readily available bitbake recipe)
> 2) Configure the services through Settings daemon.

We do have a .bbclass for "registration" we need to ensure that this is
utilized for SLP as much as possible.

> 3) Write the .service file as it needs to start after network is 
> up(after networkd-online.target)

This service file is for the openslp daemon, correct?

> How to configure the services which needs to be registered with slpd
> ============================================
> Option 1:- settingsd
> Note: Gives the flexibility to change the configured services @ runtime. 
> Do we require this functionality?
> Option 2:conf file for discovery services
> Note: During build time we can get the service info(service-name,port) 
> from the existing infra(discoveryservice.bbclass)

I don't entirely understand how these aren't phases of the same

The problem space as I see it:
    1. An application provides a service to be advertised by SLP.
    2. The application is currently started via a .service or a .socket
            a. Some services are always running.
            b. Some services use socket-activation.
    3. We need to register this service with the SLP daemon, somehow.

Do we need to ensure the application is running (or available to run via
socket activation) before we do the registration?  If the application is
being restarted should we remove the registration and add it back after
it comes back?

You mentioned dealing with IP address changes.  It is pretty annoying
that openSLP doesn't do this for you (a custom daemon could).  How are
you handling multiple network interfaces?  How to we flag internal vs 
external interfaces?  Isn't there a mechanism via systemd (or networkd) to
identify when the ip address changes?  Ideally, this would be a restart
of a .service.

I could see us building a very small application that performs three
    1. slp-register register <service>
    2. slp-register deregister <service>
    3. slp-register ip-change

For each registered service "foo.service", we can generate
foo-slp-register.service.  The foo-slp-register.service will depend on
foo.service, so it is started immediately after and stopped when the
foo.service is stopped.  The 'start' will be to call 'slp-register
register'  and the 'stop' will be to call 'slp-register deregister'.

We also can then keep off of something in systemd / networkd to run 
'slp-register ip-change' whenever the IP changes.  This could either
restart *-slp-register.service or it could extract all of the SLP
registrations and update them with new IP addresses.  Putting all of the
*-slp-register.service into a 'target' might make restarting them very

With this approach we do not need a long running application.

> How to register the services
> ==================
> 1) Static Registration:- will not work as we need ip/host-name details 
> which we don't have @build time.

It is unfortunate about this.  We can solve this with a custom

> 2) Application(new DBUS app) will register the configured services to 
> the slpd on startup.

I am not understanding what the 'dbus app' aspect of this would be.
What would be the dbus interfaces?

> We need to provide the dynamic registration support on BMC as IP of BMC 
> can change any time.  Registration of services with slpd takes the URL 
> of the service which includes ip and port of the service which needs to 
> be registered.
> Create a DBUS service application
> =====================
> 1) Once the service starts it registers the configured services with slpd.
> 2) listening on RTNETLINK event for ip change: raise a dbus signal(for 
> the IP change)

Who is getting this signal?

>       if there is IP change then dereg the old service followed by reg 
> service as the ip has changed.
> Regards
> Ratan Gupta
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20161019/3b7c84f4/attachment.sig>

More information about the openbmc mailing list