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

  1.  
  2.  
  3. RFC:  816
  4.  
  5.  
  6.  
  7.                       FAULT ISOLATION AND RECOVERY
  8.  
  9.                              David D. Clark
  10.                   MIT Laboratory for Computer Science
  11.                Computer Systems and Communications Group
  12.                                July, 1982
  13.  
  14.  
  15.      1.  Introduction
  16.  
  17.  
  18.      Occasionally, a network or a gateway will go down, and the sequence
  19.  
  20. of  hops  which the packet takes from source to destination must change.
  21.  
  22. Fault isolation is that action which  hosts  and  gateways  collectively
  23.  
  24. take  to  determine  that  something  is  wrong;  fault  recovery is the
  25.  
  26. identification and selection of an alternative route which will serve to
  27.  
  28. reconnect the source to the destination.  In fact, the gateways  perform
  29.  
  30. most  of  the  functions  of  fault  isolation and recovery.  There are,
  31.  
  32. however, a few actions which hosts must take if they wish to  provide  a
  33.  
  34. reasonable  level  of  service.   This document describes the portion of
  35.  
  36. fault isolation and recovery which is the responsibility of the host.
  37.  
  38.  
  39.      2.  What Gateways Do
  40.  
  41.  
  42.      Gateways collectively implement an algorithm which  identifies  the
  43.  
  44. best  route  between  all pairs of networks.  They do this by exchanging
  45.  
  46. packets  which  contain  each  gateway's  latest   opinion   about   the
  47.  
  48. operational status of its neighbor networks and gateways.  Assuming that
  49.  
  50. this  algorithm is operating properly, one can expect the gateways to go
  51.  
  52. through a period of confusion immediately after some network or  gateway
  53.  
  54.                                    2
  55.  
  56.  
  57. has  failed,  but  one  can assume that once a period of negotiation has
  58.  
  59. passed, the gateways are equipped with a consistent and correct model of
  60.  
  61. the connectivity of the internet.  At present this period of negotiation
  62.  
  63. may actually take several minutes, and many TCP implementations time out
  64.  
  65. within that period, but it is a design goal of  the  eventual  algorithm
  66.  
  67. that  the  gateway  should  be  able to reconstruct the topology quickly
  68.  
  69. enough that a TCP connection should be able to survive a failure of  the
  70.  
  71. route.
  72.  
  73.  
  74.      3.  Host Algorithm for Fault Recovery
  75.  
  76.  
  77.      Since  the gateways always attempt to have a consistent and correct
  78.  
  79. model of the internetwork topology, the host strategy for fault recovery
  80.  
  81. is very simple.  Whenever the host feels that  something  is  wrong,  it
  82.  
  83. asks the gateway for advice, and, assuming the advice is forthcoming, it
  84.  
  85. believes  the  advice  completely.  The advice will be wrong only during
  86.  
  87. the transient  period  of  negotiation,  which  immediately  follows  an
  88.  
  89. outage, but will otherwise be reliably correct.
  90.  
  91.  
  92.      In  fact,  it  is  never  necessary  for a host to explicitly ask a
  93.  
  94. gateway for advice, because the gateway will provide it as  appropriate.
  95.  
  96. When  a  host  sends  a datagram to some distant net, the host should be
  97.  
  98. prepared to receive back either  of  two  advisory  messages  which  the
  99.  
  100. gateway  may  send.    The  ICMP  "redirect"  message indicates that the
  101.  
  102. gateway to which the host sent the  datagram  is  not  longer  the  best
  103.  
  104. gateway  to  reach the net in question.  The gateway will have forwarded
  105.  
  106. the datagram, but the host should revise its routing  table  to  have  a
  107.  
  108. different  immediate  address  for  this  net.    The  ICMP "destination
  109.  
  110.                                    3
  111.  
  112.  
  113. unreachable"  message  indicates  that  as  a result of an outage, it is
  114.  
  115. currently impossible to reach the addressed net or host in  any  manner.
  116.  
  117. On  receipt  of  this  message, a host can either abandon the connection
  118.  
  119. immediately without any further retransmission, or resend slowly to  see
  120.  
  121. if the fault is corrected in reasonable time.
  122.  
  123.  
  124.      If  a  host  could assume that these two ICMP messages would always
  125.  
  126. arrive when something was amiss in the network, then no other action  on
  127.  
  128. the  part  of the host would be required in order maintain its tables in
  129.  
  130. an optimal condition.  Unfortunately, there are two circumstances  under
  131.  
  132. which  the  messages  will  not  arrive  properly.    First,  during the
  133.  
  134. transient following a failure, error messages may  arrive  that  do  not
  135.  
  136. correctly  represent  the  state of the world.  Thus, hosts must take an
  137.  
  138. isolated error message with some scepticism.  (This transient period  is
  139.  
  140. discussed  more  fully  below.)    Second,  if the host has been sending
  141.  
  142. datagrams to a particular gateway, and that gateway itself crashes, then
  143.  
  144. all the other gateways in the internet will  reconstruct  the  topology,
  145.  
  146. but  the  gateway  in  question will still be down, and therefore cannot
  147.  
  148. provide any advice back to the host.  As long as the host  continues  to
  149.  
  150. direct  datagrams at this dead gateway, the datagrams will simply vanish
  151.  
  152. off the face of the earth, and nothing will come back in return.   Hosts
  153.  
  154. must detect this failure.
  155.  
  156.  
  157.      If some gateway many hops away fails, this is not of concern to the
  158.  
  159. host, for then the discovery of the failure is the responsibility of the
  160.  
  161. immediate  neighbor gateways, which will perform this action in a manner
  162.  
  163. invisible to the host.  The  problem  only  arises  if  the  very  first
  164.  
  165.                                    4
  166.  
  167.  
  168. gateway, the one to which the host is immediately sending the datagrams,
  169.  
  170. fails.   We thus identify one single task which the host must perform as
  171.  
  172. its part of fault isolation in the internet:  the  host  must  use  some
  173.  
  174. strategy  to  detect  that a gateway to which it is sending datagrams is
  175.  
  176. dead.
  177.  
  178.  
  179.      Let us  assume  for  the  moment  that  the  host  implements  some
  180.  
  181. algorithm  to  detect  failed  gateways; we will return later to discuss
  182.  
  183. what this algorithm might be.  First, let  us  consider  what  the  host
  184.  
  185. should  do  when it has determined that a gateway is down. In fact, with
  186.  
  187. the exception of one small problem, the action the host should  take  is
  188.  
  189. extremely  simple.    The host should select some other gateway, and try
  190.  
  191. sending the datagram to it.  Assuming that  gateway  is  up,  this  will
  192.  
  193. either  produce  correct  results, or some ICMP advice.  Since we assume
  194.  
  195. that, ignoring temporary periods immediately following  an  outage,  any
  196.  
  197. gateway  is capable of giving correct advice, once the host has received
  198.  
  199. advice from any gateway, that host is in as good a condition as  it  can
  200.  
  201. hope to be.
  202.  
  203.  
  204.      There is always the unpleasant possibility that when the host tries
  205.  
  206. a different gateway, that gateway too will be down.  Therefore, whatever
  207.  
  208. algorithm  the  host  uses to detect a dead gateway must continuously be
  209.  
  210. applied, as the host tries every gateway in turn that it knows about.
  211.  
  212.  
  213.      The only difficult part of this algorithm is to specify  the  means
  214.  
  215. by which the host maintains the table of all of the gateways to which it
  216.  
  217. has  immediate  access.    Currently,  the specification of the internet
  218.  
  219. protocol does not architect any message by which a host can  ask  to  be
  220.  
  221.                                    5
  222.  
  223.  
  224. supplied  with  such a table.  The reason is that different networks may
  225.  
  226. provide very different mechanisms by which this table can be filled  in.
  227.  
  228. For  example,  if  the  net is a broadcast net, such as an ethernet or a
  229.  
  230. ringnet, every gateway may simply broadcast such a table  from  time  to
  231.  
  232. time,  and  the  host  need do nothing but listen to obtain the required
  233.  
  234. information.  Alternatively, the network may provide  the  mechanism  of
  235.  
  236. logical  addressing,  by  which  a whole set of machines can be provided
  237.  
  238. with a single group  address,  to  which  a  request  can  be  sent  for
  239.  
  240. assistance.   Failing those two schemes, the host can build up its table
  241.  
  242. of neighbor gateways by remembering all the gateways from which  it  has
  243.  
  244. ever received a message.  Finally, in certain cases, it may be necessary
  245.  
  246. for  this  table,  or  at  least the initial entries in the table, to be
  247.  
  248. constructed manually by a manager or operator at the  site.    In  cases
  249.  
  250. where  the  network  in question provides absolutely no support for this
  251.  
  252. kind of host query, at least some manual intervention will  be  required
  253.  
  254. to  get  started,  so  that  the  host  can  find out about at least one
  255.  
  256. gateway.
  257.  
  258.  
  259.      4.  Host Algorithms for Fault Isolation
  260.  
  261.  
  262.      We now return to the question raised above.  What  strategy  should
  263.  
  264. the  host use to detect that it is talking to a dead gateway, so that it
  265.  
  266. can know to switch to some other gateway in the list. In fact, there are
  267.  
  268. several algorithms which can be used.   All  are  reasonably  simple  to
  269.  
  270. implement, but they have very different implications for the overhead on
  271.  
  272. the  host, the gateway, and the network.  Thus, to a certain extent, the
  273.  
  274. algorithm picked must depend on the details of the network  and  of  the
  275.  
  276. host.
  277.  
  278.                                    6
  279.  
  280.  
  281.  
  282. 1.  NETWORK LEVEL DETECTION
  283.  
  284.  
  285.      Many  networks,  particularly  the  Arpanet,  perform precisely the
  286.  
  287. required function internal to the network.  If a host sends  a  datagram
  288.  
  289. to  a dead gateway on the Arpanet, the network will return a "host dead"
  290.  
  291. message, which is precisely the information the host needs  to  know  in
  292.  
  293. order  to  switch  to  another  gateway.   Some early implementations of
  294.  
  295. Internet on  the  Arpanet  threw  these  messages  away.    That  is  an
  296.  
  297. exceedingly poor idea.
  298.  
  299.  
  300. 2.  CONTINUOUS POLLING
  301.  
  302.  
  303.      The  ICMP  protocol  provides an echo mechanism by which a host may
  304.  
  305. solicit a response from a gateway.    A  host  could  simply  send  this
  306.  
  307. message  at  a  reasonable  rate, to assure itself continuously that the
  308.  
  309. gateway was still up.  This works, but, since the message must  be  sent
  310.  
  311. fairly  often  to  detect  a fault in a reasonable time, it can imply an
  312.  
  313. unbearable overhead on the host itself, the network,  and  the  gateway.
  314.  
  315. This  strategy  is  prohibited  except  where  a  specific  analysis has
  316.  
  317. indicated that the overhead is tolerable.
  318.  
  319.  
  320. 3.  TRIGGERED POLLING
  321.  
  322.  
  323.      If the use of polling could be restricted to only those times  when
  324.  
  325. something  seemed  to  be  wrong,  then  the overhead would be bearable.
  326.  
  327. Provided that one can get the proper  advice  from  one's  higher  level
  328.  
  329. protocols,  it  is  possible to implement such a strategy.  For example,
  330.  
  331. one could program the TCP level so  that  whenever  it  retransmitted  a
  332.  
  333.                                    7
  334.  
  335.  
  336. segment  more  than  once,  it  sent  a  hint down to the IP layer which
  337.  
  338. triggered polling.  This strategy does not have excessive overhead,  but
  339.  
  340. does  have  the problem that the host may be somewhat slow to respond to
  341.  
  342. an error, since only after polling has started will the host be able  to
  343.  
  344. confirm  that  something  has  gone wrong, and by then the TCP above may
  345.  
  346. have already timed out.
  347.  
  348.  
  349.      Both forms of polling suffer from a minor flaw.  Hosts as  well  as
  350.  
  351. gateways respond to ICMP echo messages.  Thus, polling cannot be used to
  352.  
  353. detect  the  error  that  a  foreign  address thought to be a gateway is
  354.  
  355. actually a host.  Such a confusion can arise if the  physical  addresses
  356.  
  357. of machines are rearranged.
  358.  
  359.  
  360. 4.  TRIGGERED RESELECTION
  361.  
  362.  
  363.      There  is a strategy which makes use of a hint from a higher level,
  364.  
  365. as did the previous  strategy,  but  which  avoids  polling  altogether.
  366.  
  367. Whenever  a  higher  level  complains  that  the  service  seems  to  be
  368.  
  369. defective, the Internet layer can pick the next gateway from the list of
  370.  
  371. available gateways, and switch to it.  Assuming that this gateway is up,
  372.  
  373. no real harm can come of this decision, even if it was  wrong,  for  the
  374.  
  375. worst that will happen is a redirect message which instructs the host to
  376.  
  377. return to the gateway originally being used.  If, on the other hand, the
  378.  
  379. original  gateway  was indeed down, then this immediately provides a new
  380.  
  381. route, so the period of time until recovery is  shortened.    This  last
  382.  
  383. strategy  seems  particularly clever, and is probably the most generally
  384.  
  385. suitable for those cases where the network itself does not provide fault
  386.  
  387. isolation.  (Regretably, I have forgotten who suggested this idea to me.
  388.  
  389. It is not my invention.)
  390.  
  391.                                    8
  392.  
  393.  
  394.      5.  Higher Level Fault Detection
  395.  
  396.  
  397.      The  previous  discussion  has  concentrated on fault detection and
  398.  
  399. recovery at the IP layer.  This section considers what the higher layers
  400.  
  401. such as TCP should do.
  402.  
  403.  
  404.      TCP has a single fault recovery action; it repeatedly retransmits a
  405.  
  406. segment until either it gets an acknowledgement or its connection  timer
  407.  
  408. expires.    As discussed above, it may use retransmission as an event to
  409.  
  410. trigger a request for fault recovery to the IP  layer.    In  the  other
  411.  
  412. direction,  information  may  flow  up from IP, reporting such things as
  413.  
  414. ICMP  Destination  Unreachable  or  error  messages  from  the  attached
  415.  
  416. network.    The  only  subtle  question about TCP and faults is what TCP
  417.  
  418. should do when such an error message arrives  or  its  connection  timer
  419.  
  420. expires.
  421.  
  422.  
  423.      The  TCP  specification discusses the timer.  In the description of
  424.  
  425. the open call, the timeout is described as an optional  value  that  the
  426.  
  427. client  of  TCP  may  specify; if any segment remains unacknowledged for
  428.  
  429. this period, TCP should abort the  connection.    The  default  for  the
  430.  
  431. timeout  is  30 seconds.  Early TCPs were often implemented with a fixed
  432.  
  433. timeout interval, but this  did  not  work  well  in  practice,  as  the
  434.  
  435. following discussion may suggest.
  436.  
  437.  
  438.      Clients  of  TCP can be divided into two classes:  those running on
  439.  
  440. immediate behalf of a human, such as  Telnet,  and  those  supporting  a
  441.  
  442. program, such as a mail sender.  Humans require a sophisticated response
  443.  
  444. to  errors.    Depending  on  exactly  what went wrong, they may want to
  445.  
  446.                                    9
  447.  
  448.  
  449. abandon the connection at once, or wait for a long time to see if things
  450.  
  451. get  better.   Programs do not have this human impatience, but also lack
  452.  
  453. the power to make complex decisions based on details of the exact  error
  454.  
  455. condition.  For them, a simple timeout is reasonable.
  456.  
  457.  
  458.      Based  on these considerations, at least two modes of operation are
  459.  
  460. needed in TCP.  One,  for  programs,  abandons  the  connection  without
  461.  
  462. exception  if  the  TCP  timer  expires.    The other mode, suitable for
  463.  
  464. people, never abandons the connection on its own initiative, but reports
  465.  
  466. to the layer above when the timer expires.  Thus, the human user can see
  467.  
  468. error messages coming from all the relevant layers, TCP  and  ICMP,  and
  469.  
  470. can request TCP to abort as appropriate.  This second mode requires that
  471.  
  472. TCP  be  able to send an asynchronous message up to its client to report
  473.  
  474. the timeout, and it requires  that  error  messages  arriving  at  lower
  475.  
  476. layers similarly flow up through TCP.
  477.  
  478.  
  479.      At  levels  above TCP, fault detection is also required.  Either of
  480.  
  481. the following can happen.  First, the foreign client of  TCP  can  fail,
  482.  
  483. even  though TCP is still running, so data is still acknowledged and the
  484.  
  485. timer never expires.  Alternatively, the communication  path  can  fail,
  486.  
  487. without the TCP timer going off, because the local client has no data to
  488.  
  489. send.  Both of these have caused trouble.
  490.  
  491.  
  492.      Sending  mail  provides an example of the first case.  When sending
  493.  
  494. mail using SMTP, there is an SMTP level acknowledgement that is returned
  495.  
  496. when a piece of mail is successfully  delivered.    Several  early  mail
  497.  
  498. receiving programs would crash just at the point where they had received
  499.  
  500. all of the mail text (so TCP did not detect a timeout due to outstanding
  501.  
  502.                                    10
  503.  
  504.  
  505. unacknowledged  data)  but  before the mail was acknowledged at the SMTP
  506.  
  507. level.  This failure would cause early mail senders to wait forever  for
  508.  
  509. the  SMTP level acknowledgement.  The obvious cure was to set a timer at
  510.  
  511. the SMTP level, but the first attempt to do this did not work, for there
  512.  
  513. was no simple way to  select  the  timer  interval.    If  the  interval
  514.  
  515. selected  was  short,  it  expired  in normal operational when sending a
  516.  
  517. large file to a slow host.  An interval of many minutes  was  needed  to
  518.  
  519. prevent  false timeouts, but that meant that failures were detected only
  520.  
  521. very slowly.  The current solution in  several  mailers  is  to  pick  a
  522.  
  523. timeout interval proportional to the size of the message.
  524.  
  525.  
  526.      Server telnet provides an example of the other kind of failure.  It
  527.  
  528. can  easily  happen that the communications link can fail while there is
  529.  
  530. no traffic flowing, perhaps because the user is thinking.    Eventually,
  531.  
  532. the  user will attempt to type something, at which time he will discover
  533.  
  534. that the connection is dead and abort it.   But  the  host  end  of  the
  535.  
  536. connection,  having  nothing  to send, will not discover anything wrong,
  537.  
  538. and will remain waiting forever.  In some systems there is no way for  a
  539.  
  540. user  in  a  different  process  to  destroy or take over such a hanging
  541.  
  542. process, so there is no way to recover.
  543.  
  544.  
  545.      One solution to this would be to have the host server telnet  query
  546.  
  547. the  user  end now and then, to see if it is still up.  (Telnet does not
  548.  
  549. have an explicit query  feature,  but  the  host  could  negotiate  some
  550.  
  551. unimportant   option,   which   should   produce   either  agreement  or
  552.  
  553. disagreement in  return.)    The  only  problem  with  this  is  that  a
  554.  
  555. reasonable  sample interval, if applied to every user on a large system,
  556.  
  557.                                    11
  558.  
  559.  
  560. can  generate  an unacceptable amount of traffic and system overhead.  A
  561.  
  562. smart server telnet would use  this  query  only  when  something  seems
  563.  
  564. wrong, perhaps when there had been no user activity for some time.
  565.  
  566.  
  567.      In  both  these  cases, the general conclusion is that client level
  568.  
  569. error detection is needed, and that the details  of  the  mechanism  are
  570.  
  571. very dependent on the application.  Application programmers must be made
  572.  
  573. aware  of  the  problem  of  failures,  and  must  understand that error
  574.  
  575. detection at the TCP or lower level cannot solve the whole  problem  for
  576.  
  577. them.
  578.  
  579.  
  580.      6.  Knowing When to Give Up
  581.  
  582.  
  583.      It  is  not  obvious,  when error messages such as ICMP Destination
  584.  
  585. Unreachable arrive, whether TCP should  abandon  the  connection.    The
  586.  
  587. reason  that  error  messages  are  difficult  to  interpret is that, as
  588.  
  589. discussed above, after a failure of a gateway or  network,  there  is  a
  590.  
  591. transient   period   during   which  the  gateways  may  have  incorrect
  592.  
  593. information,  so  that  irrelevant  or  incorrect  error  messages   may
  594.  
  595. sometimes  return.   An isolated ICMP Destination Unreachable may arrive
  596.  
  597. at a host, for example, if a packet is sent during the period  when  the
  598.  
  599. gateways  are  trying  to find a new route.  To abandon a TCP connection
  600.  
  601. based on such a message arriving would be to ignore the valuable feature
  602.  
  603. of the Internet that for many  internal  failures  it  reconstructs  its
  604.  
  605. function without any disruption of the end points.
  606.  
  607.  
  608.      But  if failure messages do not imply a failure, what are they for?
  609.  
  610. In fact, error messages serve several important  purposes.    First,  if
  611.  
  612.                                    12
  613.  
  614.  
  615. they  arrive  in response to opening a new connection, they probably are
  616.  
  617. caused by opening the connection improperly  (e.g.,  to  a  non-existent
  618.  
  619. address)  rather  than  by  a  transient  network failure.  Second, they
  620.  
  621. provide valuable information, after the TCP timeout has occurred, as  to
  622.  
  623. the  probable  cause of the failure.  Finally, certain messages, such as
  624.  
  625. ICMP Parameter Problem, imply a possible  implementation  problem.    In
  626.  
  627. general, error messages give valuable information about what went wrong,
  628.  
  629. but  are  not  to  be  taken as absolutely reliable.  A general alerting
  630.  
  631. mechanism, such as the TCP timeout  discussed  above,  provides  a  good
  632.  
  633. indication  that  whatever  is wrong is a serious condition, but without
  634.  
  635. the advisory messages to augment the timer, there  is  no  way  for  the
  636.  
  637. client  to  know  how  to  respond to the error.  The combination of the
  638.  
  639. timer and the advice from the error messages provide a reasonable set of
  640.  
  641. facts for the client layer to have.  It is important that error messages
  642.  
  643. from all layers be passed up to  the  client  module  in  a  useful  and
  644.  
  645. consistent way.
  646.  
  647.  
  648. -------
  649.