RFC 2926

Conversion of LDAP Schemas to and from SLP Templates

πŸ“… published September 2000, from ietf

RFC 2926: Conversion of LDAP Schemas to and from SLP Templates ✨

Okay bestie, this one is all about making two protocol worlds talk to each other 🫢 It's RFC 2926, titled Conversion of LDAP Schemas to and from SLP Templates. Here's the title block tea:

  • Category: Informational πŸ“š
  • Date: September 2000 πŸ—“οΈ
  • Stream: Network Working Group
  • Authors: J. Kempf (Sun Microsystems, Inc.), R. Moats (Coreon, Inc.), and P. St. Pierre (Sun Microsystems, Inc.) πŸ‘©β€πŸ’»
  • Obsoletes / Updates: the title block doesn't list any RFCs it obsoletes or updates πŸ™ˆ

Status of This Memo πŸ“œ

This memo is informational, so it's giving "here's some info for the Internet community" and not "this is an Internet standard" πŸ’… It doesn't specify a standard of any kind, and distribution of it is unlimited 🌈

Copyright (C) The Internet Society (2000). All Rights Reserved.

Abstract πŸ¦‹

Okay so this doc is all about mapping between Service Location Protocol (SLP) service advertisements and lightweight directory access protocol (LDAP) descriptions of services πŸŽ€ It covers two big vibes.

The first one is mapping between SLP service type templates and LDAP directory schema. SLP template grammar is pretty simple, so going from templates to LDAP types is super straightforward πŸ’– Going the other way is also straightforward, as long as the attributes only use a few of the syntaxes defined in RFC 2252. If arbitrary ASN.1 types show up in the schema, though, it gets way more complex and might even be impossible 😭

The second one is how service info gets represented in an LDAP directory. The recommended representation makes interop with SLP so much easier, because SLP directory agents can backend into LDAP directory servers 🧚 Service advertisements can then propagate easily between SLP and LDAP, and that's honestly iconic πŸ‘‘

Table of Contents πŸ—‚οΈ

   1.0 Introduction ................................................  2
   2.0 Mapping SLP Templates to LDAP Schema ........................  3
     2.1 Mapping from SLP Attribute Types to LDAP Attribute Types ..  8
       2.1.1 Integer ...............................................  8
       2.1.2 String ................................................  8
       2.1.3 Boolean ...............................................  9
       2.1.4 Opaque ................................................  9
     2.2 Keyword Attributes ........................................  9
     2.3 Template Flags ............................................  9
       2.3.1 Multi-valued ..........................................  9
       2.3.2 Optional .............................................. 10
       2.3.3 Literal ............................................... 10
       2.3.4 Explicit Matching ..................................... 10
     2.4 Default and Allowed Value Lists ........................... 10
     2.5 Descriptive Text .......................................... 11
     2.6 Generating LDAP Attribute OIDs ............................ 11
     2.7 Example ................................................... 11
   3.0 Attribute Name Conflicts .................................... 15
   4.0 Mapping from Schema to Templates ............................ 15
     4.1 Mapping LDAP Attribute Types to SLP Attribute Types ....... 16
     4.2 Mapping ASN.1 Types to SLP Types .......................... 17
       4.2.1 Integer ............................................... 18
       4.2.2 Boolean ............................................... 18
       4.2.3 Enumerated ............................................ 18
       4.2.4 Object Identifier ..................................... 19
       4.2.5 Octet String .......................................... 19
       4.2.6 Real .................................................. 19
     4.3 Example ASN.1 Schema ...................................... 19
   5.0 Representing SLP Service Advertisements in an LDAP DIT ...... 22
   6.0 Internationalization Considerations ......................... 24
   7.0 Security Considerations ..................................... 24
   8.0 References .................................................. 25
   9.0 Authors' Addresses .......................................... 26
   10.0 Full Copyright Statement ................................... 27

1.0 Introduction 🌸

So SLP templates [1] are meant to be a simple encoding of the syntax and semantic conventions for individual service types, their attributes, and their conventions πŸ’… They're easy to generate, easy to send, readable by humans, and easy for programs to parse, because it's a string-based syntax with required comments. Directory schemas formalize directory entry structures for use with LDAP [2]. These directories store info about lots of entity types, and network services are one of them πŸ–₯️

Interop between SLP and LDAP matters a lot, because clients on one protocol should get to benefit from services registered through the other 🫢 On top of that, LDAP directory servers can act as the backend for SLP directory agents (DAs), if interoperability is possible. To make that happen, this doc creates mappings between the SLP template grammar and LDAP directory schema, and sets up some conventions for representing service advertisements in LDAP directories πŸ¦‹ The goal is to let SLPv2 queries (which are syntactically and semantically equivalent to LDAPv3 string queries [7]) get submitted to an LDAP directory server by an SLP DA backed into LDAP, without the DA having to do a ton of processing 🧚

The notation is simple, and SLP templates' syntactic and semantic attribute capabilities map easily into directory schemas. They can even be converted by automated tools, which is so efficient πŸ€– The reverse might not be true. If the LDAP schema has attributes with unrecognized or complex syntaxes, the translation might be difficult or impossible 😭 But if the LDAP schema only uses a few of the common syntaxes defined in RFC 2252 [8], the translation is more straightforward ✨ Also, for full bidirectionality, the mapping must follow a very specific representation in its DESC attributes πŸ’œ

