RFC 1202 INFORMATIONAL DIRECTORY SERVICES · PROTOCOLS · ACCESS METHODS

Directory Assistance service

A simple text protocol for accessing X.500 directory services.

On rfc-editor.org ↗
PUBLISHED
February 1991
AUTHORS
M.T. Rose
STREAM
Legacy
CONTROL CONNECTION PORT
411
CONTROL RESPONSE PREFIXES
+OK and -ERR
NUMERIC RESPONSE CODES
1 to 5
LETTER RESPONSE CODES
m, y, p, e, l, d and P
COMMAND SET TAKEN FROM
The DISH program
PICTURE ENCODING FORMAT
PBM, from the PBMPLUS package
DOI
10.17487/RFC1202

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                                            M. Rose
Request for Comments: 1202       Performance Systems International, Inc.
                                                           February 1991


                      Directory Assistance Service

Status of this Memo

   This document defines a mechanism by which a user-interface may
   access a textual DAP-like interface over a TCP/IP connection.  This
   is a local mechanism.  This memo provides information for the
   Internet community.  It does not specify any standard.  Distribution
   of this memo is unlimited.

Table of Contents

   1. Introduction ..........................................   1
   1.1 An Aside ............................................    3
   2. Protocol ..............................................   3
   2.1 Control Connection ..................................    4
   2.1.1 Initialization ....................................    4
   2.1.2 Transactions ......................................    4
   2.1.2.1 INTR command ....................................    4
   2.1.2.2 STAT command ....................................    5
   2.1.2.3 QUIT command ....................................    5
   2.2 Data Connection .....................................    5
   2.2.1 Transactions ......................................    5
   2.2.2 Responses .........................................    6
   2.2.2.1 Numeric Responses ...............................    6
   2.2.2.2 'm' Response ....................................    6
   2.2.2.3 'y' Response ....................................    6
   2.2.2.4 'p' Response ....................................    7
   2.2.2.5 'e' Response ....................................    7
   2.2.2.6 'l' Response ....................................    7
   2.2.2.7 'd' Response ....................................    8
   2.2.2.8 'P' Response ....................................    8
   3. Example Interaction ...................................   9
   4. References ............................................  10
   5. Security Considerations...............................   11
   6. Author's Address......................................   11

1.  Introduction

   The OSI Directory [1] provides a powerful infrastructure for the
   retrieval of information objects.  This infrastructure can be used to
   support, e.g., white pages applications, application entity lookup,
   and so on.

   The Directory service is provided to applications through the
   Directory Access Protocol (DAP), which binds a Directory User Agent
   (DUA) to a Directory System Agent (DSA).

                                        | Directory Service
                                        |    provided via DAP
                                        |
               +-----------+            |            +-----------+
               |           |            |            |           |
               |    DUA    | <----------+----------> |    DSA    |
               |           |            |            |           |
               +-----------+            |            +-----------+
                                        |
                         Directory User |

   The DAP is an OSI application layer protocol which uses the rich OSI
   upper-layer infrastructure.  Unfortunately, the coding investment to
   implement the DAP is significant.  As such, it is difficult to host
   applications using the Directory on smaller workstations and personal
   computers.

   This memo details a local mechanism which has been successfully used
   to separate the functionality of the DAP from the complexity of
   implementing the DAP.  That is, a split-DUA model is used: the DAP is
   implemented on an entity (the "Directory Assistant"), which resides
   on a capable workstation or mainframe and exports a simpler
   interface, the "Directory Assistance" (DA) protocol, to other end-
   systems where the user-interface resides, termed the DA-client.

   Since this mechanism provides assistance to applications wishing to
   access the Directory, it is termed the "Directory Assistance" (DA)
   service:

                                        | Directory Service
                 split-DUA              |    provided via DAP
                                        |
               +-----------+            |            +-----------+
               |           |            |            |           |
               | Directory | <----------+----------> |    DSA    |
               | Assistant |            |            |           |
               |           |            |            +-----------+
               +-----------+            |
                    /|\                 |
                     |                  |
                     | DA-service       |
                     |   provide via    |
                     |   DA-protocol    |
                     |                  |
               ------+------            |
                     |                  |
                     |                  |
                     |                  |
                     |                  |
                     |                  |
                    \|/                 |
               +-----------+            |
               |           |            |
               | DA-client |            |
               |           |            |
               +-----------+            |
                                        |
                         Directory User |


