Protocol in Code · OSPF Session 05

Flooding Decides Where The LSA Goes

Session 05 では flooding.py を読み、newer LSA がどの interface へ送られ、どこで止まるかを追います。

IntermediateSession 05floodingOSPF

Bridge

object ができたら、次は動かす

Session 04 で Router-LSA を object として見ました。Session 05 では、その object が newer ならどの interface へ進むか、newer でなければどこで止まるかを読みます。

Read The Source

incoming interface は除外し、state で floodability を決める

outgoing = tuple(
    interface.name
    for interface in interfaces
    if interface.name != incoming_interface and interface.state in floodable_states
)

ここでは retransmission engine 全体ではなく、flood target set がどう作られるかを見ます。つまり「この LSA は今どこへ行くべきか」を比較的まっすぐ読める形です。

Walkthrough

newer LSA が 2 interface へ出る例を見る

cd protocol-in-code
PYTHONPATH=src python3 examples/ospf/session_05_walkthrough.py

walkthrough では incoming が `eth0` のとき、`eth1` と `eth2` にだけ出ていくことを見ます。

Done Check

Session 05 を終えたと言える条件

  • なぜ incoming interface に戻さないのか説明できる
  • newer でない LSA が flood されないと説明できる
  • interface state が flood target を絞ると説明できる

Next Session

次は flood の先にある保管庫です

Session 06 では LSDB を読みます。受け取った Router-LSA を replace するか ignore するかを見ます。