Skip to main content

State Machine

This section describes the state-machine model for EGP, including the variables and constants which establish the state at any time, the events which cause the state transitions, the actions which result from these transitions and the state-transition table which defines the behavior.

3.1. State Variables​

The state-machine model includes a number of state variables which establish the state of the protocol between the gateway and each of its neighbors. Thus, a gateway maintaining EGP with a number of neighbors must maintain a separate set of these state variables for each neighbor. The current state, events and actions of the state machine apply to each neighbor separately.

The model assumes that system resources, including the set of state variables, are allocated when the state machine leaves the Idle state, either because of the arrival of a Request specifying a new neighbor addreess, or because of a Start event specifying a new neighbor address. When either of these events occur the values of the state variables are initialized as indicated below. Upon return to the Idle state all resources, including the set of state variables, are deallocated and returned to the system. Implementators may, of course, elect to dedicate resources and state variables permananently.

Included among the set of state variables are the following which determine the state transitions of the model. Initial values for all of the variables except the send sequence number S are set during the initial Request/Confirm exchange. The initial value for S is arbitrary.

        Name    Function
--------------------------------------------------------------
R receive sequence number
S send sequence number
T1 interval between Hello command retransmissions
T2 interval between Poll command retransmissions
T3 interval during which neighbor-reachability
indications are counted
M hello polling mode
t1 timer 1 (used to control Request, Hello and Cease
command retransmissions)
t2 timer 2 (used to control Poll command retransmissions)
t3 timer 3 (abort timer)

Additional state variables may be necessary to support various timer and similar internal housekeeping functions. The function and management of the cited variables are discussed in Section 4.

3.2. Fixed Parameters​

This section defines several fixed parameters which characterize the gateway functions. Included is a suggested value for each parameter based on experimental implementations in the Internet system. These values may or may not be appropriate for the individual configuration.

Following is a list of time-interval parameters which control retransmissions and other time-dependent functions.

        Name    Value   Description
--------------------------------------------------------------
P1 30 sec minimum interval acceptable between successive
Hello commands received
P2 2 min minimum interval acceptable between successive
Poll commands recieved
P3 30 sec interval between Request or Cease command
retransmissions
P4 1 hr interval during which state variables are
maintained in the absence of commands or
responses in the Down and Up states.
P5 2 min interval during which state variables are
maintained in the absence of responses in the
Acquisition and Cease states

Parameters P4 and P5 are used only if the abort-timer option is implemented. Parameter P4 establishes how long the machine will remain in the Down and Up states in the absence of commands or responses and would ordinarily be set to sustain state information while the neighbor is dumped and restarted, for example. Parameter P5 establishes how long the machine will remain in the Acquisition or Cease states in the absence of responses and would ordinarily be set in the same order as the expected value of T3 variables.

Following is a list of other parameters of interest.

        Name    Active  Passive Description
-----------------------------------------------
j 3 1 neighbor-up threshold
k 1 4 neighbor-down threshold

The j and k parameters establish the "noise immunity" of the neighbor-reachability protocol described later. The values in the Active column are suggested if the gateway elects to do hello polling, while the values in the Passive column are suggested otherwise.

3.3. Events​

Following is a list of events that can cause state transitions in the model.

Name            Event
----------------------------------------------------------------------
Up At least j neighbor-reachability indications have been
received within the last T3 seconds.
Down At most k neighbor-reachabilitiy indications have been
received within the last T3 seconds.
Request Request command has been received.
Confirm Confirm command has been received.
Refuse Refuse response has been received.
Cease Cease command has been received.
Cease-ack Cease-ack response has been received.
Hello Hello command has been received.
I-H-U I-H-U response has been received.
Poll Poll command has been received.
Update Update response has been received.
Start Start event has been recognized due to system or
operator intervention.
Stop/t3 Stop event has been recognized due to (a) system or
operator intervention or (b) expiration of the abort
timer t3.
t1 Timer t1 has counted down to zero.
t2 Timer t2 has counted down to zero.

There is one special event, called a neighbor-reachability indication, which occurs when:

  1. The gateway is operating in the active mode (hello polling enabled) and either a Confirm, I-H-U or Update response is received.

  2. The gateway is operating in the passive mode (hello polling disabled) and either a Hello or Poll command is received with the "Up state" code in the Status field.

3.4. State Transition Table​

The following table summarizes the state transitions that can occur in response to the events listed above. Transitions are shown in the form n/a, where n is the next state and a represents the action.

             0 Idle      1 Aqsn      2 Down       3 Up       4 Cease