This doc lays out the correct mappings from SLP templates into the syntactic representation that RFC 2252 [8] specifies for LDAP directory schema. That syntax is a subset of the ASN.1/BER described in the X.209 specification [9], and it's what the LDAPv3 [2] directory schema uses πŸ‘‘ It also proposes rules and guidelines for consistently mapping ASN.1-based schemas that get translated into the SLP template grammar. Finally, it proposes a way to represent service advertisements in LDAP directory services that makes SLP interop work πŸŽ€

Except when used as elements in the definition of LDAP schemas, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [16]. 🧐

2.0 Mapping SLP Templates to LDAP Schema ✨

Okay bestie, so we start with this abstract object class 🧚 It's the parent of every service, and any specific service type is a subclass of it with its own attributes:

   ( 1.3.6.1.4.1.6252.2.27.6.2.1
     NAME 'slpService'
     DESC 'parent superclass for SLP services'
     ABSTRACT
     SUP top
     MUST  ( template-major-version-number $
             template-minor-version-number $
             description $
             template-url-syntax $
             service-advert-service-type $
             service-advert-scopes )
     MAY   ( service-advert-url-authenticator $
             service-advert-attribute-authenticator ) )

The attributes line up with the parts of the SLP service template and the SLP service advertisement πŸ’…

SLP service type templates start with four definitions that set the context of the template πŸŽ€

  • template-type: This defines the service type of the template. The service type can be a simple service type, like "service:ftp", an abstract service type, like "service:printer", or a concrete service type, like "service:printer:lpr". The type name can also include a naming authority, for example "service:printer.sun:local". The name in this field leaves off the "service:" prefix.
  • template-version: A string containing a major and minor version number, separated by a period.
  • template-description: A block of human readable text describing what the service type does.
  • template-url-syntax: An ABNF [6] grammar describing the service type specific part of the service URL.

The SLP template-type definition gets used as the name of the LDAP object class for the template. That class is a subclass of the "slpService" class, and the name comes with the "service" prefix to show it's for a service πŸ¦‹ When translating the service type name, colons and the period that separates the naming authority get turned into hyphens. If the template defines a concrete SLP type, the concrete type name is the one used. The abstract type name is never used. For example, the template for "service:printer:lpr" becomes an LDAP object class called service-printer-lpr. If the type name has a naming authority, that naming authority name has to be included too. So "service:printer.sun:local" becomes service-printer-sun-local. The LDAP object class is always STRUCTURAL 🌸

The template-version definition gets split into two attributes, template-major-version-number and template-minor-version-number. Here's the LDAP definition for those:

   ( 1.3.6.1.4.1.6252.2.27.6.1.1
     NAME 'template-major-version-number'
     DESC 'The major version number of the service type template'
     EQUALITY integerMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
     SINGLE-VALUE
   )

   ( 1.3.6.1.4.1.6252.2.27.6.1.2
     NAME 'template-minor-version-number'
     DESC 'The minor version number of the service type template'
     EQUALITY integerMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
     SINGLE-VALUE
   )

The template-url-syntax definition in the SLP template is described by this attribute πŸ“

   ( 1.3.6.1.4.1.6252.2.27.6.1.3
     NAME 'template-url-syntax'
     DESC 'An ABNF grammar describing the service type
           specific part of the service URL'
     EQUALITY caseExactIA5Match
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
     SINGLE-VALUE
   )

The template-description attribute gets translated into the X.520 standard attribute "description" [3] ✨

We also set up a convention for SLP template characteristics that can't be translated into LDAP. Those go into the DESC field of the object class definition 🫢 The items are separated by empty lines (two "LINE FEED" characters), each one is preceded by a LINE FEED character, and each one is tagged at the beginning of the line to show what it represents. That way the template can be rebuilt from the schema by parsing those comments properly.

The bulk of an SLP template is attribute definitions. Each SLP template attribute definition has four items that need mapping into LDAP πŸ’–

  • Attribute Name: SLPv2 attribute names are defined to be compatible with LDAPv3, so SLP attributes map straight into LDAP attributes with no change. The same goes the other way, so LDAP attributes map directly to SLP attributes.
  • Attribute Type: The SLP attribute type gets mapped into the LDAP attribute type.
  • Attribute Flags: The SLP attribute flags get mapped into characteristics of the LDAP attribute definition. If there's no equivalent LDAP characteristic, they go into the DESC field instead.
  • Default and Allowed Values: These must be handled by the client or by a DA that's enabled to handle templates, just like in SLP. For reference, though, they should be included in the DESC field of the LDAP attribute definition.
  • Descriptive Text: The SLP template descriptive text should be mapped into the DESC field.

We go through the mapping of types, flags, default and allowed values, and descriptive text in the subsections below 🌈

OIDs for SLP template conversion schema elements are standardized under the SrvLoc.Org enterprise number (6252) [18] πŸ‘‘

We also define two standardized LDAP syntaxes and attributes, with standardized OIDs, for representing an SLP entry πŸ¦‹

   ( 1.3.6.1.4.1.6252.2.27.6.2.2
     DESC 'SLP Service Type'
   )

This defines the syntax for the service type name. The syntax comes from the BNF for the service URL in RFC 2609 Section 2.1 [1].

   ( 1.3.6.1.4.1.6252.2.27.6.2.3
     DESC 'SLP Scope'
   )

