home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 900s / rfc969.txt < prev    next >
Text File  |  1992-09-22  |  40KB  |  855 lines

  1.  
  2.  
  3. Network Working Group                                     David D. Clark
  4. Request for Comments: 969                                Mark L. Lambert
  5.                                                              Lixia Zhang
  6.                                 M. I. T. Laboratory for Computer Science
  7.                                                            December 1985
  8.  
  9.                  NETBLT: A Bulk Data Transfer Protocol
  10.  
  11.  
  12. 1. STATUS OF THIS MEMO
  13.  
  14.    This RFC suggests a proposed protocol for the ARPA-Internet
  15.    community, and requests discussion and suggestions for improvements.
  16.    This is a preliminary discussion of the NETBLT protocol.  It is
  17.    published for discussion and comment, and does not constitute a
  18.    standard.  As the proposal may change, implementation of this
  19.    document is not advised.  Distribution of this memo is unlimited.
  20.  
  21. 2. INTRODUCTION
  22.  
  23.    NETBLT (Network Block Transfer) is a transport level protocol
  24.    intended for the rapid transfer of a large quantity of data between
  25.    computers. It provides a transfer that is reliable and flow
  26.    controlled, and is structured to provide maximum throughput over a
  27.    wide variety of networks.
  28.  
  29.    The protocol works by opening a connection between two clients the
  30.    sender and the receiver), transferring the data in a series of large
  31.    data aggregates called buffers, and then closing the connection.
  32.    Because the amount of data to be transferred can be arbitrarily
  33.    large, the client is not required to provide at once all the data to
  34.    the protocol module.  Instead, the data is provided by the client in
  35.    buffers.  The NETBLT layer transfers each buffer as a sequence of
  36.    packets, but since each buffer is composed of a large number of
  37.    packets, the per-buffer interaction between NETBLT and its client is
  38.    far more efficient than a per-packet interaction would be.
  39.  
  40.    In its simplest form, a NETBLT transfer works as follows.  The
  41.    sending client loads a buffer of data and calls down to the NETBLT
  42.    layer to transfer it.  The NETBLT layer breaks the buffer up into
  43.    packets and sends these packets across the network in Internet
  44.    datagrams.  The receiving NETBLT layer loads these packets into a
  45.    matching buffer provided by the receiving client.  When the last
  46.    packet in the buffer has been transmitted, the receiving NETBLT
  47.    checks to see that all packets in that buffer have arrived.  If some
  48.    packets are missing, the receiving NETBLT requests that they be
  49.    resent.  When the buffer has been completely transmitted, the
  50.    receiving client is notified by its NETBLT layer.  The receiving
  51.    client disposes of the buffer and provides a new buffer to receive
  52.    more data.  The receiving NETBLT notifies the sender that the buffer
  53.    arrived, and the sender prepares and sends the next buffer in the
  54.  
  55.  
  56. Clark & Lambert & Zhang                                         [Page 1]
  57.  
  58.  
  59.  
  60. RFC 969                                                    December 1985
  61. NETBLT: A Bulk Data Transfer Protocol
  62.  
  63.  
  64.    same manner.  This continues until all buffers have been sent, at
  65.    which time the sender notifies the receiver that the transmission has
  66.    been completed.  The connection is then closed.
  67.  
  68.    As described above, the NETBLT protocol is "lock-step"; action is
  69.    halted after a buffer is transmitted, and begins again after
  70.    confirmation is received from the receiver of data.  NETBLT provides
  71.    for multiple buffering, in which several buffers can be transmitted
  72.    concurrently.  Multiple buffering makes packet flow essentially
  73.    continuous and can improve performance markedly.
  74.  
  75.    The remainder of this document describes NETBLT in detail.  The next
  76.    sections describe the philosophy behind a number of protocol
  77.    features: packetization, flow control, reliability, and connection
  78.    management. The final sections describe the protocol format.
  79.  
  80. 3. BUFFERS AND PACKETS
  81.  
  82.    NETBLT is designed to permit transfer of an essentially arbitrary
  83.    amount of data between two clients.  During connection setup the
  84.    sending NETBLT can optionally inform the receiving NETBLT of the
  85.    transfer size; the maximum transfer length is imposed by the field
  86.    width, and is 2**32 bytes.  This limit should permit any practical
  87.    application.  The transfer size parameter is for the use of the
  88.    receiving client; the receiving NETBLT makes no use of it.  A NETBLT
  89.    receiver accepts data until told by the sender that the transfer is
  90.    complete.
  91.  
  92.    The data to be sent must be broken up into buffers by the client.
  93.    Each buffer must be the same size, save for the last buffer.  During
  94.    connection setup, the sending and receiving NETBLTs negotiate the
  95.    buffer size, based on limits provided by the clients.  Buffer sizes
  96.    are in bytes only; the client is responsible for breaking up data
  97.    into buffers on byte boundaries.
  98.  
  99.    NETBLT has been designed and should be implemented to work with
  100.    buffers of arbitrary size.  The only fundamental limitation on buffer
  101.    size should be the amount of memory available to the client.  Buffers
  102.    should be as large as possible since this minimizes the number of
  103.    buffer transmissions and therefore improves performance.
  104.  
  105.    NETBLT is designed to require a minimum of its own memory, allowing
  106.    the client to allocate as much memory as possible for buffer storage.
  107.    In particular, NETBLT does not keep buffer copies for retransmission
  108.    purposes.  Instead, data to be retransmitted is recopied directly
  109.  
  110.  
  111.  
  112.  
  113. Clark & Lambert & Zhang                                         [Page 2]
  114.  
  115.  
  116.  
  117. RFC 969                                                    December 1985
  118. NETBLT: A Bulk Data Transfer Protocol
  119.  
  120.  
  121.    from the client buffer.  This does mean that the client cannot
  122.    release buffer storage piece by piece as the buffer is sent, but this
  123.    has not proved a problem in preliminary NETBLT implementations.
  124.  
  125.    Buffers are broken down by the NETBLT layer into sequences of DATA
  126.    packets.  As with the buffer size, the packet size is negotiated
  127.    between the sending and receiving NETBLTs during connection setup.
  128.    Unlike buffer size, packet size is visible only to the NETBLT layer.
  129.  
  130.    All DATA packets save the last packet in a buffer must be the same
  131.    size.  Packets should be as large as possible, since in most cases
  132.    (including the preliminary protocol implementation) performance is
  133.    directly related to packet size.  At the same time, the packets
  134.    should not be so large as to cause Internet fragmentation, since this
  135.    normally causes performance degrada- tion.
  136.  
  137.    All buffers save the last buffer must be the same size; obviously the
  138.    last buffer can be any size required to complete the transfer. Since
  139.    the receiving NETBLT does not know the transfer size in advance, it
  140.    needs some way of identifying the last packet in each buffer.  For
  141.    this reason, the last packet of every buffer is not a DATA packet but
  142.    rather an LDATA packet.  DATA and LDATA packets are identical save
  143.    for the packet type.
  144.  
  145. 4. FLOW CONTROL
  146.  
  147.    NETBLT uses two strategies for flow control, one internal and one at
  148.    the client level.
  149.  
  150.    The sending and receiving NETBLTs transmit data in buffers; client
  151.    flow control is therefore at a buffer level.  Before a buffer can be
  152.    transmitted, NETBLT confirms that both clients have set up matching
  153.    buffers, that one is ready to send data, and that the other is ready
  154.    to receive data.  Either client can therefore control the flow of
  155.    data by not providing a new buffer.  Clients cannot stop a buffer
  156.    transfer while it is in progress.
  157.  
  158.    Since buffers can be quite large, there has to be another method for
  159.    flow control that is used during a buffer transfer.  The NETBLT layer
  160.    provides this form of flow control.
  161.  
  162.    There are several flow control problems that could arise while a
  163.    buffer is being transmitted.  If the sending NETBLT is transferring
  164.    data faster than the receiving NETBLT can process it, the receiver's
  165.    ability to buffer unprocessed packets could be overflowed, causing
  166.    packets to be lost.  Similarly, a slow gateway or intermediate
  167.    network could cause packets to collect and overflow network packet
  168.  
  169.  
  170. Clark & Lambert & Zhang                                         [Page 3]
  171.  
  172.  
  173.  
  174. RFC 969                                                    December 1985
  175. NETBLT: A Bulk Data Transfer Protocol
  176.  
  177.  
  178.    buffer space.  Packets will then be lost within the network,
  179.    degrading performance.  This problem is particularly acute for NETBLT
  180.    because NETBLT buffers will generally be quite large, and therefore
  181.    composed of many packets.
  182.  
  183.    A traditional solution to packet flow control is a window system, in
  184.    which the sending end is permitted to send only a certain number of
  185.    packets at a time.  Unfortunately, flow control using windows tends
  186.    to result in low throughput.  Windows must be kept small in order to
  187.    avoid overflowing hosts and gateways, and cannot easily be updated,
  188.    since an end-to-end exchange is required for each change.
  189.  
  190.    To permit high throughput over a variety of networks and gateways of
  191.    differing speeds, NETBLT uses a novel flow control ethod: rate
  192.    control.  The transmission rate is negotiated by the sending and
  193.    receiving NETBLTs during connection setup and after each buffer
  194.    transmission.  The sender uses timers, rather than messages from the
  195.    receiver, to maintain the negotiated rate.
  196.  
  197.    In its simplest form, rate control specifies a minimum time period
  198.    per packet transmission.  This can cause performance problems for
  199.    several reasons: the transmission time for a single packet is very
  200.    small, frequently smaller than the granularity of the timing
  201.    mechanism.  Also, the overhead required to maintain timing mechanisms
  202.    on a per packet basis is relatively high, which degrades performance.
  203.  
  204.    The solution is to control the transmission rate of groups of
  205.    packets, rather than single packets.  The sender transmits a burst of
  206.    packets over negotiated interval, then sends another burst.  In this
  207.    way, the overhead decreases by a factor of the burst size, and the
  208.    per-burst transmission rate is large enough that timing mechanisms
  209.    will work properly.  The NETBLT's rate control therefore has two
  210.    parts, a burst size and a burst rate, with (burst size)/(burst rate)
  211.    equal to the average transmission rate per packet.
  212.  
  213.    The burst size and burst rate should be based not only on the packet
  214.    transmission and processing speed which each end can handle, but also
  215.    on the capacities of those gateways and networks intermediate to the
  216.    transfer.  Following are some intuitive values for packet size,
  217.    buffer size, burst size, and burst rate.
  218.  
  219.    Packet sizes can be as small as 128 bytes.  Performance with packets
  220.    this small is almost always bad, because of the high per-packet
  221.    processing overhead.  Even the default Internet Protocol packet size
  222.    of 576 bytes is barely big enough for adequate performance.  Most
  223.  
  224.  
  225.  
  226.  
  227. Clark & Lambert & Zhang                                         [Page 4]
  228.  
  229.  
  230.  
  231. RFC 969                                                    December 1985
  232. NETBLT: A Bulk Data Transfer Protocol
  233.  
  234.  
  235.    networks do not support packet sizes much larger than one or two
  236.    thousand bytes, and packets of this size can also get fragmented when
  237.    traveling over intermediate networks, degrading performance.
  238.  
  239.    The size of a NETBLT buffer is limited only by the amount of memory
  240.    available to a client.  Theoretically, buffers of 100K bytes or more
  241.    are possible.  This would mean the transmission of 50 to 100 packets
  242.    per buffer.
  243.  
  244.    The burst size and burst rate are obviously very machine dependent.
  245.    There is a certain amount of transmission overhead in the sending and
  246.    receiving machines associated with maintaining timers and scheduling
  247.    processes.  This overhead can be minimized by sending packets in
  248.    large bursts.  There are also limitations imposed on the burst size
  249.    by the number of available packet buffers.  On most modern operating
  250.    systems, a burst size of between five and ten packets should reduce
  251.    the overhead to an acceptable level.  In fact, a preliminary NETBLT
  252.    implementation for the IBM PC/AT sends packets in bursts of five.  It
  253.    could send more, but is limited by available memory.
  254.  
  255.    The burst rate is in part determined by the granularity of the
  256.    sender's timing mechanism, and in part by the processing speed of the
  257.    receiver and any intermediate gateways.  It is also directly related
  258.    to the burst size.  Burst rates from 60 to 100 milliseconds have been
  259.    tried on the preliminary NETBLT implementation with good results
  260.    within a single local-area network.  This value clearly depends on
  261.    the network bandwidth and packet buffering available.
  262.  
  263.    All NETBLT flow control parameters (packet size, buffer size, burst
  264.    size, and burst rate) are negotiated during connection setup.  The
  265.    negotiation process is the same for all parameters.  The client
  266.    initiating the connection (the active end) proposes and sends a set
  267.    of values for each parameter with its open connection request.  The
  268.    other client (the passive end) compares these values with the
  269.    highest-performance values it can support.  The passive end can then
  270.    modify any of the parameters only by making them more restrictive.
  271.    The modified parameters are then sent back to the active end in the
  272.    response message.  In addition, the burst size and burst rate can be
  273.    re-negotiated after each buffer transmission to adjust the transfer
  274.    rate according to the performance observed from transferring the
  275.    previous buffer.  The receiving end sends a pair of burst size and
  276.    burst rate values in the OK message.  The sender compares these
  277.    values with the values it can support.  Again, it may then modify any
  278.    of the parameters only by making them more restrictive.  The modified
  279.    parameters are then communicated to the receiver in a NULL-ACK
  280.    packet, described later.
  281.  
  282.  
  283.  
  284. Clark & Lambert & Zhang                                         [Page 5]
  285.  
  286.  
  287.  
  288. RFC 969                                                    December 1985
  289. NETBLT: A Bulk Data Transfer Protocol
  290.  
  291.  
  292.    Obviously each of the parameters depend on many factors-- gateway and
  293.    host processing speeds, available memory, timer granularity--some of
  294.    which cannot be checked by either client.  Each client must therefore
  295.    try to make as best a guess as it can, tuning for performance on
  296.    subsequent transfers.
  297.  
  298. 5. RELIABILITY
  299.  
  300.    Each NETBLT transfer has three stages, connection setup, data
  301.    transfer, and connection close.  Each stage must be completed
  302.    reliably; methods for doing this are described below.
  303.  
  304.    5.1. Connection Setup
  305.  
  306.       A NETBLT connection is set up by an exchange of two packets
  307.       between the active client and the passive client.  Note that
  308.       either client can send or receive data; the words "active" and
  309.       "passive" are only used to differentiate the client initiating the
  310.       connection process from the client responding to the connection
  311.       request.  The first packet sent is an OPEN packet; the passive end
  312.       acknowledges the OPEN packet by sending a RESPONSE packet.  After
  313.       these two packets have been exchanged, the transfer can begin.
  314.  
  315.       As discussed in the previous section, the OPEN and RESPONSE
  316.       packets are used to negotiate flow control parameters.  Other
  317.       parameters used in the transfer of data are also negotiated.
  318.       These parameters are (1) the maximum number of buffers that can be
  319.       sending at any one time (this permits multiple buffering and
  320.       higher throughput) and (2) whether or not DATA/LDATA packet data
  321.       will be checksummed.  NETBLT automatically checksums all
  322.       non-DATA/LDATA packets.  If the negotiated checksum flag is set to
  323.       TRUE (1), both the header and the data of a DATA/LDATA packet are
  324.       checksummed; if set to FALSE (0), only the header is checksummed.
  325.       NETBLT uses the same checksumming algorithm as TCP uses.
  326.  
  327.       Finally, each end transmits its death-timeout value in either the
  328.       OPEN or the RESPONSE packet.  The death-timeout value will be used
  329.       to determine the frequency with which to send KEEPALIVE packets
  330.       during idle periods of an opened connection (death timers and
  331.       KEEPALIVE packets are described in the following section).
  332.  
  333.       The active end specifies a passive client through a
  334.       client-specific "well-known" 16 bit port number on which the
  335.       passive end listens.  The active end identifies itself through a
  336.       32 bit Internet address and a 16 bit port number.
  337.  
  338.       In order to allow the active and passive ends to communicate
  339.  
  340.  
  341. Clark & Lambert & Zhang                                         [Page 6]
  342.  
  343.  
  344.  
  345. RFC 969                                                    December 1985
  346. NETBLT: A Bulk Data Transfer Protocol
  347.  
  348.  
  349.       miscellaneous useful information, an unstructured, variable-
  350.       length field is provided in OPEN and RESPONSE messages for an
  351.       client-specific information that may be required.
  352.  
  353.       Recovery for lost OPEN and RESPONSE packets is provided by the use
  354.       of timers.  The active end sets a timer when it sends an OPEN
  355.       packet. When the timer expires, another OPEN packet is sent, until
  356.       some pre-determined maximum number of OPEN packets have been sent.
  357.       A similar scheme is used for the passive end when it sends a
  358.       RESPONSE packet.  When a RESPONSE packet is received by the active
  359.       end, it clears its timer.  The passive end's timer is cleared
  360.       either by receipt of a GO or a DATA packet, as described in the
  361.       section on data transfer.
  362.  
  363.       To prevent duplication of OPEN and RESPONSE packets, the OPEN
  364.       packet contains a 32 bit connection unique ID that must be
  365.       returned in the RESPONSE packet.  This prevents the initiator from
  366.       confusing the response to the current request with the response to
  367.       an earlier connection request (there can only be one connection
  368.       between any two ports).  Any OPEN or RESPONSE packet with a
  369.       destination port matching that of an open connection has its
  370.       unique ID checked.  A matching unique ID implies a duplicate
  371.       packet, and the packet is ignored.  A non-matching unique ID must
  372.       be treated as an attempt to open a second connection between the
  373.       same port pair and must be rejected by sending an ABORT message.
  374.  
  375.    5.2. Data Transfer
  376.  
  377.       The simplest model of data transfer proceeds as follows.  The
  378.       sending client sets up a buffer full of data.  The receiving
  379.       NETBLT sends a GO message inside a CONTROL packet to the sender,
  380.       signifying that it too has set up a buffer and is ready to receive
  381.       data into it. Once the GO message has been received, the sender
  382.       transmits the buffer as a series of DATA packets followed by an
  383.       LDATA packet.  When the last packet in the buffer has been
  384.       received, the receiver sends a RESEND message inside a CONTROL
  385.       packet containing a list of packets that were not received.  The
  386.       sender resends these packets.  This process continues until there
  387.       are no missing packets, at which time the receiver sends an OK
  388.       message inside a CONTROL packet to the sender, sets up another
  389.       buffer to receive data and sends another GO message.  The sender,
  390.       having received the OK message, sets up another buffer, waits for
  391.       the GO message, and repeats the process.
  392.  
  393.       There are several obvious flaws with this scheme.  First, if the
  394.       LDATA packet is lost, how does the receiver know when the buffer
  395.       has been transmitted?  Second, what if the GO, OK, or RESEND
  396.  
  397.  
  398. Clark & Lambert & Zhang                                         [Page 7]
  399.  
  400.  
  401.  
  402. RFC 969                                                    December 1985
  403. NETBLT: A Bulk Data Transfer Protocol
  404.  
  405.  
  406.       messages are lost?  The sender cannot act on a packet it has not
  407.       received, so the protocol will hang.  Solutions for each of these
  408.       problems are presented below, and are based on two kinds of
  409.       timers, a data timer and a control timer.
  410.  
  411.       NETBLT solves the LDATA packet loss problem by using a data timer
  412.       at the receiving end.  When the first DATA packet in a buffer
  413.       arrives, the receiving NETBLT sets its data timer; at the same
  414.       time, it clears its control timer, described below.  If the data
  415.       timer expires, the receiving end assumes the buffer has been
  416.       transmitted and all missing packets lost.  It then sends a RESEND
  417.       message containing a list of the missing packets.
  418.  
  419.       NETBLT solves the second problem, that of missing OK, GO, and
  420.       RESEND messages, through use of a control timer.  The receiver can
  421.       send one or more control messages (OK, GO, or RESEND) within a
  422.       single CONTROL packet.  Whenever the receiver sends a control
  423.       packet, it sets a control timer (at the same time it clears its
  424.       data timer, if one has been set).
  425.  
  426.       The control timer is cleared as follows: Each control message
  427.       includes a sequence number which starts at one and increases by
  428.       one for each control message sent.  The sending NETBLT checks the
  429.       sequence number of every incoming control message against all
  430.       other sequence numbers it has received.  It stores the highest
  431.       sequence number below which all other received sequence numbers
  432.       are consecutive, and returns this number in every packet flowing
  433.       back to the receiver.  The receiver is permitted to clear the
  434.       control timer of every packet with a sequence number equal to or
  435.       lower than the sequence number returned by the sender.
  436.  
  437.       Ideally, a NETBLT implementation should be able to cope with
  438.       out-of-sequence messages, perhaps collecting them for later
  439.       processing, or even processing them immediately.  If an incoming
  440.       control message "fills" a "hole" in a group of message sequence
  441.       numbers, the implementation could even be clever enough to detect
  442.       this and adjust its outgoing sequence value accordingly.
  443.  
  444.       When the control timer expires, the receiving NETBLT resends the
  445.       control message and resets the timer.  After a predetermined
  446.       number of resends, the receiving NETBLT can assume that the
  447.       sending NETBLT has died, and can reset the connection.
  448.  
  449.       The sending NETBLT, upon receiving a control message, should act
  450.       as quickly as possible on the packet; it either sets up a new
  451.       buffer (upon receipt of an OK packet for a previous buffer),
  452.       resends data (upon receipt of a RESEND packet), or sends data
  453.  
  454.  
  455. Clark & Lambert & Zhang                                         [Page 8]
  456.  
  457.  
  458.  
  459. RFC 969                                                    December 1985
  460. NETBLT: A Bulk Data Transfer Protocol
  461.  
  462.  
  463.       (upon receipt of a GO packet).  If the sending NETBLT is not in a
  464.       position to send data, it sends a NULL-ACK packet, which contains
  465.       a
  466.       high-received-sequence-number as described above (this permits the
  467.       receiving NETBLT to clear the control timers of any packets which
  468.       are outstanding), and waits until it can send more data.  In all
  469.       of these cases, the overhead for a response to the incoming
  470.       control message should be small; the total time for a response to
  471.       reach the receiving NETBLT should not be much more than the
  472.       network round-trip transit time, plus a variance factor.
  473.  
  474.       The timer system can be summarized as follows: normally, the
  475.       receiving NETBLT is working under one of two types of timers, a
  476.       control timer or a data timer.  There is one data timer per buffer
  477.       transmission and one control timer per control packet.  The data
  478.       timer is active while its buffer is being transferred; a control
  479.       timer is active while it is between buffer transfers.
  480.  
  481.       The above system still leaves a few problems.  If the sending
  482.       NETBLT is not ready to send, it sends a single NULL-ACK packet to
  483.       clear any outstanding control timers at the receiving end.  After
  484.       this the receiver will wait.  The sending NETBLT could die and the
  485.       receiver, with all its control timers cleared, would hang.  Also,
  486.       the above system puts timers only on the receiving NETBLT.  The
  487.       sending NETBLT has no timers; if the receiving NETBLT dies, the
  488.       sending NETBLT will just hang waiting for control messages.
  489.  
  490.       The solution to the above two problems is the use of a death timer
  491.       and a keepalive packet for both the sending and receiving NETBLTs.
  492.       As soon as the connection is opened, each end sets a death timer;
  493.       this timer is reset every time a packet is received.  When a
  494.       NETBLT's death timer at one end expires, it can assume the other
  495.       end has died and can close the connection.
  496.  
  497.       It is quite possible that the sending or receiving NETBLTs will
  498.       have to wait for long periods of time while their respective
  499.       clients get buffer space and load their buffers with data.  Since
  500.       a NETBLT waiting for buffer space is in a perfectly valid state,
  501.       the protocol must have some method for preventing the other end's
  502.       death timer from expiring. The solution is to use a KEEPALIVE
  503.       packet, which is sent repeatedly at fixed intervals when a NETBLT
  504.       is waiting for buffer space.  Since the death timer is reset
  505.       whenever a packet is received, it will never expire as long as the
  506.       other end sends packets.
  507.  
  508.       The frequency with which KEEPALIVE packets are transmitted is
  509.       computed as follows: At connection startup, each NETBLT chooses a
  510.  
  511.  
  512. Clark & Lambert & Zhang                                         [Page 9]
  513.  
  514.  
  515.  
  516. RFC 969                                                    December 1985
  517. NETBLT: A Bulk Data Transfer Protocol
  518.  
  519.  
  520.       death-timeout value and sends it to the other end in either the
  521.       OPEN or the RESPONSE packet.  The other end takes the
  522.       death-timeout value and uses it to compute a frequency with which
  523.       to send KEEPALIVE packets.  The KEEPALIVE frequency should be high
  524.       enough that several KEEPALIVE packets can be lost before the other
  525.       end's death timer expires.
  526.  
  527.       Both ends must have some way of estimating the values of the death
  528.       timers, the control timers, and the data timers.  The timer values
  529.       obviously cannot be specified in a protocol document since they
  530.       are very machine- and network-load-dependent.  Instead they must
  531.       be computed on a per-connection basis.  The protocol has been
  532.       designed to make such determination easy.
  533.  
  534.       The death timer value is relatively easy to estimate.  Since it is
  535.       continually reset, it need not be based on the transfer size.
  536.       Instead, it should be based at least in part on the type of
  537.       application using NETBLT.  User applications should have smaller
  538.       death timeout values to avoid forcing humans to wait long periods
  539.       of time for a death timeout to occur.  Machine applications can
  540.       have longer timeout values.
  541.  
  542.       The control timer must be more carefully estimated.  It can have
  543.       as its initial value an arbitrary number; this number can be used
  544.       to send the first control packet.  Subsequent control packets can
  545.       have their timer values based on the network round-trip transit
  546.       time (i.e.  the time between sending the control packet and
  547.       receiving the acknowledgment of the corresponding sequence number)
  548.       plus a variance factor.  The timer value should be continually
  549.       updated, based on a smoothed average of collected round-trip
  550.       transit times.
  551.  
  552.       The data timer is dependent not on the network round-trip transit
  553.       time, but on the amount of time required to transfer a buffer of
  554.       data. The time value can be computed from the burst rate and the
  555.       number of bursts per buffer, plus a variance value <1>. During the
  556.       RESENDing phase, the data timer value should be set according to
  557.       the number of missing packets.
  558.  
  559.       The timers have been designed to permit reasonable estimation.  In
  560.       particular, in other protocols, determination of round-trip delay
  561.       has been a problem since the action performed by the other end on
  562.       receipt of a particular packet can vary greatly depending on the
  563.       packet type. In NETBLT, the action taken by the sender on receipt
  564.       of a control message is by and large the same in all cases, making
  565.       the round-trip delay relatively independent of the client.
  566.  
  567.  
  568.  
  569. Clark & Lambert & Zhang                                        [Page 10]
  570.  
  571.  
  572.  
  573. RFC 969                                                    December 1985
  574. NETBLT: A Bulk Data Transfer Protocol
  575.  
  576.  
  577.       Timer value estimation is extremely important, especially in a
  578.       high-performance protocol like NETBLT.  If the estimates are too
  579.       low, the protocol makes many unneeded retransmissions, degrading
  580.       performance.  A short control timer value causes the sending
  581.       NETBLT to receive duplicate control messages (which it can reject,
  582.       but which takes time).  A short data timer value causes the
  583.       receiving NETBLT to send unnecessary RESEND packets.  This causes
  584.       considerably greater performance degradation since the sending
  585.       NETBLT does not merely throw away a duplicate packet, but instead
  586.       has to send a number of DATA packets.  Because data timers are set
  587.       on each buffer transfer instead of on each DATA packet transfer,
  588.       we afford to use a small variance value without worrying about
  589.       performance degradation.
  590.  
  591.    5.3. Closing the Connection
  592.  
  593.       There are three ways to close a connection: a connection close, a
  594.       "quit", or an "abort".
  595.  
  596.       The connection close occurs after a successful data transfer.
  597.       When the sending NETBLT has received an OK packet for the last
  598.       buffer in the transfer, it sends a DONE packet <2>.  On receipt of
  599.       the DONE packet, the receiving NETBLT can close its half of the
  600.       connection.  The sending NETBLT dallies for a predetermined amount
  601.       of time after sending the DONE packet.  This allows for the
  602.       possibility of the DONE packet's having been lost.  If the DONE
  603.       packet was lost, the receiving NETBLT will continue to send the
  604.       final OK packet, which will cause the sending end to resend the
  605.       DONE packet.  After the dally period expires, the sending NETBLT
  606.       closes its half of the connection.
  607.  
  608.       During the transfer, one client may send a QUIT packet to the
  609.       other if it thinks that the other client is malfunctioning.  Since
  610.       the QUIT occurs at a client level, the QUIT transmission can only
  611.       occur between buffer transmissions.  The NETBLT receiving the QUIT
  612.       packet can take no action other than to immediately notify its
  613.       client and transmit a QUITACK packet.  The QUIT sender must time
  614.       out and retransmit until a QUITACK has been received or a
  615.       predetermined number of resends have taken place.  The sender of
  616.       the QUITACK dallies in the manner described above.
  617.  
  618.       An ABORT takes place when a NETBLT layer thinks that it or its
  619.       opposite is malfunctioning.  Since the ABORT originates in the
  620.       NETBLT layer, it can be sent at any time.  Since the ABORT implies
  621.       that the NETBLT layer is malfunctioning, no transmit reliability
  622.       is expected, and the sender can immediately close it connection.
  623.  
  624.  
  625.  
  626. Clark & Lambert & Zhang                                        [Page 11]
  627.  
  628.  
  629.  
  630. RFC 969                                                    December 1985
  631. NETBLT: A Bulk Data Transfer Protocol
  632.  
  633.  
  634. 6. MULTIPLE BUFFERING
  635.  
  636.    In order to increase performance, NETBLT has been designed in a
  637.    manner that encourages a multiple buffering implementation.  Multiple
  638.    buffering is a technique in which the sender and receiver allocate
  639.    and transmit buffers in a manner that allows error recovery of
  640.    previous buffers to be concurrent with transmission of current
  641.    buffer.
  642.  
  643.    During the connection setup phase, one of the negotiated parameters
  644.    is the number of concurrent buffers permitted during the transfer.
  645.    The simplest transfer allows for a maximum of one buffer to be
  646.    transmitted at a time; this is effectively a lock-step protocol and
  647.    causes time to be wasted while the sending NETBLT receives permission
  648.    to send a new buffer.  If there are more than one buffer available,
  649.    transfer of the next buffer may start right after the current buffer
  650.    finishes.  For example, assume buffer A and B are allowed to transfer
  651.    concurrently, with A preceding B. As soon as A finishes transferring
  652.    its data and is waiting for either an OK or a RESEND message, B can
  653.    start sending immediately, keeping data flowing at a stable rate.  If
  654.    A receives an OK, it is done; if it receives a RESEND, the missing
  655.    packets specified in the RESEND message are retransmitted.  All
  656.    packets flow out through a priority pipe, with the priority equal to
  657.    the buffer number, and with the transfer rate specified by the burst
  658.    size and burst rate.  Since buffer numbers increase monotonically,
  659.    packets from an earlier buffer in the pipe will always precede those
  660.    of the later ones.  One necessary change to the timing algorithm is
  661.    that when the receiving NETBLT set data timer for a new buffer, the
  662.    timer value should also take into consideration of the transfer time
  663.    for all missing packets from the previous buffers.
  664.  
  665.    Having several buffers transmitting concurrently is actually not that
  666.    much more complicated than transmitting a single buffer at a time.
  667.    The key is to visualize each buffer as a finite state machine;
  668.    several buffers are merely a group of finite state machines, each in
  669.    one of several states.  The transfer process consists of moving
  670.    buffers through various states until the entire transmission has
  671.    completed.
  672.  
  673.    The state sequence of a send-receive buffer pair is as follows: the
  674.    sending and receiving buffers are created independently.  The
  675.    receiving NETBLT sends a GO message, putting its buffer in a
  676.    "receiving" state, and sets its control timer; the sending NETBLT
  677.    receives the GO message, putting its buffer into a "sending" state.
  678.    The sending NETBLT sends data until the buffer has been transmitted.
  679.    If the receiving NETBLT's data timer goes off before it received the
  680.    last (LDATA) packet, or it receives the LDATA packet in the buffer
  681.  
  682.  
  683. Clark & Lambert & Zhang                                        [Page 12]
  684.  
  685.  
  686.  
  687. RFC 969                                                    December 1985
  688. NETBLT: A Bulk Data Transfer Protocol
  689.  
  690.  
  691.    and packets are missing, it sends a RESEND packet and moves the
  692.    buffer into a "resending" state.  Once all DATA packets in the buffer
  693.    and the LDATA packet have been received, the receiving NETBLT enters
  694.    its buffer into a "received" state and sends an OK packet.  The
  695.    sending NETBLT receives the OK packet and puts its buffer into a
  696.    "sent" state.
  697.  
  698. 7. PROTOCOL LAYERING STRUCTURE
  699.  
  700.    NETBLT is implemented directly on top of the Internet Protocol (IP).
  701.    It has been assigned a temporary protocol number of 255.  This number
  702.    will change as soon as the final protocol specification has been
  703.    determined.
  704.  
  705. 8. PACKET FORMATS
  706.  
  707.    NETBLT packets are divided into three categories, each of which share
  708.    a common packet header.  First, there are those packets that travel
  709.    only from sender to receiver; these contain the control message
  710.    sequence numbers which the receiver uses for reliability.  These
  711.    packets are the NULL-ACK, DATA, and LDATA packets.  Second, there is
  712.    a packet that travels only from receiver to sender.  This is the
  713.    CONTROL packet; each CONTROL packet can contain an arbitrary number
  714.    of control messages (GO, OK, or RESEND), each with its own sequence
  715.    number. Finally, there are those packets which either have special
  716.    ways of insuring reliability, or are not reliably transmitted.  These
  717.    are the QUIT, QUITACK, DONE, KEEPALIVE, and ABORT packets.  Of these,
  718.    all save the DONE packet can be sent by both sending and receiving
  719.    NETBLTs.
  720.  
  721.    Packet type numbers:
  722.  
  723.       OPEN:           0
  724.       RESPONSE:       1
  725.       KEEPALIVE:      2
  726.       DONE:           3
  727.       QUIT:           4
  728.       QUITACK:        5
  729.       ABORT:          6
  730.       DATA:           7
  731.       LDATA:          8
  732.       NULL-ACK:       9
  733.       CONTROL:        10
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740. Clark & Lambert & Zhang                                        [Page 13]
  741.  
  742.  
  743.  
  744. RFC 969                                                    December 1985
  745. NETBLT: A Bulk Data Transfer Protocol
  746.  
  747.  
  748.    Standard header:
  749.  
  750.       local port:       2 bytes
  751.       foreign port:     2 bytes
  752.       checksum:         2 bytes
  753.       version number:   1 byte
  754.       packet type:      1 byte
  755.       packet length:    2 bytes
  756.  
  757.    OPEN and RESPONSE packets:
  758.  
  759.       connection unique ID:                   4 bytes
  760.       standard buffer size:                   4 bytes
  761.       transfer size:                          4 bytes
  762.       DATA packet data segment size:          2 bytes
  763.       burst size:                             2 bytes
  764.       burst rate:                             2 bytes
  765.       death timeout value in seconds:         2 bytes
  766.       transfer mode (1 = SEND, 0 = RECEIVE):  1 byte
  767.       maximum number of concurrent buffers:   1 byte
  768.       checksum entire DATA packet / checksum
  769.       DATA packet data only (1/0):         1 byte
  770.       client-specific data:                   arbitrary
  771.  
  772.    DONE, QUITACK, KEEPALIVE:
  773.  
  774.       standard header only
  775.  
  776.    ABORT, QUIT:
  777.  
  778.       reason:       arbitrary bytes
  779.  
  780.    CONTROL packet format:
  781.  
  782.       CONTROL packets consist of a standard NETBLT header of type
  783.       CONTROL, followed by an arbitrary number of control messages with
  784.       the following formats:
  785.  
  786.       Control message numbers:
  787.  
  788.          GO:             0
  789.          OK:             1
  790.          RESEND:         2
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797. Clark & Lambert & Zhang                                        [Page 14]
  798.  
  799.  
  800.  
  801. RFC 969                                                    December 1985
  802. NETBLT: A Bulk Data Transfer Protocol
  803.  
  804.  
  805.          OK message:
  806.  
  807.             message type (OK):  1 byte
  808.             buffer number:      4 bytes
  809.             sequence number:    2 bytes
  810.             new burst size:     2 bytes
  811.             new burst interval: 2 bytes
  812.  
  813.          GO message:
  814.  
  815.             message type (GO):  1 byte
  816.             buffer number:      4 bytes
  817.             sequence number:    2 bytes
  818.  
  819.          RESEND message:
  820.  
  821.             message type (RESEND):     1 byte
  822.             buffer number:             4 bytes
  823.             sequence number:           2 bytes
  824.             number of missing packets: 2 bytes
  825.             packet numbers...:         n * 2 bytes
  826.  
  827.    DATA, LDATA packet formats:
  828.  
  829.       buffer number:                                4 bytes
  830.       highest consecutive sequence number received: 2 bytes
  831.       packet number within buffer:                  2 bytes
  832.       data:                                         arbitrary bytes
  833.  
  834.    NULL-ACK packet format:
  835.  
  836.       highest consecutive sequence number received: 2 bytes
  837.       acknowledged new burst size:                  2 bytes
  838.       acknowledged new burst interval:              2 bytes
  839.  
  840. NOTES:
  841.  
  842.    <1>  When the buffer size is large, the variances in the round trip
  843.         delays of many packets may cancel each other out; this means the
  844.         variance value need not be very big.  This expectation can be
  845.         verified in further testing.
  846.  
  847.    <2>  Since the receiving end may not know the transfer size in
  848.         advance, it is possible that it may have allocated buffer space
  849.         and sent GO messages for buffers beyond the actual last buffer
  850.         sent by the sending end.  Care must be taken on the sending
  851.         end's part to ignore these extra GO messages.
  852.  
  853.  
  854. Clark & Lambert & Zhang                                        [Page 15]
  855.