home *** CD-ROM | disk | FTP | other *** search
/ Handbook of Infosec Terms 2.0 / Handbook_of_Infosec_Terms_Version_2.0_ISSO.iso / text / rfcs / rfc1436.txt < prev    next >
Text File  |  1996-05-07  |  37KB  |  410 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                     F. Anklesaria Request for Comments: 1436                                  M. McCahill                                                              P. Lindner                                                              D. Johnson                                                               D. Torrey                                                              B. Alberti                                                 University of Minnesota                                                              March 1993 
  8.  
  9.                        The Internet Gopher Protocol          (a distributed document search and retrieval protocol) 
  10.  
  11. Status of this Memo 
  12.  
  13.    This memo provides information for the Internet community.  It does    not specify an Internet standard.  Distribution of this memo is    unlimited. 
  14.  
  15. Abstract 
  16.  
  17.    The Internet Gopher protocol is designed for distributed document    search and retrieval.  This document describes the protocol, lists    some of the implementations currently available, and has an overview    of how to implement new client and server applications.  This    document is adapted from the basic Internet Gopher protocol document    first issued by the Microcomputer Center at the University of    Minnesota in 1991. 
  18.  
  19. Introduction 
  20.  
  21.    gopher  n.  1. Any of various short tailed, burrowing mammals of the    family Geomyidae, of North America.  2. (Amer. colloq.) Native or    inhabitant of Minnesota: the Gopher State.  3. (Amer. colloq.) One    who runs errands, does odd-jobs, fetches or delivers documents for    office staff.  4. (computer tech.) software following a simple    protocol for burrowing through a TCP/IP internet. 
  22.  
  23.    The Internet Gopher protocol and software follow a client-server    model.  This protocol assumes a reliable data stream; TCP is assumed.    Gopher servers should listen on port 70 (port 70 is assigned to    Internet Gopher by IANA).  Documents reside on many autonomous    servers on the Internet.  Users run client software on their desktop    systems, connecting to a server and sending the server a selector (a    line of text, which may be empty) via a TCP connection at a well-    known port.  The server responds with a block of text terminated by a    period on a line by itself and closes the connection.  No state is    retained by the server. 
  24.  
  25.  
  26.  
  27. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 1] 
  28.  RFC 1436                         Gopher                       March 1993 
  29.  
  30.     While documents (and services) reside on many servers, Gopher client    software presents users with a hierarchy of items and directories    much like a file system.  The Gopher interface is designed to    resemble a file system since a file system is a good model for    organizing documents and services; the user sees what amounts to one    big networked information system containing primarily document items,    directory items, and search items (the latter allowing searches for    documents across subsets of the information base). 
  31.  
  32.    Servers return either directory lists or documents.  Each item in a    directory is identified by a type (the kind of object the item is),    user-visible name (used to browse and select from listings), an    opaque selector string (typically containing a pathname used by the    destination host to locate the desired object), a host name (which    host to contact to obtain this item), and an IP port number (the port    at which the server process listens for connections). The user only    sees the user-visible name.  The client software can locate and    retrieve any item by the trio of selector, hostname, and port. 
  33.  
  34.    To use a search item, the client submits a query to a special kind of    Gopher server: a search server.  In this case, the client sends the    selector string (if any) and the list of words to be matched. The    response yields "virtual directory listings" that contain items    matching the search criteria. 
  35.  
  36.    Gopher servers and clients exist for all popular platforms.  Because    the protocol is so sparse and simple, writing servers or clients is    quick and straightforward. 
  37.  
  38. 1.  Introduction 
  39.  
  40.    The Internet Gopher protocol is designed primarily to act as a    distributed document delivery system.  While documents (and services)    reside on many servers, Gopher client software presents users with a    hierarchy of items and directories much like a file system.  In fact,    the Gopher interface is designed to resemble a file system since a    file system is a good model for locating documents and services.  Why    model a campus-wide information system after a file system?  Several    reasons: 
  41.  
  42.       (a) A hierarchical arrangement of information is familiar to many       users.  Hierarchical directories containing items (such as       documents, servers, and subdirectories) are widely used in       electronic bulletin boards and other campus-wide information       systems. People who access a campus-wide information server will       expect some sort of hierarchical organization to the information       presented. 
  43.  
  44.  
  45.  
  46.  Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 2] 
  47.  RFC 1436                         Gopher                       March 1993 
  48.  
  49.        (b) A file-system style hierarchy can be expressed in a simple       syntax.  The syntax used for the internet Gopher protocol is       easily understandable, and was designed to make debugging servers       and clients easy.  You can use Telnet to simulate an internet       Gopher client's requests and observe the responses from a server.       Special purpose software tools are not required.  By keeping the       syntax of the pseudo-file system client/server protocol simple, we       can also achieve better performance for a very common user       activity: browsing through the directory hierarchy. 
  50.  
  51.       (c) Since Gopher originated in a University setting, one of the       goals was for departments to have the option of publishing       information from their inexpensive desktop machines, and since       much of the information can be presented as simple text files       arranged in directories, a protocol modeled after a file system       has immediate utility.  Because there can be a direct mapping from       the file system on the user's desktop machine to the directory       structure published via the Gopher protocol, the problem of       writing server software for slow desktop systems is minimized. 
  52.  
  53.       (d) A file system metaphor is extensible.  By giving a "type"       attribute to items in the pseudo-file system, it is possible to       accommodate documents other than simple text documents.  Complex       database services can be handled as a separate type of item.  A       file-system metaphor does not rule out search or database-style       queries for access to documents.  A search-server type is also       defined in this pseudo-file system.  Such servers return "virtual       directories" or list of documents matching user specified       criteria. 
  54.  
  55. 2.  The internet Gopher Model 
  56.  
  57.    A detailed BNF rendering of the internet Gopher syntax is available    in the appendix...but a close reading of the appendix may not be    necessary to understand the internet Gopher protocol. 
  58.  
  59.    In essence, the Gopher protocol consists of a client connecting to a    server and sending the server a selector (a line of text, which may    be empty) via a TCP connection.  The server responds with a block of    text terminated with a period on a line by itself, and closes the    connection.  No state is retained by the server between transactions    with a client. The simple nature of the protocol stems from the need    to implement servers and clients for the slow, smaller desktop    computers (1 MB Macs and DOS machines), quickly, and efficiently. 
  60.  
  61.    Below is a simple example of a client/server interaction; more    complex interactions are dealt with later.  Assume that a "well-    known" Gopher server (this may be duplicated, details are discussed 
  62.  
  63.  
  64.  
  65. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 3] 
  66.  RFC 1436                         Gopher                       March 1993 
  67.  
  68.     later) listens at a well known port for the campus (much like a    domain-name server).  The only configuration information the client    software retains is this server's name and port number (in this    example that machine is rawBits.micro.umn.edu and the port 70). In    the example below the F character denotes the TAB character. 
  69.  
  70.  Client:          {Opens connection to rawBits.micro.umn.edu at port 70} 
  71.  
  72.  Server:          {Accepts connection but says nothing} 
  73.  
  74.  Client: <CR><LF> {Sends an empty line: Meaning "list what you have"} 
  75.  
  76.  Server:          {Sends a series of lines, each ending with CR LF}  0About internet GopherFStuff:About usFrawBits.micro.umn.eduF70  1Around University of MinnesotaFZ,5692,AUMFunderdog.micro.umn.eduF70  1Microcomputer News & PricesFPrices/Fpserver.bookstore.umn.eduF70  1Courses, Schedules, CalendarsFFevents.ais.umn.eduF9120  1Student-Staff DirectoriesFFuinfo.ais.umn.eduF70  1Departmental PublicationsFStuff:DP:FrawBits.micro.umn.eduF70                     {.....etc.....}  .                  {Period on a line by itself}                     {Server closes connection} 
  77.  
  78.     The first character on each line tells whether the line describes a    document, directory, or search service (characters '0', '1', '7';    there are a handful more of these characters described later).  The    succeeding characters up to the tab form a user display string to be    shown to the user for use in selecting this document (or directory)    for retrieval.  The first character of the line is really defining    the type of item described on this line. In nearly every case, the    Gopher client software will give the users some sort of idea about    what type of item this is (by displaying an icon, a short text tag,    or the like). 
  79.  
  80.    The characters following the tab, up to the next tab form a selector    string that the client software must send to the server to retrieve    the document (or directory listing).  The selector string should mean    nothing to the client software; it should never be modified by the    client.  In practice, the selector string is often a pathname or    other file selector used by the server to locate the item desired.    The next two tab delimited fields denote the domain-name of the host    that has this document (or directory), and the port at which to    connect.  If there are yet other tab delimited fields, the basic    Gopher client should ignore them.  A CR LF denotes the end of the    item. 
  81.  
  82.  
  83.  
  84.  
  85.  
  86. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 4] 
  87.  RFC 1436                         Gopher                       March 1993 
  88.  
  89.     In the example, line 1 describes a document the user will see as    "About internet Gopher".  To retrieve this document, the client    software must send the retrieval string: "Stuff:About us" to    rawBits.micro.umn.edu at port 70.  If the client does this, the    server will respond with the contents of the document, terminated by    a period on a line by itself.  A client might present the user with a    view of the world something like the following list of items: 
  90.  
  91.        About Internet Gopher       Around the University of Minnesota...       Microcomputer News & Prices...       Courses, Schedules, Calendars...       Student-Staff Directories...       Departmental Publications... 
  92.  
  93.  
  94.  
  95.    In this case, directories are displayed with an ellipsis and files    are displayed without any.  However, depending on the platform the    client is written for and the author's taste, item types could be    denoted by other text tags or by icons.  For example, the UNIX    curses-based client displays directories with a slash (/) following    the name; Macintosh clients display directories alongside an icon of    a folder. 
  96.  
  97.    The user does not know or care that the items up for selection may    reside on many different machines anywhere on the Internet. 
  98.  
  99.    Suppose the user selects the line "Microcomputer News & Prices...".    This appears to be a directory, and so the user expects to see    contents of the directory upon request that it be fetched.  The    following lines illustrate the ensuing client-server interaction: 
  100.  
  101.      Client:           (Connects to pserver.bookstore.umn.edu at port 70)     Server:           (Accepts connection but says nothing)     Client: Prices/   (Sends the magic string terminated by CRLF)     Server:           (Sends a series of lines, each ending with CR LF)     0About PricesFPrices/AboutusFpserver.bookstore.umn.eduF70     0Macintosh PricesFPrices/MacFpserver.bookstore.umn.eduF70     0IBM PricesFPrices/IckFpserver.bookstore.umn.eduF70     0Printer & Peripheral PricesFPrices/PPPFpserver.bookstore.umn.eduF70                       (.....etc.....)     .                 (Period on a line by itself)                       (Server closes connection) 
  102.  
  103.  
  104.  
  105.  
  106.  
  107. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 5] 
  108.  RFC 1436                         Gopher                       March 1993 
  109.  
  110.  3. More details 
  111.  
  112. 3.1  Locating services 
  113.  
  114.    Documents (or other services that may be viewed ultimately as    documents, such as a student-staff phonebook) are linked to the    machine they are on by the trio of selector string, machine domain-    name, and IP port.  It is assumed that there will be one well-known    top-level or root server for an institution or campus.  The    information on this server may be duplicated by one or more other    servers to avoid a single point of failure and to spread the load    over several servers.  Departments that wish to put up their own    departmental servers need to register the machine name and port with    the administrators of the top-level Gopher server, much the same way    as they register a machine name with the campus domain-name server.    An entry which points to the departmental server will then be made at    the top level server.  This ensures that users will be able to    navigate their way down what amounts to a virtual hierarchical file    system with a well known root to any campus server if they desire. 
  115.  
  116.    Note that there is no requirement that a department register    secondary servers with the central top-level server; they may just    place a link to the secondary servers in their own primary servers.    They may indeed place links to any servers they desire in their own    server, thus creating a customized view of thethe Gopher information    universe; links can of course point back at the top-level server.    The virtual (networked) file system is therefore an arbitrary graph    structure and not necessarily a rooted tree.  The top-level node is    merely one convenient, well-known point of entry.  A set of Gopher    servers linked in this manner may function as a campus-wide    information system. 
  117.  
  118.    Servers may of course point links at other than secondary servers.    Indeed servers may point at other servers offering useful services    anywhere on the internet.  Viewed in this manner, Gopher can be seen    as an Internet-wide information system. 
  119.  
  120. 3.2 Server portability and naming 
  121.  
  122.    It is recommended that all registered servers have alias names    (domain name system CNAME) that are used by Gopher clients to locate    them.  Links to these servers should use these alias names rather    than the primary names.  If information needs to be moved from one    machine to another, a simple change of domain name system alias    (CNAME) allows this to occur without any reconfiguration of clients    in the field.  In short, the domain name system may be used to re-map    a server to a new address.  There is nothing to prevent secondary    servers or services from running on otherwise named servers or ports 
  123.  
  124.  
  125.  
  126. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 6] 
  127.  RFC 1436                         Gopher                       March 1993 
  128.  
  129.     other than 70, however these should be reachable via a primary    server. 
  130.  
  131. 3.3 Contacting server administrators 
  132.  
  133.    It is recommended that every server administrator have a document    called something like: "About Bogus University's Gopher server" as    the first item in their server's top level directory.  In this    document should be a short description of what the server holds, as    well as name, address, phone, and an e-mail address of the person who    administers the server.  This provides a way for users to get word to    the administrator of a server that has inaccurate information or is    not running correctly.  It is also recommended that administrators    place the date of last update in files for which such information    matters to the users. 
  134.  
  135. 3.4  Modular addition of services 
  136.  
  137.    The first character of each line in a server-supplied directory    listing indicates whether the item is a file (character '0'), a    directory (character '1'), or a search (character '7').  This is the    base set of item types in the Gopher protocol.  It is desirable for    clients to be able to use different services and speak different    protocols (simple ones such as finger; others such as CSO phonebook    service, or Telnet, or X.500 directory service) as needs dictate.    CSO phonebook service is a client/server phonebook system typically    used at Universities to publish names, e-mail addresses, and so on.    The CSO phonebook software was developed at the University of    Illinois and is also sometimes refered to as ph or qi.  For example,    if a server-supplied directory listing marks a certain item with type    character '2', then it means that to use this item, the client must    speak the CSO protocol.  This removes the need to be able to    anticipate all future needs and hard-wire them in the basic Internet    Gopher protocol; it keeps the basic protocol extremely simple.  In    spite of this simplicity, the scheme has the capability to expand and    change with the times by adding an agreed upon type-character for a    new service.  This also allows the client implementations to evolve    in a modular fashion, simply by dropping in a module (or launching a    new process) for some new service.  The servers for the new service    of course have to know nothing about Internet Gopher; they can just    be off-the shelf CSO, X.500, or other servers.  We do not however,    encourage arbitrary or machine-specific proliferation of service    types in the basic Gopher protocol. 
  138.  
  139.    On the other hand, subsets of other document retrieval schemes may be    mapped onto the Gopher protocol by means of "gateway-servers".    Examples of such servers include Gopher-to-FTP gateways, Gopher-to-    archie gateways, Gopher-to-WAIS gateways, etc.  There are a number of 
  140.  
  141.  
  142.  
  143. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 7] 
  144.  RFC 1436                         Gopher                       March 1993 
  145.  
  146.     advantages of such mechanisms. First, a relatively powerful server    machine inherits both the intelligence and work, rather than the more    modest, inexpensive desktop system that typically runs client    software or basic server software.  Equally important, clients do not    have to be modified to take advantage of a new resource. 
  147.  
  148. 3.5  Building clients 
  149.  
  150.    A client simply sends the retrieval string to a server if it wants to    retrieve a document or view the contents of a directory.  Of course,    each host may have pointers to other hosts, resulting in a "graph"    (not necessarily a rooted tree) of hosts.  The client software may    save (or rather "stack") the locations that it has visited in search    of a document.  The user could therefore back out of the current    location by unwinding the stack.  Alternatively, a client with    multiple-window capability might just be able to display more than    one directory or document at the same time. 
  151.  
  152.    A smart client could cache the contents of visited directories    (rather than just the directory's item descriptor), thus avoiding    network transactions if the information has been previously    retrieved. 
  153.  
  154.    If a client does not understand what a say, type 'B' item (not a core    item) is, then it may simply ignore the item in the directory    listing; the user never even has to see it.  Alternatively, the item    could be displayed as an unknown type. 
  155.  
  156.    Top-level or primary servers for a campus are likely to get more    traffic than secondary servers, and it would be less tolerable for    such primary servers to be down for any long time.  So it makes sense    to "clone" such important servers and construct clients that can    randomly choose between two such equivalent primary servers when they    first connect (to balance server load), moving to one if the other    seems to be down.  In fact, smart client implementations do this    clone server and load balancing.  Alternatively, it may make sense to    have the domain name system return one of a set of redundant of    server's IP address to load balance betwen redundant sets of    important servers. 
  157.  
  158. 3.6  Building ordinary internet Gopher servers 
  159.  
  160.    The retrieval string sent to the server might be a path to a file or    directory.  It might be the name of a script, an application or even    a query that generates the document or directory returned.  The basic    server uses the string it gets up to but not including a CR-LF or a    TAB, whichever comes first. 
  161.  
  162.  
  163.  
  164.  Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 8] 
  165.  RFC 1436                         Gopher                       March 1993 
  166.  
  167.     All intelligence is carried by the server implementation rather than    the protocol.  What you build into more exotic servers is up to you.    Server implementations may grow as needs dictate and time allows. 
  168.  
  169. 3.7  Special purpose servers 
  170.  
  171.    There are two special server types (beyond the normal Gopher server)    also discussed below: 
  172.  
  173.       1.  A server directory listing can point at a CSO nameserver (the       server returns a type character of '2') to allow a campus       student-staff phonebook lookup service.  This may show up on the       user's list of choices, perhaps preceded by the icon of a phone-       book.  If this item is selected, the client software must resort       to a pure CSO nameserver protocol when it connects to the       appropriate host. 
  174.  
  175.       2.  A server can also point at a "search server" (returns a first       character of '7').  Such servers may implement campus network (or       subnet) wide searching capability.  The most common search servers       maintain full-text indexes on the contents of text documents held       by some subset of Gopher servers.  Such a "full-text search       server" responds to client requests with a list of all documents       that contain one or more words (the search criteria).  The client       sends the server the selector string, a tab, and the search string       (words to search for). If the selector string is empty, the client       merely sends the search string.  The server returns the equivalent       of a directory listing for documents matching the search criteria.       Spaces between words are usually implied Boolean ANDs (although in       different implementations or search types, this may not       necessarily be true). 
  176.  
  177.    The CSO addition exists for historical reasons: at time of design,    the campus phone-book servers at the University of Minnesota used the    CSO protocol and it seemed simplest to just engulf them.  The index-    server is however very much a Gopher in spirit, albeit with a slight    twist in the meaning of the selector-string.  Index servers are a    natural place to incorperate gateways to WAIS and WHOIS services. 
  178.  
  179. 3.7.1  Building CSO-servers 
  180.  
  181.    A CSO Nameserver implementation for UNIX and associated documentation    is available by anonymous ftp from uxa.cso.uiuc.edu.  We do not    anticipate implementing it on other machines. 
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti         [Page 9] 
  190.  RFC 1436                         Gopher                       March 1993 
  191.  
  192.  3.7.2  Building full-text search servers 
  193.  
  194.    A full-text search server is a special-purpose server that knows    about the Gopher scheme for retrieving documents.  These servers    maintain a full-text index of the contents of plain text documents on    Gopher servers in some specified domain.  A Gopher full-text search    server was implemented using several NeXTstations because it was easy    to take advantage of the full-text index/search engine built into the    NeXT system software.  A search server for generic UNIX systems based    on the public domain WAIS search engine, is also available and    currently an optional part of the UNIX gopher server.  In addition,    at least one implementation of the gopher server incorperates a    gateway to WAIS servers by presenting the WAIS servers to gopherspace    as full-text search servers.  The gopher<->WAIS gateway servers does    the work of translating from gopher protocol to WAIS so unmodified    gopher clients can access WAIS servers via the gateway server. 
  195.  
  196.    By using several index servers (rather than a monolithic index    server) indexes may be searched in parallel (although the client    software is not aware of this).  While maintaining full-text indexes    of documents distributed over many machines may seem a daunting task,    the task can be broken into smaller pieces (update only a portion of    the indexes, search several partial indexes in parallel) so that it    is manageable.  By spreading this task over several small, cheap (and    fast) workstations it is possible to take advantage of fine-grain    parallelism.  Again, the client software is not aware of this. Client    software only needs to know that it can send a search string to an    index server and will receive a list of documents that contain the    words in the search string. 
  197.  
  198. 3.8  Item type characters 
  199.  
  200.    The client software decides what items are available by looking at    the first character of each line in a directory listing.  Augmenting    this list can extend the protocol.  A list of defined item-type    characters follows: 
  201.  
  202.    0   Item is a file    1   Item is a directory    2   Item is a CSO phone-book server    3   Error    4   Item is a BinHexed Macintosh file.    5   Item is DOS binary archive of some sort.        Client must read until the TCP connection closes.  Beware.    6   Item is a UNIX uuencoded file.    7   Item is an Index-Search server.    8   Item points to a text-based telnet session.    9   Item is a binary file! 
  203.  
  204.  
  205.  
  206. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 10] 
  207.  RFC 1436                         Gopher                       March 1993 
  208.  
  209.         Client must read until the TCP connection closes.  Beware.    +   Item is a redundant server    T   Item points to a text-based tn3270 session.    g   Item is a GIF format graphics file.    I   Item is some kind of image file.  Client decides how to display. 
  210.  
  211.    Characters '0' through 'Z' are reserved.  Local experiments should    use other characters.  Machine-specific extensions are not    encouraged.  Note that for type 5 or type 9 the client must be    prepared to read until the connection closes.  There will be no    period at the end of the file; the contents of these files are binary    and the client must decide what to do with them based perhaps on the    .xxx extension. 
  212.  
  213. 3.9  User display strings and server selector strings 
  214.  
  215.    User display strings are intended to be displayed on a line on a    typical screen for a user's viewing pleasure.  While many screens can    accommodate 80 character lines, some space is needed to display a tag    of some sort to tell the user what sort of item this is.  Because of    this, the user display string should be kept under 70 characters in    length.  Clients may truncate to a length convenient to them. 
  216.  
  217. 4.   Simplicity is intentional 
  218.  
  219.    As far as possible we desire any new features to be carried as new    protocols that will be hidden behind new document-types.  The    internet Gopher philosophy is: 
  220.  
  221.       (a) Intelligence is held by the server.  Clients have the option       of being able to access new document types (different, other types       of servers) by simply recognizing the document-type character.       Further intelligence to be borne by the protocol should be       minimized. 
  222.  
  223.       (b) The well-tempered server ought to send "text" (unless a file       must be transferred as raw binary).  Should this text include       tabs, formfeeds, frufru?  Probably not, but rude servers will       probably send them anyway.  Publishers of documents should be       given simple tools (filters) that will alert them if there are any       funny characters in the documents they wish to publish, and give       them the opportunity to strip the questionable characters out; the       publisher may well refuse. 
  224.  
  225.       (c) The well-tempered client should do something reasonable with       funny characters received in text; filter them out, leave them in,       whatever. 
  226.  
  227.  
  228.  
  229.  Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 11] 
  230.  RFC 1436                         Gopher                       March 1993 
  231.  
  232.  Appendix 
  233.  
  234.    Paul's NQBNF (Not Quite BNF) for the Gopher Protocol. 
  235.  
  236.    Note:  This is modified BNF (as used by the Pascal people) with a few           English modifiers thrown in.  Stuff enclosed in '{}' can be           repeated zero or more times.  Stuff in '[]' denotes a set of           items.  The '-' operator denotes set subtraction. 
  237.  
  238.  Directory Entity 
  239.  
  240. CR-LF     ::= ASCII Carriage Return Character followed by Line Feed               character. 
  241.  
  242. Tab       ::= ASCII Tab character. 
  243.  
  244. NUL       ::= ASCII NUL character. 
  245.  
  246. UNASCII   ::= ASCII - [Tab CR-LF NUL]. 
  247.  
  248. Lastline  ::= '.'CR-LF. 
  249.  
  250. TextBlock ::= Block of ASCII text not containing Lastline pattern. 
  251.  
  252. Type      ::= UNASCII. 
  253.  
  254. RedType   ::= '+'. 
  255.  
  256. User_Name ::= {UNASCII}. 
  257.  
  258. Selector  ::= {UNASCII}. 
  259.  
  260. Host      ::= {{UNASCII - ['.']} '.'} {UNASCII - ['.']}. 
  261.  
  262. Note: This is a Fully Qualified Domain Name as defined in RFC 1034.       (e.g., gopher.micro.umn.edu)  Hosts that have a CR-LF       TAB or NUL in their name get what they deserve. 
  263.  
  264. Digit     ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' . 
  265.  
  266. DigitSeq  ::= digit {digit}. 
  267.  
  268. Port      ::= DigitSeq. 
  269.  
  270. Note: Port corresponds the the TCP Port Number, its value should       be in the range [0..65535]; port 70 is officially assigned       to gopher. 
  271.  
  272.  
  273.  
  274. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 12] 
  275.  RFC 1436                         Gopher                       March 1993 
  276.  
  277.  DirEntity ::= Type User_Name Tab Selector Tab Host Tab Port CR-LF           {RedType User_Name Tab Selector Tab Host Tab Port CR-LF} 
  278.  
  279.  
  280.  
  281. Notes: 
  282.  
  283.    It is *highly* recommended that the User_Name field contain only    printable characters, since many different clients will be using    it.  However if eight bit characters are used, the characters    should conform with the ISO Latin1 Character Set.  The length of    the User displayable line should be less than 70 Characters; longer    lines may not fit across some screens. 
  284.  
  285.    The Selector string should be no longer than 255 characters. 
  286.  
  287.  Menu Entity 
  288.  
  289. Menu      ::= {DirEntity} Lastline.  
  290.  
  291. Menu Transaction  (Type 1 item) 
  292.  
  293. C: Opens Connection S: Accepts Connection C: Sends Selector String S: Sends Menu Entity 
  294.  
  295.    Connection is closed by either client or server (typically server). 
  296.  
  297.  Textfile Entity 
  298.  
  299. TextFile  ::= {TextBlock} Lastline 
  300.  
  301. Note:  Lines beginning with periods must be prepended with an extra      period to ensure that the transmission is not terminated early.      The client should strip extra periods at the beginning of the line. 
  302.  
  303.  TextFile Transaction (Type 0 item) 
  304.  
  305. C: Opens Connection. S: Accepts connection C: Sends Selector String. S: Sends TextFile Entity. 
  306.  
  307.  
  308.  
  309.  Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 13] 
  310.  RFC 1436                         Gopher                       March 1993 
  311.  
  312.     Connection is closed by either client or server (typically server). 
  313.  
  314. Note:  The client should be prepared for the server closing the        connection without sending the Lastline.  This allows the        client to use fingerd servers. 
  315.  
  316.  Full-Text Search Transaction (Type 7 item) 
  317.  
  318. Word      ::= {UNASCII - ' '} BoolOp ::= 'and' | 'or' | 'not' | SPACE SearchStr ::= Word {{SPACE BoolOp} SPACE Word} 
  319.  
  320. C: Opens Connection. C: Sends Selector String, Tab, Search String. S: Sends Menu Entity. 
  321.  
  322. Note:  In absence of 'and', 'or', or 'not' operators, a SPACE is        regarded as an implied 'and' operator.  Expression is evaluated        left to right.  Further, not all search engines or search        gateways currently implemented have the boolean operators        implemented. 
  323.  
  324. Binary file Transaction (Type 9 or 5 item) 
  325.  
  326. C: Opens Connection. S: Accepts connection C: Sends Selector String. S: Sends a binary file and closes connection when done. 
  327.  
  328.  Syntactic Meaning for Directory Entities 
  329.  
  330.  The client should interpret the type field as follows: 
  331.  
  332. 0   The item is a TextFile Entity.     Client should use a TextFile Transaction. 
  333.  
  334. 1   The item is a Menu Entity.     Client should use a Menu Transaction. 
  335.  
  336. 2   The information applies to a CSO phone book entity.     Client should talk CSO protocol. 
  337.  
  338. 3   Signals an error condition. 
  339.  
  340. 4   Item is a Macintosh file encoded in BINHEX format 
  341.  
  342.  
  343.  
  344. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 14] 
  345.  RFC 1436                         Gopher                       March 1993 
  346.  
  347.  5   Item is PC-DOS binary file of some sort.  Client gets to decide. 
  348.  
  349. 6   Item is a uuencoded file. 
  350.  
  351. 7   The information applies to a Index Server.     Client should use a FullText Search transaction. 
  352.  
  353. 8   The information applies to a Telnet session.     Connect to given host at given port. The name to login as at this     host is in the selector string. 
  354.  
  355. 9   Item is a binary file.  Client must decide what to do with it. 
  356.  
  357. +   The information applies to a duplicated server.  The information     contained within is a duplicate of the primary server.  The primary     server is defined as the last DirEntity that is has a non-plus     "Type" field.  The client should use the transaction as defined by     the primary server Type field. 
  358.  
  359. g   Item is a GIF graphic file. 
  360.  
  361. I   Item is some kind of image file.  Client gets to decide. 
  362.  
  363. T   The information applies to a tn3270 based telnet session.     Connect to given host at given port. The name to login as at this     host is in the selector string. 
  364.  
  365. Security Considerations 
  366.  
  367.    Security issues are not discussed in this memo. 
  368.  
  369. Authors' Addresses 
  370.  
  371.    Farhad Anklesaria    Computer and Information Services, University of Minnesota    Room 152 Shepherd Labs    100 Union Street SE    Minneapolis, MN 55455 
  372.  
  373.    Phone: (612) 625 1300    EMail: fxa@boombox.micro.umn.edu 
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 15] 
  384.  RFC 1436                         Gopher                       March 1993 
  385.  
  386.     Mark McCahill    Computer and Information Services, University of Minnesota    Room 152 Shepherd Labs    100 Union Street SE    Minneapolis, MN 55455 
  387.  
  388.    Phone: (612) 625 1300    EMail: mpm@boombox.micro.umn.edu 
  389.  
  390.     Paul Lindner    Computer and Information Services, University of Minnesota    Room 152 Shepherd Labs    100 Union Street SE    Minneapolis, MN 55455 
  391.  
  392.    Phone: (612) 625 1300    EMail: lindner@boombox.micro.umn.edu 
  393.  
  394.     David Johnson    Computer and Information Services, University of Minnesota    Room 152 Shepherd Labs    100 Union Street SE    Minneapolis, MN 55455 
  395.  
  396.    Phone: (612) 625 1300    EMail: dmj@boombox.micro.umn.edu 
  397.  
  398.     Daniel Torrey    Computer and Information Services, University of Minnesota    Room 152 Shepherd Labs    100 Union Street SE    Minneapolis, MN 55455 
  399.  
  400.    Phone: (612) 625 1300    EMail: daniel@boombox.micro.umn.edu 
  401.  
  402.     Bob Alberti    Computer and Information Services, University of Minnesota    Room 152 Shepherd Labs    100 Union Street SE    Minneapolis, MN 55455 
  403.  
  404.    Phone: (612) 625 1300    EMail: alberti@boombox.micro.umn.edu 
  405.  
  406.  
  407.  
  408. Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 16] 
  409.  
  410.