This defines the syntax for the scope name. The syntax comes from the BNF for scope names in RFC 2608 Section 6.4.1 [5].

   ( 1.3.6.1.4.1.6252.2.27.6.1.4
     NAME 'service-advert-service-type'
     DESC 'The service type of the service advertisement, including
           the "service:" prefix.'
     EQUALITY caseExactIA5Match
     SYNTAX 1.3.6.1.4.1.6252.2.27.6.2.2
     SINGLE-VALUE
   )

This defines an attribute for the service type name.

   ( 1.3.6.1.4.1.6252.2.27.6.1.5
     NAME 'service-advert-scopes'
     DESC 'A list of scopes for a service advertisement.'
     EQUALITY caseExactIA5Match
     SYNTAX 1.3.6.1.4.1.6252.2.27.6.2.3
   )

This defines a multivalued attribute for the scopes.

Searching for abstract types can be done with an LDAP query that wildcards the concrete type. For example, you can look up every service advertisement of the printer abstract type with this query πŸ”

      (service-advert-service-type=service:printer:*)

SLP says that service URLs and attribute lists can come with a structured authenticator. That's a digital signature plus the info needed to verify it. One syntax and two standardized SLP attributes are defined for this πŸ”

   ( 1.3.6.1.4.1.6252.2.27.6.2.3 DESC 'SLP Authenticator')

The syntax of an SLP authenticator is the bytes of the authenticator in network byte order, see RFC 2608, Section 9.2 [5].

   ( 1.3.6.1.4.1.6252.2.27.6.1.6
     NAME 'service-advert-url-authenticator'
     DESC 'The authenticator for the URL, null if none.'
     SYNTAX 1.3.6.1.4.1.6252.2.27.6.2.3
     SINGLE-VALUE
   )

This attribute holds the SLP URL authenticator, as defined in RFC 2608, Section 9.2 [5].

   ( 1.3.6.1.4.1.6252.2.27.6.1.7
     NAME 'service-advert-attribute-authenticator'
     DESC 'The authenticator for the attribute list, null if none.'
     SYNTAX 1.3.6.1.4.1.6252.2.27.6.2.3
     SINGLE_VALUE
   )

This attribute holds the SLP attribute authenticator, as defined in RFC 2608, Section 9.2 [5].


2.1 Mapping from SLP Attribute Types to LDAP Attribute Types πŸŽ€

Here's how SLP attribute types map to LDAP:

   SLP Type    ASN.1 Type               LDAP Type
   ---------------------------------------------------
    Integer     INTEGER              INTEGER
    String      DirectoryString      Directory String
    Boolean     BOOLEAN              Boolean
    Opaque      OCTET STRING         Octet String
    Keyword     (N/A)                IA5 String

The subsections below go into more detail on the mapping πŸ’…

2.1.1 Integer

SLP integers compare as integers when you run a query, and LDAP integers act pretty similarly 🧚 So the SLP integer type maps to LDAP INTEGER, using the integerMatch matching rule.

2.1.2 String

SLP strings are encoded the way the SLP protocol specification describes [5]. All value strings are treated as case insensitive for matching operations. SLP strings aren't null terminated, and they're encoded in UTF-8 πŸ’–

SLP strings map to the LDAP Directory String type. Directory String lines up exactly with the SLP string type, meaning it's a non-null terminated UTF-8 string. For comparing string attribute values, the caseIgnoreMatch equality rule, the caseIgnoreOrderingMatch ordering rule, and the caseIgnoreSubstringsMatch substring rule are used 🌈

2.1.3 Boolean

Boolean attributes can have one of two values. In SLP those values are written as strings, TRUE and FALSE. Case doesn't matter in SLP's string encoding of a boolean value πŸ¦‹

The SLP Boolean type maps directly to an LDAP BOOLEAN. The caseIgnoreMatch rule is used for equality matching ✨

2.1.4 Opaque

SLP attribute values of type Opaque are represented as OCTET STRING in LDAP, and the octetStringMatch matching rule is used to compare them πŸ”₯

2.2 Keyword Attributes 🌸

SLP service type templates let you define keyword attributes. A keyword attribute's only characteristic is that it's present. Keyword attributes don't have flag information, and they don't have default or allowed values either, since by definition they don't have any values πŸ™ˆ

ASN.1 has no concept of keyword attributes. So keyword attributes get translated into a "May" clause in the ASN.1 class definition for the service type. If the keyword attribute is present, its value doesn't matter, but for consistency we make it just the NUL character, "\00" πŸ“

2.3 Template Flags πŸ’œ

SLP template flags can be handled the way the following subsections describe πŸŽ€

2.3.1 Multi-valued

Multi-valued attributes get defined in an SLP template using the one value. All values for a given attribute must be of the same type 🫢

LDAP attribute definitions require a single valued attribute to include the SINGLE-VALUE tag. Otherwise, the attribute is assumed to be multivalued by default πŸ’…

2.3.2 Optional

SLP uses the 'O' flag to show an attribute may or may not be present ✨ These optional attributes get defined using the "May" clause in the ASN.1 class definition for the service type. All other attributes must be defined as a "Must" πŸ‘‘

2.3.3 Literal

