Table of contents
Chapter 1 OSPF Protocol Features and Configuration
Experiment 1-3 OSPF adjacency and LSA
Step 1. Basic configuration and IP addressing
Step 2. Configure multi-area OSPF
Step 3. Modify the router OSPF interface priority to affect DR election
Step 4. Configure to summarize direct routes and import them into the OSPF area
Step 5. View various types of LSA
Step 6. Observe LSR, LSU and LSAck
Additional Experiments: Think and Verify
Chapter 1 OSPF Protocol Features and Configuration
Experiment 1- 3 OSPF adjacency relationship and LSA
learning purpose
Understand the process of establishing neighbor relationship between four OSPF neighbor routers on Ethernet
Master the method of intervening in the election of OSPF DR
· Look at the content of the 5 types of LSAs, and what they do
Understand the mutual sending of OSPF LSR, LSU, LSAck data packets
Topology
Figure 1-3 OSPF adjacency relationship and LSA
Scenes
You are the company's network administrator. Now there are five AR G3 routers in the company's network, among which R1, R2, R3 and R4 are in the company's headquarters and interconnected through Ethernet. R5 is in the company branch, and R3 is connected to R3 in the company headquarters through a leased line. Due to the large scale of the network, in order to control the flooding of LSAs, you have designed multi-area OSPF interconnection.
The loopback0 interface of R1 belongs to area 2. Loopback0 interfaces of R2, R3, and R4 and network segment 10.1.234.0/24 belong to area 0. The network segment connecting R3 and R5 belongs to area 1. The Loopback0 interface of R5 belongs to the OSPF external network.
At the same time, in order to specify the router ID of the device, you configure the device to use a fixed address as the router ID.
On the interconnected network between R1, R2, R3, and R4, it is necessary to intervene in the election of DR and BDR. In actual use, R3 is defined as DR and R2 is defined as BDR. R4 devices are defined as DROther.
Learning tasks
Step 1. Basic configuration and IP addressing
Configure IP addresses and masks for all routers. When configuring, note that all loopback interface configuration masks are 24 bits, which is simulated as a separate network segment.
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.1.234.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 24
[R1-LoopBack0]quit
<R2>system-view
Enter system view, return user view with Ctrl+Z.
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.1.234.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 24
[R2-LoopBack0]quit
<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.1.234.3 24
[R3-GigabitEthernet0/0/0]quit
[R3]interface Serial 3/0/0
[R3-Serial3/0/0]ip address 10.0.35.3 24
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 24
[R3-LoopBack0]quit
<R4>system-view
Enter system view, return user view with Ctrl+Z.
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 10.1.234.4 24
[R4-GigabitEthernet0/0/0]quit
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 10.0.4.4 24
[R4-LoopBack0]quit
<R5>system-view
Enter system view, return user view with Ctrl+Z.
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]ip address 10.0.35.5 24
[R5-Serial1/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 10.0.5.5 24
[R5-LoopBack0]quit
After the configuration is complete, test the connectivity of the direct link.
[R1]ping -c 1 10.1.234.2
PING 10.1.234.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.234.2: bytes=56 Sequence=1 ttl=255 time=13 ms
--- 10.1.234.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 13/13/13 ms
[R1]ping -c 1 10.1.234.4
PING 10.1.234.4: 56 data bytes, press CTRL_C to break
Reply from 10.1.234.4: bytes=56 Sequence=1 ttl=255 time=6 ms
--- 10.1.234.4 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 6/6/6 ms
[R3]ping -c 1 10.1.234.1
PING 10.1.234.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.234.1: bytes=56 Sequence=1 ttl=255 time=13 ms
--- 10.1.234.1 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 13/13/13 ms
[R3]ping -c 1 10.0.35.5
PING 10.0.35.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=32 ms
--- 10.0.35.5 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 32/32/32 ms
Step 2. Configure multi-area OSPF
Configure GigabitEthernet 0/0/0 to belong to area 0 and loopback 0 to area 2 on R1. For loopback interfaces in all OSPF areas, change the OSPF network type to Broadcast so that OSPF can advertise the real mask information of the loopback interface.
[R1]ospf 1 router-id 10.0.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.1.234.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]network 10.0.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ospf network-type broadcast
[R1-LoopBack0]quit
All interfaces of R2 and R4 are located in area 0.
[R2]ospf 1 router-id 10.0.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.1.234.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R2-]interface LoopBack 0
[R2-LoopBack0]ospf network-type broadcast
[R2-LoopBack0]quit
[R4]ospf 1 router-id 10.0.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.1.234.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit
[R4-]interface LoopBack 0
[R4-LoopBack0]ospf network-type broadcast
[R4-LoopBack0]quit
Configure Loopback 0 and GigabitEthernet 0/0/0 to belong to area 0 on R3, and Serial 3/0/0 to belong to area 2.
[R3]ospf 1 router-id 10.0.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.1.234.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ospf network-type broadcast
[R3-LoopBack0]quit
Configure Serial 1/0/0 on R5 to belong to area 1, and loopback 0 to not belong to any area.
[R5]osp 1 router-id 10.0.5.5
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0
[R5-ospf-1-area-0.0.0.1]quit
[R5-ospf-1]quit
After the configuration is complete, check the routing table of the device on R1.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.0/24 OSPF 10 1 D 10.1.234.2 GigabitEthernet0/0/0
10.0.3.0/24 OSPF 10 1 D 10.1.234.3 GigabitEthernet0/0/0
10.0.4.0/24 OSPF 10 1 D 10.1.234.4 GigabitEthernet0/0/0
10.0.35.0/24 OSPF 10 1563 D 10.1.234.3 GigabitEthernet0/0/0
10.1.234.0/24 Direct 0 0 D 10.1.234.1 GigabitEthernet0/0/0
10.1.234.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.1.234.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32Direct 0 0 D 127.0.0.1 InLoopBack0
Except the network 10.0.5.5/24 which is not advertised into OSPF, R1 already has the routing table of the whole network.
Test network connectivity.
[R1]ping -c 1 10.0.2.2
PING 10.0.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=2 ms
--- 10.0.2.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms
[R1]ping -c 1 10.0.4.4
PING 10.0.4.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 10.0.4.4 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
[R3]ping -c 1 10.0.1.1
PING 10.0.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 10.0.1.1 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
Run the display ospf brief command on R1 to view basic OSPF information running on the router. We can see that since the loopback 0 interface of R1 is located in area 2, R1 becomes an ABR. The network connected to the GigabitEthernet 0/0/0 interface of R1 is a broadcast network, and R1 is the DR of this network segment.
[R1]display ospf brief
OSPF Process 1 with Router ID 10.0.1.1
OSPF Protocol Information
RouterID: 10.0.1.1 Border Router: AREA
Multi-VPN-Instance is not enabled
Global DS-TE Mode: Non-Standard IETF Mode
Graceful-restart capability: disabled
Helper support capability : not configured
Applications Supported: MPLS Traffic-Engineering
Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms
Default ASE parameters: Metric: 1 Tag: 1 Type: 2
Route Preference: 10
ASE Route Preference: 150
SPF Computation Count: 22
RFC 1583 Compatible
Retransmission limitation is disabled
Area Count: 2 Nssa Area Count: 0
ExChange/Loading Neighbors: 0
Process total up interface count: 2
Process valid up interface count: 1
Area: 0.0.0.0 (MPLS TE not enabled)
Authtype: None Area flag: Normal
SPF scheduled Count: 22
ExChange/Loading Neighbors: 0
Router ID conflict state: Normal
Area interface up count: 1
Interface: 10.1.234.1 (GigabitEthernet0/0/0)
Cost: 1 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.1.234.1
Backup Designated Router: 10.1.234.2
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Area: 0.0.0.2 (MPLS TE not enabled)
Authtype: None Area flag: Normal
SPF scheduled Count: 20
ExChange/Loading Neighbors: 0
Router ID conflict state: Normal
Area interface up count: 1
Interface: 10.0.1.1 (LoopBack0)
Cost: 0 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.0.1.1
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Run the display ospf peer brief command to check the establishment of the OSPF neighbor relationship of the router. Since R1 is the DR, it forms adjacencies with all routers on the network segment. If you check the neighbors on R3, you can find that there is only a neighbor relationship between R3 and R4, but no adjacency relationship.
[R1]display ospf peer brief
OSPF Process 1 with Router ID 10.0.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0 10.0.2.2 Full
0.0.0.0 GigabitEthernet0/0/0 10.0.3.3 Full
0.0.0.0 GigabitEthernet0/0/0 10.0.4.4 Full
----------------------------------------------------------------------------
[R3]display ospf peer brief
OSPF Process 1 with Router ID 10.0.3.3
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0 10.0.1.1 Full
0.0.0.0 GigabitEthernet0/0/0 10.0.2.2 Full
0.0.0.0 GigabitEthernet0/0/0 10.0.4.4 2-Way
0.0.0.1 Serial3/0/0 10.0.5.5 Full
----------------------------------------------------------------------------
Run the display ospf lsdb command on R5 to check the OSPF database information of the router.
[R5]display ospf lsdb
OSPF Process 1 with Router ID 10.0.5.5
Link State Database
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.5.5 10.0.5.5 1182 48 80000002 1562
Router 10.0.3.3 10.0.3.3 1183 48 80000002 1562
Sum-Net 10.0.3.0 10.0.3.3 1429 28 80000001 0
Sum-Net 10.0.2.0 10.0.3.3 1429 28 80000001 1
Sum-Net 10.0.1.0 10.0.3.3 1429 28 80000001 1
Sum-Net 10.1.234.0 10.0.3.3 1429 28 80000001 1
Sum-Net 10.0.4.0 10.0.3.3 1430 28 80000001 1
It can be seen that since there are only 2 routers in area 1, there are only 2 type 1 LSAs in R5's lsdb, and the remaining 5 type 3 LSAs are inter-area routes advertised by R3 to R5.
Run the display ospf lsdb command on R2 to check the OSPF database information of the router.
[R2]display ospf lsdb
OSPF Process 1 with Router ID 10.0.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 4 48 80000009 1
Router 10.0.4.4 10.0.4.4 150 48 80000009 1
Router 10.0.2.2 10.0.2.2 149 48 8000000C 1
Router 10.0.1.1 10.0.1.1 149 36 8000000B 1
Network 10.1.234.1 10.0.1.1 149 40 80000007 0
Sum-Net 10.0.35.0 10.0.3.3 1790 28 80000001 1562
Sum-Net 10.0.1.0 10.0.1.1 817 28 80000002 0
In addition to the four Type 1 LSAs on R2, there is also a Type 2 LSA. GigabitEthernet 0/0/0 of R2 is connected to a broadcast network, and the DR on this network will generate a Type 2 LSA to describe all neighbors. Here we can know from the AdvRouter field that the router that generated this LSA is R1, and that R1 is the result of the DR of this network segment.
Run the display ospf lsdb command on R1 to check the OSPF database information of the router.
[R1]display ospf lsdb
OSPF Process 1 with Router ID 10.0.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 447 48 80000009 1
Router 10.0.4.4 10.0.4.4 592 48 80000009 1
Router 10.0.2.2 10.0.2.2 592 48 8000000C 1
Router 10.0.1.1 10.0.1.1 591 36 8000000B 1
Network 10.1.234.1 10.0.1.1 591 40 80000007 0
Sum-Net 10.0.35.0 10.0.3.3 434 28 80000002 1562
Sum-Net 10.0.1.0 10.0.1.1 1259 28 80000002 0
Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.1.1 10.0.1.1 1223 36 80000004 0
Sum-Net 10.0.35.0 10.0.1.1 433 28 80000002 1563
Sum-Net 10.0.3.0 10.0.1.1 541 28 80000002 1
Sum-Net 10.0.2.0 10.0.1.1 909 28 80000002 1
Sum-Net 10.1.234.0 10.0.1.1 1269 28 80000002 1
Sum-Net 10.0.4.0 10.0.1.1 711 28 80000002 1
Since the loopback 0 interface of R1 is located in area 2, there are two area LSDBs on R1, namely area 0 and area 2.
Run the display ospf lsdb command on R4 to check the OSPF database information of the router.
[R4]display ospf lsdb
OSPF Process 1 with Router ID 10.0.4.4
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 745 48 80000009 1
Router 10.0.4.4 10.0.4.4 888 48 80000009 1
Router 10.0.2.2 10.0.2.2 889 48 8000000C 1
Router 10.0.1.1 10.0.1.1 889 36 8000000B 1
Network 10.1.234.1 10.0.1.1 889 40 80000007 0
Sum-Net 10.0.35.0 10.0.3.3 732 28 80000002 1562
Sum-Net 10.0.1.0 10.0.1.1 1556 28 80000002 0
Note that due to differences in the roles of OSPF routers, the contents of the OSPF link state database will also vary. Compare and analyze the differences between R5, R2, R1 and R4 link state databases.
Step 3. Modify the router OSPF interface priority to affect DR election
Set the priority of the G0/0/0 interface of R3 to 255 to ensure that R3 becomes the DR of network segment 10.1.234.0/24. Change the priority of the G0/0/0 interface of R2 to 254 to ensure that R2 becomes the BDR of the network segment 10.1.234.0/24. Modify the G0/0/0 interface priority of R4 to 0 to ensure that R4 does not participate in the DR/BDR election, but becomes the DROther of the 10.1.234.0/24 network segment.
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ospf dr-priority 255
[R3-GigabitEthernet0/0/0]quit
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ospf dr-priority 254
[R2-GigabitEthernet0/0/0]quit
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ospf dr-priority 0
[R4-GigabitEthernet0/0/0]quit
After the configuration is complete, the DR/BDR role cannot be preempted because the DR/BDR has been elected. Therefore, you must close the G0/0/0 interfaces of R1, R2, R3, and R4, and open the G0/0/0 interfaces of R3, R2, R1, and R4 in sequence.
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]shutdown
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]shutdown
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]shutdown
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]shutdown
[R1-GigabitEthernet0/0/0]undo shutdown
[R1-GigabitEthernet0/0/0]quit
[R2-GigabitEthernet0/0/0]undo shutdown
[R2-GigabitEthernet0/0/0]quit
[R3-GigabitEthernet0/0/0]undo shutdown
[R3-GigabitEthernet0/0/0]quit
[R4-GigabitEthernet0/0/0]undo shutdown
[R4-GigabitEthernet0/0/0]quit
Check the DR/BDR election status of network segment 10.1.234.0/24.
[R3]display ospf peer
OSPF Process 1 with Router ID 10.0.3.3
Neighbors
Area 0.0.0.0 interface 10.1.234.3(GigabitEthernet0/0/0)'s neighbors
Router ID: 10.0.1.1 Address: 10.1.234.1
State: Full Mode:Nbr is Slave Priority: 1
DR: 10.1.234.3 BDR: 10.1.234.2 PERSON: 0
Dead timer due in 29 sec
Retrans timer interval: 3
Neighbor is up for 00:02:17
Authentication Sequence: [ 0 ]
Router ID: 10.0.2.2 Address: 10.1.234.2
State: Full Mode:Nbr is Slave Priority: 254
DR: 10.1.234.3 BDR: 10.1.234.2 PERSON: 0
Dead timer due in 35 sec
Retrans timer interval: 6
Neighbor is up for 00:01:14
Authentication Sequence: [ 0 ]
Router ID: 10.0.4.4 Address: 10.1.234.4
State: Full Mode:Nbr is Master Priority: 0
DR: 10.1.234.3 BDR: 10.1.234.2 PERSON: 0
Dead timer due in 32 sec
Retrans timer interval: 3
Neighbor is up for 00:01:26
Authentication Sequence: [ 0 ]
Neighbors
Area 0.0.0.1 interface 10.0.35.3(Serial3/0/0)'s neighbors
Router ID: 10.0.5.5 Address: 10.0.35.5
State: Full Mode:Nbr is Master Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 27 sec
Retrans timer interval: 4
Neighbor is up for 00:53:37
Authentication Sequence: [ 0 ]
After restarting the interface, R3 becomes the DR of the network segment, and R2 becomes the BDR.
Check the neighbor relationship between R4 and R1.
[R4]display ospf peer 10.0.1.1
OSPF Process 1 with Router ID 10.0.4.4
Neighbors
Area 0.0.0.0 interface 10.1.234.4(GigabitEthernet0/0/0)'s neighbors
Router ID: 10.0.1.1 Address: 10.1.234.1
State: 2-Way Mode:Nbr is Slave Priority: 1
DR: 10.1.234.3 BDR: 10.1.234.2 PERSON: 0
Dead timer due in 30 sec
Retrans timer interval: 0
Neighbor is up for 00:00:00
Authentication Sequence: [ 0 ]
After the neighbor relationship is stable, since both R1 and R4 are DROther routers, they only form a neighbor relationship and remain in the 2-way state.
Step 4. Configure to summarize direct routes and import them into the OSPF area
The Loopback0 interface of R5 does not belong to the OSPF area. Import this direct route into the OSPF area.
[R5]ospf 1
[R5-ospf-1]import-route direct
[R5-ospf-1]quit
Check the imported external routes on R1 and R3.
[R1]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 6 Routes : 6
OSPF routing table status : <Active>
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.0/24 OSPF 10 1 D 10.1.234.2 GigabitEthernet0/0/0
10.0.3.0/24 OSPF 10 1 D 10.1.234.3 GigabitEthernet0/0/0
10.0.4.0/24 OSPF 10 1 D 10.1.234.4 GigabitEthernet0/0/0
10.0.5.0/24 O_ASE 150 1 D 10.1.234.3 GigabitEthernet0/0/0
10.0.35.0/24 OSPF 10 1563 D 10.1.234.3 GigabitEthernet0/0/0
10.0.35.3/32 O_ASE 150 1 D 10.1.234.3 GigabitEthernet0/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[R3]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5
OSPF routing table status : <Active>
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.1.0/24 OSPF 10 1 D 10.1.234.1 GigabitEthernet0/0/0
10.0.2.0/24 OSPF 10 1 D 10.1.234.2 GigabitEthernet0/0/0
10.0.4.0/24 OSPF 10 1 D 10.1.234.4 GigabitEthernet0/0/0
10.0.5.0/24 O_ASE 150 1 D 10.0.35.5 Serial3/0/0
OSPF routing table status : <Inactive>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.35.3/32 O_ASE 150 1 10.0.35.5 Serial3/0/0
Two external routes are seen on both R1 and R3, namely 10.0.5.0/24 and 10.0.35.3/32. 10.0.5.0/24 is the loopback interface of R5, but why is there another 10.0.35.3/32?
Check the routing table of R5. Since R3 and R5 are encapsulated in the form of PPP, the interface address of Serial 3/0/0 of R3 will appear in the routing table of R5 as a direct route. Therefore, after running import-route direct on R5, the routing entry is also published (the output below omits other routing entries ) .
[R5]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.35.0/24 Direct 0 0 D 10.0.35.5 Serial1/0/0
10.0.35.3/32 Direct 0 0 D 10.0.35.3 Serial1/0/0
10.0.35.5/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.35.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
Finally test network connectivity.
[R1]ping -c 1 10.0.5.5
PING 10.0.5.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=254 time=41 ms
--- 10.0.5.5 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 41/41/41 ms
Check the status of OSPF external routes in the link state database on R1. We can see that there are three external routes in the LSDB of R1: 10.0.5.0/24, 10.0.35.0/24, and 10.0.35.3/32.
There are only 2 external routes seen in the routing table of R1, and the other one is missing.
[R1]display ospf lsdb ase
OSPF Process 1 with Router ID 10.0.1.1
Link State Database
Type : External
Ls id : 10.0.5.0
Adv rtr : 10.0.5.5
Ls age : 834
Len : 36
Options : E
seq# : 80000001
chksum : 0xa904
Net mask : 255.255.255.0
TOS 0 Metric: 1
E type : 2
Forwarding Address : 0.0.0.0
Tag : 1
Priority : Low
Type : External
Ls id : 10.0.35.0
Adv rtr : 10.0.5.5
Ls age : 1342
Len : 36
Options : E
seq# : 80000001
chksum : 0x5e31
Net mask : 255.255.255.0
TOS 0 Metric: 1
E type : 2
Forwarding Address : 0.0.0.0
Tag : 1
Priority : Low
Type : External
Ls id : 10.0.35.3
Adv rtr : 10.0.5.5
Ls age : 1344
Len : 36
Options : E
seq# : 80000001
chksum : 0x404c
Net mask : 255.255.255.255
TOS 0 Metric: 1
E type : 2
Forwarding Address : 0.0.0.0
Tag : 1
Priority : Medium
After comparison, it can be found that the route 10.0.35.0/24 appears in the routing table as an internal route.
Examining the Type 3 LSA in R1's LSDB reveals this entry: 10.0.35.0/24.
[R1]display ospf lsdb summary 10.0.35.0
OSPF Process 1 with Router ID 10.0.1.1
Area: 0.0.0.0
Link State Database
Type : Sum-Net
Ls id : 10.0.35.0
Adv rtr : 10.0.3.3
Ls age : 236
Len : 28
Options : E
seq# : 80000007
chksum : 0x14e5
Net mask : 255.255.255.0
Tos 0 metric: 1562
Priority : Low
Area: 0.0.0.2
Link State Database
Type : Sum-Net
Ls id : 10.0.35.0
Adv rtr : 10.0.1.1
Ls age : 1637
Len : 28
Options : E
seq# : 80000002
chksum : 0x42bf
Net mask : 255.255.255.0
Tos 0 metric: 1563
Priority : Low
It can be seen that, when the network bit and mask of the route advertised by the third type and the fifth type LSA are the same, OSPF prefers to add the route advertised by the third type LSA to the routing table.
Step 5. View various types of LSA
View the detailed content of one type of LSA 10.0.1.0 in Area0 and Area2 on R1.
[R1]display ospf lsdb router 10.0.1.1
OSPF Process 1 with Router ID 10.0.1.1
Area: 0.0.0.0
Link State Database
Type : Router
Ls id : 10.0.1.1
Adv rtr : 10.0.1.1
Ls age : 591
Len : 36
Options : ABR E
seq# : 8000001e
chksum : 0xbc70
Link count: 1
* Link ID: 10.1.234.3
Data : 10.1.234.1
Link Type: TransNet
Metric : 1
Area: 0.0.0.2
Link State Database
Type : Router
Ls id : 10.0.1.1
Adv rtr : 10.0.1.1
Ls age : 627
Len : 36
Options : ABR E
seq# : 80000008
chksum : 0x1018
Link count: 1
* Link ID: 10.0.1.0
Date : 255.255.255.0
Link Type: StubNet
Metric : 0
Priority: Low
For a type of LSA, the Ls id field indicates the Router ID of the router that generated this LSA.
R1 generates two Type 1 LSAs, one of which is flooded in area 0. R1 is connected to a Transit network segment in area 0, so the Link Type field is TransNet. For TransNet, the Link ID field is the IP address of the DR interface on the network segment, and the Data field is the IP address of the local interface.
The second type-1 LSA is flooded by R1 to area 2, and R1 is connected to area 2 through a loopback interface. For the Loopback interface, the Link Type is StubNet. At this time, the Link ID indicates the IP network address of the Stub network segment, and Data indicates the network mask of the Stub network segment.
Check the details of Type 2 LSA 10.1.234.0 in Area0 on R2, R3, and R4 respectively.
[R2]display ospf lsdb network 10.1.234.3
OSPF Process 1 with Router ID 10.0.2.2
Area: 0.0.0.0
Link State Database
Type : Network
Ls id : 10.1.234.3
Adv rtr : 10.0.3.3
Ls age : 115
Len : 40
Options : E
seq# : 8000000f
chksum: 0x807e
Net mask : 255.255.255.0
Priority : Low
Attached Router 10.0.3.3
Attached Router 10.0.1.1
Attached Router 10.0.2.2
Attached Router 10.0.4.4
It is found that the LSA seen on R2, R3 and R4 is the same.
Similarly, the Adv rtr field can be used to know that this LSA is generated by R3. The Ls id of the second type of LSA describes the interface IP address of the DR on the network segment, and the Attached Router is the Router ID of all routers on the network segment.
View the details of three types of LSA 10.0.35.0/24 in Area0 on R1 and R3.
[R3]display ospf lsdb summary 10.0.35.0
OSPF Process 1 with Router ID 10.0.3.3
Area: 0.0.0.0
Link State Database
Type : Sum-Net
Ls id : 10.0.35.0
Adv rtr : 10.0.3.3
Ls age : 591
Len : 28
Options : E
seq# : 8000000a
chksum : 0xee8
Net mask : 255.255.255.0
Tos 0 metric: 1562
Priority : Low
From the output, we can see that the route is advertised by R3 to area 0. Ls id is the network address of the advertised destination network segment, and Net mask describes the mask information of the destination network segment.
[R1]display ospf lsdb summary 10.0.35.0
OSPF Process 1 with Router ID 10.0.1.1
Area: 0.0.0.0
Link State Database
Type : Sum-Net
Ls id : 10.0.35.0
Adv rtr : 10.0.3.3
Ls age : 136
Len : 28
Options : E
seq# : 80000004
chksum : 0x1ae2
Net mask : 255.255.255.0
Tos 0 metric: 1562
Priority : Low
Area: 0.0.0.2
Link State Database
Type : Sum-Net
Ls id : 10.0.35.0
Adv rtr : 10.0.1.1
Ls age : 382
Len : 28
Options : E
seq# : 80000002
chksum : 0x42bf
Net mask : 255.255.255.0
Tos 0 metric: 1563
Priority : Low
There are two type-3 LSAs describing 10.0.35.0/24 on R1. Among them, from the Adv rtr field, we can know that this LSA in area 0 is generated by R3. Since R1 itself is also an ABR, after receiving this LSA, R1 generates another LSA and announces it to area 2.
Check the details of four types of LSA 10.0.5.0 in Area2 on R1. The fourth type of LSA is used to describe how to reach the ASBR.
[R1]display ospf lsdb asbr 10.0.5.5
OSPF Process 1 with Router ID 10.0.1.1
Area: 0.0.0.0
Link State Database
Type : Sum-Asbr
Ls id : 10.0.5.5
Adv rtr : 10.0.3.3
Ls age : 1119
Len : 28
Options : E
seq# : 80000008
chksum : 0x1df3
Tos 0 metric: 1562
Area: 0.0.0.2
Link State Database
Type : Sum-Asbr
Ls id : 10.0.5.5
Adv rtr : 10.0.1.1
Ls age : 1118
Len : 28
Options : E
seq# : 80000008
chksum : 0x41d2
Tos 0 metric: 1563
From the output, we can see that R1 has received a Type 4 LSA from R3. Ls id is used to describe the router ID of the ASBR. Since this type of LSA cannot be flooded across areas, R1 generates another Type 4 LSA to flood into Area 2.
This LSA exists in the LSDBs of area 0 of R2, R4, and R3, because these routers are not in the same area as the ASBR (R5), and they need to know the location of the ASBR through the fourth type of LSA.
[R2]display ospf lsdb asbr
OSPF Process 1 with Router ID 10.0.2.2
Area: 0.0.0.0
Link State Database
Type : Sum-Asbr
Ls id : 10.0.5.5
Adv rtr : 10.0.3.3
Ls age : 1676
Len : 28
Options : E
seq# : 80000008
chksum : 0x1df3
Tos 0 metric: 1562
In area 1, there is no type 4 LSA, and routers in the same area do not need to rely on this LSA to know the location of the ASBR.
Step 6. Observe LSR, LSU and LSAck
We first observe the process of sending OSPF Update packets and ACK packets. Turn on debugging ospf packet update and debugging ospf packet ack on R1 .
<R1>terminal monitor
Info: Current terminal monitor is on
<R1>terminal debugging
Info: Current terminal debugging is on
<R1>debugging ospf packet update
<R1>debugging ospf packet ack
By default, the network runs stably, and OSPF routers are updated every 30 minutes. To trigger queries and update information, we delete the Loopback 0 interface of R3.
[R3]undo interface LoopBack 0
Info: This operation may take a few seconds. Please wait for a moment...succeeded.
[R3]
Oct 25 2016 15:32:27+00:00 R3 %%01IFNET/4/LINK_STATE(l)[58]:The line protocol IP on the interface LoopBack0 has entered the DOWN state
We can observe that the Update message from 10.1.234.3 is first received on R1. The destination address of the message is 224.0.0.5 (that is, all OSPF routers), which describes a network segment (# Links: 1), followed by the LinkID and LinkData of the network segment.
<R1>
Oct 25 2016 15:24:57.790.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178024 Line: 2271 Level: 0x20
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0
<R1>
Oct 25 2016 15:24:57.790.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3
Oct 25 2016 15:24:57.790.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5
Oct 25 2016 15:24:57.790.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 4 (Link-State Update)
Oct 25 2016 15:24:57.790.5+00:00 R1 RM/6/RMDEBUG: Length: 64, Router: 10.0.3.3
Oct 25 2016 15:24:57.790.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: d8ce
Oct 25 2016 15:24:57.790.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 15:24:57.790.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 15:24:57.790.9+00:00 R1 RM/6/RMDEBUG: # LSAS: 1
Oct 25 2016 15:24:57.790.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 15:24:57.790.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3
Oct 25 2016 15:24:57.790.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 15:24:57.790.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 1
Oct 25 2016 15:24:57.790.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON
Oct 25 2016 15:24:57.790.15+00:00 R1 RM/6/RMDEBUG: Length: 36, Seq# 80000020
Oct 25 2016 15:24:57.790.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 9090
Oct 25 2016 15:24:57.790.17+00:00 R1 RM/6/RMDEBUG: NtBit: 0 VBit: 0 EBit: 0 BBit: 1
Oct 25 2016 15:24:57.790.18+00:00 R1 RM/6/RMDEBUG: # Links: 1
Oct 25 2016 15:24:57.790.19+00:00 R1 RM/6/RMDEBUG: LinkID: 10.1.234.3
Oct 25 2016 15:24:57.790.20+00:00 R1 RM/6/RMDEBUG: LinkData: 10.1.234.3
Oct 25 2016 15:24:57.790.21+00:00 R1 RM/6/RMDEBUG: LinkType: 2
Oct 25 2016 15:24:57.790.22+00:00 R1 RM/6/RMDEBUG: TOS# 0 Metric 1
Finally, the ACK message sent by R1 itself. The source address of the packet is the interface address of R1 GigabitEthernet 0/0/0, and the destination address is 224.0.0.6. This message is sent to DR and BDR. The sequence number of this message is also 80000020.
<R1>
Oct 25 2016 15:24:58.200.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178025 Line: 4708 Level: 0x20
OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0
<R1>
Oct 25 2016 15:24:58.200.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.1
Oct 25 2016 15:24:58.200.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.6
Oct 25 2016 15:24:58.200.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack)
Oct 25 2016 15:24:58.200.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.1.1
Oct 25 2016 15:24:58.200.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: c5ef
Oct 25 2016 15:24:58.200.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 15:24:58.200.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 15:24:58.200.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1
Oct 25 2016 15:24:58.200.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 15:24:58.200.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3
Oct 25 2016 15:24:58.200.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 15:24:58.200.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 2
Oct 25 2016 15:24:58.200.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON
Oct 25 2016 15:24:58.200.15+00:00 R1 RM/6/RMDEBUG: Length: 36, Seq# 80000020
Oct 25 2016 15:24:58.200.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 9090
Next restore the deleted Loopback0 interface on R3.
[R3]interface loopback 0
[R3-LoopBack0]ip address 10.0.3.3 24
[R3-LoopBack0]quit
As before, R1 first receives the Update message from R3, but this time a new network segment is announced in the message, so the value of # Links here is 2, followed by the network number and mask of the newly announced network segment.
<R1>
Oct 25 2016 15:51:26.250.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178024 Line: 2271 Level: 0x20
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0
<R1>
Oct 25 2016 15:51:26.250.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3
Oct 25 2016 15:51:26.250.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5
Oct 25 2016 15:51:26.250.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 4 (Link-State Update)
Oct 25 2016 15:51:26.250.5+00:00 R1 RM/6/RMDEBUG: Length: 76, Router: 10.0.3.3
Oct 25 2016 15:51:26.250.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 2c6f
Oct 25 2016 15:51:26.250.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 15:51:26.250.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 15:51:26.250.9+00:00 R1 RM/6/RMDEBUG: # LSAS: 1
Oct 25 2016 15:51:26.250.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 15:51:26.250.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3
Oct 25 2016 15:51:26.250.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 15:51:26.250.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 1
Oct 25 2016 15:51:26.250.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON
Oct 25 2016 15:51:26.250.15+00:00 R1 RM/6/RMDEBUG: Length: 48, Seq# 8000002a
Oct 25 2016 15:51:26.250.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 2cca
Oct 25 2016 15:51:26.250.17+00:00 R1 RM/6/RMDEBUG: NtBit: 0 VBit: 0 EBit: 0 BBit: 1
Oct 25 2016 15:51:26.250.18+00:00 R1 RM/6/RMDEBUG: # Links: 2
Oct 25 2016 15:51:26.250.19+00:00 R1 RM/6/RMDEBUG: LinkID: 10.1.234.3
Oct 25 2016 15:51:26.250.20+00:00 R1 RM/6/RMDEBUG: LinkData: 10.1.234.3
Oct 25 2016 15:51:26.250.21+00:00 R1 RM/6/RMDEBUG: LinkType: 2
Oct 25 2016 15:51:26.250.22+00:00 R1 RM/6/RMDEBUG: TOS# 0 Metric 1
Oct 25 2016 15:51:26.250.23+00:00 R1 RM/6/RMDEBUG: LinkID: 10.0.3.3
Oct 25 2016 15:51:26.250.24+00:00 R1 RM/6/RMDEBUG: LinkData: 255.255.255.255
Oct 25 2016 15:51:26.250.25+00:00 R1 RM/6/RMDEBUG: LinkType: 3
Oct 25 2016 15:51:26.250.26+00:00 R1 RM/6/RMDEBUG: TOS# 0 Metric 0
R1 first receives the ACK message from the BDR.
<R1>
Oct 25 2016 15:51:27.90.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178024 Line: 2271 Level: 0x20
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0
<R1>
Oct 25 2016 15:51:27.90.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.2
Oct 25 2016 15:51:27.90.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5
Oct 25 2016 15:51:27.90.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack)
Oct 25 2016 15:51:27.90.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.2.2
Oct 25 2016 15:51:27.90.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 289f
Oct 25 2016 15:51:27.90.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 15:51:27.90.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 15:51:27.90.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1
Oct 25 2016 15:51:27.90.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 15:51:27.90.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3
Oct 25 2016 15:51:27.90.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 15:51:27.90.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 2
Oct 25 2016 15:51:27.90.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON
Oct 25 2016 15:51:27.90.15+00:00 R1 RM/6/RMDEBUG: Length: 48, Seq# 8000002a
Oct 25 2016 15:51:27.90.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 2cca
Finally, the ACK message sent by R1 itself.
<R1>
Oct 25 2016 15:51:26.430.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178025 Line: 4708 Level: 0x20
OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0
<R1>
Oct 25 2016 15:51:26.430.2+00:00 R1 RM/6RMDEBUG: Source Address: 10.1.234.1
Oct 25 2016 15:51:26.430.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.6
Oct 25 2016 15:51:26.430.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack)
Oct 25 2016 15:51:26.430.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.1.1
Oct 25 2016 15:51:26.430.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 29a1
Oct 25 2016 15:51:26.430.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 15:51:26.430.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 15:51:26.430.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1
Oct 25 2016 15:51:26.430.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 15:51:26.430.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3
Oct 25 2016 15:51:26.430.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 15:51:26.430.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 1
Oct 25 2016 15:51:26.430.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON
Oct 25 2016 15:51:26.430.15+00:00 R1 RM/6/RMDEBUG: Length: 48, Seq# 8000002a
Oct 25 2016 15:51:26.430.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 2cca
In the next step we look at the Request message. Normally, the router will not actively send this message. To observe the sending of this message, we restart the OSPF process of R1. What is observed on the router is that R1 initiates an LS Request to R2.
<R1>terminal monitor
Info: Current terminal monitor is on
<R1>terminal debugging
Info: Current terminal debugging is on
<R1>debugging ospf packet update
<R1>debugging ospf packet ack
<R1>debugging ospf packet request
<R1>reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
<R1>
Oct 25 2016 16:17:59.750.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178025 Line: 2993 Level: 0x20
OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0
<R1>
Oct 25 2016 16:17:59.750.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.1
Oct 25 2016 16:17:59.750.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 10.1.234.2
Oct 25 2016 16:17:59.750.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 3 (Link-State Req)
Oct 25 2016 16:17:59.750.5+00:00 R1 RM/6/RMDEBUG: Length: 156, Router: 10.0.1.1
Oct 25 2016 16:17:59.750.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 8b05
Oct 25 2016 16:17:59.750.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 16:17:59.750.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 16:17:59.750.9+00:00 R1 RM/6/RMDEBUG: # Requesting LSAs: 11
Oct 25 2016 16:17:59.750.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 16:17:59.750.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.2.2
Oct 25 2016 16:17:59.750.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.2.2
Oct 25 2016 16:17:59.750.13+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 16:17:59.750.14+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.1.1
Oct 25 2016 16:17:59.750.15+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.1.1
Oct 25 2016 16:17:59.750.16+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 16:17:59.750.17+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.4.4
Oct 25 2016 16:17:59.750.18+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.4.4
Oct 25 2016 16:17:59.750.19+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 16:17:59.750.20+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3
Oct 25 2016 16:17:59.750.21+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 16:17:59.750.22+00:00 R1 RM/6/RMDEBUG: LSA Type 2
Oct 25 2016 16:17:59.750.23+00:00 R1 RM/6/RMDEBUG: LS ID: 10.1.234.3
Oct 25 2016 16:17:59.750.24+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 16:17:59.750.25+00:00 R1 RM/6/RMDEBUG: LSA Type 3
Oct 25 2016 16:17:59.750.26+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.1.0
Oct 25 2016 16:17:59.750.27+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.1.1
Oct 25 2016 16:17:59.750.28+00:00 R1 RM/6/RMDEBUG: LSA Type 3
Oct 25 2016 16:17:59.750.29+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.35.0
Oct 25 2016 16:17:59.750.30+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 16:17:59.750.31+00:00 R1 RM/6/RMDEBUG: LSA Type 4
Oct 25 2016 16:17:59.750.32+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.5.5
Oct 25 2016 16:17:59.750.33+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 16:17:59.750.34+00:00 R1 RM/6/RMDEBUG: LSA Type 5
Oct 25 2016 16:17:59.750.35+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.5.0
Oct 25 2016 16:17:59.750.36+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.5.5
Oct 25 2016 16:17:59.750.37+00:00 R1 RM/6/RMDEBUG: LSA Type 5
Oct 25 2016 16:17:59.750.38+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.35.0
Oct 25 2016 16:17:59.750.39+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.5.5
Oct 25 2016 16:17:59.750.40+00:00 R1 RM/6/RMDEBUG: LSA Type 5
Oct 25 2016 16:17:59.750.41+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.35.3
Oct 25 2016 16:17:59.750.42+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.5.5
Then R1 receives the LS Request from R3.
<R1>
Oct 25 2016 16:30:10.80.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178024 Line: 2271 Level: 0x20
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0
<R1>
Oct 25 2016 16:30:10.80.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3
Oct 25 2016 16:30:10.80.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 10.1.234.1
Oct 25 2016 16:30:10.80.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 3 (Link-State Req)
Oct 25 2016 16:30:10.80.5+00:00 R1 RM/6/RMDEBUG: Length: 48, Router: 10.0.3.3
Oct 25 2016 16:30:10.80.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: c4c2
Oct 25 2016 16:30:10.80.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 16:30:10.80.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 16:30:10.80.9+00:00 R1 RM/6/RMDEBUG: # Requesting LSAs: 2
Oct 25 2016 16:30:10.80.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 16:30:10.80.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.1.1
Oct 25 2016 16:30:10.80.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.1.1
Oct 25 2016 16:30:10.80.13+00:00 R1 RM/6/RMDEBUG: LSA Type 3
Oct 25 2016 16:30:10.80.14+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.1.0
Oct 25 2016 16:30:10.80.15+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.1.1
Additional Experiments : Think and Verify
Assume that there is a router R6 in area 2. What is the difference between it calculating the routing information to reach the 10.0.5.0/24 network segment and the steps of R2 and R3 calculating the information?
When will type 4 LSA appear?
In the experiment, if both R1 and R4 are configured as DROther, what hidden dangers will there be?
final device configuration
<R1>display current-configuration
[V200R007C00SPC600]
#
sysname R1
#
interface GigabitEthernet0/0/0
ip address 10.1.234.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.1.1
area 0.0.0.0
network 10.1.234.1 0.0.0.0
area 0.0.0.2
network 10.0.1.1 0.0.0.0
#
return
<R2>display current-configuration
[V200R007C00SPC600]
#
sysname R2
#
interface GigabitEthernet0/0/0
ip address 10.1.234.2 255.255.255.0
ospf dr-priority 254
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.1.234.2 0.0.0.0
network 10.0.2.2 0.0.0.0
#
return
<R3>display current-configuration
[V200R007C00SPC600]
#
sysname R3
#
interface Serial3/0/0
link-protocol ppp
ip address 10.0.35.3 255.255.255.0
#
interface GigabitEthernet0/0/0
ip address 10.1.234.3 255.255.255.0
ospf dr-priority 255
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.1.234.3 0.0.0.0
network 10.0.3.3 0.0.0.0
area 0.0.0.1
network 10.0.35.3 0.0.0.0
#
return
<R4>display current-configuration
[V200R007C00SPC600]
#
sysname R4
#
interface GigabitEthernet0/0/0
ip address 10.1.234.4 255.255.255.0
ospf dr-priority 0
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.4.4
area 0.0.0.0
network 10.1.234.4 0.0.0.0
network 10.0.4.4 0.0.0.0
#
return
<R5>display current-configuration
[V200R007C00SPC600]
#
sysname R5
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.35.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.0
#
ospf 1 router-id 10.0.5.5
import-route direct
area 0.0.0.1
network 10.0.35.5 0.0.0.0
#
return