1.1.  An Aside

   This memo documents an already existing protocol, which was
   originally used to provide a split-DUA model within the same host.
   In the absence of detailed historical and implementational
   understanding, some of the mechanisms described may not appear
   intuitive.

2.  Protocol

   The DA service operates using two TCP connections: a control
   connection, and a data connection.  The control connection defines
   the lifetime of an instance of the DA service; throughout this
   lifetime, several data connections may be established.  However, at
   any given instant, between zero and one data connections will be in
   progress.

   The DA service is provided by the "Directory Assistant", which
   consists of two entities: a DA-server, which manages the control
   connection; and, a DAP-listener, which responds to commands on the
   data connection.  The DA-server oversees the behavior of the DAP-
   listener.

2.1.  Control Connection

   Data sent over the control connection consists of a series of
   transactions.  NVT-ASCII is used to express these transactions.  Each
   transaction consists of the client sending a directive--a line of
   text terminated by CR-LF; the DA-server returns a response--a line of
   text terminated by CR-LF.  All responses from a DA-server start with
   either "+OK" or "-ERR" depending on whether the transaction was
   successful.

2.1.1.  Initialization

   A DA-server listens on TCP port 411 for incoming connections.  Upon
   establishing a control connection, the DA-server returns a response
   indicating whether the service has been started.  If successful, the
   response contains an IP-address and a TCP port, expressed in NVT-
   ASCII, and separated by one or more instances of the space character.
   This information corresponds to the TCP-endpoint that the DAP-
   listener will use for the data connection.

   Note that the DA-server and DAP-listener need not reside at the same
   IP-address.  In the future, DA-servers may employ a internal protocol
   for load-balancing purposes.

   If the DA service can not be started, an error response is returned
   and the control connection is closed.


2.1.2.  Transactions

   All transactions with the DA-server consist of a command followed by
   zero or more arguments, separated by the space character.

2.1.2.1.  INTR command

   The INTR command takes no arguments.

   The INTR command is used to interrupt any DAP transaction
   currently in progress.

   The INTR command always returns success.

2.1.2.2.  STAT command

   The STAT command takes no arguments.

   The STAT command is used to verify that the DAP-listener is
   available.

   The STAT command returns success only if the DAP-listener is
   still active.

2.1.2.3.  QUIT command

   The QUIT command takes no arguments.

   The QUIT command is used to terminate the DA service.

   The QUIT command always returns success.

2.2.  Data Connection

   Data sent over a data connection consists of a single DAP-
   transaction.  NVT-ASCII is used to express these transactions.  Each
   transaction consists of the client sending a command--a line of text
   terminated by the LF-character; the DAP-listener returns zero or more
   responses, each with a specific termination sequence.  All responses
   from a DAP-listener start with a single identifying character.  If
   the character is a digit (0-9), then the termination sequence
   consists of a closing the data connection; otherwise, if the
   character is a lower-case letter (a-z), then the response is
   interactive and is terminated by the LF-character.

2.2.1.  Transactions

   All transactions with the DAP-listener consist of a command followed
   by zero or more arguments, separated by the space character.
   Double-quotes may be used to prevent separation of tokens.

   The command set is taken from the DISH program:

               add         add a new entry
               bind        connect to the Directory
               compare     compare entry's attribute
               delete      delete an entry
               fred        back-end to FrED
               list        list children
               modify      modify an existing entry
               modifyrdn   modify an entry's name
               moveto      move to a position
               search      search for an object
               showentry   show an entry
               showname    show an entry's name
               squid       status of dish
               unbind      disconnect from the Directory

   See [2] for a complete list of commands and arguments.

   Note that commands and arguments are in lower-case, and may
   abbreviated to any unique prefix.

2.2.2.  Responses

   There are two kinds of responses: numeric-responses, which consist of
   arbitrary text; and, letter-responses, which consist of brief text,
   and expect further interaction from the client.