+-----------+-----------+-----------+-----------+-----------+
Up |0 |1 |3/Poll |3 |4 |
Down |0 |1 |2 |2 |4 |
Request |2/Confirm *|2/Confirm |2/Confirm |2/Confirm |4/Cease |
Confirm |0/Cease **|2 |2 |3 |4 |
Refuse |0/Cease **|0 |2 |3 |4 |
Cease |0/Cease-ack|0/Cease-ack|0/Cease-ack|0/Cease-ack|0/Cease-ack|
Cease-ack |0 |1 |2 |3 |0 |
Hello |0/Cease **|1 |2/I-H-U |3/I-H-U |4 |
I-H-U |0/Cease **|1 |2/Process |3/Process |4 |
Poll |0/Cease **|1 |2 |3/Update |4 |
Update |0/Cease **|1 |2 |3/Process |4 |
Start |1/Request |1/Request |1/Request |1/Request |4 |
Stop/t3 |0 |0 |4/Cease |4/Cease |0 |
t1 |0 |1/Request |2/Hello |3/Hello |4/Cease |
t2 |0 |1 |2 |3/Poll |4 |
+-----------+-----------+-----------+-----------+-----------+

Note *: The transition shown applies to the case where the
neighbor-acquisition request is accepted. The transition "0/Refuse"
applies to the case where the request is rejected.

Note **: The Cease action shown is optional.

3.5. State Transitions and Actions​

The following table describes in detail the transitions of the state machine and the actions evoked.

                Next    Message
Event           State   Sent            Actions
------------------------------------------------------------------------

Idle State (0)

Request         2       Confirm         Initialize state variables and
                        Hello           reset timer t1 to T1 seconds and
                                        reset timer t3 to P5 seconds.
  (or)          0       Refuse          Return resources.
Cease           0       Cease-ack       Return resources.
Start           1       Request         Reset timer t1 to P3 seconds and
                                        reset timer t3 to P5 seconds.

Acquisition State (1)

Request         2       Confirm         Initialize state variables and
                        Hello           reset timer t1 to T1 seconds and
                                        reset timer t3 to P5 seconds.
Confirm         2       Hello           Initialize state variables and
                                        reset timer t1 to T1 seconds and
                                        reset timer t3 to P5 seconds.
Refuse          0                       Stop timers and return
                                        resources.
Cease           0       Cease-ack       Stop timers and return
                                        resources.
Start           1       Request         Reset timer t1 to P3 seconds and
                                        reset timer t3 to P5 seconds.
Stop/t3         0                       Stop timers and return
                                        resources.
t1              1       Request         Reset timer t1 to P3 seconds.

Down State (2)
Note: Reset timer t3 to P4 seconds on receipt of a reachability
indication.

Up              3       Poll            Reset timer t2 to T2 seconds.
Request         2       Confirm         Reinitialize state variables and
                        Hello           reset timer t1 to T1 seconds and
                                        reset timer t3 to P5 seconds.
Cease           0       Cease-ack       Stop timers and return
                                        resources.
Hello           2       I-H-U
I-H-U           2                       Process neighbor-reachability
                                        info.
Start           1       Request         Reset timer t1 to P3 seconds and
                                        reset timer t3 to P5 seconds.
Stop/t3         4       Cease           Reset timer t1 to P3 seconds and
                                        reset timer t3 to P5 seconds.
t1              2       Hello           Reset timer t1 to T1 seconds.

Up State (3)
Note: Reset timer t3 to P4 seconds on receipt of a reachability
indication.

Down            2                       Stop timer t2.
Request         2       Confirm         Renitialize state variables and
                        Hello           reset timer t1 to T1 seconds and
                                        reset timer t3 to P5 seconds.
Cease           0       Cease-ack       Stop timers and return
                                        resources.
Hello           3       I-H-U
I-H-U           3                       Process neighbor-reachability
                                        info.
Poll            3       Update
Update          3                       Process net-reachability info.
Start           1       Request         Reset timer t1 to P3 seconds and
                                        reset timer t3 to P5 seconds.
Stop/t3         4       Cease           Reset timer t1 to P3 seconds and
                                        reset timer t3 to P5 seconds.
t1              3       Hello           Reset timer t1 to T1 seconds.
t2              3       Poll            Reset timer t2 to T2 seconds.

Cease State (4)

Request         4       Cease
Cease           0       Cease-ack       Stop timers and return
                                        resources.
Cease-ack       0                       Stop timers and return
                                        resources.
Stop/t3         0                       Stop timers and return
                                        resources.
t1              4       Cease           Reset timer t1 to P3 seconds.