ASN.1 doesn't have a way to say that an attribute's values shouldn't be translated from one language to another, mostly because ASN.1 schemas aren't usually translated πŸ₯Ί So this flag gets dropped when a template is translated. The presence of the flag should still be noted in the DESC field, on its own line and tagged with Literal:, so the template can be rebuilt from the schema 🌈

2.3.4 Explicit Matching πŸ’…

okay so the SLP template syntax has this flag, X, that says an attribute must be present for a query to be properly satisfied πŸ‘€. BUT there's no provision for requiring particular attributes in a query at all πŸ’€. So when we translate a template, we drop the flag. It's kinda sad, but the presence of the flag still needs to be noted in the DESC field πŸ“. Put it on its own line, tagged with Explicit:, so the template can be rebuilt from the schema later ✨.

2.4 Default and Allowed Value Lists πŸŽ€

The SLP template grammar lets you define default and allowed values for an attribute ✨. The SLP protocol doesn't enforce these restrictions on registered attributes, though πŸ™ƒ. Client side apps can use the defaults and allowed values, or a DA can use them to initialize registrations that have no attributes and to limit attribute values to the template's allowed values 🫢.

LDAP servers don't support default and allowed values on attributes either 😭. So enforcement is left up to the clients, or to the DA if the DA is backending into LDAP. The default and allowed values should be included in the DESC field. Put the comments on separate lines and label them with the Default: and Allowed: tags so the template can be reconstructed 🧚.

2.5 Descriptive Text 🌸

The descriptive text for an attribute definition should be included in the DESC field. It should start on a separate line and begin with the Description: tag πŸ’œ.

2.6 Generating LDAP Attribute OIDs πŸ”’

LDAP attributes need an OID. There's generally no a priori way to define an algorithm for generating OIDs, because it depends on the conventions used by the organization developing the template πŸ€·β€β™€οΈ. In some cases, an organization's OID procedure is regular enough that a template developer can algorithmically generate OIDs off of an assigned root 🌈. Whatever method is used, the template developer should make sure unique OIDs are assigned to each SLP attribute that gets translated into an LDAP attribute πŸ”‘.

2.7 Example πŸ¦‹

The template included below is a hypothetical abstract printer service template, similar to the one described in [10] πŸ–¨οΈ.

      template-type = printer

      template-version = 0.0

      template-description =
      The printer service template describes the attributes supported by
      network printing devices.  Devices may be either directly
      connected to a network, or connected to a printer spooler that
      understands the a network queuing protocol such as IPP, lpr or the
      Salutation  Architecture.

      template-url-syntax =
      ;The URL syntax is specific to the printing protocol being
      ;employed

      description = STRING
      # This attribute is a free form string that can contain any
      # site-specific descriptive information about this printer.

      printer-security-mechanisms-supported = STRING L M
      none
      # This attribute indicates the security mechanisms supported
      tls, ssl, http-basic, http-digest, none
      printer-operator = STRING O L M
      # A person, or persons responsible for maintaining a
      # printer on a day-to-day basis, including such tasks
      # as filling empty media trays, emptying full output
      # trays, replacing toner cartridges, clearing simple
      # paper jams, etc.

      printer-location-address = STRING O
      # Physical/Postal address for this device.  Useful for
      # nailing down a group of printers in a very large corporate
      # network.  For example: 960 Main Street, San Jose, CA 95130

      printer-priority-queue = BOOLEAN O
      FALSE
      # TRUE indicates this printer or print queue is a priority
      # queuing device.

      printer-number-up = INTEGER O
      1
      # This job attribute specifies the number of source
      # page-images to impose upon a single side of an instance
      # of a selected medium.
      1, 2, 4

      printer-paper-output = STRING M L O
      standard
      # This attribute describes the mode in which pages output
      # are arranged.

      standard, noncollated sort, collated sort, stack, unknown

We assume that the concrete type "service:printer:lpr" for printers that speak the LPR protocol [4] has the following template definition πŸ§ƒ:

      template-type = printer:lpr

      template-version = 0.0

      template-description =
      The printer:lpr service template describes the attributes
      supported by network printing devices that speak the
      LPR protocol. No new attributes are included.

      template-url-syntax = queue
      queue = ;The queue name, see RFC 1179.

The LDAP class definition for the "service:printer:lpr" concrete service type is translated as follows πŸͺ„:

   ( ---place the assigned OID here---
     NAME  'service-printer-lpr'
     DESC  'Description: The printer:lpr service template
                 describes the attributes supported by network printing
                 devices that speak the LPR protocol. No new attributes
                 are included.

            URL Syntax: queue
                 queue = ;The queue name, see RFC 1179.'
     SUP   slpService
     MUST  ( description $ security-mechanisms-supported $
     labeledURI)
     MAY   ( operator $ location-address $ priority-queue $
             number-up $ paper-output)
   )

