7 - Implement Multiarea OSPF
7 - Implement Multiarea OSPF
7 - Implement Multiarea OSPF
com/content/xtrac/2
Cisco IOS Software sequentially evaluates the ip-address wildcard-mask pair that is specified in the network command for each interface as follows:
It performs a logical OR operation between the wildcard-mask argument and the interface primary IP address.
It performs a logical OR operation between the wildcard-mask argument and the ip-address argument in the network command.
The software compares the two resulting values. If they match, OSPF is enabled on the associated interface and this interface is attached to the specified OSPF area
The area-id identifier is a 32-bit number that may be represented in integer or dotted-decimal format. If represented in dotted-decimal format, the area-id identifier does not represent the IP address, but it is only a
way of writing the same number in integer format. For example, you may specify that an interface belongs to Area 1 using area 1 or area 0.0.0.1 notation in the network command. To establish OSPF full
adjacency, two neighbor routers must be in the same area. Any individual interface can be only attached to a single area. If the address ranges specified for different areas overlap, Cisco IOS Software will adopt
the first area in the network command list and ignore subsequent overlapping portions. You must pay special attention to ensure that address ranges do not overlap to avoid conflicts.
After entering the first network command, you should receive two console messages indicating that R4 and R5 are now OSPF neighbors.
Step 2: Configure OSPF on WAN and LAN interfaces on R2 and R3. On R2, use process ID number 2, and use the OSPF network command for both directly connected networks. On R3, use process ID number
3 and use the network command for the Ethernet WAN link, and the OSPF interface configuration method for Loopback 0.
R2# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)# router ospf 2
R2(config-router)# network 172.16.12.0 0.0.0.3 area 1
*Jun 18 08:03:01.831: %OSPF-5-ADJCHG: Process 2, Nbr 1.1.1.1 on Serial0/0 from LOADING to FULL, Loading Done
R2(config-router)# network 192.168.2.0 0.0.0.255 area 1
R3# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)# router ospf 3
R3(config-router)# network 172.16.13.2 0.0.0.0 area 2
*Jun 18 08:03:47.007: %OSPF-5-ADJCHG: Process 3, Nbr 1.1.1.1 on Ethernet0/0 from LOADING to FULL, Loading Done
R3(config-router)# interface Loopback 0
R3(config-if)# ip ospf 3 area 2
Notice the use of the 0.0.0.0 wildcard mask with the network command on R3. This mask indicates that only the interface with the specific IP address listed will be enabled for OSPF.
Another method exists for enabling OSPF on an interface. R3’s loopback 0 interface is included in area 2 by using the ip ospf process-id area area-id command. This method explicitly adds the interface to area 2
without the use of the network command. This capability simplifies the configuration of unnumbered interfaces with different areas and ensures that any new interfaces brought online would not automatically be
included in the routing process. This configuration method is also used for OSPFv3 since that routing protocol doesn’t allow the use of the network statement.
Notice that since OSPF is already enabled on R1, a neighbor adjacency is formed with that router when the network commands are entered on R2 and R3.
Step 3: On R1, R2 and R3, configure the OSPF router ID using the router-id command. Use ID 1.1.1.1 for R1, 2.2.2.2 for R2 and 3.3.3.3 for R3.
R1(config-router)# router-id 1.1.1.1
% OSPF: Reload or use "clear ip ospf process" command, for this to take effect
R2(config-router)# router-id 2.2.2.2
% OSPF: Reload or use "clear ip ospf process" command, for this to take effect
R3(config-router)# router-id 3.3.3.3
% OSPF: Reload or use "clear ip ospf process" command, for this to take effect
The OSPF router ID is a fundamental parameter when you want to run the OSPF process. To start the OSPF process, Cisco IOS Software must be able to identify a unique router ID. At least one primary IP
address on an interface in the up/up state must be configured for the router to be able to choose the router ID, otherwise an error message is logged and the OSPF process does not start.
To choose the OSPF router ID at the time of OSPF process initialization, the router uses the following criteria:
Use the router ID specified in the router-id ip-address command. You can configure an arbitrary value in the IP address format, but this value must be unique. If the IP address that is specified with the router-id
command overlaps with the router ID of another already active OSPF process, the router-id command fails.
Use the highest IP address of all active loopback interfaces on the router.
Use the highest IP address among all active nonloopback interfaces.
After the three-step OSPF router ID selection process has ended, and if the router is still not able to select an OSPF router ID, an error message will be logged. An OSPF process that failed to select a router ID,
retries the selection process every time that an IP address becomes available, the interface changes its state to up/up, or, an IP address is configured on the interface.
Step 4: Start by clearing the OSPF routing process on R2 and R3 to allow the manually configured router ID to take effect.
R2# clear ip ospf process
Reset ALL OSPF processes? [no]: yes
R2#
*Jun 19 06:46:05.008: %OSPF-5-ADJCHG: Process 2, Nbr 172.16.145.1 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Jun 19 06:46:05.042: %OSPF-5-ADJCHG: Process 2, Nbr 172.16.145.1 on Serial0/0 from LOADING to FULL, Loading Done
R3# clear ip ospf 3 process
Reset OSPF process 3? [no]: yes
R3#
*Jun 19 06:47:05.485: %OSPF-5-ADJCHG: Process 3, Nbr 172.16.145.1 on Ethernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Jun 19 06:47:05.487: %OSPF-5-ADJCHG: Process 3, Nbr 172.16.145.1 on Ethernet0/0 from LOADING to FULL, Loading Done
Once an OSPF router ID is selected, it is not changed, even if the interface that is used to select it changes its operational state or IP address. To change the OSPF router ID, you must reset the OSPF process with
the clear ip ospf process command or reload the router.
In production networks, the OSPF router ID cannot be changed easily. Change of the OSPF router ID requires reset of all OSPF adjacencies, resulting in a temporary routing outage. The router also must originate
new copies of all its own LSAs with the new router ID.
You can either clear the specific OSPF process by specifying the process ID, or you can reset all OSPF processes using the clear ip ospf process command.
When the clear ip ospf process command is entered on R2 and R3, notice that the router ID being advertised by R1 is 172.16.145.1. R1 has no loopback interfaces and it didn’t have a manually configured router
ID when the OSPF process was enabled. R1 chose the highest IP address among all active nonloopback interfaces as its initial router ID.
Step 5: Clear the OSPF routing process on R1 to allow the manually configured router ID to take effect.
R1# clear ip ospf process
Reset ALL OSPF processes? [no]: yes
R1#
*Jun 19 06:50:49.113: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Ethernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached
*Jun 19 06:50:49.113: %OSPF-5-ADJCHG: Process 1, Nbr 5.5.5.5 on Ethernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached
*Jun 19 06:50:49.146: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial2/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Jun 19 06:50:49.183: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on Ethernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Jun 19 06:50:49.194: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on Ethernet0/0 from LOADING to FULL, Loading Done
R1#
*Jun 19 06:50:49.194: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Ethernet0/1 from LOADING to FULL, Loading Done
*Jun 19 06:50:49.194: %OSPF-5-ADJCHG: Process 1, Nbr 5.5.5.5 on Ethernet0/1 from LOADING to FULL, Loading Done
*Jun 19 06:50:49.215: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial2/0 from LOADING to FULL, Loading Done
The OSPF neighbor adjacencies messages show that all routers are now using manually configured router IDs.
Note
You might notice a console message on R2 or R3 indicating that the 172.16.145.1 neighbor is down because the Dead timer is expired. This occurrence is normal OSPF behavior and allows the neighbor table to
flush incorrect entries since R1 is now using the 1.1.1.1 router ID instead.
The command show ip ospf neighbor displays OSPF neighbor information on a per-interface basis. The significant fields of the output are as follows:
Step 3: Verify OSPF enabled interfaces on R2 and R3 using the show ip ospf interface command.
R2# show ip ospf interface
Loopback0 is up, line protocol is up
Internet Address 192.168.2.1/24, Area 1, Attached via Interface Enable
Process ID 2, Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 1
<…output omitted…>
Serial0/0 is up, line protocol is up
Internet Address 172.16.12.2/30, Area 1, Attached via Network Statement
Process ID 2, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 64
<…output omitted…>
R3# show ip ospf interface
Loopback0 is up, line protocol is up
Internet Address 192.168.3.1/24, Area 2, Attached via Network Statement
Process ID 3, Router ID 3.3.3.3, Network Type LOOPBACK, Cost: 1
<…output omitted…>
Ethernet0/0 is up, line protocol is up
Internet Address 172.16.13.2/30, Area 2, Attached via Network Statement
Process ID 3, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 10
<…output omitted…>
The output of the show ip ospf interface command shows you all interfaces that are enabled in the OSPF process. For each enabled interface, you can see detailed information such as OSPF area ID, OSPF
process ID, and how the interface was included into the OSPF process. In the output, you can see that both interfaces on R3 were included via the network statement, which is configured with the network
command. R2 shows that Loopback 0 was included via the explicit interface configuration method, and Serial 0/0 was included via the network statement.
Step 4: Verify OSPF routes in the routing table on R5 using the show ip route ospf command.
R5# show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Area BACKBONE(0)
The following is a summary of the states that an interface passes through before establishing as adjacency with another router:
Step 6: Observe the OSPF neighbor adjacency formation and OSPF packet types on R3 using the debug ip ospf adj and clear ip ospf process commands. Disable debug when the OSPF session is re-established.
R3# debug ip ospf adj
OSPF adjacency debugging is on
Multiaccess networks, either broadcast (such as Ethernet) or nonbroadcast (such as Frame Relay), represent interesting issues for OSPF. All routers sharing the common segment will be part of the same IP subnet.
When forming adjacency on a multiaccess network, every router will try to establish full OSPF adjacency with all other routers on the segment. This behavior may not represent an issue for the smaller multiaccess
broadcast networks, but it may represent an issue for the NBMA, where, usually, you do not have full-mesh PVC topology. This issue in NBMA networks manifests itself in the inability for neighbors to synchronize
their OSPF databases directly among themselves. A logical solution, in this case, is to have a central point of OSPF adjacency responsible for the database synchronization and advertisement of the segment to the
other routers.
As the number of routers on the segment grows, the number of OSPF adjacencies increases exponentially. Every router must synchronize its OSPF database with every other router, and in the case of many routers on
segment, this behavior leads to inefficiency. Another issue arises when every router on the segment advertises all its adjacencies to other routers in the network. If you have full-mesh OSPF adjacencies, the other
OSPF routers will receive a large amount of redundant link-state information. The solution for this problem is again to establish a central point with which every other router forms an adjacency, and which advertises
the segment to the rest of the network.
The routers on the multiaccess segment elect a DR and a BDR that centralize communication for all routers that are connected to the segment. The DR and BDR improve network functionality in the following ways:
Reducing routing update traffic: The DR and BDR act as a central point of contact for link-state information exchange on a multiaccess network. Therefore, each router must establish a full adjacency with the
DR, and the BDR. Each router, rather than exchanging link-state information with every other router on the segment, sends the link-state information to the DR and BDR only by using the dedicated multicast
address 224.0.0.6. The DR represents the multiaccess network in the sense that it sends link-state information from each router to all other routers in the network. This flooding process significantly reduces the
router-related traffic on the segment.
Managing link-state synchronization: The DR and BDR ensure that the other routers on the network have the same link-state information about the common segment. In this way, the DR, and BDR reduce the
number of routing errors.
When the DR is operating, the BDR does not perform any DR functions. Instead, the BDR receives all the information, but the DR performs the LSA forwarding and LSDB synchronization tasks. The BDR performs
the DR tasks only if the DR fails. When the DR fails, the BDR automatically becomes the new DR, and a new BDR election occurs.
Step 1: Examine the DR/BDR status on R1, R4, and R5 using the show ip ospf neighbor command.
Routers R1, R4, and R5 are all connected to the same shared network segment, where OSPF will automatically try to optimize adjacencies.
R1# show ip ospf neighbor
One of the fields in the OSPF hello packet that is used in the DR/BDR election process is the Router Priority field. Every broadcast and nonbroadcast multiaccess OSPF-enabled interface has an assigned priority
value, which is a number between 0 and 255. By default, in Cisco IOS Software, the OSPF interface priority value is 1. You can manually change it using either the ip ospf priority interface level command. To elect
a DR, and BDR, the routers view the OSPF priority value of other routers during the hello packet exchange process and then use the following conditions to determine which router to select:
The router with the highest priority value is elected as the DR.
The router with the second-highest priority value is the BDR.
If there is a tie, where two routers have the same priority value, the router ID is used as the tie-breaker. The router with the highest router ID becomes the DR. The router with the second-highest router ID becomes
the BDR.
A router with a priority that is set to 0 cannot become the DR or BDR. A router that is not the DR or BDR is called a DROTHER.
Step 4: On R1, configure OSPF priority using ip ospf priority interface level command. Clear the OSPF process on R4 to re-initiate the DR/BDR election process.
Setting the OSPF interface priority globally to a value higher than 1 will influence the DB/BDR election in favor of R1.
R1(config)# interface ethernet 0/1
R1(config-if)# ip ospf priority 100
R4# clear ip ospf process
Reset ALL OSPF processes? [no]: yes
*Dec 10 13:08:48.610: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Dec 10 13:08:48.610: %OSPF-5-ADJCHG: Process 1, Nbr 5.5.5.5 on Ethernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Dec 10 13:09:01.294: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet0/0 from LOADING to FULL, Loading Done
*Dec 10 13:09:04.159: %OSPF-5-ADJCHG: Process 1, Nbr 5.5.5.5 on Ethernet0/0 from LOADING to FULL, Loading Done
In this step, you set the OSPF interface priority value to 100. In this way, you influence the DR/BDR election and the R1 router will become the DR after you clear the OSPF process on the current DR, R4.
Step 5: On R1, verify that it has been elected as a new DR by entering the show ip ospf interface Ethernet 0/1 command.
R1# show ip ospf interface ethernet 0/1
Ethernet0/1 is up, line protocol is up
Internet Address 172.16.145.1/29, Area 0, Attached via Network Statement
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Topology-MTID Cost Disabled Shutdown Topology Name
0 10 no no Base
Transmit Delay is 1 sec, State DR, Priority 100
Designated Router (ID) 1.1.1.1, Interface address 172.16.145.1
Backup Designated router (ID) 5.5.5.5, Interface address 172.16.145.5
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/3, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 5
Last flood scan time is 0 msec, maximum is 1 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 4.4.4.4
Adjacent with neighbor 5.5.5.5 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
The output of the show ip ospf interface command on R1 shows that R1 is elected as the DR, and R5 is elected as the BDR. R1 is fully adjacent with two neighbors, R4 and R5.
Step 6: On R4 and R5, set the OSPF priority on the Ethernet 0/0 interfaces to 0 using the ip ospf priority level command.
R4(config)# interface ethernet 0/0
R4(config-if)# ip ospf priority 0
R5(config)# interface ethernet 0/0
R5(config-if)# ip ospf priority 0
Setting the OSPF priority to a value of 0 on the Ethernet 0/0 interfaces of R4 and R5 causes these two routers to not participate in DR/BDR election. They will not be eligible to become DR/BDR. Such routers
will have the DROTHER function.
Step 7: Verify DR/BDR status on R1, R4, and R5.
R1# show ip ospf neighbor
The IP MTU parameter determines the maximum size of the IP packet that can be forwarded out the interface without the fragmentation. If a packet with an IP MTU larger than the maximum arrives at the router
interface, it will either be discarded if the DF bit in the packet header is set, or it will be fragmented. OSPF packets completely rely on IP for the possible fragmentation. Although RFC 2328 does not recommend
OSPF packet fragmentation, there may arise a situation in which the size of the OSPF packet has greater value than the interface IP MTU. If MTUs are mismatched between two neighbors, this condition can
introduce issues with the exchange of link-state packets, resulting in continuous retransmissions.
To prevent such issues, OSPF requires that the same IP MTU is configured on both sides of the link. If neighbors have mismatched IP MTU configured, they will not be able to form full OSPF adjacency. They will
be stuck in the EXSTART adjacency state.
Step 1: Change the IP MTU size on R3 Ethernet0/0 interface to 1400.
R3(config)# interface ethernet 0/0
R3(config-if)# ip mtu 1400
You have changed the IP MTU size on the R3 Ethernet 0/0 interface to create a mismatch between IP MTU sizes on the link between R3 and R1. This mismatch will generate a situation in which R3 and R1 are
not able to synchronize their OSPF databases and a new full adjacency between them will never be established.
Step 2: Enable debugging of the OSPF adjacency on R3, using the debug ip ospf adj command. Clear the OSPF process to reset the adjacency and disable debug when the OSPF session is re-established.
R3# debug ip ospf adj
R3# clear ip ospf process
Reset ALL OSPF processes? [no]: yes
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: Interface going Up
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: 2 Way Communication to 1.1.1.1, state 2WAY
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: Backup seen event before WAIT timer
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: DR/BDR election
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: Elect BDR 3.3.3.3
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: Elect DR 1.1.1.1
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: Elect BDR 3.3.3.3
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: Elect DR 1.1.1.1
*Jan 19 17:37:05.969: OSPF-3 ADJ Et0/0: DR: 1.1.1.1 (Id) BDR: 3.3.3.3 (Id)
*Jan 19 17:37:05.970: OSPF-3 ADJ Et0/0: Nbr 1.1.1.1: Prepare dbase exchange
*Jan 19 17:37:05.970: OSPF-3 ADJ Et0/0: Send DBD to 1.1.1.1 seq 0x21D6 opt 0x52 flag 0x7 len 32
*Jan 19 17:37:05.970: OSPF-3 ADJ Et0/0: Rcv DBD from 1.1.1.1 seq 0x968 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Jan 19 17:37:05.970: OSPF-3 ADJ Et0/0: Nbr 1.1.1.1 has larger interface MTU
*Jan 19 17:37:05.970: OSPF-3 ADJ Et0/0: Rcv DBD from 1.1.1.1 seq 0x21D6 opt 0x52 flag 0x2 len 112 mtu 1500 state EXSTART
*Jan 19 17:37:05.970: OSPF-3 ADJ Et0/0: Nbr 1.1.1.1 has larger interface MTU
R3# no debug ip ospf adj
The DBD packet carries information about the largest non-fragmented packet that can be sent from the neighbor. In this situation, IP MTU values on different sides of the link are not equal. R3 will receive a DBD
packet with an IP MTU size 1500, which is greater than its own MTU size of 1400. This condition will result in the inability of both R3 and R1 to establish full neighbor adjacency, and the output of the debug
command will display "Nbr has larger interface MTU” message. Mismatched neighbors will stay in EXSTART state. To form full OSPF adjacency, IP MTU needs to match on both sides of the link.
Step 3: Verify the OSPF neighbor state on R3 and R1.
R3# show ip ospf neighbor
Like EIGRP, OSPF uses two timers to check neighbor reachability. These two timers are named hello and dead intervals. The values of the hello and dead intervals are carried in the OSPF hello packet, which serves
as a keepalive message with the purpose of acknowledging the router presence on the segment. The hello interval specifies the frequency of sending OSPF hello packets in seconds. The SPF dead timer specifies how
long a router waits to receive a hello packet before it declares the neighbor router down.
OSPF requires that both the hello and dead timers are identical for all routers on the segment to become OSPF neighbors. The default value of the OSPF hello timer on multiaccess broadcast and point-to-point links
is 10 seconds and on all other network types, including nonbroadcast (NBMA), is 30 seconds. Once you set up the hello interval, the default value of the dead interval will automatically be four times the hello
interval. For broadcast and point-to-point links, it is 40 seconds and for all other OSPF network types, it is 120 seconds.
To detect faster topological changes, you can lower the value of the OSPF hello interval, with the downside of having more routing traffic on the link.
To investigate the mismatch of the hello timers, use the debug ip ospf hello command.
Step 1: On R1, investigate hello and dead timer values on Ethernet 0/1 and Serial 2/0 interfaces, using the show ip ospf interface command.
R1# show ip ospf interface Ethernet 0/1
Ethernet0/1 is up, line protocol is up
Internet Address 172.16.145.1/29, Area 0, Attached via Network Statement
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Topology-MTID Cost Disabled Shutdown Topology Name
0 10 no no Base
Transmit Delay is 1 sec, State DROTHER, Priority 1
Designated Router (ID) 5.5.5.5, Interface address 172.16.145.5
Backup Designated router (ID) 4.4.4.4, Interface address 172.16.145.4
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
<…output omitted…>