home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 100s / rfc107.txt < prev    next >
Text File  |  1997-04-29  |  18KB  |  643 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group
  8. Request for Comments # 107
  9.  
  10. NIC # 5806
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                     Output of the Host-Host Protocol
  20.                        Glitch Cleaning Committee
  21.  
  22.  
  23.  
  24.  
  25.  
  26.                                   UCLA
  27.                              23 March 1971
  28.  
  29.  
  30.  
  31.  
  32.  
  33.                             Robert Bressler
  34.                              Steve Crocker
  35.                             William Crowter
  36.                              Gary Grossman
  37.                              Ray Tomlinson
  38.                               James Withe
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                                                 [Page 1]
  59.  
  60. Introduction
  61.  
  62. The Host-Host Protocol Glitch Cleaning Committee met for the second
  63. time at UCLA on 8, 9 March 1971, after canvassing the network com-
  64. munity.  [The result of the (slightly larger) committee's first
  65. meeting are documented in RFC #102.]  The committee agreed on
  66. several modifications to the protocol in Document #1; these modi-
  67. fications are listed below.
  68.  
  69. At each of the meeting, the committee quickly treated all but one
  70. of the extant topics.  At the first meeting, the bulk of time was
  71. spent considering the interrupt mechanism, and that discussion is
  72. summarized in RFC #102.  At the second meeting, the committee spent
  73. almost all of its time discussing the notion of bytes; this dis-
  74. cussion is summarized after the list of modifications.
  75.  
  76. This RFC entirely supercedes RFC #102, and is an official modi-
  77. fication of Document #1.  A revision of Document #1 will be written
  78. shortly which incorporates the changes listed here.
  79.  
  80.  
  81. NCP implementers are to incorporate these changes as soon as
  82. possible.  NCP implementers also are to estimate on what date
  83. theis NCP's will be ready and to communicate this estimate to
  84. Steve Crocker or his secretary, Byrna Kristel.
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.                                                                 [Page 2]
  112.  
  113. Modifications
  114.  
  115.  
  116. I Bytes
  117.  
  118. Heretofore, a connection has been a bit stream.  Henceforth, it is to
  119. be a byte stream, with the byte size, S, indicated in the STR command
  120. and in each message.  The byte size meets the constraints: 1 <= S <=
  121. 255.
  122.  
  123. The choice of the byte size for a connection is a 3rd level protocol
  124. issue, but the size is constant for the life of a connection.  Each
  125. message must contain an integral number of text bytes (see below).
  126.  
  127.  
  128. II Message Format
  129.  
  130. The message format is changed to the format shown in figure 1.
  131.  
  132. The fields S and C are the byte size and byte count, respectively.
  133. The S field is 8 bits wide and must match the byte size specified in
  134. the STR which created the connection.  The C field is 16 bit long and
  135. specifies the number of bytes in the text portion of the message.  A
  136. zero value in the C field serves no purpose, but is explicitly
  137. permitted.
  138.  
  139. The M1 and M2 field are each 8 bits long and must contain zero.  The
  140. M3 field is zero or more bits long and must be all zero.  The M3 may
  141. be used to fill out a message to a word boundary.  It is followed by
  142. padding.
  143.  
  144. The text field consists of C bytes, where each byte is S bit long.
  145. The text field starts 72 bits after the start of the message.
  146.  
  147.    The partition of a byte stream into messages is an artifact
  148.    required by the subnet.  No semantic contents be attacched
  149.    to message boundaries. In particular,
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.                                                                 [Page 3]
  165.  
  166.                               32 bits
  167.                 |<--------------------------------->|
  168.  
  169.  
  170.                 +-----------------------------------+
  171.                 |                                   |
  172.                 |              leader               |
  173.                 |                                   |
  174.                 +--------+--------+-----------------+
  175.                 |        |        |                 |
  176.                 |   M1   |    S   |        C        |
  177.                 |        |        |                 |
  178.                 +--------+--------+-----------------+
  179.                 |        |        ^                 |
  180.                 |   M2   |        |                 |
  181.                 |        |        |                 |
  182.                 +--------+        |                 |
  183.                 |                 |                 |
  184.                 |                 |                 |
  185.                 |                                   |
  186.                 |                Text               |
  187.                 //                                 //
  188.                 |                 |                 |
  189.                 |                 |                 |
  190.                 |                 |                 |
  191.                 |                 |                 |
  192.                 |                 |        +--------+
  193.                 |                 |        |        |
  194.                 |                 |        |   M3   |
  195.                 |                 v        |        |
  196.                 +-----------------+--------+--------+
  197.                 |                 |
  198.                 |  10 --------- 0 | <-- Padding
  199.                 |                 |
  200.                 +-----------------+
  201.  
  202.                             Typical Message
  203.  
  204.                                 Figure 1
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.                                                                 [Page 4]
  218.  
  219. 1.  A message with a zero value for C has no meaning, although
  220.     it is legal and it does use up resource allocation.  (See
  221.     Flow Control below.)
  222.  
  223. 2.  A receiver may not expect to see 3rd level control infor-
  224.     mation synchronized with message boundaries.  Particuralrly,
  225.     if the notion of record is defined for a connection, the
  226.     receiver must expect multiple records and/or record frag-
  227.     ments within one message.  (However, control message obey
  228.     special rules.  See below.)
  229.  
  230.  
  231. III Message Data Types
  232.  
  233. No notion of data type is defined as part of the 2nd level pro- tocol.
  234. 3rd level protocols may include the notion. Data types cannot be
  235. synchronized on message boundaries.
  236.  
  237.  
  238. IV Reset and Reset Reply
  239.  
  240. A new pair of one bit control commands RST (reset) and RRP (reset
  241. reply) are added.  The RST is interpreted as a signal to purge the NCP
  242. tables of all existing entries which arose from the Host which sent to
  243. RST.  The Host receiving the RST acknowledges by returning a RRP.  The
  244. Host sending the RST may proceed to request connection after receiving
  245. either a RST or RRP in return.  An RST is returned if the second Host
  246. comes up after the first Host.
  247.  
  248.  
  249. V Flow Control
  250.  
  251. The flow control techniques are changed in two ways.  First, the Cease
  252. mechanism is discontinued.  The 10HI and 11HI message will no longer
  253. be recognized by the Imps, and the Imps will no loger generate the
  254. 10HI, 11HI or 12HI messages.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.                                                                 [Page 5]
  271.  
  272. Second, the allocation mechanism now deals with two quantities, bits
  273. and messages.  The receiver allocates each of these quantities
  274. separately.  The sender and receiver each must mantain a 16 bit
  275. unsigned counter for message and a 32 bit unsigned counter for bits.
  276. When sending a message, the sender subtract one from the message
  277. counter, and the text length from the bit counter. The receiver
  278. decrements his counter similarly when receiving the message.  The
  279. sender is prohibited from sending if either counter would be decre-
  280. mented below zero.  Similarly, the receiver is prohibited from raising
  281. the current message allocation above 2**16 - 1, or the current bit
  282. allocation above 2**32 - 1.
  283.  
  284. The TEXT LENGTH of a message is the product of S, the byte size, and
  285. C, the number of bytes.  These values always appear in the first part
  286. of the message, as described under Message Format.
  287.  
  288.  
  289. The ALL, GVB, and RET command are modified to treat two quantities.
  290. Their formats are given under Control Command, below. The GVB command
  291. is further modified to make it possible to ask for none of the
  292. allocation to be returned.  The new GVB command has four eight bit
  293. fields.  The first two fields are the op code and the link, as before.
  294. The next two fields contain number fM and fB which control how much of
  295. message and a bit allocation are to be returned.  Each of these
  296. numbers is interpreted as "the number of 128ths of the current
  297. allocation" to be returned if it is in the range of 0 to 128, and is
  298. to be interpreted as "all of the current allocation", if it is in the
  299. range 128 to 255.
  300.  
  301.  
  302. VI Control Message
  303.  
  304. The control link is chsnged to link 0; link 1 is not to be used.  The
  305. old and new protocols may thereforre coexist.
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.                                                                 [Page 6]
  324.  
  325. Message sent over the control link have the same format as other
  326. regular messages, as described above under Message Format.  The byte
  327. size field must contain the value 8.
  328.  
  329. Control messages may not contain more tha 120 byte of text; the
  330. value in the byte count field is thus limited to 120.  This limi-
  331. tation is intended to help smaller hosts.
  332.  
  333. Control messages must contain an integral number of control commands.
  334. Control commands, therefore, may not be split across control messages.
  335.  
  336.  
  337. VII Link Assignment
  338.  
  339. The link are now assigned as follows:
  340.  
  341.    0          control link
  342.    1          old protocol's control link - to be phased out
  343.    2 - 31     links for connections
  344.    32 - 190   reserved -- not for current use
  345.    191        to be used only for measurement work under direction
  346.                of the network measurement center (UCLA)
  347.    192 - 255  available for any private experimental use.
  348.  
  349.  
  350. VIII Fixed Length Control Commands
  351.  
  352. The ECO, ERP and ERR commands are now fixed length.  The ECO and ERP are
  353. now 16 bit long -- 8 bits of op code and 8 bits of data. The ERR command
  354. is now 96 bits long -- 8 bits of op code, 8 bits of error code, and 80
  355. bits of text. 80 bits is long enough to hold the longest non-ERR control
  356. command.
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.                                                                 [Page 7]
  377.  
  378. IX Control Command Formats
  379.  
  380. As mentioned above, the formats of the STR, ALL, GVB, RET, ECO, ERP and
  381. ERR commands have changed; and the commands RST and RRP have been added.
  382. The formats of these commands are given here.
  383.  
  384.       |  8  |          32           |          32           |  8  |
  385.       +-----+-----------------------+-----------------------+-----+
  386.       |     |                       |                       |     |
  387. 1.    | STR | send socket           | receive socket        |     |
  388.       |     |                       |                       |  ^  |
  389.       +-----+-----------------------+-----------------------+--|--+
  390.                                                                |
  391.       |  8  |  8  |   16      |           32          |        +-- byte size
  392.       +-----+-----+-----------+-----------------------+
  393.       |     |     |           |                       |
  394. 2.    | ALL | link| msg space | bit space             |
  395.       |     |     |           |                       |
  396.       +-----+-----+-----------+-----------------------+
  397.  
  398.       |  8  |  8  |   16      |           32          |
  399.       +-----+-----+-----------+-----------------------+
  400.       |     |     |           |                       |
  401. 3.    | RET | link| msg space | bit space             |
  402.       |     |     |           |                       |
  403.       +-----+-----+-----------+-----------------------+
  404.  
  405.       |  8  |  8  |  8  |  8  |
  406.       +-----+-----+-----+-----+
  407.       |     |     |     |     |
  408. 4.    | GVB | link|  fM |  fB |
  409.       |     |     |  ^  |  ^  |
  410.       +-----+-----+--|--+--|--+
  411.                      |     |
  412.                      |     +-- bit fraction
  413.                      +-------- message fraction
  414.  
  415.       |  8  |  8  |
  416.       +-----+-----+
  417.       |     |     |
  418. 5.    | ECO |data |
  419.       |     |     |
  420.       +-----+-----+
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.                                                                 [Page 8]
  430.  
  431.       |  8  |  8  |
  432.       +-----+-----+
  433.       |     |     |
  434. 6.    | ERP |data |
  435.       |     |     |
  436.       +-----+-----+
  437.  
  438.       |  8  |  8  |                       80                        |
  439.       +-----+-----+---------------------- // -----------------------+
  440.       |     |     |                                                 |
  441. 7.    | ERR |     |  text                                           |
  442.       |     |  ^  |                                                 |
  443.       +-----+--|--+---------------------- // -----------------------+
  444.                |
  445.                +-- error code
  446.  
  447.       |  8  |
  448.       +-----+
  449.       |     |
  450. 8.    | RST |
  451.       |     |
  452.       +-----+
  453.  
  454.       |  8  |
  455.       +-----+
  456.       |     |
  457. 9.    | RRP |
  458.       |     |
  459.       +-----+
  460.  
  461.  
  462.  
  463. The values of the op codes are
  464.  
  465.             NOP   =   0
  466.             RTS   =   1
  467.             STR   =   2
  468.             CLS   =   3
  469.             ALL   =   4
  470.             GVB   =   5
  471.             RET   =   6
  472.             INR   =   7
  473.             INS   =   8
  474.             ECO   =   9
  475.             ERP   =  10
  476.             ERR   =  11
  477.             RST   =  12
  478.             RRP   =  13
  479.  
  480.  
  481.  
  482.                                                                 [Page 9]
  483.  
  484. Discussion on Byte Streams
  485.  
  486. The previous specification that connections would be conduits of bit
  487. streams provided maximum generality and minimum efficiency.  Pressure
  488. for greater efficiency developed and the problen was examined.
  489.  
  490. Two separate kinds of inefficiency arose from bit streams.
  491.  
  492.    1.  Receiving Hosts were equired to engage in expensive
  493.        shifting to concatenate the texts of successive
  494.        messages.  Sending Hosts often also had to shift text
  495.        fields to align them on word boundaries.
  496.  
  497.    2.  Sending NCP's were prohibited from hanging onto ANY
  498.        text for an indefinite time if it were possible to send
  499.        even one bit.  This requirement was necessary to prevent
  500.        possible deadlocks.  For example, suppose processes A
  501.        and B have a conversation in progress over a pair of
  502.        connections, one in each directions.  Also suppose that
  503.        these processes produce exactly one bit of output for
  504.        each bit of input.  Then if A's NCP fails to send a
  505.        waiting bit because it wants to pack it together with
  506.        later output from A, then B will not be able to output
  507.        and neither will A.  It is clear then, that unless there
  508.        is some quantitee that the data in the sending NCP's
  509.        buffers are not crucially needed on the receive side, the
  510.        sending NCP must assume otherwise and transmit any
  511.        waiting data as soon as it is able.
  512.  
  513. These considerations led to the notion of a "transmission unit," whose
  514. existence would be known to the NCP's.  The questions then became what
  515. were typical and/or possible transmission unit sizes. For
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.                                                                [Page 10]
  536.  
  537. character-oriented interaction, 8-bit transmission units seemed
  538. reasonable.  For line-oriented interaction, the transmission unit might
  539. best be the line itself, and therefore variable length; alternatively,
  540. it might be best consider the transmission unit to be a character.  For
  541. file transfer, it might be desirable for the transmission unit to be a
  542. multiple of the word lengths of both machines; however, the last part of
  543. the file may not form a whole transmission unit, if the transmission
  544. unit is too large.  The consensus became that the transmission unit
  545. should not be divisible under any circumstances, and should, therefore,
  546. be fairly small.  The notion of transmission unit thus seems to be
  547. synonymous with the notation of byte, and the term transmission unit was
  548. dropped.
  549.  
  550. Subsequent discussion of the deadlocks and wakeup aspect revealed that
  551. there may be two byte sizes associated with a single connection:
  552.  
  553.    1.  Transmission from the sending process to the sending NCP
  554.        is in bytes of size S.  The sending NCP must send a
  555.        message whenever the link is unblocked, the message
  556.        counter is at least 1, the bit counter is at least S,
  557.        and the least S bits of text are ready.  The message
  558.        must contain an integral number of bytes.
  559.  
  560.    2.  At the receiving side, there may be  a different byte
  561.        size R for transmission from the receiving NCP to the
  562.        receiving process.  An example of where R <> S, is
  563.        suggested by UCSB which is providing a file system for
  564.        transparently storing binary files.  It is reasonable that
  565.        a using HOST might send with 36 bit bytes, while the UCSB
  566.        file system might want to receive 32-bit increments.
  567.  
  568. It is clear that from a network protocol point of view, only the byte S
  569. is relevant, and this is quantity which is communicated in the STR
  570. command in every message.  The choice of the byte size R is up
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.                                                                [Page 11]
  589.  
  590. to the receiving user, and its meaning is how often the receiving NCP
  591. should wakeup the receiving process.  It may also happen that a
  592. receiving process has an agreement with the receiving NCP which is more
  593. complex than "please wake me every R bits;" for example, the NCP might
  594. scan for new-line characters before waking up the receiving process.
  595.  
  596. In the new protocol, it is the option of the receiver to refuse a
  597. request for connection on the basis of the proffered byte size.
  598. Conceptually, we imagine that NCP's are capable of handling all byte
  599. sizes, and that such a choice would be up to the third level pro- grams
  600. (user programs, loggers, telnets, etc.)  Some Hosts, small ones in
  601. particular, may know enough about their third level programs to restrict
  602. the variety of byte sizes which can be sent or received.  While it is a
  603. matter of a local policy, the committee strongly suggests that NCP's be
  604. capable of handling all byte sizes.  One of our committee, moreover,
  605. feels strongly that NCP's should be written to be able to receive all
  606. byte sizes S and provide for different byte sizes R for transmission to
  607. the user process.
  608.  
  609.  
  610.  
  611.        [ This RFC was put into machine readable form for entry ]
  612.         [ into the online RFC archives by Enrico Bertone 4/97 ]
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.                                                                [Page 12]
  642.  
  643.