2.2.2.1.  Numeric Responses

   If the response is '1', then the DAP-transaction terminated normally;
   if the response is '2', then the DAP-transaction failed; if the
   response is '3', then the DAP-transaction was a search returning more
   than one result and one of the -hitone or -list option was selected
   for the search; if the response is '4', then the DAP-transaction
   terminated normally and the remainder of this line consists of the
   name of an entry (see the 'd' Response below); if the response is
   '5', then all children of an entry were found by the DAP-transaction.
   Once the response is completely sent, the DAP-listener closes the
   data connection.

   Note that although numeric responses utilize ASCII, they are not
   NVT-ASCII; in particular, the LF-character is used to indicate end-
   of-line, rather than the CR-LF line termination sequence of NVT-
   ASCII.

2.2.2.2.  'm' Response

   The 'm' response contains a one-line message which should be
   presented to the user.

   At this point, the client returns a response consisting of 'm'
   followed by the LF-character.  The client should then continue
   reading from the existing data connection.

2.2.2.3.  'y' Response

   The 'y' response contains a yes/no question which should be presented
   to the user.  After querying the user, the response (either 'y' or
   'n'), followed by the LF-character, should be sent to the DAP-
   listener.  The client should then continue reading from the existing
   data connection.

2.2.2.4.  'p' Response

   The 'p' response contains a password-prompt which should be presented
   to the user.  After querying the user, the client returns a response
   consisting of 'p' followed by the password supplied by the user
   followed by the LF-character.  The client should then continue
   reading from the existing data connection.

2.2.2.5.  'e' Response

   The 'e' response is used to ask the user to edit some text.
   Following the 'e' character is a decimal number in ASCII followed by
   the LF-character, indicating the number of octets that should be
   presented to the user for editing (these octets may include LF-
   characters).

   At this point, the client returns a response consisting of a single
   character followed by a LF-character.  If the character is 'e', the
   edit is aborted (e.g., the text is too large), and the client should
   then continue reading from the existing data connection.

   Otherwise, the DAP-listener sends the indicated number of octets
   corresponding to the buffer that the user is to edit.  After the user
   edits the buffer, one of two responses should be sent.

   If the user aborted the edit, the response sent to the DAP-listener
   is a single character 'e', followed by the LF-character.

   Otherwise, the response consists of any single character other than
   indicating the number of octets immediately following that resulted
   from the user-edit.

   Regardless of the outcome, the client should then continue reading
   from the existing data connection.

2.2.2.6.  'l' Response

   The 'l' response contains an entry for a selection list to be
   presented to the user.  The form of this entry consists of two
   strings separated by the '$' character, and terminated by the LF-
   character.  The first string is a user-friendly name, suitable for
   display to the user; the second string is a fully-qualified
   Distinguished Name in textual format.

   At this point, the client returns a response consisting of 'l'
   followed by the LF-character.

   The client should continue to accumulate selection entries until an
   LF-character.

   At this point, the user should be asked to select one or more of the
   selection entries.  After this selection, the client sends back a
   response consisting of 'L' followed by one or more decimal numbers in
   ASCII followed by the LF-character.  The numbers are separated by
   spaces, and correspond to the entries selected by the user.  (The
   entry corresponding to the first 'l' response is numbered 1, etc.)

   The client should then continue reading from the existing data
   connection.

2.2.2.7.  'd' Response

   The 'd' response contains a name that the client may be interested
   in.  The form of this name consists of two strings separated by the
   '$' character, and terminated by the LF-character.  The first string
   is a user-friendly name, suitable for display to the user; the second
   string is a fully-qualified Distinguished Name in textual format.

   At this point, the client returns a response consisting of 'd'
   followed by the LF-character.  The client should then continue
   reading from the existing data connection.

2.2.2.8.  'P' Response

   The 'P' response is used to transmit a picture to the client.
   Following the 'P' character is a decimal number in ASCII followed by
   a name and then the LF-character.  The decimal number indicates the
   size of the picture.  The name contains three strings separated by
   the '$' character.  The first string is the name of the attribute
   corresponding to the picture, in textual format; the second string is
   a user-friendly name, suitable for display to the user; and, the
   third string is a fully-qualified DistingiushedName in textual
   format.

   At this point, the client returns a response consisting of a single
   character followed by a LF-character.  If the character is 'P', the
   picture will not be sent (e.g., the image is too large), and the
   client should then continue reading from the existing data
   connection.

   Otherwise, the DAP-listener sends the indicated number of octets
   corresponding to the picture.  The picture is encoded using the PBM
   format from the PBMPLUS package.

   Regardless of the outcome, the client should then continue reading
   from the existing data connection.

