OSPF ECMP 070

今回はOSPFのECMPを解説致します。

 

座学

ECMP

特定の宛先に対して、等コスト(メトリックが等しい)な複数の経路を使用してトラフィックを分散させて転送する機能をECMP(Equal Cost Multi Path)と呼びます。

OSPFでも、特定のルート情報を複数学習し、かつ、それらのルート情報のメトリックが等しい場合、ECMPを実現可能です。

 

また、CiscoのルータのECMPでは無制限に複数の経路に対してトラフィックを分散することはできません。分散可能な経路数には上限があり、管理者側で設定可能です。

 

実機での動作確認

検証内容

R1のg2、R2のg2とg3、R3のg2とg3、R4のg2とg3でOSPF Area 0を有効にします。
Network TypeにはPoint-to-Pointを使用します。

ECMPの経路数の上限を変更し、状態を確認します。

 

初期設定


interface GigabitEthernet2
 ip address 10.1.1.1 255.255.255.0
 ip ospf network point-to-point
!
interface GigabitEthernet3
 ip address 10.2.2.1 255.255.255.0
 ip ospf network point-to-point
!
interface GigabitEthernet4
 ip address 10.3.3.1 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 1.1.1.1
 network 10.1.1.0 0.0.0.255 area 0
 network 10.2.2.0 0.0.0.255 area 0
 network 10.3.3.0 0.0.0.255 area 0
            


interface GigabitEthernet2
 ip address 10.1.1.2 255.255.255.0
 ip ospf network point-to-point
!
interface GigabitEthernet3
 ip address 10.4.4.234 255.255.255.0
!
router ospf 1
 router-id 2.2.2.2
 network 10.1.1.0 0.0.0.255 area 0
 network 10.4.4.0 0.0.0.255 area 0
            


interface GigabitEthernet2
 ip address 10.2.2.3 255.255.255.0
 ip ospf network point-to-point
!
interface GigabitEthernet3
 ip address 10.4.4.234 255.255.255.0
!
router ospf 1
 router-id 3.3.3.3
 network 10.2.2.0 0.0.0.255 area 0
 network 10.4.4.0 0.0.0.255 area 0
            


interface GigabitEthernet2
 ip address 10.3.3.4 255.255.255.0
 ip ospf network point-to-point
!
interface GigabitEthernet3
 ip address 10.4.4.234 255.255.255.0
!
router ospf 1
 router-id 4.4.4.4
 network 10.3.3.0 0.0.0.255 area 0
 network 10.4.4.0 0.0.0.255 area 0
            

 

ECMPで使用可能な経路数の上限変更前

ECMPで使用可能な経路数の上限の確認

R1のOSPFにおいて、ECMPで使用可能な経路数の上限が4であることが確認できます。

R1

R1#show ip protocols
*** IP Routing is NSF aware ***

Routing Protocol is "application"
  Sending updates every 0 seconds
  Invalid after 0 seconds, hold down 0, flushed after 0
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Maximum path: 32
  Routing for Networks:
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 4)

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 1.1.1.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    10.1.1.0 0.0.0.255 area 0
    10.2.2.0 0.0.0.255 area 0
    10.3.3.0 0.0.0.255 area 0
  Routing Information Sources:
    Gateway         Distance      Last Update
    3.3.3.3              110      00:00:09
    4.4.4.4              110      00:01:57
    2.2.2.2              110      00:02:07
  Distance: (default is 110)
            

 

SPFの計算結果の確認

R1のSPFの計算結果から、10.4.4.0/24のネクストホップとして、10.1.1.2と10.2.2.3と10.3.3.4が存在していることが確認できます。また、3経路すべてがルーティングテーブルに投入されていることが確認できます。

R1

R1#show ip ospf rib 10.4.4.0

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Base Topology (MTID 0)

OSPF local RIB
Codes: * - Best, > - Installed in global RIB
LSA: type/LSID/originator

*>  10.4.4.0/24, Intra, cost 2, area 0
     SPF Instance 6, age 00:01:08
     Flags: RIB
      via 10.1.1.2, GigabitEthernet2
       Flags: RIB
       LSA: 1/2.2.2.2/2.2.2.2
      via 10.2.2.3, GigabitEthernet3
       Flags: RIB
       LSA: 1/3.3.3.3/3.3.3.3
      via 10.3.3.4, GigabitEthernet4
       Flags: RIB
       LSA: 1/4.4.4.4/4.4.4.4
            

 

SPFの計算結果の確認

R1のルーティングテーブルの10.4.4.0/24のネクストホップが3個存在していることが確認できます。

R1

R1#show ip route ospf
      10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O        10.4.4.0/24 [110/2] via 10.1.1.2, 00:02:52, GigabitEthernet2
                     [110/2] via 10.3.3.4, 00:02:43, GigabitEthernet4
                     [110/2] via 10.2.2.3, 00:00:54, GigabitEthernet3
            

 

ECMPで使用可能な経路数の上限変更前

R1のOSPFのECMPの経路数の上限を2に変更します。

ECMPで使用可能な経路数の上限の確認

OSPFのECMPの上限はmaximum-paths <num>コマンドで変更可能です。

R1

router ospf 1
 maximum-paths 2
            

 

ECMPで使用可能な経路数の上限の確認

R1のOSPFにおいて、ECMPで使用可能な経路数の上限が2に変化したことが確認できます。

R1

R1#show ip protocols
*** IP Routing is NSF aware ***

Routing Protocol is "application"
  Sending updates every 0 seconds
  Invalid after 0 seconds, hold down 0, flushed after 0
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Maximum path: 32
  Routing for Networks:
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 4)

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 1.1.1.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 2
  Routing for Networks:
    10.1.1.0 0.0.0.255 area 0
    10.2.2.0 0.0.0.255 area 0
    10.3.3.0 0.0.0.255 area 0
  Routing Information Sources:
    Gateway         Distance      Last Update
    3.3.3.3              110      00:00:09
    4.4.4.4              110      00:01:57
    2.2.2.2              110      00:02:07
  Distance: (default is 110)
            

 

SPFの計算結果の確認

R1のSPFの計算結果から、10.4.4.0/24への3つの経路の内、ネクストホップが10.1.1.2の経路はルーティングテーブルに投入されていないことが確認できます。

R1

R1#show ip ospf rib 10.4.4.0

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Base Topology (MTID 0)

OSPF local RIB
Codes: * - Best, > - Installed in global RIB
LSA: type/LSID/originator

*>  10.4.4.0/24, Intra, cost 2, area 0
     SPF Instance 7, age 00:00:42
     Flags: RIB
      via 10.2.2.3, GigabitEthernet3
       Flags: RIB
       LSA: 1/3.3.3.3/3.3.3.3
      via 10.3.3.4, GigabitEthernet4
       Flags: RIB
       LSA: 1/4.4.4.4/4.4.4.4
      via 10.1.1.2, GigabitEthernet2
       Flags: none
       LSA: 1/2.2.2.2/2.2.2.2
            

 

SPFの計算結果の確認

R1のルーティングテーブルの10.4.4.0/24のネクストホップが3個存在していることが確認できます。

R1

R1#show ip route ospf
      10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O        10.4.4.0/24 [110/2] via 10.3.3.4, 00:02:43, GigabitEthernet4
                     [110/2] via 10.2.2.3, 00:00:54, GigabitEthernet3
            

コメント

タイトルとURLをコピーしました