home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 00s / rfc60.txt < prev    next >
Text File  |  1997-03-24  |  19KB  |  453 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                           R. Kalin
  8. Request for Comments: 60                                             MIT
  9. Category: Experimental                                      13 July 1970
  10.  
  11.  
  12.                        A Simplified NCP Protocol
  13.  
  14. Status of this Memo
  15.  
  16.    This memo defines an Experimental Protocol for the Internet
  17.    community. This memo does not specify an Internet standard of any
  18.    kind. Discussion and suggestions for improvement are requested.
  19.    Distribution of this memo is unlimited.
  20.  
  21. Abstract
  22.  
  23.    This RFC defines a new NCP protocol that is simple enough to be
  24.    implemented on a very small computer, yet can be extended for
  25.    efficient operation on large timesharing machines. Because worst case
  26.    storage requirements can be predicted, a conservative implementation
  27.    can be freed of complicated resource allocation and storage control
  28.    procedures. A general error recovery procedure is also defined.
  29.  
  30. Overview and Rational
  31.  
  32.    The central premise of this proposal is an insistence that all user-
  33.    to-user connections be bi-directional. For those familiar with
  34.    communication theory, this appears most reasonable. All communication
  35.    requires a cyclical flow of information. To deny a simple association
  36.    between a message and its reply makes protocol unnecessarily
  37.    complicated and turns simple mechanisms of flow control into
  38.    nightmares.
  39.  
  40.    It is proposed that a bi-directional connection, or duplex link, be
  41.    identified by a pair of socket numbers, one for each end. This is
  42.    half the number presently required. Associated with the connection
  43.    are some number of "crates" or message containers. These crates
  44.    travel back and forth over the link carrying network messages from
  45.    one side to the other. Buffers are allocated at each end of the link
  46.    to hold crates and the messages that they carry. Worst case buffer
  47.    requirements are equal to the number of crates in circulation, or the
  48.    "capacity" of the link.
  49.  
  50. Details
  51.  
  52.    A message buffer has four states which follow one another cyclically.
  53.    They are:
  54.  
  55.  
  56.  
  57.  
  58. Kalin                                                           [Page 1]
  59.  
  60. RFC 60                 A Simplified NCP Protocol            13 July 1970
  61.  
  62.  
  63.    1) empty,
  64.  
  65.    2) filled with a message-laden crate to be unloaded,
  66.  
  67.    3) filled with an empty crate, and
  68.  
  69.    4) filled with a message-laden crate to be sent.
  70.  
  71.    Normally state transitions correspond to message arrival, message
  72.    removal, message insertion and message transmission.
  73.  
  74.    For a process to be an NCP it must:
  75.  
  76.    1) be able to make initial contact with foreign hosts via the control
  77.    link and, if necessary, delete user-to-user links left over from the
  78.    previous system incarnation.
  79.  
  80.    2) be able to create user-to-user links.
  81.  
  82.    3) be able to interface users with these links.
  83.  
  84.    4) be able to delete user-to-user links.
  85.  
  86.    The first of the four functions shall not be discussed here except to
  87.    point out that it contains critical races that can not be resolved
  88.    without making assumptions about maximum message propagation delays.
  89.    Since within the ARPA network, bounds on message turnaround time do
  90.    not exist, the approach chosen must necessarily be tender. The other
  91.    three functions are discussed first from the viewpoint of one
  92.    interested in implementing a minimal NCP. Then extensions and
  93.    improvements are proposed that are suitable for larger machines.
  94.  
  95.    Any NCP must be capable of creating a duplex link between a local
  96.    user process and a remote one. The current protocol accomplishes this
  97.    by queuing a potentially unbounded number of RFC's and waiting for
  98.    the user to examine the queue to determine with whom he wishes to
  99.    talk. There is no guarantee that the user will ever look at the queue
  100.    and there is no way to limit the size of the queue. The overflow
  101.    error message suggested fails in the respect because it admits that
  102.    the RFC will only be sent again. The picture need not be this bleak.
  103.    The following network conversation demonstrates how connections can
  104.    be made without using queues or relying on user process attention.
  105.  
  106.    Suppose that a local user process and a remote user process wish to
  107.    establish a new connection. The remote process asks its NCP to listen
  108.    for a connection request and gives it the socket identifier for its
  109.    end. Optionally it can give both socket identifiers. The user process
  110.    at the local end asks its NCP to send a request for a duplex link
  111.  
  112.  
  113.  
  114. Kalin                                                           [Page 2]
  115.  
  116. RFC 60                 A Simplified NCP Protocol            13 July 1970
  117.  
  118.  
  119.    (RFDL). It specifies both socket identifiers of the proposed link.
  120.    The local NCP sends a RFDL over the control link with the following
  121.    format:
  122.  
  123.    RFDL <my socket> <your socket> <max number buffers> <spare>
  124.  
  125.    The third argument is normally supplied by the local NCP and
  126.    indicates the maximum number of buffers the NCP will consider
  127.    allocating to this duplex link. If buffers are in user storage the
  128.    count may be given by the user in a call made to the NCP.
  129.  
  130.    The RFDL is received at the remote host and the remote NCP compares
  131.    <my socket> and <your socket> against the socket identifiers supplied
  132.    by unmatched listens issued to it. For listens in which just a single
  133.    identifier was given only <your socket> must match. If both socket
  134.    identifiers were given, they both must match. If a match is found an
  135.    acknowledgement message with the following format is sent back by the
  136.    NCP:
  137.  
  138.    ACDL <your socket> <my socket> <number buffers> <spare>
  139.  
  140.    The <number buffers> parameter is equal to the smaller of <max number
  141.    buffers> as specified in the RFDL and the number of message buffers
  142.    agreeable to the remote NCP. If no match is found the error message
  143.    returned is an ACDL in which <number buffers> equals zero. Note that
  144.    the RFDL mechanism is similar to a RFC mechanism in which the bound
  145.    on queue size is one and connection acceptance is done entirely by
  146.    the NCP.
  147.  
  148.    The two varieties of a listen correspond to two modes of channel
  149.    operation. The single parameter variety, as typified by a LOGIN
  150.    process, is to be used by programs that will "talk with anyone who
  151.    happens to dial their number". Screening of contacts for
  152.    appropriateness is left to the user process. The double parameter
  153.    listen is used by user programs who know with whom they will
  154.    communicate and do not wish to be bothered by random RFDL's from
  155.    other sources. Given the way in which socket name space is
  156.    partitioned, it is impossible to get a matching RFDL from any process
  157.    but the one intended.
  158.  
  159.    Message buffers for the connection are allocated in the remote host
  160.    before it sends the ACDL and in the local host at the time the ACDL
  161.    is received. The number of buffers at each end is equal to the
  162.    <number buffers> parameter in the ACDL. The state of all remote
  163.    buffers is "empty" and of all local buffers "filled with empty
  164.    crate". After buffers are allocated the local user process is
  165.    notified that it is able to start sending messages.
  166.  
  167.  
  168.  
  169.  
  170. Kalin                                                           [Page 3]
  171.  
  172. RFC 60                 A Simplified NCP Protocol            13 July 1970
  173.  
  174.  
  175.    The type of interface presented by the NCP between the user process
  176.    and the newly created duplex link is a decision local to that host. A
  177.    simple but complete interface would provide two calls to be made to
  178.    the NCP. GETMESSAGE would return the next message from the link
  179.    complete with marking, text and padding. PUTMESSAGE would take a
  180.    message, marking and text only, and buffer it for transmission. The
  181.    obvious logical errors would be reported.
  182.  
  183.    We suggest that message alignment be left to the user. On most
  184.    machines it is a simple but time consuming operation. If done in the
  185.    NCP there is no guarantee that the user will not have to readjust it
  186.    himself. It is usually not possible to know a priori whether the text
  187.    portion should be right adjusted to a word boundary, left adjusted to
  188.    a word boundary, aligned to the end of the last message, or
  189.    fragmented in some exotic way.
  190.  
  191.    Within this protocol message boundaries are used to provide storage
  192.    allocation information. If not required by the user this information
  193.    can be forgotten and the user interface can be made to appear as a
  194.    bit stream. Though welcomed by purists, such a strategy may produce
  195.    complications when attempting to synchronize both ends of a link.
  196.  
  197.    Links are deleted by removing empty crates from them and reclaiming
  198.    the buffers allocated to the crates removed. Only buffers with crates
  199.    in can be reclaimed; empty buffers must remain available to receive
  200.    messages that may arrive. When no crates are left, no buffers remain,
  201.    and the socket identifiers can be forgotten. When empty crates are
  202.    removed, a decrement size message is sent to the foreign NCP to allow
  203.    it to reduce its buffer allocation:
  204.  
  205.    DEC <my socket> <your socket> <number of buffers dropped>
  206.  
  207.    A reply is solicited from the foreign NCP to affirm the deletions or
  208.    to complain of an error. Possible errors include "no such link" and
  209.    "impossible number of buffers dropped".
  210.  
  211.    The option to close a link can be given to a user process by
  212.    providing either of two system calls. NOMOREOUTPUT declares that no
  213.    more messages will be sent by the local user process. All local
  214.    buffers for the link that contain empty crates are reclaimed by the
  215.    NCP. DEC messages are sent to the foreign NCP. As crates are emptied,
  216.    via GETMESSAGE calls, their buffers are reclaimed too. As an
  217.    alternative, the call KILLMESSAGE can be implemented. This call can
  218.    be used in place of a PUTMESSAGE. Instead of filling an empty crate
  219.    with a message to be sent, KILLMESSAGE will cause the crate to be
  220.    reclaimed and a DEC control message sent.
  221.  
  222.    In situations where the user process has died, or for some other
  223.  
  224.  
  225.  
  226. Kalin                                                           [Page 4]
  227.  
  228. RFC 60                 A Simplified NCP Protocol            13 July 1970
  229.  
  230.  
  231.    reason can not close the link, more drastic measures must be taken.
  232.    For these situations, the ABEND control message is defined:
  233.  
  234.    ABEND <my socket> <your socket>
  235.  
  236.    After sending an ABEND the issuing NCP starts to close the link. All
  237.    buffers containing input are destroyed. A DEC is issued for these and
  238.    the previously empty buffers. If messages arrive on the link, they
  239.    are destroyed and a DEC is issued. Any ABEND received for the link is
  240.    ignored.
  241.  
  242.    When the remote NCP receives the ABEND, it stops sending messages
  243.    over the link and refuses new messages from the user process at its
  244.    end. Empty buffers are reclaimed. Pending output messages are
  245.    destroyed and their buffers reclaimed. Input messages are fed to the
  246.    user process as long as it will accept them. Buffers are reclaimed as
  247.    input is accepted. DEC's are issued to cover all buffers reclaimed.
  248.    When the user process will take no more input, input messages are
  249.    destroyed and their buffers reclaimed. Eventually all buffers will be
  250.    reclaimed at both ends of the link. At such time the connection can
  251.    be considered closed and the socket numbers used can be reassigned
  252.    without ambiguity.
  253.  
  254.    Under this proposed protocol the above four functions constitute all
  255.    that must be part of a network NCP. If buffers are allocated only
  256.    when free ones exist there can be no "overflow" errors nor is there
  257.    any need to place further constraints on message flow. For any user
  258.    message that arrives buffer room is guaranteed. All control messages
  259.    can be processed without requiring additional storage to be
  260.    allocated. Attempts by a user process to issue too many listens can
  261.    be thwarted by local control procedures.
  262.  
  263.    Inefficiencies in storage will result when the number of outstanding
  264.    connections gets large. One price of coding simplicity is a fifty
  265.    percent utilization of buffer space. On large hosts it may prove
  266.    advantageous to implement some of the following NCP extensions. With
  267.    more complicated flow control procedures, it becomes possible for an
  268.    NCP to allocate more buffer space than actually exists and still not
  269.    to get into trouble. Other extensions provide message compression,
  270.    improved throughput and user transparent error recovery.
  271.  
  272.    Because some extensions require the cooperation of foreign hosts and
  273.    assume that they have implemented more than the minimal NCP it is
  274.    proposed that an inquiry control message be used to find out what
  275.    extensions the foreign host has implemented. The response to an INQ
  276.    will be a control message defining a host profile. If an "undefined
  277.    error" message is returned, the foreign host is assumed to have only
  278.    a minimal NCP.
  279.  
  280.  
  281.  
  282. Kalin                                                           [Page 5]
  283.  
  284. RFC 60                 A Simplified NCP Protocol            13 July 1970
  285.  
  286.  
  287.    A simple extension is to define a control message that will replace
  288.    user RFNM's. A user RFNM is a null text message sent, for example, as
  289.    a reply when a file is transferred via a duplex link. They are
  290.    inefficient since they tie up an entry in the IMP's link assignment
  291.    table and degrade network throughput. A more efficient solution is to
  292.    send a special message over the control link. In this way one short
  293.    message can replace several user messages.
  294.  
  295.    URFNM <my socket> <your socket> <number of user RFNM's>
  296.  
  297.    Because the control link is concurrent with the return side of the
  298.    user link, URFNM's can not be substituted for user RFNM's when there
  299.    are other messages to be sent on the return link. Otherwise ordering
  300.    will be lost and with it user transparency.
  301.  
  302.    Throughput can also be increased with a mechanism to add additional
  303.    crates on a duplex link. This might be at user instigation or be a
  304.    decision of the NCP.
  305.  
  306.    INC <my socket> <your socket> <number buffers desired>
  307.  
  308.    The foreign host replies to an increase request by returning an INCR.
  309.  
  310.    INCR <my socket> <your socket> <number buffers to be added>
  311.  
  312.    If the foreign NCP is unable to meet the additional buffer demand,
  313.    <number buffers to be added> will be less than <number buffers
  314.    desired> and possibly zero. The initial state of all local buffers
  315.    added is "filled with empty crate" and of all foreign buffers
  316.    "empty".
  317.  
  318.    The spare argument in the RFDL and ACDL could be used to declare the
  319.    maximum sized message that will actually be sent in that direction. A
  320.    perceptive NCP could observe this information and allocate smaller
  321.    buffers. A lesser NCP could ignore it and always assume maximum
  322.    length messages. For example, if the field were zero then only user
  323.    RFNM's would be sent. A smart NCP would allocate no storage at all.
  324.  
  325.    If the NCP retains a copy of each user message sent over the network
  326.    until a reply is returned, an automatic error recovery procedure can
  327.    be implemented. Because the capacity of the link is always known, an
  328.    NCP can determine whether there are messages in transit. This is done
  329.    by first sending a STOP message to the foreign NCP:
  330.  
  331.    STOP <my socket> <your socket>
  332.  
  333.    The STOP message tells the foreign NCP to temporarily stop
  334.    transmitting messages over the selected link. Unlike CEASE-ON-LINK
  335.  
  336.  
  337.  
  338. Kalin                                                           [Page 6]
  339.  
  340. RFC 60                 A Simplified NCP Protocol            13 July 1970
  341.  
  342.  
  343.    there is no guarantee as to how many messages will be sent before the
  344.    STOP takes effect. The local NCP then sends a link inquiry message:
  345.  
  346.    LINQ <my socket> <your socket>
  347.  
  348.    The reply gives the number of crates at the foreign end of the link.
  349.    The LINQ message is repeated until this number plus the number of
  350.    local crates equals the capacity of the link. At this time no
  351.    messages are in transit and the two ends of the link have been
  352.    synchronized. Messages can now be identified relative to the
  353.    synchronization point. Thus the local NCP can send a control message
  354.    asking, for example, that the third to last message be retransmitted.
  355.    The foreign NCP is able to identify which message this is and to
  356.    retransmit it. Once all errors have been recovered a START control
  357.    message, similar in format to the STOP, is sent to the foreign NCP
  358.    and normal operation continues. The entire recovery procedure can be
  359.    transparent to both user processes.
  360.  
  361.    It is expected that the larger hosts will not adhere strictly to the
  362.    worst case storage allocation requirements. Rather they will allocate
  363.    more buffers than they have and reply on statistics to keep them out
  364.    of trouble most of the time. Such conduct is perfectly permissible as
  365.    long as it is transparent to foreign hosts. The protocol allows an
  366.    NCP to lie about storage allocation as long as he is not caught. In
  367.    situations where detection appears imminent some of the following
  368.    control mechanisms will need to be applied. They are listed in
  369.    increasing order of power.
  370.  
  371.    a) Do not send out any user RFNM's or other short messages. There is
  372.    a good chance that they will be replaced by longer messages that will
  373.    strain buffer capacity even more.
  374.  
  375.    b) Try not to accept any new messages from the IMP. Block local
  376.    processes attempting to issue messages.
  377.  
  378.    c) Issue DEC's to free up buffer space. Do not allocate more than one
  379.    buffer to RFDL's and refuse INC's.
  380.  
  381.    d) Fake errors in messages waiting for local user action. Do this
  382.    only if the host that sent it has implemented error recovery. This
  383.    will free buffer space and allow you to recover later. This final
  384.    measure is admittedly a last resort, but it should be powerful enough
  385.    to control any emergency.
  386.  
  387.    It is the hope of the author that the above protocol presents an
  388.    attractive alternative to that proposed by RFC 54 and its additions.
  389.    Although it appears at a late date, it should not be more than a
  390.    minor jolt to implementation efforts. It is simple enough to be
  391.  
  392.  
  393.  
  394. Kalin                                                           [Page 7]
  395.  
  396. RFC 60                 A Simplified NCP Protocol            13 July 1970
  397.  
  398.  
  399.    implemented quickly. If adopted, a majority of the present sites
  400.    could be talking intelligently with one another by the end of the
  401.    summer.
  402.  
  403. References
  404.  
  405.    [1] Crocker, S.D., Postel, J., Newkirk, J. and Kraley, M., "Official
  406.    protocol proffering", RFC 54, June 1970.
  407.  
  408. Author's Address
  409.  
  410.    Richard Kalin
  411.    MIT Lincoln Laboratory
  412.  
  413.  
  414.  
  415.  
  416.        [ This RFC was put into machine readable form for entry ]
  417.          [ into the online RFC archives by Ian Redfern 3/97 ]
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451. Kalin                                                           [Page 8]
  452.  
  453.