3.  Example Interaction

   In the text that follows, "S:" refers to the DA-server, "L:" refers
   to the DAP-listener, "C:" refers to the client talking to the DA-
   server, and, "I:" refers to the client talking to the DAP-listener.

          S: <wait for connection on TCP port 411>

          C: <open connection to DA-server>
          L: <wait for connections>
          S: +OK 192.33.4.21 32867

          I: <open connection to DAP-listener>
          I: bind -simple -user "@c=US@cn=Manager"
          L: pc=US@cn=Manager
          -- client asks user for password for "c=US@cn=Manager"
          I: psecret
          L: <closes connection, signaling success but no response>

          -- since response was null, client verifies that DAP-listener
          -- is still operating...
          C: STAT
          S: +OK

          I: <open connection to DAP-listener>
          I: fred -expand "@"
          L: 5
             North America$l=North America
             US$c=US
             ...
          L: <closes connection>

          I: <open connection to DAP-listener>
          I: fred -ufn rose,psi,us
          L: 1
             <followed by much data>
          L: <closes connection>

          I: <open connection to DAP-listener>
          I: fred -ufn -list,rose,ps,us
          L: lHewlett-Packard, US$c=US@o=Hewlett-Packard
          I: l
          L: lPerformance Systems International, US$c=US@o=Performance...

          I: l
          L: lRutgers University, US$c=US@o=Rutgers University
          I: l
          L: Lps
          -- client presents selection list to user asking to select
          -- matches for 'ps', user selects the 2nd
          I: L 2
          L: dManager, US$c=US@cn=Manager
          I: d
          L: 4Marshall Rose, ...$c=US@o=Performance...
             <followed by much data>
          L: <closes connection>

          I: <open connection to DAP-listener>
          I: fred -ufn -list,schoffstall,ps,us
          L: 33 matches found.
          Martin Schoffstall, ...$c=US@o=Performance...
          Marvin Schoffstall, ...$c=US@o=Performance...
          Steve Schoffstall, ...$c=US@o=Performance...
          L: <closes connection>

          C: QUIT
          L: <stop listening for connections>
          S: +OK
          C: <close connection>

          S: <wait for next connection>

4.  References

   [1] Information Processing - Open Systems Interconnection - The
       Directory, International Organization for Standardization.
       International Standard 9594, (1988).

   [2] Kille, S., Robbins, C., Roe, M., and A. Turland, "The ISO
       Development Environment: User's Manual", Volume 5: QUIPU,
       Performance Systems International, January 1990.

5.  Security Considerations

   Security considerations are not discussed in this memo.

6.  Author's Address

   Marshall T. Rose
   PSI, Inc.
   PSI California Office
   P.O. Box 391776
   Mountain View, CA 94039

   Phone: (415) 961-3380

   EMail: mrose@psi.com

ISO Plain Language

On this page
PROBLEMThe X.500 directory is powerful but its access protocol, DAP, needs the full OSI stack, which is too much code to fit on a small workstation or a personal computer.
MECHANISMThe memo describes a split model. A Directory Assistant on a capable machine holds the DAP implementation and exports a plain text protocol over TCP, and a small client on the other machine speaks that.
WHY IT MATTERSIt is an Informational document that records a protocol already in use, and it says explicitly that it specifies no standard.

§1The Problem and the Split Model

The OSI Directory provides a powerful infrastructure for the retrieval of information objects. This infrastructure can be used to support white pages applications, application entity lookup and so on. The Directory service is provided to applications through the Directory Access Protocol, which binds a Directory User Agent to a Directory System Agent.

The DAP is an OSI application layer protocol which uses the rich OSI upper-layer infrastructure. Unfortunately, the coding investment to implement the DAP is significant, so it is difficult to host applications using the Directory on smaller workstations and personal computers.

