メインコンテンツまでスキップ

状態機械

本節では、EGP の状態機械モデルについて説明する。これには、任意の時点で状態を確定する変数と定数、状態遷移を引き起こすイベント、それらの遷移から生じるアクション、および動作を定義する状態遷移表が含まれる。

3.1. 状態変数​

状態機械モデルには、ゲートウェイとその各隣接ノードとの間のプロトコルの状態を確定する多数の状態変数が含まれる。したがって、複数の隣接ノードと EGP を維持するゲートウェイは、隣接ノードごとにこれらの状態変数の別個の組を保持しなければならない。状態機械の現在の状態、イベント、アクションは、各隣接ノードに対して個別に適用される。

モデルでは、状態変数の組を含むシステム資源は、状態機械が Idle 状態を離れるとき、すなわち新しい隣接ノードのアドレスを指定する Request が到着したとき、または新しい隣接ノードのアドレスを指定する Start イベントが発生したときに割り当てられると仮定している。これらのイベントのいずれかが発生すると、状態変数の値は以下に示すように初期化される。Idle 状態に戻ると、状態変数の組を含むすべての資源が解放され、システムに返却される。もちろん、実装者は資源と状態変数を恒久的に専有することを選んでもよい。

状態変数の組には、モデルの状態遷移を決定する次のものが含まれる。送信シーケンス番号 S を除くすべての変数の初期値は、最初の Request/Confirm 交換の間に設定される。S の初期値は任意である。

        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)

各種のタイマーや同様の内部管理機能をサポートするために、追加の状態変数が必要になることがある。上記の変数の機能と管理については第 4 節で論じる。

3.2. 固定パラメータ​

本節では、ゲートウェイの機能を特徴づけるいくつかの固定パラメータを定義する。各パラメータについて、インターネットシステムにおける実験的実装に基づく推奨値を示す。これらの値は、個々の構成に適している場合もそうでない場合もある。

以下は、再送やその他の時間依存の機能を制御する時間間隔パラメータの一覧である。

        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

パラメータ P4 と P5 は、中断タイマー(abort-timer)オプションが実装されている場合にのみ使用される。パラメータ P4 は、コマンドや応答がない場合に機械が Down 状態および Up 状態にとどまる時間を定めるもので、たとえば隣接ノードがダンプされて再起動される間、状態情報を維持するように設定されるのが通常である。パラメータ P5 は、応答がない場合に機械が Acquisition 状態または Cease 状態にとどまる時間を定めるもので、通常は T3 変数の期待値と同程度の大きさに設定される。

以下は、その他の注目すべきパラメータの一覧である。

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

パラメータ j と k は、後述する隣接ノード到達可能性プロトコルの「雑音耐性」を定める。ゲートウェイが hello ポーリングを行うことを選択する場合は Active 列の値が、そうでない場合は Passive 列の値が推奨される。

3.3. イベント​

以下は、モデルにおいて状態遷移を引き起こし得るイベントの一覧である。

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.

隣接ノード到達可能性通知(neighbor-reachability indication)と呼ばれる特別なイベントが 1 つあり、これは次の場合に発生する。

  1. ゲートウェイがアクティブモード(hello ポーリング有効)で動作しており、Confirm、I-H-U、または Update 応答のいずれかを受信した場合。

  2. ゲートウェイがパッシブモード(hello ポーリング無効)で動作しており、Status フィールドに「Up state」コードを持つ Hello または Poll コマンドを受信した場合。

3.4. 状態遷移表​

次の表は、上記のイベントに応じて発生し得る状態遷移をまとめたものである。遷移は n/a の形式で示され、n は次の状態、a はアクションを表す。

             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. 状態遷移とアクション​

次の表は、状態機械の遷移と、それによって引き起こされるアクションを詳細に説明する。

                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.