home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc2229 < prev    next >
Text File  |  1997-10-29  |  60KB  |  1,684 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                           R. Faith
  8. Request for Comments: 2229                U. North Carolina, Chapel Hill
  9. Category: Informational                                        B. Martin
  10.                                                      Miranda Productions
  11.                                                             October 1997
  12.  
  13.                       A Dictionary Server Protocol
  14.  
  15.  
  16. Status of this Memo
  17.  
  18.    This memo provides information for the Internet community.  It does
  19.    not specify an Internet standard of any kind.  Distribution of this
  20.    memo is unlimited.
  21.  
  22. Copyright Notice
  23.  
  24.    Copyright (C) The Internet Society (1997).  All Rights Reserved.
  25.  
  26. Abstract
  27.  
  28.    The Dictionary Server Protocol (DICT) is a TCP transaction based
  29.    query/response protocol that allows a client to access dictionary
  30.    definitions from a set of natural language dictionary databases.
  31.  
  32. Table of Contents
  33.  
  34.    1.      Introduction .........................................    2
  35.    1.1.    Requirements .........................................    3
  36.    2.      Protocol Overview ....................................    3
  37.    2.1.    Link Level ...........................................    3
  38.    2.2.    Lexical Tokens .......................................    3
  39.    2.3.    Commands .............................................    4
  40.    2.4.    Responses ............................................    5
  41.    2.4.1.  Status Responses .....................................    5
  42.    2.4.2.  General Status Responses .............................    6
  43.    2.4.3.  Text Responses .......................................    6
  44.    3.      Command and Response Details .........................    7
  45.    3.1.    Initial Connection ...................................    7
  46.    3.2.    The DEFINE Command ...................................    9
  47.    3.3.    The MATCH Command ....................................   10
  48.    3.4.    A Note on Virtual Databases ..........................   12
  49.    3.5.    The SHOW Command .....................................   13
  50.    3.5.1.  SHOW DB ..............................................   13
  51.    3.5.2.  SHOW STRAT ...........................................   13
  52.    3.5.3.  SHOW INFO ............................................   14
  53.    3.5.4.  SHOW SERVER ..........................................   14
  54.    3.6.    The CLIENT Command ...................................   15
  55.  
  56.  
  57.  
  58. Faith & Martin               Informational                      [Page 1]
  59.  
  60. RFC 2229              A Dictionary Server Protocol          October 1997
  61.  
  62.  
  63.    3.7.    The STATUS Command ...................................   15
  64.    3.8.    The HELP Command .....................................   15
  65.    3.9.    The QUIT Command .....................................   16
  66.    3.10.   The OPTION Command ...................................   16
  67.    3.10.1. OPTION MIME ..........................................   16
  68.    3.11.   The AUTH Command .....................................   18
  69.    3.12.   The SASLAUTH Command .................................   18
  70.    4.      Command Pipelining ...................................   20
  71.    5.      URL Specification ....................................   20
  72.    6.      Extensions ...........................................   22
  73.    6.1.    Experimental Command Syntax ..........................   22
  74.    6.2.    Experimental Commands and Pipelining .................   22
  75.    7.      Summary of Response Codes ............................   23
  76.    8.      Sample Conversations .................................   23
  77.    8.1.    Sample 1 - HELP, DEFINE, and QUIT commands ...........   24
  78.    8.2.    Sample 2 - SHOW commands, MATCH command ..............   25
  79.    8.3.    Sample 3 - Server downtime ...........................   26
  80.    8.4.    Sample 4 - Authentication ............................   26
  81.    9.      Security Considerations ..............................   26
  82.    10.     References ...........................................   27
  83.    11.     Acknowledgements .....................................   29
  84.    12.     Authors' Addresses ...................................   29
  85.    13.     Full Copyright Statement .............................   30
  86.  
  87. 1.  Introduction
  88.  
  89.    For many years, the Internet community has relied on the "webster"
  90.    protocol for access to natural language definitions.  The webster
  91.    protocol supports access to a single dictionary and (optionally) to a
  92.    single thesaurus.  In recent years, the number of publicly available
  93.    webster servers on the Internet has dramatically decreased.
  94.  
  95.    Fortunately, several freely-distributable dictionaries and lexicons
  96.    have recently become available on the Internet.  However, these
  97.    freely-distributable databases are not accessible via a uniform
  98.    interface, and are not accessible from a single site.  They are often
  99.    small and incomplete individually, but would collectively provide an
  100.    interesting and useful database of English words.  Examples include
  101.    the Jargon file [JARGON], the WordNet database [WORDNET], MICRA's
  102.    version of the 1913 Webster's Revised Unabridged Dictionary
  103.    [WEB1913], and the Free Online Dictionary of Computing [FOLDOC].
  104.    Translating and non-English dictionaries are also becoming available
  105.    (for example, the FOLDOC dictionary is being translated into
  106.    Spanish).
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Faith & Martin               Informational                      [Page 2]
  115.  
  116. RFC 2229              A Dictionary Server Protocol          October 1997
  117.  
  118.  
  119.    The webster protocol is not suitable for providing access to a large
  120.    number of separate dictionary databases, and extensions to the
  121.    current webster protocol were not felt to be a clean solution to the
  122.    dictionary database problem.
  123.  
  124.    The DICT protocol is designed to provide access to multiple
  125.    databases.  Word definitions can be requested, the word index can be
  126.    searched (using an easily extended set of algorithms), information
  127.    about the server can be provided (e.g., which index search strategies
  128.    are supported, or which databases are available), and information
  129.    about a database can be provided (e.g., copyright, citation, or
  130.    distribution information).  Further, the DICT protocol has hooks that
  131.    can be used to restrict access to some or all of the databases.
  132.  
  133. 1.1.  Requirements
  134.  
  135.    In this document, we adopt the convention discussed in Section 1.3.2
  136.    of [RFC1122] of using the capitalized words MUST, REQUIRED, SHOULD,
  137.    RECOMMENDED, MAY, and OPTIONAL to define the significance of each
  138.    particular requirement specified in this document.
  139.  
  140.    In brief: "MUST" (or "REQUIRED") means that the item is an absolute
  141.    requirement of the specification; "SHOULD" (or "RECOMMENDED") means
  142.    there may exist valid reasons for ignoring this item, but the full
  143.    implications should be understood before doing so; and "MAY" (or
  144.    "OPTIONAL") means that his item is optional, and may be omitted
  145.    without careful consideration.
  146.  
  147. 2.  Protocol Overview
  148.  
  149. 2.1.  Link Level
  150.  
  151.    The DICT protocol assumes a reliable data stream such as provided by
  152.    TCP.  When TCP is used, a DICT server listens on port 2628.
  153.  
  154.    This server is only an interface between programs and the dictionary
  155.    databases.  It does not perform any user interaction or
  156.    presentation-level functions.
  157.  
  158. 2.2.  Lexical Tokens
  159.  
  160.    Commands and replies are composed of characters from the UCS
  161.    character set [ISO10646] using the UTF-8 [RFC2044] encoding.  More
  162.    specifically, using the grammar conventions from [RFC822]:
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Faith & Martin               Informational                      [Page 3]
  171.  
  172. RFC 2229              A Dictionary Server Protocol          October 1997
  173.  
  174.  
  175.                                                ; (  Octal, Decimal.)
  176.    CHAR        =  <any UTF-8 character (1 to 6 octets)>
  177.    CTL         =  <any ASCII control           ; (  0- 37,  0.- 31.)
  178.                    character and DEL>          ; (    177,     127.)
  179.    CR          =  <ASCII CR, carriage return>  ; (     15,      13.)
  180.    LF          =  <ASCII LF, linefeed>         ; (     12,      10.)
  181.    SPACE       =  <ASCII SP, space>            ; (     40,      32.)
  182.    HTAB        =  <ASCII HT, horizontal-tab>   ; (     11,       9.)
  183.    <">         =  <ASCII quote mark>           ; (     42,      34.)
  184.    <'>         =  <ASCII single quote mark>    ; (     47,      39.)
  185.    CRLF        =  CR LF
  186.    WS          =  1*(SPACE / HTAB)
  187.  
  188.    dqstring    =  <"> *(dqtext/quoted-pair) <">
  189.    dqtext      =  <any CHAR except <">, "\", and CTLs>
  190.    sqstring    =  <'> *(dqtext/quoted-pair) <'>
  191.    sqtext      =  <any CHAR except <'>, "\", and CTLs>
  192.    quoted-pair =  "\" CHAR
  193.  
  194.    atom        =  1*<any CHAR except SPACE, CTLs, <'>, <">, and "\">
  195.    string      =  *<dqstring / sqstring / quoted-pair>
  196.    word        =  *<atom / string>
  197.    description =  *<word / WS>
  198.    text        =  *<word / WS>
  199.  
  200. 2.3.  Commands
  201.  
  202.    Commands consist of a command word followed by zero or more
  203.    parameters.  Commands with parameters must separate the parameters
  204.    from each other and from the command by one or more space or tab
  205.    characters.  Command lines must be complete with all required
  206.    parameters, and may not contain more than one command.
  207.  
  208.    Each command line must be terminated by a CRLF.
  209.  
  210.    The grammar for commands is:
  211.  
  212.              command     = cmd-word *<WS cmd-param>
  213.              cmd-word    = atom
  214.              cmd-param   = database / strategy / word
  215.              database    = atom
  216.              strategy    = atom
  217.  
  218.    Commands are not case sensitive.
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Faith & Martin               Informational                      [Page 4]
  227.  
  228. RFC 2229              A Dictionary Server Protocol          October 1997
  229.  
  230.  
  231.    Command lines MUST NOT exceed 1024 characters in length, counting all
  232.    characters including spaces, separators, punctuation, and the
  233.    trailing CRLF.  There is no provision for the continuation of command
  234.    lines.  Since UTF-8 may encode a character using up to 6 octets, the
  235.    command line buffer MUST be able to accept up to 6144 octets.
  236.  
  237. 2.4.  Responses
  238.  
  239.    Responses are of two kinds, status and textual.
  240.  
  241. 2.4.1.  Status Responses
  242.  
  243.    Status responses indicate the server's response to the last command
  244.    received from the client.
  245.  
  246.    Status response lines begin with a 3 digit numeric code which is
  247.    sufficient to distinguish all responses.  Some of these may herald
  248.    the subsequent transmission of text.
  249.  
  250.    The first digit of the response broadly indicates the success,
  251.    failure, or progress of the previous command (based generally on
  252.    [RFC640,RFC821]):
  253.  
  254.        1yz - Positive Preliminary reply
  255.        2yz - Positive Completion reply
  256.        3yz - Positive Intermediate reply
  257.        4yz - Transient Negative Completion reply
  258.        5yz - Permanent Negative Completion reply
  259.  
  260.    The next digit in the code indicates the response category:
  261.  
  262.        x0z - Syntax
  263.        x1z - Information (e.g., help)
  264.        x2z - Connections
  265.        x3z - Authentication
  266.        x4z - Unspecified as yet
  267.        x5z - DICT System (These replies indicate the status of the
  268.              receiver DICT system vis-a-vis the requested transfer
  269.              or other DICT system action.)
  270.        x8z - Nonstandard (private implementation) extensions
  271.  
  272.    The exact response codes that should be expected from each command
  273.    are detailed in the description of that command.
  274.  
  275.    Certain status responses contain parameters such as numbers and
  276.    strings.  The number and type of such parameters is fixed for each
  277.    response code to simplify interpretation of the response.  Other
  278.    status responses do not require specific text identifiers.  Parameter
  279.  
  280.  
  281.  
  282. Faith & Martin               Informational                      [Page 5]
  283.  
  284. RFC 2229              A Dictionary Server Protocol          October 1997
  285.  
  286.  
  287.    requirements are detailed in the description of relevant commands.
  288.    Except for specifically detailed parameters, the text following
  289.    response codes is server-dependent.
  290.  
  291.    Parameters are separated from the numeric response code and from each
  292.    other by a single space.  All numeric parameters are decimal, and may
  293.    have leading zeros.  All string parameters MUST conform to the "atom"
  294.    or "dqstring" grammar productions.
  295.  
  296.    If no parameters are present, and the server implementation provides
  297.    no implementation-specific text, then there MAY or MAY NOT be a space
  298.    after the response code.
  299.  
  300.    Response codes not specified in this standard may be used for any
  301.    installation-specific additional commands also not specified.
  302.  
  303.    These should be chosen to fit the pattern of x8z specified above.
  304.    The use of unspecified response codes for standard commands is
  305.    prohibited.
  306.  
  307. 2.4.2.  General Status Responses
  308.  
  309.    In response to every command, the following general status responses
  310.    are possible:
  311.  
  312.              500 Syntax error, command not recognized
  313.              501 Syntax error, illegal parameters
  314.              502 Command not implemented
  315.              503 Command parameter not implemented
  316.              420 Server temporarily unavailable
  317.              421 Server shutting down at operator request
  318.  
  319. 2.4.3.  Text Responses
  320.  
  321.    Before text is sent a numeric status response line, using a 1yz code,
  322.    will be sent indicating text will follow. Text is sent as a series of
  323.    successive lines of textual matter, each terminated with a CRLF.  A
  324.    single line containing only a period (decimal code 46, ".") is sent
  325.    to indicate the end of the text (i.e., the server will send a CRLF at
  326.    the end of the last line of text, a period, and another CRLF).
  327.  
  328.    If a line of original text contained a period as the first character
  329.    of the line, that first period is doubled by the DICT server.
  330.    Therefore, the client must examine the first character of each line
  331.    received.  Those that begin with two periods must have those two
  332.    periods collapsed into one period.  Those that contain only a single
  333.    period followed by a CRLF indicate the end of the text response.
  334.  
  335.  
  336.  
  337.  
  338. Faith & Martin               Informational                      [Page 6]
  339.  
  340. RFC 2229              A Dictionary Server Protocol          October 1997
  341.  
  342.  
  343.    If the OPTION MIME command has been given, all textual responses will
  344.    be prefaced by a MIME header [RFC2045] followed by a single blank
  345.    line (CRLF).  See section 3.10.1 for more details on OPTION MIME.
  346.  
  347.    Following a text response, a 2yz response code will be sent.
  348.  
  349.    Text lines MUST NOT exceed 1024 characters in length, counting all
  350.    characters including spaces, separators, punctuation, the extra
  351.    initial period (if needed), and the trailing CRLF.  Since UTF-8 may
  352.    encode a character using up to 6 octets, the text line input buffer
  353.    MUST be able to accept up to 6144 octets.
  354.  
  355.    By default, the text of the definitions MUST be composed of
  356.    characters from the UCS character set [ISO10644] using the UTF-8
  357.    [RFC2044] encoding.  The UTF-8 encoding has the advantage of
  358.    preserving the full range of 7-bit US ASCII [USASCII] values.
  359.    Clients and servers MUST support UTF-8, even if only in some minimal
  360.    fashion.
  361.  
  362. 3.  Command and Response Details
  363.  
  364.    Below, each DICT command and appropriate responses are detailed.
  365.    Each command is shown in upper case for clarity, but the DICT server
  366.    is case-insensitive.
  367.  
  368.    Except for the AUTH and SASLAUTH commands, every command described in
  369.    this section MUST be implemented by all DICT servers.
  370.  
  371. 3.1.  Initial Connection
  372.  
  373.    When a client initially connects to a DICT server, a code 220 is sent
  374.    if the client's IP is allowed to connect:
  375.  
  376.              220 text capabilities msg-id
  377.  
  378.    The code 220 is a banner, usually containing host name and DICT
  379.    server version information.
  380.  
  381.    The second-to-last sequence of characters in the banner is the
  382.    optional capabilities string, which will allow servers to declare
  383.    support for extensions to the DICT protocol.  The capabilities string
  384.    is defined below:
  385.  
  386.              capabilities =  ["<" msg-atom *("." msg-atom) ">"]
  387.              msg-atom     =  1*<any CHAR except SPACE, CTLs,
  388.                                 "<", ">", ".", and "\">
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Faith & Martin               Informational                      [Page 7]
  395.  
  396. RFC 2229              A Dictionary Server Protocol          October 1997
  397.  
  398.  
  399.    Individual capabilities are described by a single msg-atom.  For
  400.    example, the string <html.gzip> might be used to describe a server
  401.    that supports extensions which allow HTML or compressed output.
  402.    Capability names beginning with "x" or "X" are reserved for
  403.    experimental extensions, and SHOULD NOT be defined in any future DICT
  404.    protocol specification.  Some of these capabilities may inform the
  405.    client that certain functionality is available or can be requested.
  406.    The following capabilities are currently defined:
  407.  
  408.        mime        The OPTION MIME command is supported
  409.        auth        The AUTH command is supported
  410.        kerberos_v4 The SASL Kerberos version 4 mechanism is supported
  411.        gssapi      The SASL GSSAPI [RFC2078] mechanism is supported
  412.        skey        The SASL S/Key [RFC1760] mechanism is supported
  413.        external    The SASL external mechanism is supported
  414.  
  415.    The last sequence of characters in the banner is a msg-id, similar to
  416.    the format specified in [RFC822].  The simplified description is
  417.    given below:
  418.  
  419.        msg-id       =  "<" spec ">"            ; Unique message id
  420.        spec         =  local-part "@" domain
  421.        local-part   =  msg-atom *("." msg-atom)
  422.        domain       =  msg-atom *("." msg-atom)
  423.  
  424.    Note that, in contrast to [RFC822], spaces and quoted pairs are not
  425.    allowed in the msg-id.  This restriction makes the msg-id much easier
  426.    for the client to locate and parse but does not significantly
  427.    decrease any security benefits, since the msg-id may be arbitrarily
  428.    long (as bounded by the response length limits set forth elsewhere in
  429.    this document).
  430.  
  431.    Note also that the open and close brackets are part of the msg-id and
  432.    should be included in the string that is used to compute the MD5
  433.    checksum.
  434.  
  435.    This message id will be used by the client when formulating the
  436.    authentication string used in the AUTH command.
  437.  
  438.    If the client's IP is not allowed to connect, then a code 530 is sent
  439.    instead:
  440.  
  441.              530 Access denied
  442.  
  443.    Transient failure responses are also possible:
  444.  
  445.              420 Server temporarily unavailable
  446.              421 Server shutting down at operator request
  447.  
  448.  
  449.  
  450. Faith & Martin               Informational                      [Page 8]
  451.  
  452. RFC 2229              A Dictionary Server Protocol          October 1997
  453.  
  454.  
  455.    For example, response code 420 should be used if the server cannot
  456.    currently fork a server process (or cannot currently obtain other
  457.    resources required to proceed with a usable connection), but expects
  458.    to be able to fork or obtain these resources in the near future.
  459.  
  460.    Response code 421 should be used when the server has been shut down
  461.    at operator request, or when conditions indicate that the ability to
  462.    service more requests in the near future will be impossible.  This
  463.    may be used to allow a graceful operator-mediated temporary shutdown
  464.    of a server, or to indicate that a well known server has been
  465.    permanently removed from service (in which case, the text message
  466.    might provide more information).
  467.  
  468. 3.2.  The DEFINE Command
  469.  
  470.    DEFINE database word
  471.  
  472. 3.2.1.  Description
  473.  
  474.    This command will look up the specified word in the specified
  475.    database.  All DICT servers MUST implement this command.
  476.  
  477.    If the database name is specified with an exclamation point (decimal
  478.    code 33, "!"), then all of the databases will be searched until a
  479.    match is found, and all matches in that database will be displayed.
  480.    If the database name is specified with a star (decimal code 42, "*"),
  481.    then all of the matches in all available databases will be displayed.
  482.    In both of these special cases, the databases will be searched in the
  483.    same order as that printed by the "SHOW DB" command.
  484.  
  485.    If the word was not found, then status code 552 is sent.
  486.  
  487.    If the word was found, then status code 150 is sent, indicating that
  488.    one or more definitions follow.
  489.  
  490.    For each definition, status code 151 is sent, followed by the textual
  491.    body of the definition.  The first three space-delimited parameters
  492.    following status code 151 give the word retrieved, the name of the
  493.    database (which is the same as the first column of the SHOW DB
  494.    command), and a short description for the database (which is the same
  495.    as the second column of the SHOW DB command).  The short name is
  496.    suitable for printing as:
  497.  
  498.              From name:
  499.  
  500.    before the definition is printed.  This provides source information
  501.    for the user.
  502.  
  503.  
  504.  
  505.  
  506. Faith & Martin               Informational                      [Page 9]
  507.  
  508. RFC 2229              A Dictionary Server Protocol          October 1997
  509.  
  510.  
  511.    The textual body of each definition is terminated with a CRLF period
  512.    CRLF sequence.
  513.  
  514.    After all of the definitions have been sent, status code 250 is sent.
  515.    This command can provide optional timing information (which is server
  516.    dependent and is not intended to be parsable by the client).  This
  517.    additional information is useful when debugging and tuning the
  518.    server.
  519.  
  520. 3.2.2.  Responses
  521.  
  522.        550 Invalid database, use "SHOW DB" for list of databases
  523.        552 No match
  524.        150 n definitions retrieved - definitions follow
  525.        151 word database name - text follows
  526.        250 ok (optional timing information here)
  527.  
  528.    Response codes 150 and 151 require special parameters as part of
  529.    their text.  The client can use these parameters to display
  530.    information on the user's terminal.
  531.  
  532.    For code 150, parameters 1 indicates the number of definitions
  533.    retrieved.
  534.  
  535.    For code 151, parameter 1 is the word retrieved, parameter 2 is the
  536.    database name (the first name as shown by "SHOW DB") from which the
  537.    definition has been retrieved, and parameter 3 is the the short
  538.    database description (the second column of the "SHOW DB" command).
  539.  
  540. 3.3.  The MATCH Command
  541.  
  542.    MATCH database strategy word
  543.  
  544. 3.3.1.  Description
  545.  
  546.    This command searches an index for the dictionary, and reports words
  547.    which were found using a particular strategy.  Not all strategies are
  548.    useful for all dictionaries, and some dictionaries may support
  549.    additional search strategies (e.g., reverse lookup).  All DICT
  550.    servers MUST implement the MATCH command, and MUST support the
  551.    "exact" and "prefix" strategies.  These are easy to implement and are
  552.    generally the most useful.  Other strategies are server dependent.
  553.  
  554.    The "exact" strategy matches a word exactly, although different
  555.    servers may treat non-alphanumeric data differently.  We have found
  556.    that a case-insensitive comparison which ignores non-alphanumeric
  557.  
  558.  
  559.  
  560.  
  561.  
  562. Faith & Martin               Informational                     [Page 10]
  563.  
  564. RFC 2229              A Dictionary Server Protocol          October 1997
  565.  
  566.  
  567.    characters and which folds whitespace is useful for English-language
  568.    dictionaries.  Other comparisons may be more appropriate for other
  569.    languages or when using extended character sets.
  570.  
  571.    The "prefix" strategy is similar to "exact", except that it only
  572.    compares the first part of the word.
  573.  
  574.    Different servers may implement these algorithms differently.  The
  575.    requirement is that strategies with the names "exact" and "prefix"
  576.    exist so that a simple client can use them.
  577.  
  578.    Other strategies that might be considered by a server implementor are
  579.    matches based on substring, suffix, regular expressions, soundex
  580.    [KNUTH73], and Levenshtein [PZ85] algorithms.  These last two are
  581.    especially useful for correcting spelling errors.  Other useful
  582.    strategies perform some sort of "reverse" lookup (i.e., by searching
  583.    definitions to find the word that the query suggests).
  584.  
  585.    If the database name is specified with an exclamation point (decimal
  586.    code 33, "!"), then all of the databases will be searched until a
  587.    match is found, and all matches in that database will be displayed.
  588.    If the database name is specified with a star (decimal code 42, "*"),
  589.    then all of the matches in all available databases will be displayed.
  590.    In both of these special cases, the databases will be searched in the
  591.    same order as that printed by the "SHOW DB" command.
  592.  
  593.    If the strategy is specified using a period (decimal code 46, "."),
  594.    then the word will be matched using a server-dependent default
  595.    strategy, which should be the best strategy available for interactive
  596.    spell checking.  This is usually a derivative of the Levenshtein
  597.    algorithm [PZ85].
  598.  
  599.    If no matches are found in any of the searched databases, then status
  600.    code 552 will be returned.
  601.  
  602.    Otherwise, status code 152 will be returned followed by a list of
  603.    matched words, one per line, in the form:
  604.  
  605.              database word
  606.  
  607.    This makes the responses directly useful in a DEFINE command.
  608.  
  609.    The textual body of the match list is terminated with a CRLF period
  610.    CRLF sequence.
  611.  
  612.    Following the list, status code 250 is sent, which may include
  613.    server-specific timing and statistical information, as discussed in
  614.    the section on the DEFINE command.
  615.  
  616.  
  617.  
  618. Faith & Martin               Informational                     [Page 11]
  619.  
  620. RFC 2229              A Dictionary Server Protocol          October 1997
  621.  
  622.  
  623. 3.3.2.  Responses
  624.  
  625.         550 Invalid database, use "SHOW DB" for list of databases
  626.         551 Invalid strategy, use "SHOW STRAT" for a list of strategies
  627.         552 No match
  628.         152 n matches found - text follows
  629.         250 ok (optional timing information here)
  630.  
  631.    Response code 152 requires a special parameter as part of its text.
  632.    Parameter 1 must be the number of matches retrieved.
  633.  
  634. 3.4.  A Note on Virtual Databases
  635.  
  636.    The ability to search all of the provided databases using a single
  637.    command is given using the special "*" and "!" databases.
  638.  
  639.    However, sometimes, a client may want to search over some but not all
  640.    of the databases that a particular server provides.  One alternative
  641.    is for the client to use the SHOW DB command to obtain a list of
  642.    databases and descriptions, and then (perhaps with the help of a
  643.    human), select a subset of these databases for an interactive search.
  644.    Once this selection has been done once, the results can be saved, for
  645.    example, in a client configuration file.
  646.  
  647.    Another alternative is for the server to provide "virtual" databases
  648.    which merge several of the regular databases into one.  For example,
  649.    a virtual database may be provided which includes all of the
  650.    translating dictionaries, but which does not include regular
  651.    dictionaries or thesauri.  The special "*" and "!" databases can be
  652.    considered as names of virtual databases which provide access to all
  653.    of the databases.  If a server implements virtual databases, then the
  654.    special "*" and "!" databases should probably exclude other virtual
  655.    databases (since they merely provide information duplicated in other
  656.    databases).  If virtual databases are supported, they should be
  657.    listed as a regular database with the SHOW DB command (although,
  658.    since "*" and "!" are required, they need not be listed).
  659.  
  660.    Virtual databases are an implementation-specific detail which has
  661.    absolutely no impact on the DICT protocol.  The DICT protocol views
  662.    virtual and non-virtual databases the same way.
  663.  
  664.    We mention virtual databases here, however, because they solve a
  665.    problem of database selection which could also have been solved by
  666.    changes in the protocol.  For example, each dictionary could be
  667.    assigned attributes, and the protocol could be extended to specify
  668.    searches over databases with certain attributes.  However, this
  669.    needlessly complicates the parsing and analysis that must be
  670.    performed by the implementation.  Further, unless the classification
  671.  
  672.  
  673.  
  674. Faith & Martin               Informational                     [Page 12]
  675.  
  676. RFC 2229              A Dictionary Server Protocol          October 1997
  677.  
  678.  
  679.    system is extremely general, there is a risk that it would restrict
  680.    the types of databases that can be used with the DICT protocol
  681.    (although the protocol has been designed with human-language
  682.    databases in mind, it is applicable to any read-only database
  683.    application, especially those with a single semi-unique alphanumeric
  684.    key and textual data).
  685.  
  686. 3.5.  The SHOW Command
  687.  
  688. 3.5.1.  SHOW DB
  689.  
  690.    SHOW DB
  691.    SHOW DATABASES
  692.  
  693. 3.5.1.1.  Description
  694.  
  695.    Displays the list of currently accessible databases, one per line, in
  696.    the form:
  697.  
  698.              database description
  699.  
  700.    The textual body of the database list is terminated with a CRLF
  701.    period CRLF sequence.  All DICT servers MUST implement this command.
  702.  
  703.    Note that some databases may be restricted due to client domain or
  704.    lack of user authentication (see the AUTH and SASLAUTH commands in
  705.    sections 3.11 and 3.12).  Information about these databases is not
  706.    available until authentication is performed.  Until that time, the
  707.    client will interact with the server as if the additional databases
  708.    did not exist.
  709.  
  710. 3.5.1.2.  Responses
  711.  
  712.              110 n databases present - text follows
  713.              554 No databases present
  714.  
  715.         Response code 110 requires a special parameter.  Parameter 1
  716.         must be the number of databases available to the user.
  717.  
  718. 3.5.2.  SHOW STRAT
  719.  
  720.    SHOW STRAT
  721.    SHOW STRATEGIES
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Faith & Martin               Informational                     [Page 13]
  731.  
  732. RFC 2229              A Dictionary Server Protocol          October 1997
  733.  
  734.  
  735. 3.5.2.1.  Description
  736.  
  737.    Displays the list of currently supported search strategies, one per
  738.    line, in the form:
  739.  
  740.              strategy description
  741.  
  742.    The textual body of the strategy list is terminated with a CRLF
  743.    period CRLF sequence.  All DICT servers MUST implement this command.
  744.  
  745. 3.5.2.2.  Responses
  746.  
  747.              111 n strategies available - text follows
  748.              555 No strategies available
  749.  
  750.    Response code 111 requires a special parameter.  Parameter 1 must be
  751.    the number of strategies available.
  752.  
  753. 3.5.3.  SHOW INFO
  754.  
  755.    SHOW INFO database
  756.  
  757. 3.5.3.1.  Description
  758.  
  759.    Displays the source, copyright, and licensing information about the
  760.    specified database.  The information is free-form text and is
  761.    suitable for display to the user in the same manner as a definition.
  762.    The textual body of the information is terminated with a CRLF period
  763.    CRLF sequence.  All DICT servers MUST implement this command.
  764.  
  765. 3.5.3.2.  Responses
  766.  
  767.              550 Invalid database, use "SHOW DB" for list of databases
  768.              112 database information follows
  769.  
  770.    These response codes require no special parameters.
  771.  
  772. 3.5.4.  SHOW SERVER
  773.  
  774.    SHOW SERVER
  775.  
  776. 3.5.4.1.  Description
  777.  
  778.    Displays local server information written by the local administrator.
  779.    This could include information about local databases or strategies,
  780.    or administrative information such as who to contact for access to
  781.    databases requiring authentication.  All DICT servers MUST implement
  782.    this command.
  783.  
  784.  
  785.  
  786. Faith & Martin               Informational                     [Page 14]
  787.  
  788. RFC 2229              A Dictionary Server Protocol          October 1997
  789.  
  790.  
  791. 3.5.4.2.  Responses
  792.  
  793.              114 server information follows
  794.  
  795.    This response code requires no special parameters.
  796.  
  797. 3.6.  The CLIENT Command
  798.  
  799.    CLIENT text
  800.  
  801. 3.6.1.  Description
  802.  
  803.    This command allows the client to provide information about itself
  804.    for possible logging and statistical purposes.  All clients SHOULD
  805.    send this command after connecting to the server.  All DICT servers
  806.    MUST implement this command (note, though, that the server doesn't
  807.    have to do anything with the information provided by the client).
  808.  
  809. 3.6.2.  Responses
  810.  
  811.              250 ok (optional timing information here)
  812.  
  813.    This response code requires no special parameters.
  814.  
  815. 3.7.  The STATUS Command
  816.  
  817.    STATUS
  818.  
  819. 3.7.1.  Description
  820.  
  821.    Display some server-specific timing or debugging information.  This
  822.    information may be useful in debugging or tuning a DICT server.  All
  823.    DICT servers MUST implement this command (note, though, that the text
  824.    part of the response is not specified and may be omitted).
  825.  
  826. 3.7.2.  Responses
  827.  
  828.              210 (optional timing and statistical information here)
  829.  
  830.    This response code requires no special parameters.
  831.  
  832. 3.8.  The HELP Command
  833.  
  834.    HELP
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842. Faith & Martin               Informational                     [Page 15]
  843.  
  844. RFC 2229              A Dictionary Server Protocol          October 1997
  845.  
  846.  
  847. 3.8.1.  Description
  848.  
  849.    Provides a short summary of commands that are understood by this
  850.    implementation of the DICT server.  The help text will be presented
  851.    as a textual response, terminated by a single period on a line by
  852.    itself.  All DICT servers MUST implement this command.
  853.  
  854. 3.8.2.  Responses
  855.  
  856.              113 help text follows
  857.  
  858.    This response code requires no special parameters.
  859.  
  860. 3.9.  The QUIT Command
  861.  
  862.    QUIT
  863.  
  864. 3.9.1.  Description
  865.  
  866.    This command is used by the client to cleanly exit the server.  All
  867.    DICT servers MUST implement this command.
  868.  
  869. 3.9.2.  Responses
  870.  
  871.              221 Closing Connection
  872.  
  873.    This response code requires no special parameters.
  874.  
  875. 3.10.  The OPTION Command
  876.  
  877. 3.10.1.  OPTION MIME
  878.  
  879.    OPTION MIME
  880.  
  881. 3.10.1.1.  Description
  882.  
  883.    Requests that all text responses be prefaced by a MIME header
  884.    [RFC2045] followed by a single blank line (CRLF).
  885.  
  886.    If a client requests this option, then the client MUST be able to
  887.    parse Content-Type and Content-transfer-encoding headers, and MUST be
  888.    able to ignore textual responses which have an unsupported content or
  889.    encoding.  A client MUST support the UTF-8 encoding [RFC2044], which
  890.    minimally means that the client MUST recognize UTF-8 multi-octet
  891.    encodings and convert these into some symbol that can be printed by
  892.    the client.
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Faith & Martin               Informational                     [Page 16]
  899.  
  900. RFC 2229              A Dictionary Server Protocol          October 1997
  901.  
  902.  
  903.    If a client requests this option, then the server will provide a MIME
  904.    header.  If the header is empty, the text response will start with a
  905.    single blank line (CRLF), in which case a client MUST interpret this
  906.    as a default header.  The default header for SASL authentication is:
  907.  
  908.              Content-type: application/octet-stream
  909.              Content-transfer-encoding: base64
  910.  
  911.    The default header for all other textual responses is:
  912.  
  913.              Content-type: text/plain; charset=utf-8
  914.              Content-transfer-encoding: 8bit
  915.  
  916.    If OPTION MIME is not specified by the client, then the server may
  917.    restrict the information content provided to the client.  For
  918.    example, a definition may be accompanied by an image and an audio
  919.    clip, but the server cannot transmit this information unless the
  920.    client is able to parse MIME format headers.
  921.  
  922.    Note that, because of the line length restrictions and end-of-
  923.    response semantics, the "binary" content-transfer-encoding MUST NOT
  924.    be used.  In the future, extensions to the protocol may be provided
  925.    which allow a client to request binary encodings, but the default
  926.    SHOULD always be that the client can look for a "CRLF . CRLF"
  927.    sequence to locate the end of the current text response.  This allows
  928.    clients to easily skip over text responses which have unsupported
  929.    types or encodings.
  930.  
  931.    In the future, after significant experience with large databases in
  932.    various languages has been gained, and after evaluating the need for
  933.    specifying character sets and other encodings (e.g., compressed or
  934.    BASE64 encoding), standard extensions to this protocol should be
  935.    proposed which allow the client to request certain content types or
  936.    encodings.  Care should be taken that these extensions do not require
  937.    a handshake which defeats pipelining.  In the mean time, private
  938.    extensions should be used to explore the parameter space to determine
  939.    how best to implement these extensions.
  940.  
  941.    OPTION MIME is a REQUIRED server capability, all DICT servers MUST
  942.    implement this command.
  943.  
  944. 3.10.1.2.  Responses
  945.  
  946.              250 ok (optional timing information here)
  947.  
  948.    Note that some older server implementations, completed before this
  949.    document was finalized, will return a status code 500 if this command
  950.    is not implemented.  Clients SHOULD be able to accept this behavior,
  951.  
  952.  
  953.  
  954. Faith & Martin               Informational                     [Page 17]
  955.  
  956. RFC 2229              A Dictionary Server Protocol          October 1997
  957.  
  958.  
  959.    making default assumptions.  Clients may also examine the
  960.    capabilities string in the status code 220 header to determine if a
  961.    server supports this capability.
  962.  
  963. 3.11.  The AUTH Command
  964.  
  965.    AUTH username authentication-string
  966.  
  967. 3.11.1.  Description
  968.  
  969.    The client can authenticate itself to the server using a username and
  970.    password.  The authentication-string will be computed as in the APOP
  971.    protocol discussed in [RFC1939].  Briefly, the authentication-string
  972.    is the MD5 checksum of the concatenation of the msg-id (obtained from
  973.    the initial banner) and the "shared secret" that is stored in the
  974.    server and client configuration files.  Since the user does not have
  975.    to type this shared secret when accessing the server, the shared
  976.    secret can be an arbitrarily long passphrase.  Because of the
  977.    computational ease of computing the MD5 checksum, the shared secret
  978.    should be significantly longer than a usual password.
  979.  
  980.    Authentication may make more dictionary databases available for the
  981.    current session.  For example, there may be some publicly
  982.    distributable databases available to all users, and other private
  983.    databases available only to authenticated users.  Or, a server may
  984.    require authentication from all users to minimize resource
  985.    utilization on the server machine.
  986.  
  987.    Authentication is an optional server capability.  The AUTH command
  988.    MAY be implemented by a DICT server.
  989.  
  990. 3.11.2.  Responses
  991.  
  992.              230 Authentication successful
  993.              531 Access denied, use "SHOW INFO" for server information
  994.  
  995.    These response codes require no special parameters.
  996.  
  997. 3.12.  The SASLAUTH Command
  998.  
  999.    SASLAUTH mechanism initial-response
  1000.    SASLRESP response
  1001.  
  1002. 3.12.1.  Description
  1003.  
  1004.    The Simple Authentication and Security Layer (SASL) is currently
  1005.    being developed [RFC2222].  The DICT protocol reserves the SASLAUTH
  1006.    and SASLRESP commands for this method of authentication.  The results
  1007.  
  1008.  
  1009.  
  1010. Faith & Martin               Informational                     [Page 18]
  1011.  
  1012. RFC 2229              A Dictionary Server Protocol          October 1997
  1013.  
  1014.  
  1015.    of successful authentication with SALSAUTH will be the same as the
  1016.    results of successful AUTH authentication: more dictionary databases
  1017.    may become available for the current session.
  1018.  
  1019.    The initial-response is an optional parameter for the SASLAUTH
  1020.    command, encoded using BASE64 encoding [RFC2045].  Some SASL
  1021.    mechanisms may allow the use of this parameter.  If SASL
  1022.    authentication is supported by a DICT server, then this parameter
  1023.    MUST also be supported.
  1024.  
  1025.    A typical SASL authentication will be initiated by the client using
  1026.    the SASLAUTH command.  The server will reply with status code 130,
  1027.    followed by a challenge.  The challenge will be followed by status
  1028.    code 330, indicating that the client must now send a response to the
  1029.    server.
  1030.  
  1031.    Depending on the details of the SASL mechanism currently in use, the
  1032.    server will either continue the exchange using status code 130, a
  1033.    challenge, and status code 330; or the server will use status code
  1034.    230 or 531 to indicate authentication was successful or has failed.
  1035.  
  1036.    The challenges sent by the server are defined by the mechanisms as
  1037.    binary tokens of arbitrary length, and should be sent using a
  1038.    standard DICT textual response, as described in section 2.4.3.  If
  1039.    OPTION MIME is not set, then BASE64 encoding MUST be used.  If
  1040.  
  1041.    OPTION MIME is set, then BASE64 is the default encoding, as specified
  1042.    in section 3.10.1.
  1043.  
  1044.    The client will send all responses using the SASLRESP command and a
  1045.    BASE64-encoded parameter.  The responses sent by the client are
  1046.    defined by the mechanisms as binary tokens of arbitrary length.
  1047.    Remember that DICT command lines may only be 1024 characters in
  1048.    length, so the response provided by a DICT client is limited.
  1049.  
  1050.    If the mechanism specified in the SASLAUTH command is not supported,
  1051.    then status code 532 will be returned.
  1052.  
  1053.    Authentication is an optional server capability.  The SASLAUTH
  1054.    command MAY be implemented by a DICT server.
  1055.  
  1056. 3.12.2.  Responses
  1057.  
  1058.              130 challenge follows
  1059.              330 send response
  1060.              230 Authentication successful
  1061.              531 Access denied, use "SHOW INFO" for server information
  1062.              532 Access denied, unknown mechanism
  1063.  
  1064.  
  1065.  
  1066. Faith & Martin               Informational                     [Page 19]
  1067.  
  1068. RFC 2229              A Dictionary Server Protocol          October 1997
  1069.  
  1070.  
  1071.         These response codes require no special parameters.
  1072.  
  1073. 4.  Command Pipelining
  1074.  
  1075.    All DICT servers MUST be able to accept multiple commands in a single
  1076.    TCP send operation.  Using a single TCP send operation for multiple
  1077.    commands can improved DICT performance significantly, especially in
  1078.    the face of high latency network links.
  1079.  
  1080.    The possible implementation problems for a DICT server which would
  1081.    prevent command pipelining are similar to the problems that prevent
  1082.    pipelining in an SMTP server.  These problems are discussed in detail
  1083.    in [RFC1854], which should be consulted by all DICT server
  1084.    implementors.
  1085.  
  1086.    The main implication is that a DICT server implementation MUST NOT
  1087.    flush or otherwise lose the contents of the TCP input buffer under
  1088.    any circumstances whatsoever.
  1089.  
  1090.    A DICT client may pipeline several commands and must check the
  1091.    responses to each command individually.  If the server has shut down,
  1092.    it is possible that all of the commands will not be processed.  For
  1093.    example, a simple DICT client may pipeline a CLIENT, DEFINE, and QUIT
  1094.    command sequence as it is connecting to the server.  If the server is
  1095.    shut down, the initial response code sent by the server may be 420
  1096.    (temporarily unavailable) instead of 220 (banner).  In this case, the
  1097.    definition cannot be retrieved, and the client should report and
  1098.    error or retry the command.  If the server is working, it may be able
  1099.    to send back the banner, definition, and termination message in a
  1100.    single TCP send operation.
  1101.  
  1102. 5.  URL Specification
  1103.  
  1104.    The DICT URL scheme is used to refer to definitions or word lists
  1105.    available using the DICT protocol:
  1106.  
  1107.  
  1108.    dict://<user>;<auth>@<host>:<port>/d:<word>:<database>:<n>
  1109.    dict://<user>;<auth>@<host>:<port>/m:<word>:<database>:<strat>:<n>
  1110.  
  1111.  
  1112.    The "/d" syntax specifies the DEFINE command (section 3.2), whereas
  1113.    the "/m" specifies the MATCH command (section 3.3).
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122. Faith & Martin               Informational                     [Page 20]
  1123.  
  1124. RFC 2229              A Dictionary Server Protocol          October 1997
  1125.  
  1126.  
  1127.    Some or all of "<user>;<auth>@", ":<port>", "<database>", "<strat>",
  1128.    and "<n>" may be omitted.
  1129.  
  1130.    "<n>" will usually be omitted, but when included, it specifies the
  1131.    nth definition or match of a word.  A method for extracting exactly
  1132.    this information from the server is not available using the DICT
  1133.    protocol.  However, a client using the URL specification could obtain
  1134.    all of the definitions or matches, and then select the one that is
  1135.    specified.
  1136.  
  1137.    If "<user>;<auth>@" is omitted, no authentication is done.  If
  1138.    ":<port>" is omitted, the default port (2628) SHOULD be used.  If
  1139.    "<database>" is omitted, "!" SHOULD be used (see section 3.2).  If
  1140.    "<strat>" is omitted, "." SHOULD be used (see section 3.3).
  1141.  
  1142.    "<user>;<auth>@" specifies the username and the type of
  1143.    authentication performed.  For "<auth>", the string "AUTH" indicates
  1144.    that APOP authentication using the AUTH command will be performed,
  1145.    whereas the string "SASLAUTH=<auth_type>" indicates that the SASLAUTH
  1146.    and SASLRESP commands will be used, with "<auth_type>" indicating the
  1147.    type of SASL authentication which will be used.  If "<auth_type>" is
  1148.    a star (decimal code 42, "*"), then the client will select some type
  1149.    of authentication.
  1150.  
  1151.    Whenever authentication is required, the client SHOULD request
  1152.    additional information (e.g., a passphrase) from the user.  In
  1153.    contrast to [RFC1738], clear text passwords are not permitted in the
  1154.    URL.
  1155.  
  1156.    Trailing colons may be omitted.  For example, the following URLs
  1157.    might specify definitions or matches:
  1158.  
  1159.              dict://dict.org/d:shortcake:
  1160.              dict://dict.org/d:shortcake:*
  1161.              dict://dict.org/d:shortcake:wordnet:
  1162.              dict://dict.org/d:shortcake:wordnet:1
  1163.              dict://dict.org/d:abcdefgh
  1164.              dict://dict.org/d:sun
  1165.              dict://dict.org/d:sun::1
  1166.  
  1167.              dict://dict.org/m:sun
  1168.              dict://dict.org/m:sun::soundex
  1169.              dict://dict.org/m:sun:wordnet::1
  1170.              dict://dict.org/m:sun::soundex:1
  1171.              dict://dict.org/m:sun:::
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. Faith & Martin               Informational                     [Page 21]
  1179.  
  1180. RFC 2229              A Dictionary Server Protocol          October 1997
  1181.  
  1182.  
  1183. 6.  Extensions
  1184.  
  1185.    This protocol was designed so that flat text databases can be used
  1186.    with a server after a minimum of analysis and formatting.  Our
  1187.    experience is that merely constructing an index for a database may be
  1188.    sufficient to make it useful with a DICT server.  The ability to
  1189.    serve preformatted text is especially important since freely-
  1190.    available databases are often distributed as flat text files without
  1191.    any semantic mark-up information (and often contain "ASCII art" which
  1192.    precludes the automation of even simple formatting).
  1193.  
  1194.    However, given a database with sufficient mark-up information, it may
  1195.    be possible to generate output in a variety of different formats
  1196.    (e.g., simple HTML or more sophisticated SGML).  The specification of
  1197.    formatting is beyond the scope of this document.  The requirements
  1198.    for negotiation of format (including character set and other
  1199.    encodings) is complex and should be examined over time as more
  1200.    experience is gained.  We suggest that the use of different formats,
  1201.    as well as other server features, be explored as extensions to the
  1202.    protocol.
  1203.  
  1204. 6.1.  Experimental Command Syntax
  1205.  
  1206.    Single-letter commands are reserved for debugging and testing, SHOULD
  1207.    NOT be defined in any future DICT protocol specification, and MUST
  1208.    NOT be used by any client software.
  1209.  
  1210.    Commands beginning with the letter "X" are reserved for experimental
  1211.    extensions, and SHOULD NOT be defined in any future DICT protocol
  1212.    specification.  Authors of client software should understand that
  1213.    these commands are not part of the DICT protocol and may not be
  1214.    available on all DICT servers.
  1215.  
  1216. 6.2.  Experimental Commands and Pipelining
  1217.  
  1218.    Experimental commands should be designed so that a client can
  1219.    pipeline the experimental commands without knowing if a server
  1220.    supports the commands (e.g., instead of using feature negotiation).
  1221.    If the server does not support the commands, then a response code in
  1222.    the 5yz series (usually 500) will be given, notifying the client that
  1223.    the extension is not supported.  Of course, depending on the
  1224.    complexity of the extensions added, feature negotiation may be
  1225.    necessary.  To help minimize negotiation time, server-supported
  1226.    features may be announced in the banner (code 220) using the optional
  1227.    capabilities parameter.
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234. Faith & Martin               Informational                     [Page 22]
  1235.  
  1236. RFC 2229              A Dictionary Server Protocol          October 1997
  1237.  
  1238.  
  1239. 7.  Summary of Response Codes
  1240.  
  1241.    Below is a summary of response codes.  A star (*) in the first column
  1242.    indicates the response has defined arguments that must be provided.
  1243.  
  1244.       * 110 n databases present - text follows
  1245.       * 111 n strategies available - text follows
  1246.         112 database information follows
  1247.         113 help text follows
  1248.         114 server information follows
  1249.         130 challenge follows
  1250.       * 150 n definitions retrieved - definitions follow
  1251.       * 151 word database name - text follows
  1252.       * 152 n matches found - text follows
  1253.         210 (optional timing and statistical information here)
  1254.       * 220 text msg-id
  1255.         221 Closing Connection
  1256.         230 Authentication successful
  1257.         250 ok (optional timing information here)
  1258.         330 send response
  1259.         420 Server temporarily unavailable
  1260.         421 Server shutting down at operator request
  1261.         500 Syntax error, command not recognized
  1262.         501 Syntax error, illegal parameters
  1263.         502 Command not implemented
  1264.         503 Command parameter not implemented
  1265.         530 Access denied
  1266.         531 Access denied, use "SHOW INFO" for server information
  1267.         532 Access denied, unknown mechanism
  1268.         550 Invalid database, use "SHOW DB" for list of databases
  1269.         551 Invalid strategy, use "SHOW STRAT" for a list of strategies
  1270.         552 No match
  1271.         554 No databases present
  1272.         555 No strategies available
  1273.  
  1274. 8.  Sample Conversations
  1275.  
  1276.    Theses are samples of the conversations that might be expected with
  1277.    a typical DICT server.  The notation "C:" indicates commands set by
  1278.    the client, and "S:" indicates responses sent by the server.  Blank
  1279.    lines are included for clarity and do not indicate actual newlines
  1280.    in the transaction.
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Faith & Martin               Informational                     [Page 23]
  1291.  
  1292. RFC 2229              A Dictionary Server Protocol          October 1997
  1293.  
  1294.  
  1295. 8.1.  Sample 1 - HELP, DEFINE, and QUIT commands
  1296.  
  1297. C: [ client initiates connection ]
  1298.  
  1299. S: 220 dict.org dictd (version 0.9) <27831.860032493@dict.org>
  1300.  
  1301.  
  1302. C: HELP
  1303.  
  1304. S: 113 Help text follows
  1305. S: DEFINE database word            look up word in database
  1306. S: MATCH database strategy word    match word in database using strategy
  1307. S: [ more server-dependent help text ]
  1308. S: .
  1309. S: 250 Command complete
  1310.  
  1311.  
  1312. C: DEFINE ! penguin
  1313.  
  1314. S: 150 1 definitions found: list follows
  1315. S: 151 "penguin" wn "WordNet 1.5" : definition text follows
  1316. S: penguin
  1317. S:   1. n: short-legged flightless birds of cold southern esp. Antarctic
  1318. S:      regions having webbed feet and wings modified as flippers
  1319. S: .
  1320. S: 250 Command complete
  1321.  
  1322.  
  1323. C: DEFINE * shortcake
  1324.  
  1325. S: 150 2 definitions found: list follows
  1326. S: 151 "shortcake" wn "WordNet 1.5" : text follows
  1327. S: shortcake
  1328. S:   1. n: very short biscuit spread with sweetened fruit and usu.
  1329. S:      whipped cream
  1330. S: .
  1331. S: 151 "Shortcake" web1913 "Webster's Dictionary (1913)" : text follows
  1332. S: Shortcake
  1333. S:    \Short"cake`\, n.
  1334. S:    An unsweetened breakfast cake shortened with butter or lard,
  1335. S:    rolled thin, and baked.
  1336. S: .
  1337. S: 250 Command complete
  1338.  
  1339.  
  1340. C: DEFINE abcdefgh
  1341.  
  1342. S: 552 No match
  1343.  
  1344.  
  1345.  
  1346. Faith & Martin               Informational                     [Page 24]
  1347.  
  1348. RFC 2229              A Dictionary Server Protocol          October 1997
  1349.  
  1350.  
  1351. C: quit
  1352.  
  1353. S: 221 Closing connection
  1354.  
  1355. 8.2.  Sample 2 - SHOW commands, MATCH command
  1356.  
  1357. C: SHOW DB
  1358.  
  1359. S: 110 3 databases present: list follows
  1360. S: wn "WordNet 1.5"
  1361. S: foldoc "Free On-Line Dictionary of Computing"
  1362. S: jargon "Hacker Jargon File"
  1363. S: .
  1364. S: 250 Command complete
  1365.  
  1366.  
  1367. C: SHOW STRAT
  1368.  
  1369. S: 111 5 strategies present: list follows
  1370. S: exact "Match words exactly"
  1371. S: prefix "Match word prefixes"
  1372. S: substring "Match substrings anywhere in word"
  1373. S: regex "Match using regular expressions"
  1374. S: reverse "Match words given definition keywords"
  1375. S: .
  1376. S: 250 Command complete
  1377.  
  1378.  
  1379. C: MATCH foldoc regex "s.si"
  1380.  
  1381. S: 152 7 matches found: list follows
  1382. S: foldoc Fast SCSI
  1383. S: foldoc SCSI
  1384. S: foldoc SCSI-1
  1385. S: foldoc SCSI-2
  1386. S: foldoc SCSI-3
  1387. S: foldoc Ultra-SCSI
  1388. S: foldoc Wide SCSI
  1389. S: .
  1390. S: 250 Command complete
  1391.  
  1392.  
  1393. C: MATCH wn substring "abcdefgh"
  1394.  
  1395. S: 552 No match
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Faith & Martin               Informational                     [Page 25]
  1403.  
  1404. RFC 2229              A Dictionary Server Protocol          October 1997
  1405.  
  1406.  
  1407. 8.3.  Sample 3 - Server downtime
  1408.  
  1409.  
  1410. C: [ client initiates connection ]
  1411.  
  1412. S: 420 Server temporarily unavailable
  1413.  
  1414.  
  1415. C: [ client initiates connection ]
  1416.  
  1417. S: 421 Server shutting down at operator request
  1418.  
  1419.  
  1420. 8.4.  Sample 4 - Authentication
  1421.  
  1422. C: [ client initiates connection ]
  1423.  
  1424. S: 220 dict.org dictd (version 0.9) <27831.860032493@dict.org>
  1425.  
  1426.  
  1427. C: SHOW DB
  1428.  
  1429. S: 110 1 database present: list follows
  1430. S: free "Free database"
  1431. S: .
  1432. S: 250 Command complete
  1433.  
  1434.  
  1435. C: AUTH joesmith authentication-string
  1436.  
  1437. S: 230 Authentication successful
  1438.  
  1439.  
  1440. C: SHOW DB
  1441.  
  1442. S: 110 2 databases present: list follows
  1443. S: free "Free database"
  1444. S: licensed "Local licensed database"
  1445. S: .
  1446. S: 250 Command complete
  1447.  
  1448.  
  1449.  
  1450.  
  1451. 9.  Security Considerations
  1452.  
  1453.    This RFC raises no security issues.
  1454.  
  1455.  
  1456.  
  1457.  
  1458. Faith & Martin               Informational                     [Page 26]
  1459.  
  1460. RFC 2229              A Dictionary Server Protocol          October 1997
  1461.  
  1462.  
  1463. 10.  References
  1464.  
  1465.    [ASCII] US-ASCII. Coded Character Set - 7-Bit American Standard
  1466.         Code for Information Interchange. Standard ANSI X3.4-1986,
  1467.         ANSI, 1986.
  1468.  
  1469.    [FOLDOC] Howe, Denis, ed.  The Free On-Line Dictionary of
  1470.         Computing, <URL:http://wombat.doc.ic.ac.uk/>
  1471.  
  1472.    [ISO10646] ISO/IEC 10646-1:1993. International Standard --
  1473.         Information technology -- Universal Multiple-Octet Coded
  1474.         Character Set (UCS) -- Part 1: Architecture and Basic
  1475.         Multilingual Plane.  UTF-8 is described in Annex R, adopted
  1476.         but not yet published.  UTF-16 is described in Annex Q,
  1477.         adopted but not yet published.
  1478.  
  1479.    [JARGON] The on-line hacker Jargon File, version 4.0.0, 25 JUL
  1480.         1996, <URL:http://www.ccil.org/jargon/>
  1481.  
  1482.    [KNUTH73] Knuth, Donald E. "The Art of Computer Programming",
  1483.         Volume 3: Sorting and Searching (Addison-Wesley Publishing
  1484.         Co., 1973, pages 391 and 392). Knuth notes that the soundex
  1485.         method was originally described by Margaret K. Odell and
  1486.         Robert C. Russell [US Patents 1261167 (1918) and 1435663
  1487.         (1922)].
  1488.  
  1489.    [PZ85] Pollock, Joseph J. and Zamora, Antonio, "Automatic spelling
  1490.         correction in scientific and scholarly text," CACM, 27(4):
  1491.         Apr. 1985, 358-368.
  1492.  
  1493.    [RFC640] Postel, J., "Revised FTP Reply Codes", RFC 640, June,
  1494.         1975.
  1495.  
  1496.    [RFC821] Postel, J., "Simple Mail Transfer Protocol", STD 10,
  1497.         RFC 821, August 1982.
  1498.  
  1499.    [RFC822] Crocker, D., "Standard for the Format of ARPA Internet
  1500.         Text Messages", STD 11, RFC 822, August 1982.
  1501.  
  1502.    [RFC977] Kantor, B., and P. Lapsley, "Network News Transfer
  1503.         Protocol: A Proposed Standard for the Stream-Based
  1504.         Transmission of News", RFC 977, February 1986.
  1505.  
  1506.    [RFC2045] Freed, N., and N. Borenstein, "Multipurpose Internet
  1507.         Mail Extensions (MIME) Part One: Format of Internet Message
  1508.         Bodies", RFC 2045, November 1996.
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Faith & Martin               Informational                     [Page 27]
  1515.  
  1516. RFC 2229              A Dictionary Server Protocol          October 1997
  1517.  
  1518.  
  1519.    [RFC1738] Berners-Lee, T., Masinter, L. and M. McCahill, "Uniform
  1520.         Resource Locators (URL)", RFC 1738, December 1994.
  1521.  
  1522.    [RFC1760] Haller, N., "The S/KEY One-Time Password System",
  1523.         RFC 1760, February 1995.
  1524.  
  1525.    [RFC1985] Freed, N., and A. Cargille, "SMTP Service Extension for
  1526.         Command Pipelining", RFC 1854, October 1995.
  1527.  
  1528.    [RFC1939] Myers, J., and M. Rose, "Post Office Protocol - Version 3",
  1529.         STD 53, RFC 1939, May 1996.
  1530.  
  1531.    [RFC2044] Yergeau, F., "UTF-8, a transformation format of Unicode
  1532.         and ISO 10646", RFC 2044, October 1996.
  1533.  
  1534.    [RFC2068] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
  1535.         and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1",
  1536.         RFC 2068, January 1997.
  1537.  
  1538.    [RFC2078] Linn, J., "Generic Security Service Application Program
  1539.         Interface, Version 2", RFC 2078, January 1997.
  1540.  
  1541.    [RFC2222] Myers, J., "Simple Authentication and Security Layer
  1542.         (SASL)", RFC 2222, October 1997.
  1543.  
  1544.    [WEB1913] Webster's Revised Unabridged Dictionary (G & C. Merriam
  1545.         Co., 1913, edited by Noah Porter).  Online version prepared by
  1546.         MICRA, Inc., Plainfield, N.J. and edited by Patrick Cassidy
  1547.         <cassidy@micra.com>.  For further information, see
  1548.    <URL:ftp://uiarchive.cso.uiuc.edu/pub/etext/gutenberg/etext96/pgw*>,
  1549.         and
  1550.    <URL:http://humanities.uchicago.edu/forms_unrest/webster.form.html>
  1551.  
  1552.    [WORDNET] Miller, G.A. (1990), ed. WordNet: An On-Line Lexical
  1553.         Database. International Journal of Lexicography. Volume 3,
  1554.         Number 4.  <URL:http://www.cogsci.princeton.edu/~wn/>
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570. Faith & Martin               Informational                     [Page 28]
  1571.  
  1572. RFC 2229              A Dictionary Server Protocol          October 1997
  1573.  
  1574.  
  1575. 11.  Acknowledgements
  1576.  
  1577.    Thanks to Arnt Gulbrandsen and Nicolai Langfeldt for many helpful
  1578.    discussions.  Thanks to Bennet Yee, Doug Hoffman, Kevin Martin, and
  1579.    Jay Kominek for extensive testing and feedback on the initial
  1580.    implementations of the DICT server.  Thanks to Zhong Shao for advice
  1581.    and support.
  1582.  
  1583.    Thanks to Brian Kanto, Phil Lapsley, and Jon Postel for writing
  1584.    exemplary RFCs which were consulted during the preparation of this
  1585.    document.
  1586.  
  1587.    Thanks to Harald T. Alvestrand, whose comments helped improve this
  1588.    document.
  1589.  
  1590. 12.  Authors' Addresses
  1591.  
  1592.  
  1593.    Rickard E. Faith
  1594.    EMail: faith@cs.unc.edu (or faith@acm.org)
  1595.  
  1596.  
  1597.    Bret Martin
  1598.    EMail: bamartin@miranda.org
  1599.  
  1600.    The majority of this work was completed while Bret Martin was a
  1601.    student at Yale University.
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626. Faith & Martin               Informational                     [Page 29]
  1627.  
  1628. RFC 2229              A Dictionary Server Protocol          October 1997
  1629.  
  1630.  
  1631. 13.  Full Copyright Statement
  1632.  
  1633.    Copyright (C) The Internet Society (1997).  All Rights Reserved.
  1634.  
  1635.    This document and translations of it may be copied and furnished to
  1636.    others, and derivative works that comment on or otherwise explain it
  1637.    or assist in its implmentation may be prepared, copied, published
  1638.    andand distributed, in whole or in part, without restriction of any
  1639.    kind, provided that the above copyright notice and this paragraph are
  1640.    included on all such copies and derivative works.  However, this
  1641.    document itself may not be modified in any way, such as by removing
  1642.    the copyright notice or references to the Internet Society or other
  1643.    Internet organizations, except as needed for the purpose of
  1644.    developing Internet standards in which case the procedures for
  1645.    copyrights defined in the Internet Standards process must be
  1646.    followed, or as required to translate it into languages other than
  1647.    English.
  1648.  
  1649.    The limited permissions granted above are perpetual and will not be
  1650.    revoked by the Internet Society or its successors or assigns.
  1651.  
  1652.    This document and the information contained herein is provided on an
  1653.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  1654.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  1655.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  1656.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  1657.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Faith & Martin               Informational                     [Page 30]
  1683.  
  1684.