The memo details a local mechanism which has been successfully used to separate the functionality of the DAP from the complexity of implementing it. A split-DUA model is used: the DAP is implemented on an entity, the Directory Assistant, which resides on a capable workstation or mainframe and exports a simpler interface, the Directory Assistance protocol, to other end-systems where the user interface resides, termed the DA-client. Since this mechanism provides assistance to applications wishing to access the Directory, it is termed the Directory Assistance service.

The memo also notes that it documents an already existing protocol, which was originally used to provide a split-DUA model within the same host. In the absence of detailed historical and implementational understanding, some of the mechanisms described may not appear intuitive.

The idea is a helper on the big machine. The small machine asks the helper a simple question, and the helper does the hard directory work on its behalf.

The split-DUA model the memo describes
  1. Directory UserThe application using the directory
  2. DA-clientThe user interface, on a small machine
  3. Directory AssistantHolds the DAP implementation on a capable machine
  4. Directory System AgentThe directory server that answers the query

§2The Two Connections

The DA service operates using two TCP connections, a control connection and a data connection. The control connection defines the lifetime of an instance of the DA service. Throughout this lifetime, several data connections may be established, but at any given instant between zero and one data connections will be in progress.

The service is provided by the Directory Assistant, which consists of two entities: a DA-server, which manages the control connection, and a DAP-listener, which responds to commands on the data connection. The DA-server oversees the behavior of the DAP-listener.

Data sent over the control connection consists of a series of transactions expressed in NVT-ASCII. Each transaction consists of the client sending a directive, a line of text terminated by CR-LF, and the DA-server returning a response, also a line of text terminated by CR-LF. All responses from a DA-server start with either +OK or -ERR, depending on whether the transaction was successful. A DA-server listens on TCP port 411 for incoming connections. Upon establishing a control connection it returns a response indicating whether the service has been started. If successful, the response contains an IP address and a TCP port, expressed in NVT-ASCII and separated by one or more spaces, corresponding to the TCP endpoint that the DAP-listener will use for the data connection. The DA-server and DAP-listener need not reside at the same IP address. If the service cannot be started, an error response is returned and the control connection is closed.

There are three commands on the control connection. The INTR command takes no arguments and is used to interrupt any DAP transaction currently in progress; it always returns success. The STAT command takes no arguments and is used to verify that the DAP-listener is available, returning success only if the DAP-listener is still active. The QUIT command takes no arguments and is used to terminate the DA service; it always returns success.

One connection stays open for the life of the session and carries housekeeping. The other is opened and closed for each query, and the server tells the client which port to use for it.

The control connection and the data connections
DA-clientDA-serverDAP-listener
  1. CONTROL CONNECTIONOpened to TCP port 411. Defines the lifetime of the service instance.
  2. +OK ADDRESS PORTThe IP address and port the DAP-listener will use for the data connection.
  3. DATA CONNECTIONOne DAP transaction per connection.
  4. COMMANDA DISH command in lower case, abbreviated to any unique prefix.
  5. RESPONSEA digit closes the connection; a lower-case letter asks the client something.
  6. QUITTerminates the DA service; the DA-server answers +OK.

§2.2The Data Connection and Its Responses

Data sent over a data connection consists of a single DAP transaction, expressed in NVT-ASCII. Each transaction consists of the client sending a command, a line of text terminated by the LF character, and the DAP-listener returning zero or more responses, each with a specific termination sequence. All responses from a DAP-listener start with a single identifying character. If the character is a digit, the termination sequence consists of closing the data connection; if the character is a lower-case letter, the response is interactive and is terminated by the LF character.

All transactions with the DAP-listener consist of a command followed by zero or more arguments separated by the space character, and double quotes may be used to prevent separation of tokens. The command set is taken from the DISH program and includes add, bind, compare, delete, fred, list, modify, modifyrdn, moveto, search, showentry, showname, squid and unbind. Commands and arguments are in lower case and may be abbreviated to any unique prefix.

There are two kinds of response. Numeric responses consist of arbitrary text. A response of 1 means the DAP transaction terminated normally; 2 means it failed; 3 means it was a search returning more than one result and one of the -hitone or -list option was selected; 4 means it terminated normally and the remainder of the line consists of the name of an entry; and 5 means all children of an entry were found. Once the response is completely sent, the DAP-listener closes the data connection. Although numeric responses use ASCII, they are not NVT-ASCII: the LF character is used to indicate end-of-line rather than the CR-LF line termination sequence.

