スタブエリアとは
マルチエリアとABRでは、エリアを分けるとRouter-LSA(Type 1)がエリアの外に出なくなることを確認しました。しかし外部経路を表すAS External-LSA(Type 5)はエリアの境界を越えてAS全体に流れます。インターネットの経路を再配布しているような環境では、このType 5がLSDBの大半を占めることになります。
そこでOSPFには、エリア単位でType 5を止めてしまう仕組みがあります。これがスタブエリア(Stub Area)です。外部経路が見えなくなる代わりに、そのエリアのABRが「ここから外へ出ればよい」というデフォルト経路を代わりに入れてくれます。
| 用語 | 説明 |
|---|---|
| スタブエリア | Type 4とType 5を入れないエリア。ABRが0.0.0.0/0をType 3で注入する |
| トータリースタブエリア | スタブエリアからさらにType 3も止めたもの。エリア内にはエリア内経路とデフォルト経路しか残らない |
| デフォルト経路の注入 | ABRが0.0.0.0/0をSummary-LSA(Type 3)として広告する動作。RFC 2328ではDefaultDestinationと呼ぶ |
default-cost | ABRが注入するデフォルト経路のメトリック。IOS XRの既定は1 |
この記事では、7台構成の3エリアのうち1つをスタブエリア・トータリースタブエリアにして、何が消えて何が入るのか、LSDBがどれだけ小さくなるのか、設定を1台でも忘れるとどうなるのかを実機で確認します。NSSA(Not-So-Stubby Area)はNSSAとトータリーNSSAで解説しています。
エリアの種類の整理
| 種類 | Type 1 / 2 | Type 3 | Type 4 / 5 | デフォルト経路 |
|---|---|---|---|---|
| 通常エリア | 入る | 入る | 入る | 自動では入らない |
| スタブエリア | 入る | 入る | 入らない | ABRが0.0.0.0/0を入れる |
| トータリースタブエリア | 入る | 入らない | 入らない | ABRが0.0.0.0/0を入れる |
| NSSA | 入る | 入る | 入らない(Type 7で持ち込む) | 設定による |
トータリースタブエリアは、RFC 2328に「トータリースタブ」という名前で定義されているわけではありません。ただしRFC 2328のSection 12.4.3.1に「スタブエリアに接続するABRは、summary-LSAの一部だけを生成することを選んでもよい(設定によって)」という規定があり、この動作自体は規格の範囲内です。名前とno-summaryというコマンドがCiscoのものです。
スタブエリアの制約
RFC 2328のSection 3.6は、スタブエリアに3つの制約を挙げています。
| 制約 | 内容 | この記事での確認 |
|---|---|---|
| エリア内の全ルータで設定を一致させる | 「OSPFはエリアに属するすべてのルータがスタブかどうかで一致することを保証する」。HelloのEビットが一致しないと隣接が確立しない | STEP 5 |
| スタブエリアにASBRを置けない | 外部経路を持ち込むルータをスタブエリアの内部に置けない | STEP 4 |
| バックボーンはスタブにできない | エリア0はエリア間の経路配布を担うため | 下記 |
| 仮想リンクをスタブエリア経由で張れない | — | この記事では未検証(別記事で扱います) |
バックボーンについては、IOS XRが設定の投入時点で拒否します。R2(エリア0とエリア1のABR)で試すと、コミットがセマンティックエラーで失敗し、変更は自動的に巻き戻されます。
RP/0/RP0/CPU0:R2#configure terminal
Sun Sep 6 23:21:12.360 UTC
RP/0/RP0/CPU0:R2(config)#router ospf 1
RP/0/RP0/CPU0:R2(config-ospf)#area 0
RP/0/RP0/CPU0:R2(config-ospf-ar)#stub
RP/0/RP0/CPU0:R2(config-ospf-ar)#commit
Sun Sep 6 23:21:13.708 UTC
% Failed to commit one or more configuration items during a pseudo-atomic operation. All changes made have been reverted. Please issue 'show configuration failed [inheritance]' from this session to view the errors
RP/0/RP0/CPU0:R2(config-ospf-ar)#show configuration failed
Sun Sep 6 23:21:19.713 UTC
!! SEMANTIC ERRORS: This configuration was rejected by
!! the system due to semantic errors. The individual
!! errors with each failed configuration command can be
!! found below.
router ospf 1
area 0
stub
!!% 'OSPF' detected the 'warning' condition 'Error: Backbone area cannot be configured as a stub or NSSA'
!
!
end
RP/0/RP0/CPU0:R2(config-ospf-ar)#abortエラーメッセージはstub or NSSAと書かれており、NSSAも同じくバックボーンには設定できないことが分かります。この試行の後もR2の隣接3本はFULLのままで、設定にもstubは入っていません(採取ファイルの後半に記録しています)。
検証構成
マルチエリアとABRと同じ7台の3エリア構成をそのまま使い、エリア2をスタブエリアにします。エリア2にはABRが2台(R3・R4)向いているので、デフォルト経路をどちらのABR経由で使うのかも確認できます。エリア1は通常エリアのまま残すので、同じLSAが「エリア1には届くがエリア2には届かない」対比ができます。
| 項目 | 内容 |
|---|---|
| エリア1 | R1のLoopback0とR1 - R2間。R1はASBRで192.168.1.0/24を再配布している |
| エリア0 | R2・R3・R4のLoopback0と、R2 - R3間、R2 - R4間 |
| エリア2 | R11・R12・R13のLoopback0と、R3 - R11間、R4 - R12間、R11 - R13間、R12 - R13間。ここをスタブにする |
| ABR | R2(エリア1 ↔ 0)、R3・R4(エリア0 ↔ 2) |
| 観測点 | R13(エリア2の内部ルータ) |
| リンクのコスト | すべて既定のコスト1。ただしR4 - R12間だけ両端cost 10(R13から見てR3のほうが近い状態を作るため) |
| ネットワークタイプ | 全リンクnetwork point-to-point。DR/BDRの選出がなくなり、Network-LSA(Type 2)を生成する必要もなくなる |
通常エリアの状態(STEP 0)
まずスタブにする前の状態を見ておきます。R13のルーティングテーブルには、エリア間経路(O IA)と外部経路(O E2)が両方入っています。
RP/0/RP0/CPU0:R13#show route ospf
Sun Sep 6 22:13:51.197 UTC
O IA 1.1.1.1/32 [110/5] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O IA 2.2.2.2/32 [110/4] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O IA 3.3.3.3/32 [110/3] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O IA 4.4.4.4/32 [110/5] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O IA 10.0.12.0/24 [110/4] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O IA 10.0.23.0/24 [110/3] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O IA 10.0.24.0/24 [110/4] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O 11.11.11.11/32 [110/2] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O 12.12.12.12/32 [110/2] via 10.1.12.12, 00:04:34, GigabitEthernet0/0/0/1
O 172.16.3.0/24 [110/2] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0
O 172.16.4.0/24 [110/11] via 10.1.12.12, 00:04:34, GigabitEthernet0/0/0/1
O E2 192.168.1.0/24 [110/20] via 10.1.11.11, 00:04:29, GigabitEthernet0/0/0/0LSDBには4種類のLSAが並びます。Router-LSAが5、Summary-LSA(Type 3)が14、ASBR Summary-LSA(Type 4)が2、AS External-LSA(Type 5)が1で、合計22です。
RP/0/RP0/CPU0:R13#show ospf database
Sun Sep 6 22:13:54.402 UTC
OSPF Router with ID (13.13.13.13) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 302 0x80000002 0x00cc8d 2
4.4.4.4 4.4.4.4 290 0x80000002 0x0084b4 2
11.11.11.11 11.11.11.11 276 0x80000004 0x00ca9d 5
12.12.12.12 12.12.12.12 279 0x80000004 0x006ed1 5
13.13.13.13 13.13.13.13 275 0x80000004 0x0091ef 5
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 3.3.3.3 275 0x80000001 0x001f0b
1.1.1.1 4.4.4.4 275 0x80000001 0x000125
2.2.2.2 3.3.3.3 310 0x80000001 0x00e640
2.2.2.2 4.4.4.4 302 0x80000001 0x00c85a
3.3.3.3 3.3.3.3 311 0x80000001 0x00ae75
3.3.3.3 4.4.4.4 302 0x80000001 0x00a479
4.4.4.4 3.3.3.3 297 0x80000001 0x009489
4.4.4.4 4.4.4.4 309 0x80000001 0x0062b9
10.0.12.0 3.3.3.3 310 0x80000001 0x003cdc
10.0.12.0 4.4.4.4 302 0x80000001 0x001ef6
10.0.23.0 3.3.3.3 311 0x80000001 0x00b856
10.0.23.0 4.4.4.4 302 0x80000001 0x00a465
10.0.24.0 3.3.3.3 310 0x80000001 0x00b755
10.0.24.0 4.4.4.4 309 0x80000001 0x008f7a
Summary ASB Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 3.3.3.3 275 0x80000001 0x000723
1.1.1.1 4.4.4.4 275 0x80000001 0x00e83d
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
192.168.1.0 1.1.1.1 290 0x80000001 0x000d25 0show ospf border-routersには、ABRの2台に加えてASBR(1.1.1.1)が並びます。エリア2からASBRへ到達できるのは、ABRがType 4を出しているからです。
RP/0/RP0/CPU0:R13#show ospf border-routers
Sun Sep 6 22:13:59.261 UTC
OSPF 1 Internal Routing Table
Codes: i - Intra-area route, I - Inter-area route
I 1.1.1.1 [4] via 10.1.11.11, GigabitEthernet0/0/0/0, ASBR , Area 2, SPF 7
i 3.3.3.3 [2] via 10.1.11.11, GigabitEthernet0/0/0/0, ABR , Area 2, SPF 7
i 4.4.4.4 [11] via 10.1.12.12, GigabitEthernet0/0/0/1, ABR , Area 2, SPF 7エリア2をスタブにする(STEP 1)
スタブエリアの設定は、そのエリアに接続する全ルータに入れます。ここではR3・R4(ABR)とR11・R12・R13(内部ルータ)の5台です。
(R3・R4・R11・R12・R13の5台すべてに投入する)
router ospf 1
area 2
stubR13から見ると、外部経路192.168.1.0/24が消え、代わりに0.0.0.0/0が現れます。それでも192.168.1.1への疎通は保たれていて、tracerouteの経路も変わりません。個別の経路を知らなくてもデフォルト経路で同じ場所へ届くという状態です。
RP/0/RP0/CPU0:R13#show route 0.0.0.0/0
Sun Sep 6 22:16:17.583 UTC
Routing entry for 0.0.0.0/0
Known via "ospf 1", distance 110, metric 3, candidate default path, type inter area
Installed Sep 6 22:15:58.890 for 00:00:18
Routing Descriptor Blocks
10.1.11.11, from 3.3.3.3, via GigabitEthernet0/0/0/0
Route metric is 3
No advertising protos.
RP/0/RP0/CPU0:R13#ping 192.168.1.1 source 13.13.13.13
Sun Sep 6 22:16:17.827 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1 timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/13/16 ms
RP/0/RP0/CPU0:R13#traceroute 192.168.1.1 source 13.13.13.13
Sun Sep 6 22:16:18.697 UTC
Type escape sequence to abort.
Tracing the route to 192.168.1.1
1 10.1.11.11 7 msec 5 msec 5 msec
2 172.16.3.3 9 msec 7 msec 8 msec
3 10.0.23.2 12 msec 10 msec 10 msec
4 10.0.12.1 17 msec * 18 msec 注入されたデフォルト経路をLSDBで見ると、R3(3.3.3.3)とR4(4.4.4.4)の両方が0.0.0.0をメトリック1で広告しています。この1という値がIOS XRのdefault-costの既定値です。
RP/0/RP0/CPU0:R13#show ospf database summary 0.0.0.0
Sun Sep 6 22:20:52.664 UTC
OSPF Router with ID (13.13.13.13) (Process ID 1)
Summary Net Link States (Area 2)
Routing Bit Set on this LSA
LS age: 365
Options: (No TOS-capability, DC)
LS Type: Summary Links (Network)
Link State ID: 0.0.0.0 (Summary Network Number)
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x57da
Length: 28
Network Mask: /0
TOS: 0 Metric: 1
LS age: 351
Options: (No TOS-capability, DC)
LS Type: Summary Links (Network)
Link State ID: 0.0.0.0 (Summary Network Number)
Advertising Router: 4.4.4.4
LS Seq Number: 80000001
Checksum: 0x39f4
Length: 28
Network Mask: /0
TOS: 0 Metric: 1 Type 4とType 5は、データベースから完全に消えます。
RP/0/RP0/CPU0:R13#show ospf database asbr-summary
Sun Sep 6 22:19:00.396 UTC
OSPF Router with ID (13.13.13.13) (Process ID 1)RP/0/RP0/CPU0:R13#show ospf database external
Sun Sep 6 22:19:00.862 UTC
OSPF Router with ID (13.13.13.13) (Process ID 1)Type 4が無くなったので、show ospf border-routersからもASBRの行が消えます。残るのはABRの2台だけです。
RP/0/RP0/CPU0:R13#show ospf border-routers
Sun Sep 6 22:19:01.801 UTC
OSPF 1 Internal Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 3.3.3.3 [2] via 10.1.11.11, GigabitEthernet0/0/0/0, ABR , Area 2, SPF 10
i 4.4.4.4 [11] via 10.1.12.12, GigabitEthernet0/0/0/1, ABR , Area 2, SPF 10エリアの種別が変わると、HelloのOptionsフィールドのEビットも変わります。エリア2内でキャプチャーしたHelloのOptionsを並べると、0x12から0x10へ変わる瞬間が残っています。No.11まではR13が0x12、No.12でR11が先に0x10になり、この間は両者のEビットが食い違っています。Eビットの詳細はOSPF Optionsフィールドで解説しています。
1 10.1.11.13 0x12
2 10.1.11.11 0x12
3 10.1.11.13 0x12
4 10.1.11.11 0x12
5 10.1.11.13 0x12
6 10.1.11.11 0x12
7 10.1.11.13 0x12
8 10.1.11.11 0x12
9 10.1.11.13 0x12
10 10.1.11.11 0x12
11 10.1.11.13 0x12
12 10.1.11.11 0x10
13 10.1.11.13 0x12
14 10.1.11.11 0x10
15 10.1.11.13 0x12
16 10.1.11.11 0x10
17 10.1.11.13 0x10
18 10.1.11.11 0x10
40 10.1.11.13 0x10
41 10.1.11.11 0x10
42 10.1.11.13 0x10
43 10.1.11.11 0x10
44 10.1.11.13 0x10
45 10.1.11.11 0x10
46 10.1.11.13 0x10
47 10.1.11.11 0x10
48 10.1.11.13 0x10
49 10.1.11.11 0x10
50 10.1.11.13 0x10
51 10.1.11.11 0x10
52 10.1.11.13 0x10
53 10.1.11.11 0x10
54 10.1.11.13 0x10
55 10.1.11.11 0x10
56 10.1.11.13 0x10
57 10.1.11.11 0x10
58 10.1.11.13 0x10
59 10.1.11.11 0x10
60 10.1.11.13 0x10
61 10.1.11.11 0x10
62 10.1.11.13 0x10
63 10.1.11.11 0x10
64 10.1.11.13 0x10
65 10.1.11.11 0x10
66 10.1.11.13 0x10
67 10.1.11.11 0x10
68 10.1.11.13 0x10
69 10.1.11.11 0x10
70 10.1.11.13 0x10
71 10.1.11.11 0x10
72 10.1.11.13 0x10
73 10.1.11.11 0x10
74 10.1.11.13 0x10
75 10.1.11.11 0x10
76 10.1.11.13 0x10
77 10.1.11.11 0x10
78 10.1.11.13 0x10
79 10.1.11.11 0x10
80 10.1.11.13 0x10
81 10.1.11.11 0x10
82 10.1.11.13 0x10デフォルト経路のコストを変える(STEP 2)
デフォルト経路を2台のABRが広告しているとき、どちらを使うかはコストで決まります。R3側のデフォルトを重くしてみます。
(R3)
router ospf 1
area 2
default-cost 50ABR自身のshow ospfには、そのエリアへ入れるデフォルト経路のコストが表示されます。
RP/0/RP0/CPU0:R3#show ospf
Sun Sep 6 22:22:35.797 UTC
Routing Process "ospf 1" with ID 3.3.3.3
Role: Primary Active
NSR (Non-stop routing) is Enabled
Supports only single TOS(TOS0) routes
Supports opaque LSA
It is an area border router
Maximum number of non self-generated LSA allowed 500000
Current number of non self-generated LSA 25
Threshold for warning message 75%
Ignore-time 5 minutes, reset-time 10 minutes
Ignore-count allowed 5, current ignore-count 0
Maximum number of external prefixes per router 50000 (suppress-neighbor)
Warning threshold 75%
Maximum Exchange time 10 Hold time 5 Max Recovery count 300
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 50 msecs
Minimum hold time between two consecutive SPFs 200 msecs
Maximum wait time between two consecutive SPFs 5000 msecs
Initial LSA throttle delay 50 msecs
Minimum hold time for LSA throttle 200 msecs
Maximum wait time for LSA throttle 5000 msecs
Minimum LSA interval 200 msecs. Minimum LSA arrival 100 msecs
LSA refresh interval 1800 seconds
Flood pacing interval 33 msecs. Retransmission pacing interval 66 msecs
Adjacency stagger enabled; initial (per area): 2, maximum: 64
Number of neighbors forming: 0, 2 full
Maximum number of configured interfaces 1024
Number of external LSA 1. Checksum Sum 0x00250d
Number of opaque AS LSA 0. Checksum Sum 00000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 1 normal 1 stub 0 nssa
External flood list length 0
SNMP trap is enabled
LSD not connected, revision 0
Segment Routing Global Block default (16000-23999), not allocated
Segment Routing Local Block, unknown
Segment Routing prefix-sid-map, Advertise local: Disabled, Receive remote: Disabled
Strict-SPF capability is enabled
Area BACKBONE(0)
Number of interfaces in this area is 2
SPF algorithm executed 9 times
Number of LSA 20. Checksum Sum 0x0bc1b4
Number of opaque link LSA 0. Checksum Sum 00000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Number of LFA enabled interfaces 0, LFA revision 0
Number of Per Prefix LFA enabled interfaces 0
Number of neighbors forming in staggered mode 0, 1 full
Area 2
Number of interfaces in this area is 1
It is a stub area
generates stub default route with cost 50R13のデフォルト経路は、R3経由(2 + 50 = 52)からR4経由(11 + 1 = 12)へ切り替わりました。LSDBにはR3の広告するメトリック50とR4のメトリック1が並んでいます。RFC 2328のSection 12.4.3.1は「StubDefaultCostはスタブエリアのすべてのABRで同じ値に設定する必要はない」と明記しており、実際に別々の値のまま動作しています。
RP/0/RP0/CPU0:R13#show route 0.0.0.0/0
Sun Sep 6 22:21:31.240 UTC
Routing entry for 0.0.0.0/0
Known via "ospf 1", distance 110, metric 12, candidate default path, type inter area
Installed Sep 6 22:21:19.306 for 00:00:12
Routing Descriptor Blocks
10.1.12.12, from 4.4.4.4, via GigabitEthernet0/0/0/1
Route metric is 12
No advertising protos.
RP/0/RP0/CPU0:R13#show ospf database summary 0.0.0.0
Sun Sep 6 22:21:31.437 UTC
OSPF Router with ID (13.13.13.13) (Process ID 1)
Summary Net Link States (Area 2)
LS age: 14
Options: (No TOS-capability, DC)
LS Type: Summary Links (Network)
Link State ID: 0.0.0.0 (Summary Network Number)
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0x41be
Length: 28
Network Mask: /0
TOS: 0 Metric: 50
Routing Bit Set on this LSA
LS age: 390
Options: (No TOS-capability, DC)
LS Type: Summary Links (Network)
Link State ID: 0.0.0.0 (Summary Network Number)
Advertising Router: 4.4.4.4
LS Seq Number: 80000001
Checksum: 0x39f4
Length: 28
Network Mask: /0
TOS: 0 Metric: 1
RP/0/RP0/CPU0:R13#traceroute 192.168.1.1 source 13.13.13.13
Sun Sep 6 22:21:32.154 UTC
Type escape sequence to abort.
Tracing the route to 192.168.1.1
1 10.1.12.12 7 msec 4 msec 6 msec
2 172.16.4.4 10 msec 8 msec 10 msec
3 10.0.24.2 12 msec 10 msec 10 msec
4 10.0.12.1 14 msec * 16 msec このときエリア2に流れたLS Updateが、添付のキャプチャーのNo.5です。0.0.0.0のSummary-LSAが1つだけ入っていて、Advertising RouterはR3(3.3.3.3)、Metric: 50になっています。
Open Shortest Path First
OSPF Header
Version: 2
Message Type: LS Update (4)
Packet Length: 56
Source OSPF Router: 11.11.11.11
Area ID: 0.0.0.2
Checksum: 0xff90 [correct]
Instance ID: Base IPv4 Unicast Instance (0)
Auth Type: Null (0)
Auth Data (none): 0000000000000000
LS Update Packet
Number of LSAs: 1
LSA-type 3 (Summary-LSA (IP network)), len 28
.000 0000 0000 0010 = LS Age (seconds): 2
0... .... .... .... = Do Not Age Flag: 0
Options: 0x20, (DC) Demand Circuits
0... .... = DN: Not set
.0.. .... = (O) Opaque: Not set
..1. .... = (DC) Demand Circuits: Supported
...0 .... = (L) LLS Data block: Not Present
.... 0... = (N) NSSA: Not supported
.... .0.. = (MC) Multicast: Not capable
.... ..0. = (E) External Routing: Not capable
.... ...0 = (MT) Multi-Topology Routing: No
LS Type: Summary-LSA (IP network) (3)
Link State ID: 0.0.0.0
Advertising Router: 3.3.3.3
Sequence Number: 0x80000002
Checksum: 0x41be
Length: 28
Netmask: 0.0.0.0
TOS: 0
Metric: 50トータリースタブにする(STEP 3)
default-costを既定に戻したうえで、ABRの2台だけにno-summaryを足します。内部ルータ(R11・R12・R13)の設定はstubのままで変えません。
(R3・R4のみ。R3では STEP 2 の default-cost も戻す)
router ospf 1
area 2
no default-cost 50
stub no-summaryABRのshow ospfの表示がIt is a stub area, no summary LSA in this areaに変わります。
RP/0/RP0/CPU0:R3#show ospf
Sun Sep 6 22:27:01.248 UTC
Routing Process "ospf 1" with ID 3.3.3.3
Role: Primary Active
NSR (Non-stop routing) is Enabled
Supports only single TOS(TOS0) routes
Supports opaque LSA
It is an area border router
Maximum number of non self-generated LSA allowed 500000
Current number of non self-generated LSA 18
Threshold for warning message 75%
Ignore-time 5 minutes, reset-time 10 minutes
Ignore-count allowed 5, current ignore-count 0
Maximum number of external prefixes per router 50000 (suppress-neighbor)
Warning threshold 75%
Maximum Exchange time 10 Hold time 5 Max Recovery count 300
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 50 msecs
Minimum hold time between two consecutive SPFs 200 msecs
Maximum wait time between two consecutive SPFs 5000 msecs
Initial LSA throttle delay 50 msecs
Minimum hold time for LSA throttle 200 msecs
Maximum wait time for LSA throttle 5000 msecs
Minimum LSA interval 200 msecs. Minimum LSA arrival 100 msecs
LSA refresh interval 1800 seconds
Flood pacing interval 33 msecs. Retransmission pacing interval 66 msecs
Adjacency stagger enabled; initial (per area): 2, maximum: 64
Number of neighbors forming: 0, 2 full
Maximum number of configured interfaces 1024
Number of external LSA 1. Checksum Sum 0x00250d
Number of opaque AS LSA 0. Checksum Sum 00000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 1 normal 1 stub 0 nssa
External flood list length 0
SNMP trap is enabled
LSD not connected, revision 0
Segment Routing Global Block default (16000-23999), not allocated
Segment Routing Local Block, unknown
Segment Routing prefix-sid-map, Advertise local: Disabled, Receive remote: Disabled
Strict-SPF capability is enabled
Area BACKBONE(0)
Number of interfaces in this area is 2
SPF algorithm executed 10 times
Number of LSA 20. Checksum Sum 0x0bc1b4
Number of opaque link LSA 0. Checksum Sum 00000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Number of LFA enabled interfaces 0, LFA revision 0
Number of Per Prefix LFA enabled interfaces 0
Number of neighbors forming in staggered mode 0, 1 full
Area 2
Number of interfaces in this area is 1
It is a stub area, no summary LSA in this area
generates stub default route with cost 1R13のルーティングテーブルからエリア間経路(O IA)が消え、残るのはエリア内経路とデフォルト経路だけになりました。LSDBもRouter-LSA 5件と0.0.0.0のType 3が2件の合計7件まで減っています。
RP/0/RP0/CPU0:R13#show route ospf
Sun Sep 6 22:25:54.007 UTC
O*IA 0.0.0.0/0 [110/3] via 10.1.11.11, 00:00:18, GigabitEthernet0/0/0/0
O 11.11.11.11/32 [110/2] via 10.1.11.11, 00:09:55, GigabitEthernet0/0/0/0
O 12.12.12.12/32 [110/2] via 10.1.12.12, 00:09:55, GigabitEthernet0/0/0/1
O 172.16.3.0/24 [110/2] via 10.1.11.11, 00:09:55, GigabitEthernet0/0/0/0
O 172.16.4.0/24 [110/11] via 10.1.12.12, 00:09:55, GigabitEthernet0/0/0/1
RP/0/RP0/CPU0:R13#show route 0.0.0.0/0
Sun Sep 6 22:25:54.193 UTC
Routing entry for 0.0.0.0/0
Known via "ospf 1", distance 110, metric 3, candidate default path, type inter area
Installed Sep 6 22:25:35.835 for 00:00:18
Routing Descriptor Blocks
10.1.11.11, from 3.3.3.3, via GigabitEthernet0/0/0/0
Route metric is 3
No advertising protos.
RP/0/RP0/CPU0:R13#show ospf database
Sun Sep 6 22:25:54.352 UTC
OSPF Router with ID (13.13.13.13) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 25 0x80000006 0x00e275 2
4.4.4.4 4.4.4.4 14 0x80000005 0x00e262 1
11.11.11.11 11.11.11.11 25 0x80000009 0x00de86 5
12.12.12.12 12.12.12.12 4 0x80000009 0x0082ba 5
13.13.13.13 13.13.13.13 599 0x80000006 0x00abd5 5
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 3.3.3.3 30 0x80000003 0x0053dc
0.0.0.0 4.4.4.4 14 0x80000002 0x0037f5
RP/0/RP0/CPU0:R13#traceroute 192.168.1.1 source 13.13.13.13
Sun Sep 6 22:25:54.991 UTC
Type escape sequence to abort.
Tracing the route to 192.168.1.1
1 10.1.11.11 6 msec 4 msec 27 msec
2 172.16.3.3 8 msec 7 msec 7 msec
3 10.0.23.2 10 msec 10 msec 10 msec
4 10.0.12.1 45 msec * 15 msec no-summaryを入れた瞬間、ABRはそれまでエリア2へ入れていたType 3をLS Age 3600(MaxAge)で送り直して取り消します。添付のキャプチャーのNo.4が、R3が8件のType 3をまとめて引き上げたLS Updateです。
4 11.539631 10.1.11.11 → 224.0.0.5 OSPF 286 LS Update
7 15.274140 10.1.11.11 → 224.0.0.5 OSPF 134 LS Update
8 15.814386 10.1.11.11 → 224.0.0.5 OSPF 126 LS Update
9 15.865280 10.1.11.11 → 224.0.0.5 OSPF 146 LS Update
10 15.898546 10.1.11.11 → 224.0.0.5 OSPF 110 LS Update
13 20.801426 10.1.11.11 → 10.1.11.13 OSPF 110 LS Update
16 26.958238 10.1.11.13 → 224.0.0.5 OSPF 286 LS Update
20 33.575569 10.1.11.13 → 224.0.0.5 OSPF 134 LS Update
22 35.879174 10.1.11.13 → 224.0.0.5 OSPF 126 LS Update
23 35.929703 10.1.11.13 → 224.0.0.5 OSPF 146 LS Update
26 40.752365 10.1.11.13 → 224.0.0.5 OSPF 110 LS Updateトータリースタブエリアで印象的なのは、経路表に無い宛先にも届くことです。R13は1.1.1.1/32(R1のLoopback0)の経路を持っていませんが、pingは通ります。デフォルト経路がすべてを引き受けているためです。
RP/0/RP0/CPU0:R13#show route 1.1.1.1/32
Sun Sep 6 23:09:13.422 UTC
% Network not in table
RP/0/RP0/CPU0:R13#ping 1.1.1.1 source 13.13.13.13
Sun Sep 6 23:09:13.686 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1 timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 11/13/16 ms
RP/0/RP0/CPU0:R13#traceroute 1.1.1.1 source 13.13.13.13
Sun Sep 6 23:09:14.518 UTC
Type escape sequence to abort.
Tracing the route to 1.1.1.1
1 10.1.11.11 7 msec 5 msec 5 msec
2 172.16.3.3 10 msec 10 msec 8 msec
3 10.0.23.2 12 msec 10 msec 10 msec
4 10.0.12.1 16 msec * 17 msec LSDBはどれだけ小さくなるか
R13から見たエリア2のLSDBを、3つの状態で数えると次のようになります。
| 状態 | Router(Type 1) | Summary(Type 3) | ASBR Summary(Type 4) | External(Type 5) | 合計 | OSPF経路数 |
|---|---|---|---|---|---|---|
| 通常エリア(STEP 0) | 5 | 14 | 2 | 1 | 22 | 12 |
| スタブエリア(STEP 1) | 5 | 16(14 + デフォルト2) | 0 | 0 | 21 | 12 |
| トータリースタブ(STEP 3) | 5 | 2(デフォルトのみ) | 0 | 0 | 7 | 5 |
スタブにしただけではLSAはほとんど減りません。この構成では外部経路が1件しかないため、Type 4とType 5の3件が消える一方でデフォルト経路が2件増え、差し引き1件しか減らないからです。外部経路が数万件ある実際のネットワークではここが劇的に効きますが、エリア内のルータの負担を確実に下げたいならトータリースタブのほうが効果が分かりやすく、22件が7件になっています。
スタブエリアで再配布を試す(STEP 4)
RFC 2328のSection 3.6は「AS境界ルータをスタブエリアの内部に置くことはできない」と定めています。では設定を入れたらどうなるのか、R13でスタティックルートを再配布してみます。
(R13)
router static
address-family ipv4 unicast
192.168.13.0/24 Null0
!
router ospf 1
redistribute static設定自体はエラーにならずに通ります。show ospfにも「staticを再配布している」「再配布したプレフィックスは1件」と表示されます。ところがshow ospf database externalは空のままで、Type 5は1つも作られていません。
RP/0/RP0/CPU0:R13#show ospf database external
Sun Sep 6 22:30:29.465 UTC
OSPF Router with ID (13.13.13.13) (Process ID 1)
RP/0/RP0/CPU0:R13#show ospf
Sun Sep 6 22:30:30.091 UTC
Routing Process "ospf 1" with ID 13.13.13.13
Role: Primary Active
NSR (Non-stop routing) is Enabled
Supports only single TOS(TOS0) routes
Supports opaque LSA
It is an autonomous system boundary router
Maximum number of non self-generated LSA allowed 500000
Current number of non self-generated LSA 6
Threshold for warning message 75%
Ignore-time 5 minutes, reset-time 10 minutes
Ignore-count allowed 5, current ignore-count 0
Redistributing External Routes from,
static
Maximum number of redistributed prefixes 10240
Threshold for warning message 75%
Current number of redistributed prefixes 1
Maximum number of external prefixes per router 50000 (suppress-neighbor)
Warning threshold 75%
Maximum Exchange time 10 Hold time 5 Max Recovery count 300
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 50 msecs
Minimum hold time between two consecutive SPFs 200 msecs
Maximum wait time between two consecutive SPFs 5000 msecs
Initial LSA throttle delay 50 msecs
Minimum hold time for LSA throttle 200 msecs
Maximum wait time for LSA throttle 5000 msecs
Minimum LSA interval 200 msecs. Minimum LSA arrival 100 msecs
LSA refresh interval 1800 seconds
Flood pacing interval 33 msecs. Retransmission pacing interval 66 msecs
Adjacency stagger enabled; initial (per area): 2, maximum: 64
Number of neighbors forming: 0, 2 full
Maximum number of configured interfaces 1024
Number of external LSA 0. Checksum Sum 00000000
Number of opaque AS LSA 0. Checksum Sum 00000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 0 normal 1 stub 0 nssa
External flood list length 0
SNMP trap is enabled
LSD not connected, revision 0
Segment Routing Global Block default (16000-23999), not allocated
Segment Routing Local Block, unknown
Segment Routing prefix-sid-map, Advertise local: Disabled, Receive remote: Disabled
Strict-SPF capability is enabled
Area 2
Number of interfaces in this area is 3
It is a stub area
SPF algorithm executed 17 times
Number of LSA 7. Checksum Sum 0x04fb11
Number of opaque link LSA 0. Checksum Sum 00000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Number of LFA enabled interfaces 0, LFA revision 0
Number of Per Prefix LFA enabled interfaces 0
Number of neighbors forming in staggered mode 0, 2 full隣のR11から見ても192.168.13.0/24は現れません。設定は通るのに経路が出ないという形で、RFCの制約が効いています。スタブエリアの中に外部経路を持ち込みたい場合は、NSSAを使います。
設定漏れの再現(STEP 5)
スタブエリアの設定は、エリア内の全ルータで一致していなければなりません。R13だけstubを外して、運用でありがちな設定漏れを再現します。
(R13)
router ospf 1
area 2
no stubR13の隣接は両方ともDOWNになり、OSPFの経路が1本残らず消えます。show ospf interface briefのNbrs F/Cも0/1(1つ設定されているうちFullは0)になっています。
RP/0/RP0/CPU0:R13#show ospf neighbor
Sun Sep 6 22:34:03.132 UTC
* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up
Neighbors for OSPF 1
Neighbor ID Pri State Dead Time Address Interface
11.11.11.11 1 DOWN/ - - 10.1.11.11 GigabitEthernet0/0/0/0
12.12.12.12 1 DOWN/ - - 10.1.12.12 GigabitEthernet0/0/0/1
Total neighbor count: 2
RP/0/RP0/CPU0:R13#show route ospf
Sun Sep 6 22:34:04.046 UTC
% No matching routes found
RP/0/RP0/CPU0:R13#show ospf interface brief
Sun Sep 6 22:34:04.165 UTC
* Indicates MADJ interface, (P) Indicates fast detect hold down state
Interfaces for OSPF 1
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Lo0 1 2 13.13.13.13/32 1 LOOP 0/0
Gi0/0/0/0 1 2 10.1.11.13/24 1 P2P 0/1
Gi0/0/0/1 1 2 10.1.12.13/24 1 P2P 0/1隣のR11のsyslogには、デッドタイマー切れで隣接が落ちたことが記録されています。Helloは届いているのにEビットが食い違うため、相手のHelloが無視され続けた結果です。
RP/0/RP0/CPU0:R11#show logging start Sep 6 22:32:47
Sun Sep 6 22:36:09.027 UTC
Time Zone UTC, DST disabled
Syslog logging: enabled (0 messages dropped, 0 flushes, 0 overruns)
Console logging: Disabled
Monitor logging: level debugging, 0 messages logged
Trap logging: level informational, 0 messages logged
Buffer logging: level debugging, 146 messages logged
Log Buffer (2097152 bytes):
RP/0/RP0/CPU0:Sep 6 22:32:48.091 UTC: logger[66500]: %OS-SYSLOG-6-LOG_INFO : informational STEP5-BEGIN
RP/0/RP0/CPU0:Sep 6 22:32:48.410 UTC: ssh_syslog_proxy[1188]: %SECURITY-SSHD_SYSLOG_PRX-6-INFO_GENERAL : sshd[9109]: Received disconnect from 10.100.3.1 port 51054:11: disconnected by user
RP/0/RP0/CPU0:Sep 6 22:32:48.410 UTC: ssh_syslog_proxy[1188]: %SECURITY-SSHD_SYSLOG_PRX-6-INFO_GENERAL : sshd[9109]: Disconnected from user cisco 10.100.3.1 port 51054
RP/0/RP0/CPU0:Sep 6 22:34:22.025 UTC: ospf[1035]: %ROUTING-OSPF-5-ADJCHG : Process 1, Nbr 13.13.13.13 on GigabitEthernet0/0/0/1 in area 2 from FULL to DOWN, Neighbor Down: dead timer expired, vrf default vrfid 0x60000000
RP/0/RP0/CPU0:Sep 6 22:35:53.406 UTC: ssh_syslog_proxy[1188]: %SECURITY-SSHD_SYSLOG_PRX-6-INFO_GENERAL : sshd[9408]: Accepted authentication/pam for cisco from 10.100.3.1 port 51172 ssh2
RP/0/RP0/CPU0:Sep 6 22:36:06.688 UTC: ssh_syslog_proxy[1188]: %SECURITY-SSHD_SYSLOG_PRX-6-INFO_GENERAL : sshd[9413]: Received disconnect from 10.100.3.1 port 51172:11: disconnected by user
RP/0/RP0/CPU0:Sep 6 22:36:06.688 UTC: ssh_syslog_proxy[1188]: %SECURITY-SSHD_SYSLOG_PRX-6-INFO_GENERAL : sshd[9413]: Disconnected from user cisco 10.100.3.1 port 51172
RP/0/RP0/CPU0:Sep 6 22:36:07.539 UTC: ssh_syslog_proxy[1188]: %SECURITY-SSHD_SYSLOG_PRX-6-INFO_GENERAL : sshd[9614]: Accepted authentication/pam for cisco from 10.100.3.1 port 51177 ssh2 復旧(STEP 6)
R13にstubを戻すと隣接が再確立し、デフォルト経路も戻ります。
RP/0/RP0/CPU0:R13#show ospf neighbor
Sun Sep 6 22:38:36.429 UTC
* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up
Neighbors for OSPF 1
Neighbor ID Pri State Dead Time Address Interface
11.11.11.11 1 FULL/ - 00:00:31 10.1.11.11 GigabitEthernet0/0/0/0
Neighbor is up for 00:01:14
12.12.12.12 1 FULL/ - 00:00:38 10.1.12.12 GigabitEthernet0/0/0/1
Neighbor is up for 00:01:08
Total neighbor count: 2
RP/0/RP0/CPU0:R13#show route ospf
Sun Sep 6 22:38:36.940 UTC
O*IA 0.0.0.0/0 [110/3] via 10.1.11.11, 00:01:14, GigabitEthernet0/0/0/0
O 11.11.11.11/32 [110/2] via 10.1.11.11, 00:01:14, GigabitEthernet0/0/0/0
O 12.12.12.12/32 [110/2] via 10.1.12.12, 00:01:08, GigabitEthernet0/0/0/1
O 172.16.3.0/24 [110/2] via 10.1.11.11, 00:01:14, GigabitEthernet0/0/0/0
O 172.16.4.0/24 [110/11] via 10.1.12.12, 00:01:08, GigabitEthernet0/0/0/1
RP/0/RP0/CPU0:R13#ping 192.168.1.1 source 13.13.13.13
Sun Sep 6 22:38:37.127 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1 timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/12/15 msIOS XRの設定コマンド
| コマンド | 入れる場所 | 意味 |
|---|---|---|
area <ID> 配下のstub | そのエリアに接続する全ルータ | エリアをスタブにする。1台でも漏れると隣接が確立しない |
area <ID> 配下のstub no-summary | ABRだけ | Type 3も止める(トータリースタブ)。内部ルータはstubのままでよい |
area <ID> 配下のdefault-cost <値> | ABRだけ | 注入するデフォルト経路のメトリック。既定は1。ABRごとに違う値でよい |
router ospf 1
area 2
stub no-summary
default-cost 50
!
!IOS XEではrouter ospf <プロセス>配下にarea <ID> stub / area <ID> stub no-summary / area <ID> default-cost <値>と書きます。設定例は別記事で解説します。
検証Configおよびshow結果
各STEPで7台すべてから、次の3種類をルータごとに分けて取得しています。検証Configはこの..._run.txtです(最終状態はSTEP 6のもの)。
| ファイル | 内容 |
|---|---|
..._show.txt | show version / show interface description / show route / show route ospf / show ospf / show ospf interface / show ospf interface brief / show ospf neighbor / show ospf neighbor detail / show ospf database / show ospf database router / show ospf database network / show ospf statistics interface / show ospf database summary / show ospf database asbr-summary / show ospf database external / show ospf border-routers / show ospf routes / show route 0.0.0.0/0 / show route 1.1.1.1/32 / show route 192.168.1.0/24 / show ospf trace events |
..._log.txt | そのSTEPの範囲だけに絞ったshow logging。各STEPの開始時にlogmsgでマーカーを入れ、その時刻をshow logging startに指定して取得したもの |
..._run.txt | そのSTEP時点のshow running-config(=そのSTEPの検証Config) |
最終状態はエリア2がトータリースタブエリア(ABRにno-summary、内部ルータにstub)です。
STEP 0:通常エリア(スタブにする前) — O IAとO E2が両方あり、LSAは22件
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R11 | show | log | run |
| R12 | show | log | run |
| R13 | show | log | run |
このSTEPではR13からping と tracerouteも取得しています。
STEP 1:エリア2の5台にstub — Type 4とType 5が消え、0.0.0.0/0がType 3で入る(LSAは21件)
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R11 | show | log | run |
| R12 | show | log | run |
| R13 | show | log | run |
このSTEPではR13からshow route / ping / traceroute、show ospf database summary 0.0.0.0も取得しています。
STEP 2:R3にdefault-cost 50 — デフォルト経路がR4経由(コスト12)へ切り替わる
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R11 | show | log | run |
| R12 | show | log | run |
| R13 | show | log | run |
このSTEPではR13からshow route / show ospf database summary 0.0.0.0 / tracerouteも取得しています。
STEP 3:ABRの2台にstub no-summary(トータリースタブ) — Type 3も消え、LSAは7件・OSPF経路は5本に
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R11 | show | log | run |
| R12 | show | log | run |
| R13 | show | log | run |
このSTEPではR13からshow route ospf / show ospf database / traceroute、show ospf database summary 0.0.0.0も取得しています。
STEP 4:R13でスタティックを再配布 — 設定は通るがType 5は生成されない
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R11 | show | log | run |
| R12 | show | log | run |
| R13 | show | log | run |
このSTEPではR13からshow ospf database external / show ospfも取得しています。
STEP 5:R13のstubだけ外す(設定漏れの再現) — Eビット不一致で隣接がDOWN、OSPF経路が全滅
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R11 | show | log | run |
| R12 | show | log | run |
| R13 | show | log | run |
このSTEPではR13からshow ospf neighbor / show route ospf / show ospf interface briefも取得しています。
STEP 6:R13にstubを戻す(最終状態) — 隣接とデフォルト経路が復旧
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
| R11 | show | log | run |
| R12 | show | log | run |
| R13 | show | log | run |
このSTEPではR13からshow ospf neighbor / show route ospf / ping、show route 1.1.1.1/32 / ping / tracerouteも取得しています。
バックボーンをスタブにしようとしたときの記録はR2の端末ログにあります。
キャプチャーはエリア2内(R11 - R13間)で3回に分けて取得しました(フィルタはip proto 89)。
スタブ化の前後(STEP 1)のキャプチャーをダウンロード
default-cost変更(STEP 2)のキャプチャーをダウンロード
トータリースタブ化(STEP 3)のキャプチャーをダウンロード
参考
| RFC | タイトル | 概要 |
|---|---|---|
| RFC 2328 | OSPF Version 2 | スタブエリアの定義と制約(Section 3.6)。スタブエリアへのsummary-LSAの生成とデフォルト経路の注入、StubDefaultCost、Type 4を生成しないこと(Section 12.4.3.1)。 |
関連記事
- OSPFとは
- OSPF ルータID
- OSPFパケットの種類とヘッダーフォーマット
- OSPFの状態遷移
- OSPF Optionsフィールド
- DRとBDR
- OSPF ネットワークタイプ
- OSPFの外部経路(スタティックの再配布)
- OSPFのマルチエリアとABR
- OSPFのスタブエリアとトータリースタブエリア
- OSPFのNSSAとトータリーNSSA
- OSPFの経路集約
- OSPFのLSAとLSAヘッダー
- OSPFのRouter-LSA(Type 1)
- OSPFのNetwork-LSA(Type 2)
- OSPFのSummary-LSA(Type 3)
- OSPFのASBR Summary-LSA(Type 4)
- OSPFのAS External-LSA(Type 5)