home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 600s / rfc626.txt < prev    next >
Text File  |  1992-10-14  |  13KB  |  335 lines

  1.  
  2.  
  3.  
  4. Network Working Group                                  L. Kleinrock  (UCLA-NMC)
  5. Request for Comments:  626                             H. Opderbeck  (UCLA-NMC)
  6. NIC #22161                                                             Mar 1974
  7.  
  8.  
  9.  
  10.  
  11.                 "On a Possible Lockup Condition in the
  12.                  IMP Subnet Due to Message Sequencing"
  13.  
  14.  
  15. Lockup or deadlock conditions are one of the most serious system malfunctions
  16. that can occur in a computer system or network.  Communication protocols have 
  17. to be designed very carefully to avoid the occurrence of these lockups.  Their
  18. common characteristic is that they occur only under unusual circumstances which
  19. were not foreseen or deemed too unlikely to occur by the protocol designers.  
  20. (However, these designers often are not the ones in a position to evaluate
  21. such likelihoods quantitatively.)
  22.  
  23. The best known lockup that has occurred in the ARPANET is the reassembly
  24. lockup [1].  The store-and-forward lockup, also described in Reference 1, has
  25. been avoided in the new IMPSYS by carefully observing Kahn's heuristics [1].  
  26. The last lockup in the subnet we know of occurred on December 21, 1973 
  27. (Christmas lockup").  This dormant lockup conditions was brought to light
  28. by collecting snapshot measurement messages from all sites simultaneously.
  29. The Christmas lockup happened when snapshot messages arrived at ther UCLA IMP
  30. which had allocated reassembly storage for them and no reassembly blocks were
  31. free.  (A reassembly block is a piece of storage used in the actual process
  32. of reassembling packets back into messages) [2]. 
  33.  
  34. Deadlock conditions have not only been observed in the subnet but also in
  35. higher level protocols.  The original design of the ICP, for example, had a
  36. flaw that was discovered only after a few months of use [3,4].  More recently
  37. BBN reported a deadlock problem involving the exchange of HOST status
  38. information by the RSEXEC server (RSSER) programs [5].
  39.  
  40. As long as it is not possible to design practical communication protocols
  41. which guarantee deadlock-free operation it is vital to continually check those
  42. protocols that are currently in use for any such failures - even if they appear
  43. "very unlikely" to occur.  In this RFC we comment on a possible deadlock
  44. condition in the IMP subnet which, to our knowledge, has not yet occurred,
  45. neither has it been identified.  Though we have never seen this problem 
  46. actually happen it may occur in the future if no precautions are taken.  This
  47. possible lockup condition is due to the sequencing of messages in the subset.
  48.  
  49. To avoid the occurrence of reassembly lockup, the flow control mechanism in
  50. the subnet was modified in some significant ways.  Currently there is a limit
  51. of four messages that can simultaneously be in transmission between any pair of
  52. source and destination IMPs.  As a result of removing the link-handling from
  53. the old IMPSYS, it became necessary to introduce a message sequencing 
  54. mechanism.
  55.  
  56.  
  57.  
  58.                                    -1-
  59.  
  60.  
  61. Network Working Group                
  62. Request for Comments:  626
  63.  
  64.  
  65.  
  66. Messages leave the destination IMP in the same order as they entered the source
  67. IMP.  (Note that the sequencing is done on an IMP-to-IMP basis, not a HOST-to-
  68. Host basis.  This may introduce undesirable "sequencing delay" if two HOSTs 
  69. attached to the same destination IMP receive messages from the same source 
  70. IMP).
  71.  
  72. Sequencing of messages has, in general, the potential of introducing deadlock
  73. conditions.  The reason for this is that any message, say message (n+1), which
  74. is out of order (and therefore cannot be delivered to its destination HOST)
  75. may use up resources that are required by message (n) which must be delivered
  76. next.  Therefore, message (n) cannot reach its destination IMP which, in turn,
  77. prevents the other messages (n+1), etc) that are out of order from being 
  78. delivered to their destination HOST(s).  For this reason one has to be very
  79. careful not to allocate too many resources (e.g., buffers) to messages that
  80. are out of order.
  81.  
  82. To avoid lockup conditions the current IMPSYS takes the following two
  83. precautions:
  84.  
  85.     1.  Requests for buffer allocation are always services in order
  86.         of message number; i.e., no 'ALLOCATE' is returned for 
  87.         message (n+1) if message (n) (or a request for buffer
  88.         allocation for message (n)) has not yet been received and
  89.         serviced.
  90.  
  91.     2.  Single packet messages (regular and priority) that arrive
  92.         at the destination IMP out of order are not accepted unless
  93.         they were retransmitted in response to a previous buffer
  94.         allocation.  These messages are treated rather as a request 
  95.         for the allocation of one buffer (according to 1 above) and
  96.         then discarded.
  97.  
  98. With these two precautions a deadlock condition appears to be impossible to
  99. occur.  However, there is a second buffer allocation mechanism that is not
  100. tried to the message sequencing, namely the 'ALLOCATE' that is piggy-backed
  101. on the RFNM for a multiple-packet message.  The piggy-backed ALLOCATE
  102. represents a buffer allocation for the next multiple-packet message, and NOT
  103. for the next message in sequence.  Thus, if the next message in sequence is
  104. a single-packet message, the piggy-backed ALLOCATE in effect allocates
  105. buffers to a message that is out of order.
  106.  
  107. Let us see how this situation can lead to a deadlock condition.  Assume there
  108. is a maximum number of 24 reassembly buffers in each IMP.
  109.  
  110.  
  111.                                    -2-
  112.  
  113.  
  114. Network Working Group
  115. Request for Comments:  626
  116.  
  117.  
  118.  
  119. Let IMPs A, B, and C continually transmit 8-packet messages to the same
  120. destination IMP D such that all 24 reassembly buffers in IMP D are used up by
  121. this transmission of multiple packet messages.  If now, in the stream of
  122. 8-packet messages, IMP A sends a single-packet message it will generally not
  123. be accepted by destination IMP D since there is no reassembly buffer space
  124. available.  (There may be a free reassembly buffer if the single-packet message
  125. happens to arrive during the time one of the three 8-packet messages is being
  126. transmitted to its HOST).  The single-packet message will therefore be treated
  127. as a request for buffer allocation.  This request will not be serviced before
  128. the RFNM of the previous multiple-packet message is sent.  At this time, 
  129. however, all the free reassembly buffers have already been allocated to the
  130. next multiple-packet message via the piggy-backed ALLOCATE mechanism.  The
  131. only chance for the single-packet message to get its allocation request
  132. satisfied is to grab a reassembly buffer from one of the other two 8-packet
  133. messages.  This attempt may be unsuccessful because it depends on the timing
  134. of events in the IMP. A deadlock condition can occur if IMP B and IMP C
  135. also send a single-packet message in their stream of 8-packet measures which
  136. cannot be serviced for the same reason.  In this case, the three 8-packet
  137. messages that will arrive later at IMP D cannot be delivered to their
  138. destination HOST(s) because they are out of order.  The three single-packet 
  139. messages that should be delivered next, however, will never reach the
  140. destination IMP since there is no reassembly space available.
  141.  
  142. A possible sequence of event that leads to a deadlock condition can be
  143. described as follows:
  144.  
  145.   Examples for Notation:
  146.  
  147.     event:  A8 arrives  ->        all 8 packets of the 8-packet message
  148.                     from IMP A have arrived at IMP D
  149.  
  150.     event:  C1 arrives  ->        a single packet message from IMP C has
  151.                     arrived at IMP D (and is treated as a
  152.                     request for buffer allocation)
  153.  
  154.     event:  B8 complete ->        the last packet of the 8-packet
  155.                     message from IMP B has been received
  156.                     by its destination HOST
  157.  
  158.     event:  A8 RFNM/ALL ->        a RFNM with the piggy-backed ALLOCATE
  159.                     is sent to IMP A
  160.  
  161.  
  162.  
  163.  
  164.                                    -3-
  165.  
  166.  
  167. Network Working Group
  168. Request for Comments:  626
  169.  
  170.  
  171.  
  172.  
  173.             # of Allocated    # of Reassembly        # of Free
  174.              Reassembly           Buffers        Reassembly
  175.               Buffers              in Use         Buffers
  176.  
  177.      Initially        24              0                0
  178.  1.  A8 arrives        16              8                0
  179.  2.  B8 arrives         8             16                0
  180.  3.  C8 arrives         0             24                0
  181.  4.  Al arrives         0             24                0
  182.  5.  B1    arrives         0             24                0
  183.  6.  C1 arrives         0             24                0
  184.  7.  A8 complete     0             16                8
  185.  8.  B8 complete     0              8               16
  186.  9.  C8 complete     0              0               24
  187. 10.  A8 RFNM/ALL     8              0               16
  188. 11.  B8 RFNM/ALL    16              0                8
  189. 12.  C8 RFNM/ALL    24              0                0
  190. 13.  A8 arrives        16              8                0
  191. 14.  B8 arrives         8             16                0
  192. 15.  C8 arrives         0             24                0
  193. 16.  - deadlock -
  194.  
  195. Note that an ALLOCATE for one of the single-packet messages A1, B1 and C1 can
  196. only be returned to source IMP A, B, and C, respectively, after the RFNM
  197. (with its piggy-backed ALLOCATE) for the previous 8-packet message has been
  198. sent.  If these RFNMs are sent in sequence, i.e., without an ALLOCATE for
  199. one of the single-packet messages in between, the temporarily freed reassembly
  200. storage (events (7) through (9) is implicitly allocated to the next multiple-
  201. packet messages (events (10) through (12) and not to any of the single-packet
  202. messages.  The next 8-packet messages are, however, out of order and
  203. cannot be delivered to their destination HOST(s).
  204.  
  205. Right now it looks as if such a lockup can only occur if the number of
  206. reassembly buffers is a multiple of eight.  Indeed, the probability of a 
  207. lockup in this latter case is much higher.  However, deadlocks can also occur
  208. if the number of reassembly buffers is not a multiple of eight.
  209.  
  210.  
  211. Let us assume there are 26 instead of 24 reassembly buffers.  Assume also that,
  212. due to alternate paths, line failure, or retransmission, the second packet of
  213. a 2-packet message arrives at IMP D before a single-packet message from the 
  214. same source IMP A.  The single-packet message has a smaller sequence number 
  215. and must therefore be delivered to its destination HOST before the 2-packet
  216. message.  When the second packet of the 2-packet message arrives at IMP D the
  217. IMP realizes that only 2 of the allocated 8 buffers will be needed.  Therefore
  218.  
  219.  
  220.  
  221.                                    -4-
  222.  
  223.  
  224. Network Working Group
  225. Request for Comments:  626
  226.  
  227.  
  228.  
  229. 6 buffers are returned to the pool of free reassembly buffers.  If there were
  230. 26-3x8=2 buffers in the pool before, the pool size is increased by 6 to 8
  231. buffers.  These 8 buffers, however, are just enough to send out another
  232. piggy-backed ALLOCATE.  The single-packet message will therefore find the pool
  233. of free reassembly buffers empty although the total number of reassembly
  234. buffers is not a multiple of eight.  The 2-packet message cannot be delivered
  235. to its destination HOST because it is out of order.  Therefore the deadlock
  236. condition we described before may occur again.
  237.  
  238. We agree that the above mentioned sequence of events is unlikely to occur
  239. (otherwise one would have observed it already).  This is particularly true
  240. since the current maximum number of reassembly buffers (58) is much larger
  241. than 24.  Judging from past experience with computer systems and networks,
  242. however, we know that even very unlikely events have a tendency to occur in the
  243. long run.  Also, the probability of this deadlock condition increases with 
  244. increasing traffic in the net.  Therefore, it is certainly worthwhile to
  245. modify the IMPSYS in such a way that this deadlock cannot occur.  It turns out
  246. that a minor modification already achieves the desired effect.  Recall that 
  247. that described deadlock can only occur because single- and multiple-packet 
  248. messages use the same pool of reassembly buffers.  If we set aside a single
  249. reassembly buffer (or one for each destination HOST) that can be used only by 
  250. single-packet messages this lockup condition due to message sequencing cannot
  251. occur.
  252.  
  253. Another solution to this problem is, of course, to more the message sequencing
  254. from the IMP to the HOST level.  This does not mean that similar lockup
  255. problems cannot occur on the HOST level.  Also, it is currently much easier
  256. to resolve this problem by a slight modification of the IMPSYS rather than
  257. having to coordinate all the various HOSTs.  Another alternative is to
  258. discontinue the use of multiple-packet messages.  However, this also involves
  259. much more drastic changes which require careful consideration.
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.                                    -5-
  277.  
  278.  
  279. Network Working Group
  280. Request for Comments:  626
  281.  
  282.  
  283.  
  284.  
  285.                               REFERENCES
  286.  
  287.  
  288.  
  289. 1.  Kahn, R. E. and W. R. Crowther, "Flow Control in a Resource-Sharing
  290.     Computer Network," IEEE Transactions on Communication, Volume COM-20,3
  291.     June 1972.
  292.  
  293. 2.  BBN Report No. 2717, "Interface Message Processors for the ARPA Computer
  294.     Network," Quarterly Technical Report No. 4, January 1974.
  295.  
  296. 3.  Naylor, W., J. Wong, C. Kline, and J. Postel, "Regarding Proffered
  297.     Official ICP," RFC 143, NIC 6728.
  298.  
  299. 4.  Postel, J. B. "A Graph Model Analysis of Computer Communications
  300.     Protocols," PhD dissertation, University of California, Los Angeles.
  301.  
  302. 5.  BBN Report No. 2670.  "Natural Communication with Computers IV,"  Quarterly
  303.     Progress Report No. 12, October 1973.
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                    -6-
  335.