The attribute definitions are translated as follows πŸ’–:

   ( ---place the assigned OID here---
     NAME 'printer-security-mechanisms-supported'
     DESC 'Description: This attribute indicates the security mechanisms
           supported.

           Default: value

           Allowed: tls, ssl, http-basic, http-digest, none

           Literal:'
     EQUALITY caseIgnoreMatch
     ORDERING caseIgnoreOrderingMatch
     SUBSTR caseIgnoreSubstringsMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
   )

   ( ---place the assigned OID here---
     NAME 'printer-operator'
     DESC 'Description: A person, or persons responsible for
           maintaining a printer on a day-to-day basis, including
           such tasks as filling empty media trays, emptying full
           output trays, replacing toner cartridges, clearing simple
           paper jams, etc.

           Literal:'
     EQUALITY caseIgnoreMatch
     ORDERING caseIgnoreOrderingMatch
     SUBSTR caseIgnoreSubstringsMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
   )

   ( --place the assigned OID here---
     NAME 'printer-location-address'
     DESC 'Description Physical/Postal address for this device.
           Useful for nailing down a group of printers in a very
           large corporate network.  For example: 960 Main Street,
           San Jose, CA 95130.'
     EQUALITY caseIgnoreMatch
     ORDERING caseIgnoreOrderingMatch
     SUBSTR caseIgnoreSubstringsMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
     SINGLE-VALUE
   )

   ( ---place the assigned OID here---
     NAME 'printer-priority-queue'
     DESC 'Description: TRUE indicates this printer or print
          queue is a priority queuing device.'
     EQUALITY booleanMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
     SINGLE-VALUE
   )

   ( ---place the assigned OID here---
     NAME 'printer-number-up'
     DESC 'Description: This job attribute specifies the number
           of source page-images to impose upon a single side of
           an instance of a selected medium. This attribute is
           INTEGER.

           Default: 1

           Allowed: 1, 2, 3, 4'
     EQUALITY integerMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
     SINGLE-VALUE
   )
   ( ---place the assigned OID here---
     NAME 'printer-paper-output'
     DESC 'Description: This attribute describes the mode in
           which pages output are arranged. Default value is
           standard.

           Default: standard

           Allowed: standard, noncollated sort, collated sort,
             stack, unknown.
           Literal:'
     EQUALITY caseIgnoreMatch
     ORDERING caseIgnoreOrderingMatch
     SUBSTR caseIgnoreSubstringsMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
   )

3.0 Attribute Name Conflicts πŸ’₯

LDAP has a flat name space, and attribute names and OIDs must be unique in a directory server πŸ—‚οΈ. To avoid name conflicts when translating SLP templates to LDAP schemas, template developers may want to consider prepending the name of the service type to the attribute. Post-processing attribute names to make them unique isn't possible, because it would mean the DA has to rewrite queries before submitting them to the directory server πŸ™…β€β™€οΈ. Developers should also use standard LDAP attributes whenever those are available ⭐.

In the above example template, the abstract type name "printer" is prepended to attributes to avoid conflicts πŸ–¨οΈ. The standard "description" attribute defined by X.520 [3] is used to translate the template description attribute 🫢.

4.0 Mapping from Schema to Templates πŸͺž

The reverse mapping from LDAP schema to SLP service type templates means dealing with both LDAP and ASN.1 data types 🧠. RFC 2252 defines 33 attribute syntaxes that should be supported by LDAP directory servers. These syntaxes are defined using BNF for strings, or using ASN.1 for binary valued attributes defined by X.520 πŸ“œ.

Mapping LDAP data types into SLP template types is fairly straightforward πŸ“. Mapping arbitrary ASN.1 data types is somewhat more complicated, though, and requires encoding the ASN.1 data type into a string. To a certain extent this masks the ASN.1 data type, because it becomes impossible to tell apart a native string with content equivalent to an encoded ASN.1 string πŸ™ˆ. However, including the ASN.1 data type in the comment provides extra information, in case a reverse transformation from SLP to ASN.1 is ever required πŸ”.

The following subsections deal with both LDAP and ASN.1 attribute data type mappings πŸŽ€.

4.1 Mapping LDAP Attribute Syntaxes to SLP Attribute Types ✨

okay so here's the cheat sheet for which SLP data type each LDAP syntax lands on 🧚 some of them are NA, which means there's no SLP match for those, so they're not in the mapping πŸ™ˆ

     LDAP Type                              SLP Type
  --------------------------------------------------------
     ACI Item                                 NA
     Access Point                             NA
     Attribute Type Description               NA
     Audio                                    Opaque
     Binary                                   ASN.1 escape
     Bit String                               String
     Boolean                                  Boolean
     Certificate                              Opaque
     Certificate List                         Opaque
     Certificate Pair                         Opaque
     Country String                           String
     DN                                       String
     Data Quality Syntax                      NA
     Delivery Method                          NA
     Directory String                         String
     DIT Content Rule Description             NA
     DIT Structure Rule Description           NA
     DL Submit Permission                     NA
     DSA Quality Syntax                       NA
     Enhanced Guide                           NA
     Facsimile Telephone Number               String
     Fax                                      Opaque
     Generalized Time                         String
     Guide                                    NA
     IA5 String                               String
     INTEGER                                  Integer
     JPEG                                     Opaque
     LDAP Syntax Description                  NA
     LDAP Schema Definition                   NA
     LDAP Schema Description                  NA
     Master and Shadow Access Points          NA
     Matching Rule Description                NA
     Matching Rule Use Description            NA
     Mail Preference                          NA
     MHS OR Address                           String
     Modify Rights                            NA
     Name and Optional UID                    NA
     Name Form Description                    NA
     Numeric String                           String
     Object Class Description                 NA
     Octet String                             Opaque
     OID                                      String
     Other Mailbox                            String
     Postal Address                           String
     Protocol Information                     NA
     Presentation Address                     String
     Printable String                         String
     Substring Assertion                      NA
     Subtree Specification                    NA
     Supplier Information                     NA
     Supplier or Consumer                     NA
     Supplier And Consumer                    NA
     Supported Algorithm                      NA
     DSE Type                                 NA
     Telephone Number                         String
     Teletex Terminal Identifier              String
     Telex Number                             String
     UTC Time                                 String