Letter responses consist of brief text and expect further interaction from the client. The m response contains a one-line message to present to the user. The y response contains a yes or no question to present to the user, and the client answers with y or n followed by the LF character. The p response contains a password prompt, and the client answers with p followed by the password and the LF character. The e response asks the user to edit some text: it is followed by a decimal number of octets to be presented for editing, and the client answers with a single character, where e aborts the edit.

The l response contains an entry for a selection list, consisting of two strings separated by the dollar character, the first a user-friendly name and the second a fully-qualified Distinguished Name in textual format. The client acknowledges each one with l, and when it has collected them all it asks the user to select, then sends back L followed by one or more decimal numbers separated by spaces, the entry corresponding to the first response being numbered 1. The d response contains a name that the client may be interested in, in the same two-string form, and the client acknowledges it with d. The P response transmits a picture: it is followed by a decimal size, then three strings separated by the dollar character, naming the attribute, a user-friendly name and the Distinguished Name. The client answers with a single character, where P means the picture will not be sent, and otherwise the listener sends that number of octets, encoded using the PBM format from the PBMPLUS package.

The server answers with a single character that says what kind of answer it is: a number means it is finished, a letter means it needs something from the user first.

The response codes a DAP-listener can send
  • 1Normal termination — The DAP transaction terminated normally.
  • 2Failed — The DAP transaction failed.
  • 3Multiple results — A search returning more than one result, with the -hitone or -list option selected.
  • 4Normal, with a name — Terminated normally, and the rest of the line is the name of an entry.
  • 5Children found — All children of an entry were found.
  • mMessage — A one-line message to present to the user.
  • yQuestion — A yes or no question; the client answers with y or n.
  • pPassword prompt — The client answers with p followed by the password.
  • eEdit request — The user is asked to edit a given number of octets of text.
  • lSelection list entry — A friendly name and a distinguished name, offered for the user to choose from.
  • dName of interest — A friendly name and a distinguished name the client may want.
  • PPicture — A picture follows, encoded in PBM, with a size and three strings.

§3An Example Interaction

The memo gives a worked example in which S refers to the DA-server, L to the DAP-listener, C to the client talking to the DA-server, and I to the client talking to the DAP-listener. The DA-server waits for a connection on TCP port 411, the client opens one, and the DAP-listener waits for connections of its own. The DA-server replies +OK 192.33.4.21 32867, giving the address and port of the data connection. The client opens that connection and sends bind -simple -user "@c=US@cn=Manager", and the DAP-listener replies with the name pc=US@cn=Manager, asking the client for a password. The client sends the password, and the DAP-listener closes the connection, signalling success but with no response. Since the response was null, the client verifies that the DAP-listener is still operating by sending STAT to the DA-server, which answers +OK.

The client then opens a new data connection and sends fred -expand "@" to list the top of the tree. The DAP-listener answers 5 and then a series of lines pairing a friendly name with a distinguished name, such as North America$l=North America and US$c=US, and closes the connection. A search for one person, fred -ufn rose,psi,us, returns 1 followed by much data. A search that matches several people, fred -ufn -list,rose,ps,us, produces a series of l responses, one for each match, each acknowledged with l. The client then sends L 2 to say that the second match was chosen, and the listener answers with a d response naming the entry followed by 4 and the data for that entry. Finally the client sends QUIT to the DA-server, the DAP-listener stops listening for connections, and the DA-server answers +OK.

The example walks through signing in, browsing the top of the tree, and picking one person out of a list of several.

§5Security Considerations

The memo says in one line that security considerations are not discussed in it. It is a description of an existing local mechanism, with no standard proposed and no analysis of the security of the arrangement.

The memo does not discuss security at all.

§6References

[1]Information Processing - Open Systems Interconnection - The Directory, International Organization for Standardization, International Standard 9594, (1988).
[2]Kille, S., Robbins, C., Roe, M., and A. Turland, "The ISO Development Environment: User's Manual", Volume 5: QUIPU, Performance Systems International, January 1990.