home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 900s / rfc904.txt < prev    next >
Text File  |  1992-09-22  |  64KB  |  1,391 lines

  1. Network Working Group                                   D.L.  Mills
  2. Request for Comments:  904                              April 1984
  3.  
  4.  
  5.              Exterior Gateway Protocol Formal Specification
  6.  
  7.  
  8. 0.  Status of this Memo
  9.  
  10.      This RFC is the specification of the Exterior Gateway Protocol
  11. (EGP).  This document updates RFCs 827 and 888.  This RFC specifies a
  12. standard for the DARPA community.  Interactions between gateways of
  13. different autonomous systems in the ARPA-Internet must follow this 
  14. protocol.
  15.  
  16. 1.  Introduction
  17.  
  18.      This document is a formal specification of the Exterior Gateway
  19. Protocol (EGP), which is used to exchange net-reachability information
  20. between Internet gateways belonging to the same or different autonomous
  21. systems.  The specification is intended as a reference guide for
  22. implementation, testing and verification and includes suggested
  23. algorithmic parameters suitable for operation over a wide set of
  24. configurations, including the ARPANET and many local-network
  25. technologies now part of the Internet system.
  26.  
  27.      Specifically excluded in this document is discussion on the
  28. background, application and limitations of EGP, which have been
  29. discussed elsewhere (RFC-827, RFC-888).  If, as expected, EGP evolves to
  30. include topologies not restricted to tree-structures and to incorporate
  31. full routing capabilities, this specification will be amended or
  32. obsoleted accordingly.  However, it is expected that, as new features
  33. are added to EGP, the basic protocol mechanisms described here will
  34. remain substantially unchanged, with only the format and interpretation
  35. of the Update message (see below) changed.
  36.  
  37.      Section 2 of this document describes the nomenclature used, while
  38. Section 3 describes the state-machine model, including events, actions,
  39. parameters and state transitions.  Section 4 contains a functional
  40. description of the operation of the machine, together with specific
  41. procedures and algorithms.  Appendix A describes the EGP message
  42. formats, while Appendix B contains a summary of the minor differences
  43. between these and the formats described in RFC-888.  Appendix C presents
  44. a reachability analysis including a table of composite state transitions
  45. for a system of two communicating EGP gateways.
  46.  
  47. 1.1.  Summary and Overview
  48.  
  49.      EGP exists in order to convey net-reachability information between
  50. neighboring gateways, possibly in different autonomous systems.  The
  51. protocol includes mechanisms to acquire neighbors, monitor neighbor
  52. reachability and exchange net-reachability information in the form of
  53. Update messages.  The protocol is based on periodic polling using
  54. Hello/I-Heard-You (I-H-U) message exchanges to monitor neighbor
  55. reachability and Poll commands to solicit Update responses.
  56.  
  57.      Specification of EGP is based on a formal model consisting of a
  58.  
  59. Exterior Gateway Protocol Formal Specification                    Page 2
  60. D.L. Mills
  61.  
  62.  
  63. finite-state automaton with defined events, state transitions and
  64. actions.  The following diagram shows a simplified graphical
  65. representation of this machine (see Section 3.4 for a detailed state
  66. transition table).
  67.  
  68.           +-------+
  69.           |       |---------------+---------------+
  70.     +---->| Idle  |               A               A
  71.     |     |       |-----------+   |               |
  72.     |     +-------+           |   |               |
  73.     |       |   A     Request |   | Cease         | Cease
  74.     | Start |   | Cease       |   |               |
  75.     |       V   | Refuse      V   |               |
  76.     |     +-------+ Confirm +-------+    Up   +-------+
  77.     |     |       |-------->|       |-------->|       |
  78.     |     | Aqsn  |         | Down  |   Down  |  Up   |
  79.     |     |       |----+    |       |<--------|       |
  80.     |     +-------+    |    +-------+         +-------+
  81.     |                  |        |                 |
  82.     | Stop             |        |                 |
  83.     | Cease-ack        | Stop   | Stop            | Stop
  84.     |     +-------+    |        |                 |
  85.     |     |       |    V        V                 V
  86.     +-----| Cease |<---+--------+-----------------+
  87.           |       |
  88.           +-------+
  89.  
  90.      Following is a brief summary and overview of gateway operations by
  91. state as determined by this model.
  92.  
  93. Idle State (0)
  94.  
  95.     In the Idle state the gateway has no resources (table space)
  96.     assigned to the neighbor and no protocol activity of any kind is in
  97.     progress.  It responds only to a Request command or a Start event
  98.     (system or operator initiated) and ignores all other commands and
  99.     responses.  The gateway may optionally return a Cease-ack response
  100.     to a Cease command in this state.
  101.  
  102.     Upon receipt of a Request command the gateway initializes the state
  103.     variables as described in Section 3.1, sends a Confirm response and
  104.     transitions to the Down state, if resource committments permit, or
  105.     sends a Refuse response and returns to the Idle state if not.  Upon
  106.     receipt of a Start event it sends a Request command and transitions
  107.     to the Acquistion state.
  108.  
  109. Acquisition State (1)
  110.  
  111.     In the Acquisition state the gateway periodically retransmits
  112.     Request commands.  Upon receiving a Confirm response it initializes
  113.  
  114. Exterior Gateway Protocol Formal Specification                    Page 3
  115. D.L. Mills
  116.  
  117.  
  118.     the state variables and transitions to the Down state.  Upon
  119.     receiving a Refuse response it returns to the Idle state.  The
  120.     gateway does not send any other commands or responses in this state,
  121.     since not all state variables have yet been initialized.
  122.  
  123. Down State (2)
  124.  
  125.     In the Down state the gateway has received a Request command or a
  126.     Confirm response has been received for a previously sent Request.
  127.     The neighbor-reachability protocol has declared the neighbor to be
  128.     down.  In this state the gateway processes Request, Cease and Hello
  129.     commands and responds as required.  It periodically retransmits
  130.     Hello commands if enabled.  It does not process Poll commands and
  131.     does not send them, but may optionally process an unsolicited Update
  132.     indication.
  133.  
  134. Up State (3)
  135.  
  136.     In the Up state the neighbor-reachability protocol has declared the
  137.     neighbor to be up.  In this state the gateway processes and responds
  138.     to all commands.  It periodically retransmits Hello commands, if
  139.     enabled, and Poll commands.
  140.  
  141. Cease State (4)
  142.  
  143.     A Stop event causes a Cease command to be sent and a transition to
  144.     the Cease state.  In this state the gateway periodically retransmits
  145.     the Cease command and returns to the Idle state upon receiving a
  146.     Cease-ack response or a another Stop event.  The defined state
  147.     transitions are designed to ensure that the neighbor does with high
  148.     probability receive the Cease command and stop the protocol.
  149.  
  150.      In following sections of this document document a state machine
  151. which can serve as a model for implementation is described.  It may
  152. happen that implementators may deviate from this model while conforming
  153. to the protocol specification;  however, in order to verify conformance
  154. to the specification, the state-machine model is intended as the
  155. reference model.
  156.  
  157.      Although not mentioned specifically in this document, it should be
  158. understood that all Internet gateways must include support for the
  159. Internet Control Message Protocol (ICMP), specifically ICMP Redirect and
  160. ICMP Destination Unreachable messages.
  161.  
  162. 2.  Nomenclature
  163.  
  164.      The following EGP message types are recognized in this document.
  165. The format of each of these messages is described in Appendix A.
  166.  
  167. Exterior Gateway Protocol Formal Specification                    Page 4
  168. D.L. Mills
  169.  
  170.  
  171.         Name            Function
  172.         ------------------------------------------------------
  173.         Request         request acquisition of neighbor and/or
  174.                         initialize polling variables
  175.         Confirm         confirm acquisition of neighbor and/or
  176.                         initialize polling variables
  177.         Refuse          refuse acquisition of neighbor
  178.         Cease           request de-acquisition of neighbor
  179.         Cease-ack       confirm de-acquisition of neighbor
  180.         Hello           request neigbor reachability
  181.         I-H-U           confirm neigbor reachability
  182.         Poll            request net-reachability update
  183.         Update          net-reachability update
  184.         Error           error
  185.  
  186.      EGP messages are classed as commands which request some action,
  187. responses, which are sent to indicate the status of that action, and
  188. indications, which are similar to responses, but may be sent at any
  189. time.  Following is a list of commands along with their possible
  190. responses.
  191.  
  192.         Command         Corresponding Responses
  193.         ---------------------------------------
  194.         Request         Confirm, Refuse, Error
  195.         Cease           Cease-ack, Error
  196.         Hello           I-H-U, Error
  197.         Poll            Update, Error
  198.  
  199.      The Update and Error messages are classed both as responses and
  200. indications.  When sent in reply to a previous command, either of these
  201. messages is classed as a response.  In some circumstances an unsolicited
  202. Update message can be sent, in which case it is classed as an
  203. indication.  The use of the Error message other than as a response to a
  204. previous command is a topic for further study.
  205.  
  206. 3.  State Machine
  207.  
  208.      This section describes the state-machine model for EGP, including
  209. the variables and constants which establish the state at any time, the
  210. events which cause the state transitions, the actions which result from
  211. these transitions and the state-transition table which defines the
  212. behavior.
  213.  
  214. 3.1.  State Variables
  215.  
  216.      The state-machine model includes a number of state variables which
  217. establish the state of the protocol between the gateway and each of its
  218. neighbors.  Thus, a gateway maintaining EGP with a number of neighbors
  219. must maintain a separate set of these state variables for each neighbor.
  220. The current state, events and actions of the state machine apply to each
  221.  
  222. Exterior Gateway Protocol Formal Specification                    Page 5
  223. D.L. Mills
  224.  
  225.  
  226. neighbor separately.
  227.  
  228.      The model assumes that system resources, including the set of state
  229. variables, are allocated when the state machine leaves the Idle state,
  230. either because of the arrival of a Request specifying a new neighbor
  231. addreess, or because of a Start event specifying a new neighbor address.
  232. When either of these events occur the values of the state variables are
  233. initialized as indicated below.  Upon return to the Idle state all
  234. resources, including the set of state variables, are deallocated and
  235. returned to the system.  Implementators may, of course, elect to
  236. dedicate resources and state variables permananently.
  237.  
  238.      Included among the set of state variables are the following which
  239. determine the state transitions of the model.  Initial values for all of
  240. the variables except the send sequence number S are set during the
  241. initial Request/Confirm exchange.  The initial value for S is arbitrary.
  242.  
  243.         Name    Function
  244.         --------------------------------------------------------------
  245.         R       receive sequence number
  246.         S       send sequence number
  247.         T1      interval between Hello command retransmissions
  248.         T2      interval between Poll command retransmissions
  249.         T3      interval during which neighbor-reachability
  250.                 indications are counted
  251.         M       hello polling mode
  252.         t1      timer 1 (used to control Request, Hello and Cease
  253.                 command retransmissions)
  254.         t2      timer 2 (used to control Poll command retransmissions)
  255.         t3      timer 3 (abort timer)
  256.  
  257. Additional state variables may be necessary to support various timer and
  258. similar internal housekeeping functions.  The function and management of
  259. the cited variables are discussed in Section 4.
  260.  
  261. 3.2.  Fixed Parameters
  262.  
  263.      This section defines several fixed parameters which characterize
  264. the gateway functions.  Included is a suggested value for each parameter
  265. based on experimental implementations in the Internet system.  These
  266. values may or may not be appropriate for the individual configuration.
  267.  
  268.      Following is a list of time-interval parameters which control
  269. retransmissions and other time-dependent functions.
  270.  
  271. Exterior Gateway Protocol Formal Specification                    Page 6
  272. D.L. Mills
  273.  
  274.  
  275.         Name    Value   Description
  276.         --------------------------------------------------------------
  277.         P1      30 sec  minimum interval acceptable between successive
  278.                         Hello commands received
  279.         P2      2 min   minimum interval acceptable between successive
  280.                         Poll commands recieved
  281.         P3      30 sec  interval between Request or Cease command
  282.                         retransmissions
  283.         P4      1 hr    interval during which state variables are
  284.                         maintained in the absence of commands or
  285.                         responses in the Down and Up states.
  286.         P5      2 min   interval during which state variables are
  287.                         maintained in the absence of responses in the
  288.                         Acquisition and Cease states
  289.  
  290.      Parameters P4 and P5 are used only if the abort-timer option is
  291. implemented.  Parameter P4 establishes how long the machine will remain
  292. in the Down and Up states in the absence of commands or responses and
  293. would ordinarily be set to sustain state information while the neighbor
  294. is dumped and restarted, for example.  Parameter P5 establishes how long
  295. the machine will remain in the Acquisition or Cease states in the
  296. absence of responses and would ordinarily be set in the same order as
  297. the expected value of T3 variables.
  298.  
  299.      Following is a list of other parameters of interest.
  300.  
  301.         Name    Active  Passive Description
  302.         -----------------------------------------------
  303.         j       3       1       neighbor-up threshold   
  304.         k       1       4       neighbor-down threshold
  305.  
  306.      The j and k parameters establish the "noise immunity" of the
  307. neighbor-reachability protocol described later.  The values in the
  308. Active column are suggested if the gateway elects to do hello polling,
  309. while the values in the Passive column are suggested otherwise.
  310.  
  311. 3.3.  Events
  312.  
  313.      Following is a list of events that can cause state transitions in
  314. the model.
  315.  
  316. Exterior Gateway Protocol Formal Specification                    Page 7
  317. D.L. Mills
  318.  
  319.  
  320. Name            Event
  321. ----------------------------------------------------------------------
  322. Up              At least j neighbor-reachability indications have been
  323.                 received within the last T3 seconds.
  324. Down            At most k neighbor-reachabilitiy indications have been
  325.                 received within the last T3 seconds.
  326. Request         Request command has been received.
  327. Confirm         Confirm command has been received.
  328. Refuse          Refuse response has been received.
  329. Cease           Cease command has been received.
  330. Cease-ack       Cease-ack response has been received.
  331. Hello           Hello command has been received.
  332. I-H-U           I-H-U response has been received.
  333. Poll            Poll command has been received.
  334. Update          Update response has been received.
  335. Start           Start event has been recognized due to system or
  336.                 operator intervention.
  337. Stop/t3         Stop event has been recognized due to (a) system or
  338.                 operator intervention or (b) expiration of the abort
  339.                 timer t3.
  340. t1              Timer t1 has counted down to zero.
  341. t2              Timer t2 has counted down to zero.
  342.  
  343.      There is one special event, called a neighbor-reachability
  344. indication, which occurs when:
  345.  
  346. 1.  The gateway is operating in the active mode (hello polling enabled)
  347.     and either a Confirm, I-H-U or Update response is received.
  348.  
  349. 2.  The gateway is operating in the passive mode (hello polling
  350.     disabled) and either a Hello or Poll command is received with the
  351.     "Up state" code in the Status field.
  352.  
  353. 3.4.  State Transition Table
  354.  
  355.      The following table summarizes the state transitions that can occur
  356. in response to the events listed above.  Transitions are shown in the
  357. form n/a, where n is the next state and a represents the action.
  358.  
  359. Exterior Gateway Protocol Formal Specification                    Page 8
  360. D.L. Mills
  361.  
  362.  
  363.              0 Idle      1 Aqsn      2 Down       3 Up       4 Cease
  364.           +-----------+-----------+-----------+-----------+-----------+
  365. Up        |0          |1          |3/Poll     |3          |4          |
  366. Down      |0          |1          |2          |2          |4          |
  367. Request   |2/Confirm *|2/Confirm  |2/Confirm  |2/Confirm  |4/Cease    |
  368. Confirm   |0/Cease  **|2          |2          |3          |4          |
  369. Refuse    |0/Cease  **|0          |2          |3          |4          |
  370. Cease     |0/Cease-ack|0/Cease-ack|0/Cease-ack|0/Cease-ack|0/Cease-ack|
  371. Cease-ack |0          |1          |2          |3          |0          |
  372. Hello     |0/Cease  **|1          |2/I-H-U    |3/I-H-U    |4          |
  373. I-H-U     |0/Cease  **|1          |2/Process  |3/Process  |4          |
  374. Poll      |0/Cease  **|1          |2          |3/Update   |4          |
  375. Update    |0/Cease  **|1          |2          |3/Process  |4          |
  376. Start     |1/Request  |1/Request  |1/Request  |1/Request  |4          |
  377. Stop/t3   |0          |0          |4/Cease    |4/Cease    |0          |
  378. t1        |0          |1/Request  |2/Hello    |3/Hello    |4/Cease    |
  379. t2        |0          |1          |2          |3/Poll     |4          |
  380.           +-----------+-----------+-----------+-----------+-----------+
  381.  
  382. Note *:  The transition shown applies to the case where the
  383. neighbor-acquisition request is accepted.  The transition "0/Refuse"
  384. applies to the case where the request is rejected.
  385.  
  386. Note **:  The Cease action shown is optional.
  387.  
  388. 3.5.  State Transitions and Actions
  389.  
  390.      The following table describes in detail the transitions of the
  391. state machine and the actions evoked.
  392.  
  393.                 Next    Message
  394. Event           State   Sent            Actions
  395. ------------------------------------------------------------------------
  396.  
  397. Idle State (0)
  398.  
  399. Request         2       Confirm         Initialize state variables and
  400.                         Hello           reset timer t1 to T1 seconds and
  401.                                         reset timer t3 to P5 seconds.
  402.   (or)          0       Refuse          Return resources.
  403. Cease           0       Cease-ack       Return resources.
  404. Start           1       Request         Reset timer t1 to P3 seconds and
  405.                                         reset timer t3 to P5 seconds.
  406.  
  407. Acquisition State (1)
  408.  
  409. Request         2       Confirm         Initialize state variables and
  410.                         Hello           reset timer t1 to T1 seconds and
  411.                                         reset timer t3 to P5 seconds.
  412. Confirm         2       Hello           Initialize state variables and
  413.  
  414. Exterior Gateway Protocol Formal Specification                    Page 9
  415. D.L. Mills
  416.  
  417.  
  418.                                         reset timer t1 to T1 seconds and
  419.                                         reset timer t3 to P5 seconds.
  420. Refuse          0                       Stop timers and return
  421.                                         resources.
  422. Cease           0       Cease-ack       Stop timers and return
  423.                                         resources.
  424. Start           1       Request         Reset timer t1 to P3 seconds and
  425.                                         reset timer t3 to P5 seconds.
  426. Stop/t3         0                       Stop timers and return
  427.                                         resources.
  428. t1              1       Request         Reset timer t1 to P3 seconds.
  429.  
  430. Down State (2)
  431. Note: Reset timer t3 to P4 seconds on receipt of a reachability
  432. indication.
  433.  
  434. Up              3       Poll            Reset timer t2 to T2 seconds.
  435. Request         2       Confirm         Reinitialize state variables and
  436.                         Hello           reset timer t1 to T1 seconds and
  437.                                         reset timer t3 to P5 seconds.
  438. Cease           0       Cease-ack       Stop timers and return
  439.                                         resources.
  440. Hello           2       I-H-U
  441. I-H-U           2                       Process neighbor-reachability
  442.                                         info.
  443. Start           1       Request         Reset timer t1 to P3 seconds and
  444.                                         reset timer t3 to P5 seconds.
  445. Stop/t3         4       Cease           Reset timer t1 to P3 seconds and
  446.                                         reset timer t3 to P5 seconds.
  447. t1              2       Hello           Reset timer t1 to T1 seconds.
  448.  
  449. Up State (3)
  450. Note: Reset timer t3 to P4 seconds on receipt of a reachability
  451. indication.
  452.  
  453. Down            2                       Stop timer t2.
  454. Request         2       Confirm         Renitialize state variables and
  455.                         Hello           reset timer t1 to T1 seconds and
  456.                                         reset timer t3 to P5 seconds.
  457. Cease           0       Cease-ack       Stop timers and return
  458.                                         resources.
  459. Hello           3       I-H-U
  460. I-H-U           3                       Process neighbor-reachability
  461.                                         info.
  462. Poll            3       Update
  463. Update          3                       Process net-reachability info.
  464. Start           1       Request         Reset timer t1 to P3 seconds and
  465.                                         reset timer t3 to P5 seconds.
  466. Stop/t3         4       Cease           Reset timer t1 to P3 seconds and
  467.                                         reset timer t3 to P5 seconds.
  468.  
  469. Exterior Gateway Protocol Formal Specification                   Page 10
  470. D.L. Mills
  471.  
  472.  
  473. t1              3       Hello           Reset timer t1 to T1 seconds.
  474. t2              3       Poll            Reset timer t2 to T2 seconds.
  475.  
  476. Cease State (4)
  477.  
  478. Request         4       Cease
  479. Cease           0       Cease-ack       Stop timers and return
  480.                                         resources.
  481. Cease-ack       0                       Stop timers and return
  482.                                         resources.
  483. Stop/t3         0                       Stop timers and return
  484.                                         resources.
  485. t1              4       Cease           Reset timer t1 to P3 seconds.
  486.  
  487. 4.  Functional Description
  488.  
  489.      This section contains detailed descriptions of the various
  490. procedures and algorithms used to manage the protocol.
  491.  
  492. 4.1.  Managing the State Variables
  493.  
  494.      The state variables which characterize the protocol are summarized
  495. in Section 3.1.  This section describes the detailed management of these
  496. variables, including sequence numbers, polling intervals and timers.
  497.  
  498. 4.1.1.  Sequence Numbers
  499.  
  500.      All EGP commands and replies carry a sequence number.  The state
  501. variable R records the last sequence number received in a command from
  502. that neighbor.  The current value of R is used as the sequence number
  503. for all replies and indications sent to the neighbor until a command
  504. with a different sequence number is received from that neighbor.
  505.  
  506.      Implementors are free to manage the sequence numbers of the
  507. commands sent;  however, it is suggested that a separate send state
  508. variable S be maintained for each EGP neighbor and that its value be
  509. incremented just before the time an Poll command is sent and at no other
  510. times.  The actions upon receipt of a response or indication with
  511. sequence number not equal to S is not specified;  however, it is
  512. recommended these be discarded.
  513.  
  514. 4.1.1.  Polling Intervals
  515.  
  516.      As part of the Request/Confirm exchange a set of polling intervals
  517. are established including T1, which establishes the interval between
  518. Hello command retransmissions, and T2, which establishes the interval
  519. between Poll retransmissions.
  520.  
  521.      Each gateway configuration is characterized by a set of fixed
  522. parameters, including P1, which specifies the minimum polling interval
  523.  
  524. Exterior Gateway Protocol Formal Specification                   Page 11
  525. D.L. Mills
  526.  
  527.  
  528. at which it will respond to Hello commands, and P2, which specifies the
  529. minimum polling interval at which it will respond to Poll commands.  P1
  530. and P2 are inserted in the Hello Interval (S1) and Poll Interval (S2)
  531. fields, respectively, of Request commands and Confirm responses.
  532.  
  533.      A gateway receiving a Request command or Confirm response uses the
  534. S1 and S2 fields in the message to calculate its own T1 and T2 state
  535. variables, respectively.  Implementors are free to perform this
  536. calculation in arbitrary ways;  however, the following constraints must
  537. be observed:
  538.  
  539. 1.  If T1 < S1 the neighbor may discard Hello commands.  If T2 < S2 the
  540.     neighbor may discard Poll commands.
  541.  
  542. 2.  The time window T3 in which neighbor-reachability indications are
  543.     counted is dependent on T1.  In the case where two neighbors select
  544.     widely differing values for their T3 state variables, the
  545.     neighbor-reachability algorithm may not work properly.  This can be
  546.     avoided if T1 > max(P1, S1).
  547.  
  548. 3.  If either S1 or S2 or both are unacceptable for some reason (e.g.
  549.     exceed useful limits), the neighbor may either send a Refuse
  550.     response or declare a Stop event, depending on state.
  551.  
  552.      It is suggested that T3 be computed as four times the value of T1,
  553. giving a window of four neighbor-reachability indications, which has
  554. been found appropriate in the experimental implementations.
  555. Implementors may choose to make T3 a fixed parameter in those cases
  556. where the path between the neighbors has well-known characteristics.
  557.  
  558.      Note that, if a gateway attempts to send Hello commands near the
  559. rate max(P1, S1) or Poll commands near the rate max(P2, S2), the
  560. neighbor may observe their succeeding arrivals to violate the polling
  561. restrictions due to bunching in the net.  For this reason the gateway
  562. should send at rates somewhat below these.  Just how much below these
  563. rates is appropriate depends on many factors beyond the scope of this
  564. specification.
  565.  
  566. 4.1.3.  Hello Polling Mode
  567.  
  568.      The neighbor-reachability algorithm can be used in either the
  569. active or passive mode.  In the active mode Hello commands are sent
  570. periodically along with Poll commands, with reachability determined by
  571. the corresponding I-H-U and Update responses.  In the passive mode Hello
  572. commands are not sent and I-H-U responses are not expected.
  573. Reachability is then determined from the Status field of received Hello
  574. or Poll commands or Update responses.
  575.  
  576.      The M state variable specifies whether the gateway operates in the
  577. active or passive mode.  At least one of the two neighbors sharing the
  578.  
  579. Exterior Gateway Protocol Formal Specification                   Page 12
  580. D.L. Mills
  581.  
  582.  
  583. protocol must operate in the active mode;  however, the
  584. neighbor-reachability protocol is designed to work even if both
  585. neighbors operate in the active mode.  The value of M is determined from
  586. the Status field of a Request command or Confirm response.  The sender
  587. sets this field according to whether the implementation supports the
  588. active mode, passive mode or both:
  589.  
  590.                 Status  Sender capabilities
  591.                 --------------------------------
  592.                 0       either active or passive
  593.                 1       active only
  594.                 2       passive only
  595.  
  596.      The receiver inspects this field and sets the value of M according
  597. to its own capabilities as follows:
  598.  
  599.                 Status  Receiver capabilites
  600.                 field   0       1       2
  601.                 -------------------------------
  602.                 0       *       active  passive 
  603.                 1       passive active  passive
  604.                 2       active  active  **
  605.  
  606.      In the case of "*" the mode is determined by comparing the
  607. autonomous system numbers of the neigbors.  The neighbor with the
  608. smallest such number assumes active mode, while the other neighbor
  609. assumes passive mode.  In the case of "**" the neighbor may either send
  610. a Refuse response or declare a Stop event, depending on state.
  611.  
  612. 4.1.4.  Timers
  613.  
  614.      There are three timers defined in the state machine:  t1, used to
  615. control retransmission of Request, Hello and Cease messages, t2, used to
  616. control retransmission of Poll commands, and t3, which serves as an
  617. abort-timer mechanism should the protocol hang indefinately.  The timers
  618. are set to specified values upon entry to each state and count down to
  619. zero.
  620.  
  621.      In the case of t1 and t2 state-dependent events are declared when
  622. the timer counts down to zero, after which the timer is reset to the
  623. specified value and counts down again.  In the case of t3 a Stop event
  624. is declared when the timer counts down to zero.  Implementors may choose
  625. not to implement t3 or, if so, may choose to implement it only in
  626. certain states, with the effect that Request, Hello and/or Cease
  627. commands may be retransmitted indefinately.
  628.  
  629.      The following table shows the initial values for each of the timers
  630. in each state.  A missing value indicates the timer is not used in that
  631. state.  Note that timer t3 is set to P4 upon receipt of a
  632. neighbor-reachability indication when in either the Down or Up states.
  633.  
  634. Exterior Gateway Protocol Formal Specification                   Page 13
  635. D.L. Mills
  636.  
  637.  
  638.                 Idle    Aqsn    Down    Up      Cease
  639.         Timer   0       1       2       3       4
  640.         ---------------------------------------------
  641.         t1              P3      T1              P3
  642.         t2                              T2      
  643.         t3              P5      P5              P5
  644.  
  645. 4.2.  Starting and Stopping the Protocol
  646.  
  647.      The Start and Stop events are intrinsic to the system environment
  648. of the gateway.  They can be declared as the result of the gateway
  649. process being started and stopped by the operator, for example.  A Start
  650. event has meaning only in some states;  however, a Stop event has
  651. meaning in all states.
  652.  
  653.      In all except the Idle state the abort timer t3 is presumed
  654. running.  This timer is initialized at P5 seconds upon entry to any
  655. state and at P4 seconds upon receipt of a neighbor-reachability
  656. indication in the Down and Up states.  If it expires a Stop event is
  657. declared.  A Stop event can also be declared by an intrinsic system
  658. action such as a resource problem or operator command.
  659.  
  660.      If the abort timer is not implemented a manually-initiated Stop
  661. event can be used to stop the protocol.  If this is done in the Down or
  662. Up states, the machine will transition to the Cease state and emit a
  663. Cease command.  If the neighbor does not respond to this command the
  664. machine will stay in the Cease state indefinately;  however, a second
  665. Stop event can be used in this state to force a transition to the Idle
  666. state.
  667.  
  668.      A Cease command received in any state will cause the gateway to
  669. immediately send the Cease-ack response and transition to the Idle
  670. state.  This causes the protocol to be stopped and all system resources
  671. committed to the gateway process to be released.  The interval between
  672. the time the gateway enters the Idle state as the result of receiving a
  673. Cease command and the time when it next sends a Request command to
  674. resume the protocol is not specified;  however, it is recommended this
  675. interval be at least P5 seconds.
  676.  
  677.      It may happen that the Cease-ack response is lost in the network,
  678. causing the neighbor to retransmit the Cease response indefinately, at
  679. least if it has not implemented the abort-timer option.  In order to
  680. reduce the likelihood of this happening, it is suggested that a gateway
  681. in the Idle state be prepared to reply to a Cease command with a
  682. Cease-ack response whenever possible.
  683.  
  684. 4.3.  Determining Neighbor Reachability
  685.  
  686.      The purpose of the neighbor-reachability algorithm is to confirm
  687. that the neighbor can safely be considered operational and capable of
  688.  
  689. Exterior Gateway Protocol Formal Specification                   Page 14
  690. D.L. Mills
  691.  
  692.  
  693. providing reliable net-reachability information.  An equally important
  694. purpose is to filter noisy reachability information before sending it on
  695. to the remainder of the Internet gateway system, thus avoiding
  696. unneccesary reachability changes.
  697.  
  698.      As described above, a gateway operating in the active mode sends
  699. periodic Hello commands and listens for I-H-U responses in order to
  700. determine neighbor-reachability indications.  A gateway operating in the
  701. passive mode determines reachability indications by means of the Status
  702. field in received Hello commands.  Poll commands and Update responses
  703. can be used in lieu of Hello commands and I-H-U responses respectively,
  704. since they contain the same Status-field information.
  705.  
  706.      The neighbor-reachability algorithm runs continuously while the
  707. gateway is in the Down and Up states and operates as follows.  Define a
  708. moving window in time starting at the present and extending backwards
  709. for t seconds.  Then count the number n of neighbor-reachability
  710. indications which have occured in that window.  If n increases to j,
  711. then declare a Up event.  If n decreases to k, then declare a Down
  712. event.  The number n is set to zero upon entering the Down state from
  713. any state other than the Up state.
  714.  
  715.      The window t in this algorithm is defined as T3 seconds, the value
  716. of which is suggested as four times T1, which itself is determined
  717. during the Request/Confirm exchange.  For proper operation of the
  718. algorithm only one neighbor-reachability indication is significant in
  719. any window of T1 seconds and additional ones are ignored.  Note that the
  720. only way n can increase is as the result of a new neighbor-reachability
  721. indication and the only way it can decrease is as the result of an old
  722. neighbor-reachability indication moving out of the window.
  723.  
  724.      The behavior of the algorithm described above and using the
  725. suggested fixed parameters j and k differs depending on whether the
  726. gateway is operating in the active or passive mode.  In the active mode
  727. (j = 3, k = 1 and T3/T1 = 4), once the neighbor has been declared down
  728. it will be forced down for at least two T1 intervals and, once it has
  729. been declared up it will be forced up for at least two T1 intervals.  It
  730. will not change state unless at least three of the last four
  731. determinations of reachability have indicated that change.
  732.  
  733.      In the passive mode (j = 1, k = 4 and T3/T1 = 4), the neighbor will
  734. be considered up from the first time the Status field of a Hello or Poll
  735. command or Update response indicates "Up state" until four successive T1
  736. intervals have passed without such indication.  This design, suggested
  737. by similar designs used in the ARPANET, has proven effective in the
  738. experimental implementations, but may need to be adjusted for other
  739. configurations.
  740.  
  741.      It is convenient for the active gateway to send Hello commands at a
  742. rate of one every T1 seconds and substitute a Poll command for a Hello
  743.  
  744. Exterior Gateway Protocol Formal Specification                   Page 15
  745. D.L. Mills
  746.  
  747.  
  748. command approximately once every T2 seconds, with the
  749. neighbor-reachability indication generated by the corresponding I-H-U or
  750. Update responses.  Its passive neighbor generates neighbor-reachability
  751. indications from the Status field of received Hello and Poll commands
  752. and Update responses.
  753.  
  754.  
  755.      Implementors may find the following model useful in the
  756. understanding and implementation of this algorithm.  Consider an n-bit
  757. shift register that shifts one bit to the right each T1-second interval.
  758. If a neighbor-reachability indication was received during the preceeding
  759. T1-second interval a one bit is shifted into the register at the end of
  760. the interval;  otherwise, a zero bit is shifted.  A table of 2**n
  761. entries indexed by the contents of the register can be used to calculate
  762. the number of one bits, which can then be used to declare the
  763. appropriate event to the state machine.  A value of n equal to four has
  764. been found useful in the experimental implementations.
  765.  
  766. 4.4.  Determining Network Reachability
  767.  
  768.      Network reachability information is encoded into Update messages in
  769. the form of lists of nets and gateways.  The IP Source Address field of
  770. the Poll command is used to specify a network common to the autonomous
  771. systems of each of the neighbors, which is usually, but not necessarily,
  772. the one common to the neighbors themselves.  The Update response
  773. includes a list of gateways on the common net.  Associated with each
  774. gateway is a list of the networks reachable via that gateway together
  775. with corresponding hop counts.
  776.  
  777.      It is important to understand that, at the present state of
  778. development as described in RFC-827 and RFC-888, the EGP architectural
  779. model restricts the interpretation of "reachable" in this context.  This
  780. consideration, as well as the implied topological restrictions, are
  781. beyond the scope of discussion here.  The reader is referred to the RFCs
  782. for further discussion.
  783.  
  784.      Two types of gateway lists can be included in the Update response,
  785. the format of which is described in Appendix A.  Both lists include only
  786. those gateways directly connected to the net specified in the IP Source
  787. Network field of the last-received Poll command.  The internal list
  788. includes some or all of the gateways in the same autonomous system as
  789. the sender, together with the nets which are reachable via these
  790. gateways, with the sending gateway listed first.  A net is reachable in
  791. this context if a path exists to that net including only gateways in the
  792. system.  The external list includes those gateways in other autonomous
  793. systems known to the sender.  It is important to realize that the hop
  794. counts do not represent a routing metric and are comparable between
  795. different gateways only if those gateways belong to the same autonomous
  796. system;  that is, are in the internal list.
  797.  
  798.  
  799. Exterior Gateway Protocol Formal Specification                   Page 16
  800. D.L. Mills
  801.  
  802.  
  803.      According to the current system architectural model, only gateways
  804. belonging to a designated system, called the core system, may include
  805. the external list in their Update responses.  All other gateways may
  806. include only those gateways belonging to the same system and can claim
  807. reachability for a particular net only if that net is reachable in the
  808. same system.
  809.  
  810.      The interval between successive Poll commands T2 is determined
  811. during the Request/Confirm exchange.  However, the specification permits
  812. at most one unsolicited Update indication between succeeding Poll
  813. commands received from the neighbor.  It is the intent of the model here
  814. that an Update indication is sent (a) upon entry to the Up state and (b)
  815. when a change in the reachability data base is detected, subject to this
  816. limitation.
  817.  
  818.      Occasionally it may happen that a Poll command or Update response
  819. is lost in the network, with the effect that net-reachability
  820. information may not be available until after another T2 interval.  As an
  821. implementation option, the gateway sending a Poll command and not
  822. receiving an Update response after T1 seconds may send another Poll.
  823. The gateway receiving this Poll may either (a) send an Update response
  824. if it never received the original Poll for that interval, (b) send a
  825. second Update response (which counts as the unsolicited Update
  826. indication mentioned in the preceeding paragraph) or (c) send an Error
  827. response or not respond at all in other cases.
  828.  
  829. 4.5.  Error Messages
  830.  
  831.      Error messages can be used to report problems such as described in
  832. Appendix A in connection with the Error Response/Indication message
  833. format.  In general, an Error message is sent upon receipt of another
  834. command or response with bad format, content or ordering, but never in
  835. response to another Error message.  Receipt of an Error message should
  836. be considered advisory and not result in change of state, except
  837. possibly to evoke a Stop event.
  838.  
  839. Exterior Gateway Protocol Formal Specification                   Page 17
  840. D.L. Mills
  841.  
  842.  
  843. Appendix A.  EGP Message Formats
  844.  
  845.      The formats for the various EGP messages are described in this
  846. section.  All EGP messages include a ten-octet header of six fields,
  847. which may be followed by additional fields depending on message type.
  848. The format of the header is shown below along with a description of its
  849. fields.
  850.  
  851.       0                   1                   2                   3
  852.       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  853.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  854.      | EGP Version # |     Type      |     Code      |    Status     |
  855.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  856.      |        Checksum               |       Autonomous System #     |
  857.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  858.      |        Sequence #             |
  859.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  860.  
  861. EGP Version #           assigned number identifying the EGP version
  862.                         (currently 2)
  863.  
  864. Type                    identifies the message type
  865.  
  866. Code                    identifies the message code (subtype)
  867.  
  868. Status                  contains message-dependent status information
  869.  
  870. Checksum                The EGP checksum is the 16-bit one's complement
  871.                         of the one's complement sum of the EGP message
  872.                         starting with the EGP version number field. When
  873.                         computing the checksum the checksum field itself
  874.                         should be zero.
  875.  
  876. Autonomous System #     assigned number identifying the particular
  877.                         autonomous system
  878.  
  879. Sequence #              send state variable (commands) or receive state
  880.                         variable (responses and indications)
  881.  
  882.      Following is a description of each of the message formats.  Note
  883. that the above description applies to all formats and will not be
  884. repeated.
  885.  
  886. Exterior Gateway Protocol Formal Specification                   Page 18
  887. D.L. Mills
  888.  
  889.  
  890. A.1.  Neighbor Acquisition Messages
  891.  
  892.       0                   1                   2                   3
  893.       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  894.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  895.      | EGP Version # |     Type      |     Code      |    Status     |
  896.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  897.      |        Checksum               |       Autonomous System #     |
  898.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  899.      |        Sequence #             |          Hello Interval       |
  900.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  901.      |        Poll Interval          |
  902.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  903.  
  904. Note:  the Hello Interval and Poll Interval fields are present only in
  905. Request and Confirm messages.
  906.  
  907. Type                    3
  908.  
  909. Code                    0       Request command
  910.                         1       Confirm response
  911.                         2       Refuse response
  912.                         3       Cease command
  913.                         4       Cease-ack response
  914.  
  915. Status (see below)      0       unspecified
  916.                         1       active mode
  917.                         2       passive mode
  918.                         3       insufficient resources
  919.                         4       administratively prohibited
  920.                         5       going down
  921.                         6       parameter problem
  922.                         7       protocol violation
  923.  
  924. Hello Interval          minimum Hello command polling interval (seconds)
  925.  
  926. Poll Interval           minumum Poll command polling interval (seconds)
  927.  
  928. Following is a summary of the assigned Status codes along with a list of
  929. scenarios in which they might be used.
  930.  
  931. Exterior Gateway Protocol Formal Specification                   Page 19
  932. D.L. Mills
  933.  
  934.  
  935. Code    Status                  Scenarios
  936. -------------------------------------------------------------------
  937. 0       unspecified             when nothing else fits
  938.  
  939. 1       active mode             Request/Confirm only
  940.  
  941. 2       passive mode            Request/Confirm only    
  942.  
  943. 3       insufficient resources  1. out of table space
  944.                                 2. out of system resources
  945.  
  946. 4       administratively        1. unknown Autonomous System  
  947.         prohibited              2. use another gateway
  948.  
  949. 5       going down              1. operator initiated Stop
  950.                                 2. abort timeout
  951.  
  952. 6       parameter problem       1. nonsense polling parameters
  953.                                 2. unable to assume compatible mode
  954.  
  955. 7       protocol violation      1. Invalid command or response
  956.                                    received in this state
  957.  
  958. Exterior Gateway Protocol Formal Specification                   Page 20
  959. D.L. Mills
  960.  
  961.  
  962. A.2. Neighbor Reachability Messages
  963.  
  964.       0                   1                   2                   3
  965.       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  966.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  967.      | EGP Version # |     Type      |     Code      |    Status     |
  968.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  969.      |    Checksum                   |    Autonomous System #        |
  970.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  971.      |      Sequence #               |
  972.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  973.  
  974. Type                    5
  975.  
  976. Code                    0       Hello command
  977.                         1       I-H-U response
  978.  
  979. Status                  0       indeterminate
  980.                         1       Up state
  981.                         2       Down state
  982.  
  983. Exterior Gateway Protocol Formal Specification                   Page 21
  984. D.L. Mills
  985.  
  986.  
  987. A.3. Poll Command
  988.  
  989.       0                   1                   2                   3
  990.       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  991.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  992.      | EGP Version # |    Type       |     Code      |    Status     |
  993.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  994.      |         Checksum              |       Autonomous System #     |
  995.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  996.      |         Sequence #            |           Reserved            |
  997.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  998.      |                       IP Source Network                       |
  999.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1000.  
  1001. Type                    2
  1002.  
  1003. Code                    0
  1004.  
  1005. Status                  0       indeterminate
  1006.                         1       Up state
  1007.                         2       Down state
  1008.  
  1009. IP Source Network       IP network number of the network about which
  1010.                         reachability information is being requested
  1011.                         (coded as 1, 2 or 3 octets, left justified with
  1012.                         trailing zeros)
  1013.  
  1014. Exterior Gateway Protocol Formal Specification                   Page 22
  1015. D.L. Mills
  1016.  
  1017.  
  1018. A.4. Update Response/Indication
  1019.  
  1020.       0                   1                   2                   3
  1021.       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1022.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1023.      | EGP Version # |    Type       |     Code      |    Status     |
  1024.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1025.      |    Checksum                   |       Autonomous System #     |
  1026.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1027.      |    Sequence #                 | # of Int Gwys | # of Ext Gwys |
  1028.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1029.      |                       IP Source Network                       |
  1030.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1031.      | Gateway 1 IP address (without network #)      | (1-3 octets)
  1032.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1033.      |  # Distances  |
  1034.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1035.      |  Distance 1   |   # Nets      |
  1036.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1037.      |   net 1,1,1   ||||||||||||||||||||||||||||||||| (1-3 octets)
  1038.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1039.      |   net 1,1,2   ||||||||||||||||||||||||||||||||| (1-3 octets)
  1040.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1041.             ...
  1042.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1043.      |  Distance 2   |   # Nets      |
  1044.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1045.      |   net 1,2,1   ||||||||||||||||||||||||||||||||| (1-3 octets)
  1046.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1047.      |   net 1,2,2   ||||||||||||||||||||||||||||||||| (1-3 octets)
  1048.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1049.             ...
  1050.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1051.      |             Gateway  n IP address (without network #)         |
  1052.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1053.      |  # Distances  |
  1054.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1055.      |  Distance 1   |  # Nets       |
  1056.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1057.      |   net n,1,1   |||||||||||||||||||||||||||||||||  (1-3 octets)
  1058.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1059.      |   net n,1,2   |||||||||||||||||||||||||||||||||  (1-3 octets)
  1060.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1061.      |  Distance 2   |  # Nets       |
  1062.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1063.      |   net n,2,1   |||||||||||||||||||||||||||||||||  (1-3 octets)
  1064.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1065.      |   net n,2,2   |||||||||||||||||||||||||||||||||  (1-3 octets)
  1066.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1067.            ...
  1068.  
  1069. Exterior Gateway Protocol Formal Specification                   Page 23
  1070. D.L. Mills
  1071.  
  1072.  
  1073. Type                    1
  1074.  
  1075. Code                    0
  1076.  
  1077. Status                  0       indeterminate
  1078.                         1       Up state
  1079.                         2       Down state
  1080.                         128     unsolicited message bit
  1081.  
  1082. # of Int Gwys           number of interior gateways appearing in this
  1083.                         message
  1084.  
  1085. # of Ext Gwys           number of exterior gateways appearing in this
  1086.                         message
  1087.  
  1088. IP Source Network       IP network number of the network about which
  1089.                         reachability information is being supplied
  1090.                         (coded as 1, 2 or 3 octets, left justified with
  1091.                         trailing zeros)
  1092.  
  1093. Gateway IP addresses    IP address (without network number) of the
  1094.                         gateway block (coded as 1, 2 or 3 octets)
  1095.  
  1096. # of Distances          number of distances in the gateway block
  1097.  
  1098. Distances               numbers depending on autonomous system
  1099.                         architecture
  1100.  
  1101. # of Nets               number of nets at each distance
  1102.  
  1103. Nets                    IP network number reachable via the gateway
  1104.  
  1105. Exterior Gateway Protocol Formal Specification                   Page 24
  1106. D.L. Mills
  1107.  
  1108.  
  1109. A.5. Error Response/Indication
  1110.  
  1111.       0                   1                   2                   3
  1112.       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1113.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1114.      | EGP Version # |    Type       |     Code      |    Status     |
  1115.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1116.      |    Checksum                   |       Autonomous System #     |
  1117.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1118.      |       Sequence #              |          Reason               |
  1119.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1120.      |                                                               |
  1121.      |                     Error Message Header                      |
  1122.      |            (first three 32-bit words of EGP header)           |
  1123.      |                                                               |
  1124.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1125.  
  1126. Type                    8
  1127.  
  1128. Code                    0
  1129.  
  1130. Status                  0       indeterminate
  1131.                         1       Up state
  1132.                         2       Down state
  1133.                         128     unsolicited message bit
  1134.  
  1135. Reason (see below)      0       unspecified
  1136.                         1       bad EGP header format
  1137.                         2       bad EGP data field format
  1138.                         3       reachability info unavailable
  1139.                         4       excessive polling rate
  1140.                         5       no response
  1141.  
  1142. Error Message Header    first three 32-bit words of EGP header
  1143.  
  1144. Following is a summary of the assigned Reason codes along with a list of
  1145. scenarios in which they might be used.
  1146.  
  1147. Exterior Gateway Protocol Formal Specification                   Page 25
  1148. D.L. Mills
  1149.  
  1150.  
  1151. Code    Reason                  Scenarios
  1152. ------------------------------------------------------------------------
  1153. 0       unspecified             when nothing else fits
  1154.  
  1155. 1       bad EGP header format   1. bad message length
  1156.                                 2. invalid Type, Code or Status fields
  1157.  
  1158.                                 Notes: The recipient can determine which
  1159.                                 of the above hold by inspecting the EGP
  1160.                                 header included in the message. An
  1161.                                 instance of a wrong EGP version or bad
  1162.                                 checksum should not be reported, since
  1163.                                 the original recipient can not trust the
  1164.                                 header format. An instance of an unknown
  1165.                                 autonomous system should be caught at
  1166.                                 acquistion time.
  1167.  
  1168. 2       bad EGP data field      1. nonsense polling rates
  1169.         format                     (Request/Confirm)
  1170.                                 2. invalid Update message format
  1171.                                 3. response IP Net Address field does
  1172.                                    not match command (Update)
  1173.  
  1174.                                 Notes: An instance of nonsense polling
  1175.                                 intervals (e.g. too long to be useful)
  1176.                                 specified in a Request or Confirm should
  1177.                                 result in a Refuse or Cease with this
  1178.                                 cause specified.
  1179.  
  1180. 3       reachability info       1. no info available on net specified in
  1181.         unavailable                IP Net Address field (Poll)
  1182.  
  1183. 4       excessive polling rate  1. two or more Hello commands received
  1184.                                    within minimum specified polling
  1185.                                    interval
  1186.                                 2. two or more Poll commands received
  1187.                                    within minimum specified polling
  1188.                                    interval
  1189.                                 3. two or more Request commands received
  1190.                                    within some (reasonably short)
  1191.                                    interval
  1192.  
  1193.                                 Notes: The recipient can determine which
  1194.                                 of the above hold by inspecting the EGP
  1195.                                 header included in the message.
  1196.  
  1197. 5       no response             1. no Update received for Poll within
  1198.                                    some (reasonably long) interval
  1199.  
  1200. Exterior Gateway Protocol Formal Specification                   Page 26
  1201. D.L. Mills
  1202.  
  1203.  
  1204. Appendix B.  Comparison with RFC-888
  1205.  
  1206.      Minor functional enhancements are necessary in the RFC-888 message
  1207. formats to support certain features assumed of the state-machine model,
  1208. in particular the capability to request a neighbor to suppress Hello
  1209. commands.  In addition, the model suggests a mapping between its states
  1210. and certain status and error indications which clarifies and generalizes
  1211. the interpretation.
  1212.  
  1213.      All of the header fields except the Status field (called the
  1214. Information field at some places in RFC-888) remain unchanged.  The
  1215. following table summarizes the suggested format changes in the Status
  1216. field for the various messages by (Type, Code) class.
  1217.  
  1218. Class   Messages                Status Codes
  1219. -------------------------------------------------------------------
  1220. 3,0     Request                 0       unspecified
  1221. 3,1     Confirm                 1       active mode
  1222. 3,2     Refuse                  2       passive mode
  1223. 3,3     Cease                   3       insufficient resources
  1224. 3,4     Cease-ack               4       administratively prohibited
  1225.                                 5       going down
  1226.                                 6       parameter problem
  1227.  
  1228. 5,0     Hello                   0       indeterminate
  1229. 5,1     I-H-U                   1       Up state
  1230. 2,0     Poll                    2       Down state
  1231. 1,0     Update                  128     unsolicited message bit
  1232. 8,0     Error
  1233.  
  1234. The changes from RFC-888 are as follows:
  1235.  
  1236. 1.  The status codes have been combined in two classes, one for those
  1237.     messages involved in starting and stopping the protocol and the
  1238.     other for those messages involved in maintaining the protocol and
  1239.     exchanging reachability information.  Some messages of either class
  1240.     may not use all the status codes assigned.
  1241.  
  1242. 2.  The status codes for the Request and Confirm indicate whether the
  1243.     sender can operate in active or passive mode.  In RFC-888 this field
  1244.     must be zero;  however, RFC-888 does not specify any mechanism to
  1245.     decide how the neighbors poll each other.
  1246.  
  1247. 3.  The status codes for the Cease, Refuse and Cease-ack have the same
  1248.     interpretation.  This provides a clear and unambiguous indication
  1249.     when the protocol is terminated due to an unusual situation, for
  1250.     instance if the NOC dynamically repartitions the ARPANET.  The
  1251.     assigned codes are not consistent with RFC-888, since the codes for
  1252.     the Refuse and Cease were assigned conflicting values;  however, the
  1253.     differences are minor and should cause no significant problems.
  1254.  
  1255. Exterior Gateway Protocol Formal Specification                   Page 27
  1256. D.L. Mills
  1257.  
  1258.  
  1259. 4.  The status codes for the Hello, I-H-U, Poll, Update and Error have
  1260.     the same interpretation.  Codes 0 through 2 are mutually exclusive
  1261.     and are chosen solely on the basis of the state of the sender.  In
  1262.     the case of the Update (and possibly Error) one of these codes can
  1263.     be combined with the "unsolicited bit," which corresponds to code
  1264.     128.  In RFC-888 this field is unused for the Poll and Error and may
  1265.     contain only zero or 128 for the Update, so that the default case is
  1266.     to assume that reciprocal reachability cannot be determined by these
  1267.     messages.
  1268.  
  1269. 5.  Some of the reachability codes defined in RFC-888 have been removed
  1270.     as not applicable.
  1271.  
  1272. Exterior Gateway Protocol Formal Specification                   Page 28
  1273. D.L. Mills
  1274.  
  1275.  
  1276. Appendix C.  Reachability Analysis
  1277.  
  1278.      The following table shows the state transitions which can occur in
  1279. a system of two neighboring EGP gateways.  Besides being useful in the
  1280. design and verification of the protocol, the table is useful for
  1281. implementation and testing.
  1282.  
  1283.      The system of two neighboring EGP gateways is modelled as a
  1284. finite-state automaton constructed as the cartesian product of two state
  1285. machines as defined above.  Each state of this machine is represented as
  1286. [i,j], where i and j are states of the original machine.  Each line of
  1287. the table shows one state transition of the machine in the form:
  1288.  
  1289.                         [i1,j1] -> [i2,j2]  E  A
  1290.  
  1291. which specifies the machine in state [i1,j1] presented with event E
  1292. transitions to state [i2,j2] and generates action A.  Multiple actions
  1293. are separated by the "/" symbol.  The special symbol "*" represents the
  1294. set of lines where all "*"s in the line take on the (same) values 0 - 4
  1295. in turn.
  1296.  
  1297.      The table shows only those transitions which can occur as the
  1298. result of events arriving at one of the two neighbors.  The full table
  1299. includes a duplicate set of lines for the other neighbor as well, with
  1300. each line derived from a line of the table below using the
  1301. transformation:
  1302.  
  1303.          [i1,j1] -> [i2,j2]  E  A  =>  [j1,i1] -> [j2,i2]  E  A
  1304.  
  1305. State    State  Event           Actions
  1306. ---------------------------------------------------
  1307. [*,4] -> [0,4]  Cease           Cease-ack
  1308.  
  1309. [0,1] -> [2,1]  Request         Confirm/Hello/Up/t1
  1310. [0,1] -> [0,1]  Request         Refuse
  1311. [0,*] -> [1,*]  Start           Request/t1
  1312.  
  1313. [1,1] -> [2,1]  Request         Confirm/Hello/Up/t1
  1314. [1,2] -> [2,2]  Confirm         Hello/Up/t1
  1315. [1,3] -> [2,3]  Confirm         Hello/Up/t1
  1316. [1,0] -> [0,0]  Refuse          Null
  1317. [1,*] -> [1,*]  Start           Request/r1
  1318. [1,*] -> [0,*]  Stop            Null
  1319. [1,*] -> [1,*]  t1              Request/t1
  1320.  
  1321. [2,1] -> [3,1]  Up              Down/Hello/Poll/t1/t2
  1322. [2,1] -> [2,1]  Request         Confirm/Hello/Up/t1
  1323. [2,2] -> [2,2]  Hello           I-H-U
  1324. [2,3] -> [2,3]  Hello           I-H-U
  1325. [2,2] -> [2,2]  I-H-U           Process
  1326.  
  1327. Exterior Gateway Protocol Formal Specification                   Page 29
  1328. D.L. Mills
  1329.  
  1330.  
  1331. [2,3] -> [2,3]  I-H-U           Process
  1332. [2,*] -> [1,*]  Start           Request/r1
  1333. [2,*] -> [4,*]  Stop            Cease/t1
  1334. [2,1] -> [2,1]  t1              Hello/t1
  1335. [2,2] -> [2,2]  t1              Hello/t1
  1336. [2,3] -> [2,3]  t1              Hello/t1
  1337.  
  1338. [3,1] -> [2,1]  Down            Null
  1339. [3,2] -> [2,2]  Down            Null
  1340. [3,3] -> [2,3]  Down            Null
  1341. [3,1] -> [2,1]  Request         Confirm/Hello/Up/t1
  1342. [3,2] -> [3,2]  Hello           I-H-U
  1343. [3,3] -> [3,3]  Hello           I-H-U
  1344. [3,2] -> [3,2]  I-H-U           Process
  1345. [3,3] -> [3,3]  I-H-U           Process
  1346. [3,3] -> [3,3]  Poll            Update
  1347. [3,3] -> [3,3]  Update          Process
  1348. [3,*] -> [1,*]  Start           Request/r1
  1349. [3,*] -> [4,*]  Stop            Cease/t1
  1350. [3,1] -> [3,1]  t1              Hello/t1
  1351. [3,2] -> [3,2]  t1              Hello/t1
  1352. [3,3] -> [3,3]  t1              Hello/t1
  1353. [3,1] -> [3,1]  t2              Poll/t2
  1354. [3,2] -> [3,2]  t2              Poll/t2
  1355. [3,3] -> [3,3]  t2              Poll/t2
  1356.  
  1357. [4,1] -> [4,1]  Request         Cease
  1358. [4,*] -> [0,*]  Cease           Cease-ack
  1359. [4,0] -> [0,0]  Cease-ack       Null
  1360. [4,*] -> [0,*]  Stop            Null
  1361. [4,*] -> [4,*]  t1              Cease/t1
  1362.  
  1363.      In the state-machine model defined in this document all states of
  1364. the above machine are reachable;  however, some are reachable only in
  1365. extreme cases when one neighbor crashes, for example.  In the common
  1366. case where only one of the neighbors initiates and terminates the
  1367. protocol and neither one crashes, for example, not all states are
  1368. reachable.  Following is a matrix showing the states which can be
  1369. reached in this case, where the neighbor that initiates and terminates
  1370. the protocol is called the active gateway and the other the passive
  1371. gateway.
  1372.  
  1373. Exterior Gateway Protocol Formal Specification                   Page 30
  1374. D.L. Mills
  1375.  
  1376.  
  1377.                                 Passive Gateway
  1378. Active     0 Idle      1 Aqsn      2 Down      3 Up        4 Cease
  1379. Gateway   +-----------+-----------+-----------+-----------+-----------+
  1380. 0 Idle    |stable     |           |           |           |unstable   |
  1381. 1 Aqsn    |unstable   |unstable   |unstable   |unstable   |unstable   |
  1382. 2 Down    |           |           |stable     |unstable   |           |
  1383. 3 Up      |           |           |unstable   |stable     |           |
  1384. 4 Cease   |unstable   |unstable   |unstable   |unstable   |unstable   |
  1385.           +-----------+-----------+-----------+-----------+-----------+
  1386.  
  1387.      In the above matrix the blank entries represent unreachable states,
  1388. while those marked unstable represent transient states which cannot
  1389. persist for long, due to retransmission of Request and Hello messages,
  1390. for example.
  1391.