home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit 2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Texts / Rfc / RFC816.TXT < prev    next >
Encoding:
Text File  |  1999-11-04  |  19.6 KB  |  661 lines

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