4.2 Mapping ASN.1 Types to SLP Types πŸ’…

ASN.1 is lowkey SO much richer than SLP, like it has way more data types going on 😭 so a complete list just isn't possible here. instead, here's a sample of some ASN.1 types and their closest SLP buddies πŸ¦‹

ASN.1 type               SLP type
-----------------------------------------
INTEGER                  Integer
BOOLEAN                  Boolean
ENUMERATED               String
OBJECT IDENTIFIER        String
OCTET STRING             Opaque
REAL                     String

any data type that doesn't map directly to an SLP type should be defined as either a String or an Opaque. ASN.1 types that can only contain characters that are valid for Strings (as defined in X.680 [9]) should be encoded as strings. ASN.1 types like GraphicString, which switch their character set partway through a value, should not be encoded as strings. if you really need one of those, use the SLP Opaque type instead 🫢 either way, the first line of the help text is used to note the original ASN.1 data type, so nobody gets confused later πŸŽ€

the following subsections walk through converting ASN.1 BER [9] to the SLP template for each type in the table above 🌸

4.2.1 Integer

both SLP templates and ASN.1 support Integers, so it's a one to one mapping between an SLP Integer attribute and an ASN.1 Integer attribute πŸ“ the details on how integers are encoded are summed up in the SLP template to ASN.1 section above ✨

4.2.2 Boolean

booleans are supported by both SLP and ASN.1, but their on-the-wire encodings are different πŸ‘€ X.680 [9] specifies zero and non-zero encoding for booleans, while SLP encodes booleans using the strings TRUE and FALSE πŸ’œ most LDAP servers use the LDAP Boolean type, which is a string, so again the ASN.1 type should be recorded in the comment or it gets lost 😭

4.2.3 Enumerated

SLP templates handle enumerations by listing the allowed values in the attribute definition πŸ’– these enumerations aren't strictly binding on clients or DAs, but they're kinda similar to ASN.1 enumerations. BER encodes an ASN.1 enumeration by sending the number of the element's position in the enumeration, which means both sides need to know the specific enumeration before they can decode its value πŸ™ƒ SLP doesn't give any special support for sending enumerations. they're just String types, and the ASN.1 type and encoding info for the enumeration values goes in the comment 🌈

example time πŸŽ€

color-supported = STRING   M
none
# ASN.1: Enumeration.
# ASN.1 Mapping: none = 0, highlight = 1, three color = 2,
#   four color = 4, monochromatic = 5
#This attribute specifies whether the Printer supports
# color and, if so, what type.
none,highlight,three color,four color,monochromatic

4.2.4 Object Identifier

object identifiers (OIDs) are super common in the ASN.1 world for identifying objects and attributes πŸ”₯ an OID is a numerical version of an element's spot in the naming hierarchy. every element at a given level of a hierarchy gets a unique number within that level 🌸 for example, the naming tree for SNMP MIBs goes iso(1) org(3) dod(6) internet(1) mgmt(2) mib(1), and that gets written as the string "1.3.6.1.2.1" 🧚

because it boils down to a string of dot separated numbers, it maps easily to the SLP String type πŸ’… the help text for this element should say it's an ASN.1 OID 🫢

identifier = STRING
# ASN.1: OID
# The object identifier for this SNMP agent.

4.2.5 Octet String

an ASN.1 octet string should be mapped to an Opaque in an SLP template πŸ¦‹ an octet string is a sequence of bytes, and an Opaque is a string that encodes a sequence of bytes, so they're a good match πŸ’œ once again, the ASN.1 type gets lost unless it's recorded in the comment, so don't forget that 😭

4.2.6 Real

there's no direct mapping between floating point numbers and any SLP data types πŸ™ˆ so attributes with the ASN.1 type Real get mapped to the SLP type String instead πŸ“ comments are added to the attribute help text saying the value was originally an ASN.1 real. for example 🌈

weight = STRING
# ASN.1: Real
# The objects weight in pounds.

4.3 Example ASN.1 Schema

Okay bestie, here's an example schema for an exported filesystem πŸ’Ύ It's shown in ASN.1 first, and the SLP template translation comes right after. Heads up: the template doesn't capture the actual attribute format for the Set type. That part is the job of the LDAP client software doing the translation 🧚 Also, even though the class definition doesn't follow the conventions we set up earlier for SLP classes, it can still be translated into an SLP template. Slay, right? ✨ The syntax used in this example follows:

-- Abstraction of a fstab entry (a "mount").
-- These lookups would likely be performed by an
-- an automounter type application.
mount   OBJECT-CLASS ::= {
        SUBCLASS OF { top }
        MUST CONTAIN { mountHost |
                       mountDirectory |
                       mountType
                     }
        MAY CONTAIN { mountOption |
                      mountDumpFrequency |
                      mountPassNo
                    }
        ID { <oid1> }
}


- The mount host.
mountHost       ATTRIBUTE ::= {
                WITH SYNTAX caseIgnoreString
                EQUALITY MATCHING RULE caseIgnoreMatch
                SINGLE VALUE
                ID { <oid2> }
}


