home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 00s / rfc59.txt < prev    next >
Text File  |  1997-06-09  |  18KB  |  438 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                           Edwin W. Meyer, Jr.
  8.                             MIT Project MAC
  9.                               27 June 1970
  10.  
  11.  
  12. The method of flow control described in RFC 54, prior allocation of
  13. buffer space by the use of ALL network commands, has one particular
  14. advantage. If no more than 100% of an NCP's buffer space is allocated,
  15. the situation in which more messages are presented to a HOST then it can
  16. handle will never arise.
  17.  
  18. However, this scheme has very serious disadvantages:
  19.  
  20.  
  21. (i)  chronic underutilization of resources,
  22.  
  23. (ii) highly restricted bandwidth,
  24.  
  25. (iii)considerable overhead under normal operation,
  26.  
  27. (iv) insufficient flexibility under conditions of increasing load,
  28.  
  29. (v)  it optimizes for the wrong set of conditions, and
  30.  
  31. (vi) the scheme breaks down because of message length indeterminacy.
  32.  
  33. Several people from Project MAC and Lincoln Laboratories have discussed
  34. this topic, and we feel that the "cease on link" flow control scheme
  35. proposed in RFC 35 by UCLA is greatly preferable to this new plan for
  36. flow control.
  37.  
  38. The method of flow control proposed in RFC 46, using BLK and RSM control
  39. messages, has been abandoned because it can not guarantee to quench flow
  40. within a limited number of messages.
  41.  
  42.  
  43. The advantages of "cease on link" to the fixed allocation proposal are
  44. that:
  45.  
  46. (i)  it permits greater utilization of resources,
  47.  
  48. (ii) does not arbitrarily limit transmission bandwidth,
  49.  
  50. (iii)is highly flexible under conditions of changing load,
  51.  
  52. (iv) imposes no overhead on normal operation, and
  53.  
  54. (v)  optimizes for the situations that most often occur.
  55.  
  56. Its single disadvantage is that under rare circumstances an NCP's input
  57. buffers can become temporarily overloaded. This should not be a serious
  58. drawback for network operation.
  59.  
  60. The "cease on link" method of flow control operates in the following
  61.  
  62.  
  63.  
  64.                                                                 [Page 1]
  65.  
  66. NWG/RFC 59   Flow Control - Fixed Versus Demand Allocation
  67.  
  68.  
  69. manner.  IMP messages for a particular "receive" link may be coming in
  70. to the destination HOST faster than the attached process is reading them
  71. out of the NCP's buffers. At some point the NCP will decide that the
  72. input queue for that link is too large in relation to the total amount
  73. of free NCP buffer space remaining. At this time the NCP initiates
  74. quenching by sending a "cease on link" IMP message to its IMP. This does
  75. nothing until the next message for that link comes in to the destination
  76. IMP. The message still gets transmitted to the receiving HOST. However,
  77. the RFNM returned to the transmitting HOST has a special bit set. This
  78. indicates to the originating NCP that it should stop sending over that
  79. link. As a way of confirming the suspension, the NCP sends an SPD <link>
  80. "suspended" NCP control message to the receiving HOST, telling it that
  81. it indeed has stopped transmitting. At a future time the receiving pro-
  82. cess will have cut the input queue for the link down to reasonable size,
  83. and the NCP tells the sending NCP to begin sending messages by issuing a
  84. RSM <link> "resume" NCP control message.
  85.  
  86. The flow control argument is based on the following premises:
  87.  
  88.  
  89. (1)  Most network transmission falls into two categories:
  90.      Type 1 - short messages (<500 bits) at intervals of several seconds
  91.      or more. (console communication)
  92.      Type 2 - a limited number (10 - 100) of full messages (8000 bits)
  93.      in rapid succession. (file transmission)
  94.  
  95.  
  96. (2)  Most processes are ready to accept transmitted data when it arrives
  97.      at the destination and will pick it up within a few seconds (longer
  98.      for large files). Thus, at any particular instant the great major-
  99.      ity of read links have no data buffered at the destination HOST.
  100.      This assumes a sensible software system at both ends.
  101.  
  102.  
  103. (3)  Flow control need be imposed only rarely on links transmitting Type
  104.      1 messages, somewhat more frequently for Type 2 messages.
  105.  
  106.  
  107. (4)  Both the total network load and that over a single connection fluc-
  108.      tuate and can not be adequately predicted by either the NCP or the
  109.      process attached to an individual connection.
  110.  
  111.  
  112. (5)  Assuming adequate control of wide bandwidth transmission (Type 2),
  113.      the probability that an NCP will be unable to accept messages from
  114.      the IMP due to full buffers is quite small, even if the simultane-
  115.      ous receipt of moderately small messages over all active links
  116.      would more than fill the NCP's input buffers.
  117.  
  118.  
  119. (6)  In the event that an NCP's buffers do fill completely, it may
  120.      refuse to accept any transmission from the IMP for up to a minute
  121.      without utter catastrophe.
  122.  
  123.  
  124.  
  125.  
  126.                                                                 [Page 2]
  127.  
  128. NWG/RFC 59   Flow Control - Fixed Versus Demand Allocation
  129.  
  130.  
  131. (7)  Under cases of extreme input load, if an NCP has large amounts of
  132.      data buffered for input to a local process, AND that process has
  133.      not read data over that connection for more than a minute, the NCP
  134.      may delete that data to make space for messages from the IMP. This
  135.      is expected to happen extremely rarely, except in cases where the
  136.      process is the main contributor to the overload by maintaining
  137.      several high volume connections which it is not reading.
  138.  
  139.  
  140.  
  141. Based on the preceding premises, I see the following disadvantages in
  142. the flow control proposed in RFC 54:
  143.  
  144.  
  145. (1)  Chronic Underutilization of Resources - A fixed allocation of
  146.      buffer space dedicated to a single Type 1 connection will go
  147.      perhaps 90% unused if we actually achieve responsive console
  148.      interaction through the network. This is because it is empty most
  149.      of the time and is very seldom more than partially filled. Stated
  150.      conversely, a scheme of demand allocation might be expected to han-
  151.      dle several times as many console connections using the same buffer
  152.      resources. (It has been suggested that this problem of underutili-
  153.      zation could be alleviated by allocating more than 100% of the
  154.      available buffer space. This is in fact no solution at all, because
  155.      it defeats the basic premise underlying this method of flow con-
  156.      trol: guaranteed receptivity. True, it might fail in less than one
  157.      case in 1000, but that is exactly the case for which flow control
  158.      exists.)
  159.  
  160.  
  161. (2)  Highly Restricted Bandwidth - At the same time that all that buffer
  162.      space dedicated to low volume connections is being wasted (and it
  163.      can't be deallocated - see below), high volume communication is
  164.      unnecessarily slowed because of inadequate buffer allocation.
  165.      (Because of the inability to deallocate, it is unwise to give a
  166.      large allocation.) Data is sent down the connection to the alloca-
  167.      tion limit, then stops. Several seconds later, after the receiving
  168.      process picks up some of the data, a new allocation is made, and
  169.      another parcel of data is sent. It seems clear that even under only
  170.      moderately favorable conditions, a demand allocation scheme will
  171.      allow several times the bandwidth that this one does.
  172.  
  173.  
  174. (3)  Considerable Overhead During Normal Operation - It can be seen that
  175.      flow control actually need be imposed relatively rarely. However,
  176.      this plan imposes a constant overhead for all connections due to
  177.      the continuing need to send new allocations. Under demand alloca-
  178.      tion, only two RFC's, two CLS's, and perhaps a couple of SPD and
  179.      RSM control messages need be transmitted for a single connection.
  180.      Under this plan, a large fraction of the NCP control messages will
  181.      be ALL allocation requests. There will probably be several times as
  182.      many control messages to be processed by both the sending and
  183.      receiving NCP's, as under a demand allocation scheme.
  184.  
  185.  
  186.  
  187.  
  188.                                                                 [Page 3]
  189.  
  190. NWG/RFC 59   Flow Control - Fixed Versus Demand Allocation
  191.  
  192.  
  193. (4)  Inflexibility Under Increasing Load Conditions - Not only is this
  194.      plan inflexible as to different kinds of load conditions on a sin-
  195.      gle link, there is potential inflexibility under increasing total
  196.      load. The key problem here is that an allocation can not be arbi-
  197.      trarily revoked. It can be taken back only if it is used. As an
  198.      example of the problem that can be caused, assume the case of a
  199.      connection made at 9 AM. The HOST controlling the receiving socket
  200.      senses light load, and gives the connection a moderately large
  201.      allocation. However, the process attached to the send socket
  202.      intends to use it only to report certain special events, and
  203.      doesn't normally intend to send much at all down this connection.
  204.      Comes 12 noon, and this connection still has 90% of its original
  205.      allocation left. Many other processes are now using the network,
  206.      and the NCP would dearly love to reduce its allocation, if only it
  207.      could. Of course it can't. If the NCP is to keep its part of the
  208.      flow control bargain, it must keep that space empty waiting for the
  209.      data it has agreed to receive.
  210.  
  211.      This problem can't really be solved by basing future allocations on
  212.      past use of the connection, because future use may not correlate
  213.      with past use. Also, the introduction of a deallocation command
  214.      would cause synchrony problems.
  215.  
  216.      The real implication of this problem is that an NCP must base its
  217.      allocation to a link on conditions of heavy load, even if there is
  218.      currently only light network traffic.
  219.  
  220.  
  221. (5)  Wrong Type of Optimization - This type of flow control optimizes
  222.      for the case where every connection starts sending large amounts of
  223.      data almost simultaneously, exactly the case that just about never
  224.      occurs. As a result the NCP operates almost as slowly under light
  225.      load as it does under heavy load.
  226.  
  227.  
  228. (6)  Loss of Allocation Synchrony Due to Message Length Indeterminacy -
  229.      If this plan is to be workable, the allocation must apply to the
  230.      entire message, including header, padding, text, and marking, oth-
  231.      erwise, a plethora of small messages could overflow the buffers,
  232.      even though the text allocation had not been exceeded. Thomas Bar-
  233.      kalow of Lincoln Laboratories has pointed out that this also fails,
  234.      because the sending HOST can not know how many bits of padding that
  235.      the receiving HOST's system will add to the message. After several
  236.      messages, the allocation counters of the sending and receiving
  237.      HOSTs will get seriously out of synchrony. This will have serious
  238.      consequences.
  239.  
  240.      It has been argued that the allocation need apply only to the text
  241.      portion, because the header, padding, and marking are deleted soon
  242.      after receipt of the message. This imposes an implementation res-
  243.      triction on the NCP, that it must delete all but the text part of
  244.      the message just as soon as it gets it from the IMP. In both the
  245.      TX2 and Multics implementations it is planned to keep most of the
  246.      message in the buffers until it is read by the receiving process.
  247.  
  248.  
  249.  
  250.                                                                 [Page 4]
  251.  
  252. NWG/RFC 59   Flow Control - Fixed Versus Demand Allocation
  253.  
  254.  
  255. The advantages of demand allocation using the "cease on link" flow con-
  256. trol method are pretty much the converse of the disadvantages of fixed
  257. allocation. There is much greater resource utilization, flexibility,
  258. bandwidth, and less overhead, primarily because flow control restric-
  259. tions are imposed only when needed, not on normal flow.
  260.  
  261.  
  262. One would expect very good performance under light and moderate load,
  263. and I won't belabor this point.
  264.  
  265.  
  266. The real test is what happens under heavy load conditions. The chief
  267. disadvantage of this demand allocation scheme is that the "cease on
  268. link" IMP message can not quench flow over a link soon enough to prevent
  269. an NCP's buffers from filling completely under extreme overload.
  270.  
  271. This is true. However, it is not a critical disadvantage for three rea-
  272. sons:
  273.  
  274.  
  275. (i)  An overload that would fill an NCP's buffers is expected to occur
  276.      at infrequent intervals.
  277.  
  278.  
  279. (ii) When it does occur, the situation is generally self-correcting and
  280.      lasts for only a few seconds. Flow over individual connections may
  281.      be temporarily delayed, but this is unlikely to be serious.
  282.  
  283.  
  284. (iv) In a few of these situations radical action by the NCP may be
  285.      needed to unblock the logjam. However, this will have serious
  286.      consequences only for those connections directly responsible for
  287.      the tie-up.
  288.  
  289. Let's examine the operation of an NCP employing demand allocation and
  290. using "cease on link" for flow control. The following discussion is
  291. based on a flow control algorithm in which the maximum permissible queue
  292. length (MQL) is calculated to be a certain fraction (say 10%) of the
  293. total empty buffer space currently available. The NCP will block a con-
  294. nection if the input queue length exceeds the MQL. This can happen
  295. either due to new input to the queue or a new calculation of the MQL at
  296. a lower value. Under light load conditions, the MQL is reasonably high,
  297. and relatively long input queues can be maintained without the connec-
  298. tion being blocked.
  299.  
  300. As load increases, the remaining available buffer space goes down, and
  301. the MQL is constantly recalculated at a lower value. This hardly affects
  302. console communications with short queues, but more queues for high
  303. volume connections are going above the MQL. As they do, "cease on link"
  304. messages are being sent out for these connections.
  305.  
  306. If the flow control algorithm constants are set properly, there is a
  307. high probability that flow over the quenched links will indeed cease
  308. before the scarcity of buffer space reaches critical proportions.
  309.  
  310.  
  311.  
  312.                                                                 [Page 5]
  313.  
  314. NWG/RFC 59   Flow Control - Fixed Versus Demand Allocation
  315.  
  316.  
  317. However, there is a finite probability that the data still coming in
  318. over the quenched links will fill the buffers. This is most likely under
  319. already heavy load conditions when previously inactive links start
  320. transmitting at at once at high volume.
  321.  
  322. Once the NCP's buffers are filled it must stop taking all messages from
  323. its IMP. This is serious because now the NCP can no longer receive con-
  324. trol messages sent by other NCP's, and because the IMP may soon be
  325. forced to stop accepting messages from the NCP. (Fortunately, the NCP
  326. already has sent out "cease on link" messages for virtually all of the
  327. high volume connections before it stopped taking data from the IMP.)
  328.  
  329. In most cases input from the IMP remains stopped for only a few seconds.
  330. After a very short interval, some process with data queued for input is
  331. likely to come in and pick it up from the NCP's buffers. The NCP immedi-
  332. ately starts taking data from the IMP again. The IMP output may stop and
  333. start several times as the buffers are opened and then refilled. How-
  334. ever, more processes are now reading data queued for their receive sock-
  335. ets, and the NCP's buffers are emptying at an accelerating rate. Soon
  336. the reading processes make enough buffer space to take in all the mes-
  337. sages still pending for blocked links, and normal IMP communications
  338. resume.
  339.  
  340. As the reading processes catch up with the sudden burst of data, the MQL
  341. becomes lower, and more and more links become unblocked. The crisis can
  342. not immediately reappear, because each link generally becomes unblocked
  343. at a different time. If new data suddenly shoots through, the link
  344. immediately goes blocked again. The MQL goes up, with the result that
  345. other links do not become unblocked.
  346.  
  347. The worst case appears at a HOST with relatively small total buffer
  348. space (less than 8000 bits per active receive link) under heavy load
  349. conditions. Suppose that high volume transmission suddenly comes in over
  350. more than a half-dozen links simultaneously, and the processes attached
  351. to the receive links take little or none of the input. The input buffers
  352. may completely fill, and the NCP must stop all input from the IMP. If
  353. some processes are reading links, buffer space soon opens up. Shortly it
  354. is filled again, this time with messages over links which are not being
  355. read. At this point the NCP is blocked, and could remain so indefin-
  356. itely. The NCP waits for a time, hoping that some process starts reading
  357. data. If this happens, the crisis may soon ease.
  358.  
  359. If buffer space does not open up of its own accord, after a limited
  360. interval the NCP must take drastic action to get back into communication
  361. with its IMP. It selects the worst offending link on the basis of amount
  362. of data queued and interval since data was last read by this process,
  363. and totally deletes the input queue for this link. This should break the
  364. logjam and start communications again.
  365.  
  366. This type of situation is expected to occur most often when a process
  367. deliberately tries to block an NCP in this manner. The solution has
  368. serious consequences only for "bad" processes: those that flood the net-
  369. work with high volume transmission over multiple links which are not
  370. being read by the receiving processes.
  371.  
  372.  
  373.  
  374.                                                                 [Page 6]
  375.  
  376. NWG/RFC 59   Flow Control - Fixed Versus Demand Allocation
  377.  
  378.  
  379. Because of the infrequency and tolerability of this situation, the
  380. overall performance of the network using this scheme of demand alloca-
  381. tion should still be much superior to that of a network employing a
  382. fixed allocation scheme.
  383.  
  384.        [ This RFC was put into machine readable form for entry ]
  385.          [ into the online RFC archives by William Lewis 6/97 ]
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.                                                                 [Page 7]
  437.  
  438.