- The file system to mount.
mountDirectory  ATTRIBUTE ::= {
                WITH SYNTAX caseIgnoreString
                EQUALITY MATCHING RULE caseIgnoreMatch
                SINGLE VALUE
                ID { <oid3> }
}

- The type of file system being mounted.
mountType       ATTRIBUTE ::= {
                WITH SYNTAX INTEGER { ufs(1),
                                      hsfs(2),
                                      nfs(3),
                                      rfs(4)
                                    }
                EQUALITY MATCHING RULE integerMatch
                SINGLE VALUE
                ID { <oid4> }
}
- Options for the mount operation.
mountOption     ATTRIBUTE ::= {
                WITH SYNTAX caseIgnoreString
                EQUALITY MATCHING RULE caseIgnoreString
                ID { <oid5> }
}


- How often to dump the file system.
mountDumpFrequency      ATTRIBUTE :: = {
                        WITH SYNTAX  INTEGER (0..9)
                        EQUALITY MATCHING RULE integerMatch
                        SINGLE VALUE
                        ID { <oid6> }
}

- Boot time mount pass number.
mountPassNo     ATTRIBUTE ::= {
                WITH SYNTAX INTEGER
                EQUALITY MATCHING RULE integerMatch
                SINGLE VALUE
                ID { <oid7> }
}

The translated SLP template is:

template-type = mount

template-version = 1.0

template-description = "Describes a remote filesystem access
protocol"

template-url-syntax =
             filesystem   = 1*[ DIGIT / ALPHA ]
             urlpath = "/" filesystem

mountHost = STRING L
# ASN.1: Case Ignore String, Single Value
# The mount host

mountDirectory = STRING L
# ASN.1: Case Ignore String, Single Value
# The filesystem to mount
mountType = STRING L
ufs
# ASN.1: Enumeration, Single Value
# ASN.1 Mapping: ufs = 1, hsfs = 2, nfs = 3, rfs = 4
# The type of the filesystem being mounted
ufs, hsfs, nfs, rfs

mountOption = STRING M O L
# ASN.1: Case Ignore String
# mount options for this filesystem

mountDumpFrequency = INTEGER O
0
# ASN.1: Integer Range, Single Value
# How often to dump this filesystem
0, 1, 2, 3, 4, 5, 6, 7, 8, 9

mountPassNo = INTEGER O
# ASN.1: Integer, Single Value
# Boot time mount pass number

5.0 Representing SLP Service Advertisements in an LDAP DIT ✨

Okay so, besides translating between SLP templates and LDAP schema, there's another compatibility thing we need: how SLP service advertisements get represented in an LDAP DIT 🌸 A standard representation lets SLP DAs store service advertisements in LDAP, and lets LDAP clients query the DIT for those services. And if LDAP clients represent service info the same way, SLP clients get to enjoy the interoperability too 🫢

A service advertisement holds its service URL in a labeledURI attribute [11]. The labeledURI attribute in a service advertisement should only contain the service URL for the service, with no additional label. It is recommended that the labeledURI be used as the RDN for the service object in the DIT.

Service advertisements can live anywhere in the DIT, but it is recommended that all services be stored under a single common point, or root node, so searching in a domain is easy πŸ” That lets a client search for all advertisements of a particular service type, say, for all printers πŸ–¨οΈ The recommended parent entry is one named ou=service below the entry that represents the domain, as described in RFC 2247.

For example, a printer service with a labeledURI of service:lpr://printsrv/queue1 in the domain foobar.com, advertised in the LDAP server that holds the entry dc=foobar,dc=com, has this DN:

labeledURI=service:lpr://printsrv/queue1, ou=service, dc=foobar,dc=com

Yes, this leads to a flat space of service storage. But since SLP uses search filters from LDAP for searches, those filters can be used for one-level searches from the root node πŸ’…

Service advertisements in SLP also have a lease time attached πŸ’€ In LDAP servers that support the extensions for dynamic directory services [12], the service advertisement entry's objectClass should be extended with the dynamicObject class. That lets the advertisement time out within the LDAP directory server. If the LDAP directory server doesn't support the dynamic directory services extension, then the SLP agent has to handle the lease timeouts itself.

The following example shows how an advertisement with a simple service type gets represented. The advertisement (in conceptual form) for a printer is:

Service Type: service:lpr://printsrv/queue1
Scopes: eng,corp
Attributes:
  description = A general printer for all to use.
  security-mechanisms-supported = none
Authentication: none

The RDN of the object is labeledURI=service:lpr://printsrv/queue1, and the following LDAP search filter will return this object, along with any others of the service type service:lpr that match the other attributes:

(&(service-advert-service-type=service:lpr)
  (service-advert-scopes=eng)
  (service-advert-scopes=corp)
  (description=A general printer for all to use.)
  (security-mechanisms-supported=none))

The schema for service advertisements outlined in this section is mainly for SLP DAs that use LDAP as a backing store. But if LDAP agents register services using the same format, complete interoperability with SLP is achieved πŸŽ‰


6.0 Internationalization Considerations 🌈

SLP specifies that an RFC 1766 [13] language code comes with every service advertisement. Language codes for service advertisements in LDAP must be represented according to RFC 2596 [14].

RFC 2596 prohibits language codes in DNs. It also says that a directory server which doesn't support language codes must treat an attribute with a language code as an unrecognized attribute πŸ™ˆ According to RFC 2596, language codes get appended to attribute names with a semicolon (";"). For example, this attribute/value pair is in the German locale:

(address;lang-de=44 Bahnhofstrasse, 2365 Weibstadt, Deutschland)

An attribute with a language tag in a specific locale is treated as a separate attribute from attributes in other locales. Keep that in mind, bestie πŸ¦‹

If the service advertisement is in the default SLP locale (en, no dialect), then the language code doesn't need to be appended to the attribute name.

SLP queries in locales other than the default don't need to be rewritten to include language tags before being submitted to the directory server. RFC 2596 specifies that all matching entries get returned, including the ones with language tags, without requiring the language tags to be explicitly present in the query. The SLP DA can then postprocess the result to select the entries from the required locale πŸ’–


7.0 Security Considerations πŸ”

Lowkey the most serious part of this whole doc, so listen up πŸ‘‘ SLP authenticators are stored with the service advertisement in the DIT, as discussed in Section~7ef{slpdit}. LDAP clients need to use LDAP authentication [15] to make sure they're connecting with a secure server. In particular, SLP DAs that use LDAP as a back end store and that implement SLP authentication MUST use LDAP authentication to assure that the LDAP entries for their service registrations are secure. No skipping this one, periodt 😭


Acknowledgements ✨

Many thanks are due to Mark Wahl, whose detailed and insightful comments were instrumental in helping improve the technical accuracy of this document with respect to LDAP 🫢


8.0 References πŸ“š

[1] Guttman, E., Perkins, C. and J. Kempf, "Service Templates and service: Schemes", RFC 2609, April 1999.

[2] Wahl, W., Howes, T. and S. Kille, "Lightweight Directory Access Protocol (v3)", RFC 2251, December 1997.

[3] International Telecommunications Union. The Directory:Selected Attribute Types. ITU Recommendation X.520. August, 1997.

[4] McLaughlin, L., "Line Printer Daemon Protocol, RFC 1179, August 1990.

[5] Guttman, E., Perkins, C., Veizades, J. and M. Day, "Service Location Protocol Version 2", RFC 2608, April 1999.

[6] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.

[7] Howes, T., "The String Representation of LDAP Search Filters", RFC 2254, December 1997.

[8] Wahl, W., Coulbeck, A., Howe, T. and S. Kille, "Lightweight Directory Access Protocol (v3): Attribute Syntax Definition", RFC 2252, December 1997.

[9] ITU-T Rec. X.680. Abstract Syntax Notation One (ASN.1) - Specification of Basic Notation. 1994.

[10] Fleming, P., Jones, K., Lewis, H., and McDonald, I., "Internet Printing Protocol (IPP): LDAP Schema for Printer Services", Work in Progress.

[11] Smith, M., "Definition of an X.500 Attribute Type and an Object Class to Hold Uniform Resource Identifiers (URIs)", RFC 2079, January 1997.

[12] Yaacovi, Y., Wahl, M. and T. Genovese, "Lightweight Directory Access Protocol (v3): Extensions for Dynamic Directory Services", RFC 2589, May 1999.

[13] Alvestrand, H., "Tags for the Identification of Languages", RFC 1766, December 1997.

[14] Wahl, M. and T. Howes, "Use of Language Codes in LDAP", RFC 2596, May 1999.

[15] Wahl, M., Alvestrand, H., Hodges, J. and R. Morgan, "Authentication Methods for LDAP", RFC 2829, May 2000.

[16] Bradner, S., "Key Words for Use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[17] Dubuisson, O. ASN.1: Communication between Heterogeneous Systems. OSS Nokalva, 2000.

[18] http://www.srvloc.org

9.0 Authors' Addresses ✨

okay bestie, here are the three people who wrote this one 🫢 all of them were at Sun Microsystems or Coreon, and each one gets their own little contact card below πŸ’…

James Kempf Sun Microsystems 901 San Antonio Avenue Palo Alto, CA 94303 USA

Phone: +1 650 786-5890 EMail: james.kempf@sun.com

Ryan Moats Coreon, Inc. 15621 Drexel Circle Omaha, NE, 68135 USA

EMail: rmoats@coreon.net

Pete St. Pierre Sun Microsystems 901 San Antonio Avenue Palo Alto, CA 94303 USA

Phone: +1 415 786-5790 EMail: Pete.StPierre@Eng.Sun.COM


Copyright (C) The Internet Society (2000). All Rights Reserved. 🌈

okay so this part is the legal fine print, and it's lowkey important πŸ™ˆ the gist is that you're allowed to copy this document and share it, and you can even write your own stuff that explains it or helps people build it πŸ¦‹ as long as the copyright notice and this paragraph stay attached to every copy.

BUT the document itself can't be changed in any way, not even by removing the copyright notice or the references to the Internet Society or other Internet organizations πŸ’€ the one exceptions are if you're developing Internet standards (then the Internet Standards process copyright procedures have to be followed) or if you're translating it into a language other than English 🌸

the permissions are perpetual and the Internet Society or its successors or assigns won't take them back πŸ’œ

and the document and everything in it is provided on an "AS IS" basis, and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. no cap, that's a big disclaimer 😭


Acknowledgement πŸ“

Funding for the RFC Editor function is currently provided by the Internet Society. 🫢

πŸ“¦ where this page comes from