This chapter covers the following topics:
Open Shortest Path First (OSPF) is a link-state routing protocol that provides every router with a complete map for all destination networks. Every router in the network calculates the best, shortest, loop-free paths using this complete map of the network.
This chapter focuses on identifying and troubleshooting issues that are caused with forming OSPF neighbor adjacency, path selection, and missing routes.
OSPF advertises link-state advertisements (LSA) that contain the link state and metric to neighboring routers. Received LSAs are stored in a local database called the link-state database (LSDB), which are then advertised to neighboring routers exactly as the LSAs were received. The same LSA is flooded throughout the OSPF area just as the advertising router advertised it. The LSDB provides the topology of the network, in essence providing the router a complete map of the network.
All routers run the Dijkstra Shortest Path First (SPF) algorithm to construct a loop-free topology of shortest paths. Each router sees itself as the top of the tree, and the tree contains all network destinations within the OSPF domain. The SPF Tree (SPT) is different for each OSPF router, but the LSDB used to calculate the SPT is identical for all OSPF routers in that area.
OSPF runs on its own protocol (89) and multicast where possible to reduce unnecessary traffic. The two OSPF multicast addresses are as follows:
AllSPFRouters: IPv4 Address 224.0.0.5 or MAC 01:00:5E:00:00:05
All routers running OSPF should be able to receive these packets.
AllDRouters: IPv4 Address 224.0.0.6 or MAC 01:00:5E:00:00:06
Communication with Designated Routers uses this address.
Within the OSPF protocol are five types of packets. Table 8-1 provides an overview of the OSPF packet types and a brief description for each type.
Type |
Packet Name |
Functional Overview |
1 |
Hello |
Discover & Maintain neighbors Packets are sent out periodically on all OSPF interfaces to discover new neighbors while ensuring other neighbors are still online. |
2 |
Database Description (DBD) or (DDP) |
Summarize Database Contents Packets are exchanged when an OSPF adjacency is first being formed. These packets are used to describe the contents of the LSDB. |
3 |
Link State Request (LSR) |
Database Download When a router thinks that part of its LSDB is stale, it may request a portion of a neighbor’s database using this packet type. |
4 |
Link State Update (LSU) |
Database Update This is an explicit LSA for a specific network link and normally is sent in direct response to a LSR. |
5 |
Link State Ack |
Flooding Acknowledgement These packets are sent in response to the flooding of LSAs, therefore making the flooding a reliable transport feature. |
OSPF Hello packets are responsible for discovering and maintaining neighbors. In most instances, the router sends Hello packets to the AllSPFRouters address (224.0.0.5). Table 8-2 provides a listing of some of the data contained within an OSPF Hello packet.
Data Field |
Description |
Router-ID (RID) |
A unique 32-bit ID within an OSPF domain. |
Authentication Options |
Allows secure communication between OSPF routers to prevent malicious activity. Options are None, Clear Text, or MD5. |
Area-ID |
OSPF area that the OSPF interface belongs to. It is a 32-bit number that can be written in dotted decimal format (0.0.1.0) or decimal (256). |
Interface Address Mask |
The network mask for the primary IP for the interface that the Hello is sent out. |
Interface Priority |
Router Interface priority for Designated Router elections. |
Hello Interval |
Time span, in seconds, that a router sends out Hello packets on the interface. |
Dead Interval |
Time span, in seconds, that a router will wait to hear a Hello from a neighbor router before it declares that router Down. |
Designated Router & Backup Designated Router |
IP address of the Designated Router & Backup Designated Router for that network link. |
Active Neighbor |
A list of OSPF neighbors seen on that network segment. Must have received a Hello from the neighbor within the Dead Interval. |
An OSPF neighbor is a router that shares a common OSPF-enabled network link. OSPF routers discover other neighbors via the OSPF Hello packets. An adjacent OSPF neighbor is an OSPF neighbor that shares a synchronized OSPF database between the two neighbors.
Each OSPF process maintains a table for adjacent OSPF neighbors and the state of each router. Table 8-3 provides an overview of the OSPF neighbor states.
State |
Description |
Down |
Initial state of a neighbor relationship. It indicates that it has not received any LSAs from that router. |
Attempt |
This state is relevant to nonbroadcast multiple access (NBMA) networks that do not support broadcast and require explicit neighbor configuration. This state indicates that no recent information has been received, but the router is still attempting communication. |
Init |
A Hello packet has been received from another a router, but bidirectional communication has not been established. |
2-Way |
Bidirectional communication has been established. If a Designated Router or Backup Designated Router is needed, the election occurs during this state. |
ExStart |
This is the first state of forming an adjacency. Routers identify which router will be the master or slave for the LSDB synchronization. |
Exchange |
During this state, routers are exchanging link-states and via DBD packets. |
Loading |
LSR packets are sent to the neighbor asking for the more recent LSAs that have been discovered (but not received) in the Exchange state. |
Full |
Neighboring routers are fully adjacent. |
Multi-access networks such as Ethernet (LANs) allow more than two routers to exist on a network segment. This could cause scalability problems with OSPF as the number of routers on a segment increases. Additional routers flood more LSAs on the segment, and OSPF traffic becomes excessive as OSPF neighbor adjacencies increase. If 6 routers share the same multi-access network, 15 OSPF adjacencies would form along with 15 occurrences of database flooding on that one network.
Multi-access networks overcome this inefficiency by using a Designated Router (DR). DRs reduce the number of OSPF adjacencies on a multi-access network segment because routers only form a full OSPF adjacency with the DR and not each other. The DR is then responsible for flooding the update to all OSPF routers on that segment as updates occur.
If the DR fails, OSPF must form new adjacencies invoking all new LSAs and could potentially cause a temporary loss of routes. In the event of DR failure, a Backup Designated Router (BDR) becomes the new DR; then an election occurs to replace the BDR. To minimize transition time, the BDR also forms a full OSPF adjacency with all OSPF routers on that segment.
The DROther is a router on the DR-enabled segment that is not the DR or the BDR; it is simply the other router.
Note
Neighbors are selected as the DR and BDR based on the highest OSPF priority, followed by higher Router ID (RID) when the priority is a tie. The OSPF priority is set on an interface with the command ip ospf priority 0-255. Setting the value to zero prevents that router from becoming a DR for that segment.
OSPF provides scalability for the routing table by using multiple OSPF areas with the routing domain. Each OSPF area provides a collection of connected networks and hosts that are grouped together. OSPF uses a two-tier hierarchical architecture where Area 0 is a special area known as the backbone, and all other OSPF areas must connect to Area 0. In other words, Area 0 provides transit connectivity between nonbackbone areas. Nonbackbone areas advertise routes into the backbone, and the backbone then advertises routes into other nonbackbone areas.
The exact topology of the area is invisible from outside of the area while still providing connectivity to routers outside of the area. This means that routers outside the area do not have a complete topological map for that area, which reduces OSPF network traffic in that area. By segmenting an OSPF routing domain into multiple areas, it is no longer true that all OSPF routers will have identical LSDBs; however, all routers within the same area will have identical area LSDBs. The reduction in routing traffic uses less router memory and resources providing scalability.
Area Border Routers (ABR) are OSPF routers connected to Area 0 and another OSPF area. ABRs are responsible for advertising routes from one area and injecting them into a different OSPF area. Every ABR needs to participate in Area 0; otherwise, routes do not advertise into another area.
When a router redistributes external routes into an OSPF domain, the router is called an Autonomous System Boundary Router (ASBR). An ASBR can be any OSPF router, and the ASBR function is independent of the ABR function.
Understanding how OSPF builds a topology table and the how various link state advertisement (LSA) types function helps with troubleshooting missing routes. Table 8-4 provides a summary of the OSPF LSAs discussed.
LSA Type |
Description |
1 |
Router Link—Every OSPF router advertises a Type-1 LSA. Type-1 LSAs are the most basic LSA within the LSDB. A Type-1 LSA entry exists for all OSPF enabled links (that is, interfaces) and reflects an actual network. Router links are classified either as either stub or transit. A stub router link includes a netmask, whereas a transit link does not. |
2 |
Network Link—Type-2 LSAs represent multi-access network segments that use a DR. The DR always advertises the Type-2 LSA, and connects the Type-1 transit link type LSAs together. Type-2 LSAs also provide the network mask for the Type-1 transit link types. |
|
If a DR has not been elected, a Type-2 LSA is not present in the LSDB because the corresponding Type-1 transit link type LSA will be a stub. Type-2 LSAs are not flooded outside of the originating OSPF area in an identical fashion to Type-1 LSAs. |
3 |
Summary Link—The role of the ABRs is to participate in multiple OSPF areas and ensure that the networks associated with Type-1 LSAs are reachable in the non-originating OSPF area. ABRs do not forward Type-1 or Type-2 LSAs into other areas. When an ABR receives a Type-1 LSA, it creates a Type-3 LSA referencing the network in the original Type-1 LSA. A Type-2 LSA is used to determine the network mask of a multi-access network. The ABR then advertises the Type-3 LSA into other areas. If an ABR receives a Type-3 LSA from Area 0 (backbone), it generates a new Type-3 LSA for the nonbackbone area, but lists itself as the advertising router. |
4 |
ASBR Summary—Type-4 LSAs locate the ASBR for Type-5 LSAs. A Type-5 LSA is flooded through the OSPF domain unmodified, and the only mechanism to identify the ASBR is the RID. Routers examine the Type-5 LSA, check to see if the RID is in the local area, and if it is not, they require a mechanism to locate the ASBR. Only Type-1 or Type-2 LSAs provide a method to locate the RID within an area. The Type-4 LSA provides a way for routers to locate the ASBR when the router is in a different area from the ASBR. |
5 |
AS External—When a route is redistributed into OSPF on the ASBR, the external route is flooded throughout the entire OSPF domain as a Type-5 LSA. Type-5 LSAs are not associated to a specific area and are flooded across all ABRs. Only the LSA age is modified during flooding. |
7 |
NSSA External—Not So Stubby Areas (NSSA) areas are a method to reduce the LSDB within an area by preventing Type-4 and Type-5 LSAs while allowing redistribution of networks into the area. A Type-7 LSA exists only in NSSA areas where the route redistribution is occurring. An ASBR injects external routes as Type-7 LSAs into an NSSA area. The ABR does not advertise Type-7 LSAs outside of the originating NSSA area, but advertises a Type-5 LSA for the other OSPF areas. If the Type-5 LSA crosses Area 0, then the second ABR creates a Type-4 LSA for the Type-5 LSA. |
Note
Every LSA contains the advertising router’s RID. The router RID represents the router and is how links are connected to each other.
Figure 8-1 displays a multi-area OSPF topology with an external route redistributed into Area 56. On the left of the figure is the network prefix for the topology, and the appropriate LSA type is displayed underneath the segment it is advertised. This demonstrates where each LSA is located. Notice that Area 1234 is a broadcast area and contains a DR, which generates a Type-2 LSA. NX-6 is redistributing the 100.65.0.0/16 network into OSPF, whereas NX-5 advertises the first Type-4 LSA for the ASBR (NX-6).
Note
The Cisco Press book IP Routing on Cisco IOS, IOS XE and IOS XR describes OSPF LSAs and how a router builds the actual topology table using LSAs in a visual manner.
OSPF classifies routes into the following three categories:
Intra-area routes: Routes for networks that exist in that OSPF area and contain intra beside them in the routing table.
Inter-area routes: Routes for networks that exist in the OSPF domain from a different OSPF area and contain inter beside them in the routing table.
External routes: Routes that were redistributed into the OSPF domain and contain a type-1 or type-2 beside them in the routing table.
Example 8-1 displays the routing table from NX-1 from Figure 8-1 that includes intra-area, inter-area, and external OSPF routes.
Now that an overview of the OSPF protocol has been provided, let’s review how OSPF is configured and how to troubleshoot OSPF neighbor adjacencies for NX-OS.
The OSPF configuration process on a NX-OS switch requires configuration under the OSPF process and under the interface configuration submode. The following steps explain the process for configuring OSPF on a NX-OS device:
Step 1. Enable the OSPF feature. The OSPF feature must be enabled with the global configuration command feature ospf.
Step 2. Define an OSPF process tag. The OSPF process must be defined with the global configuration command router ospf process-tag. The process-tag can be up to 20 alphanumeric characters in length.
Step 3. Enable OSPF neighbor logging (recommended). NX-OS does not log OSPF neighbor adjacencies forming or dissolving by default. The OSPF configuration command log-adjacency-changes [detail] enables logging and is recommended. The optional detail keyword lists out the OSPF neighbor states from Table 8-3 as they are entered.
Step 4. Define the Router-ID (recommended). The OSPF Router-ID (RID) is a 32-bit unique number that identifies an OSPF router and is synonymous with the term Neighbor ID. The RID must be unique for each OSPF process in an OSPF domain as it is used to build the topology table. The command router-id router-id is used to statically set the RID.
If the RID is not manually configured, the Loopback 0 IP address is always preferred. If the Loopback 0 does not exist, NX-OS selects the IP address for the first loopback interface in the configuration. If no loopback interfaces exist, NX-OS selects the IP address for the first physical interface in the configuration.
Step 5. Enable OSPF on interfaces. The interface that OSPF is enabled on is selected with the command interface interface-id. The OSPF process is then enabled on that interface with the command ip router ospf process-tag area area-id. The area-id can be entered in decimal format (1-65,536) or dotted-decimal format, but it is always stored in dotted decimal format.
Secondary networks are advertised by default after OSPF is enabled on that interface. This behavior is disabled with the command ip router ospf process-tag area area-id secondaries none.
Loopback interfaces are advertised as a /32 regardless of the actual subnet mask. The command ip ospf advertise-subnet changes the behavior so that the subnet mask is advertised with the LSA.
Note
Typically, an interface can exist in only one area at a time. However, recent changes allow an interface to exist in multiple areas across only point-to-point OSPF links with the command ip router ospf process-tag multi-area area-id.
The configuration in Example 8-2 enables OSPF only on interfaces Ethernet1/1, VLAN 10, and Loopback 0.
OSPF requires a neighbor relationship to form before routes are processed and added to the RIB. The neighbor adjacency table is vital for tracking neighbor status and the updates sent to each neighbor. This section explains the process for troubleshooting OSPF neighbor adjacencies on NX-OS switches.
Figure 8-2 provides a simple topology with two Nexus switches that are used to explain how to troubleshoot OSPF adjacency problems.
First, verify devices that have successfully established an OSPF adjacency with the command show ip ospf neighbors [interface-id [detail | summary] | neighbor-id [detail] | vrf {vrf-name | all}] [summary]. The summary keyword displays the count of OSPF neighbors and the interface that those neighbors are associated with.
Example 8-3 demonstrates a couple iterations of the command being run on NX-1. Notice the additional information like Dead timer and last change that is included with the detail keyword.
Table 8-5 provides a brief overview of the fields that appear in Example 8-3.
Field |
Description |
Neighbor ID |
Router-ID (RID) of neighboring router. |
PRI |
Priority for the neighbor’s interface. This is used for DR/BDR elections. |
State |
The first field is the neighbor state as described in Table 8-3. The second field is the DR, BDR, or DROther role if the interface requires a DR. For non-DR network links, the second field will show ‘-'. Looking at an OSPF neighbor’s state is helpful when troubleshooting adjacency issues. Depending on the LSDB size, the state may transition faster than you can see. |
Dead Time |
Dead time left until the router is declared unreachable. |
Address |
Primary IP address for the OSPF neighbor. |
Interface |
Local interface that the OSPF neighbor is attached to. |
Besides enabling OSPF on the network interfaces of an NX-OS device, the following parameters must match for the two routers to become neighbors:
Interfaces must be Active.
Connectivity between devices must exist using the primary subnet.
Maximum transmission unit (MTU) matches between devices.
Router-IDs are unique.
Interface area must match.
OSPF stub area flags match.
Need for DR matches based on OSPF network types.
OSPF Hello and Dead Timers match.
Authentication parameters.
If a neighbor adjacency is missing, it is important to verify that the correct interfaces are running OSPF. The command show ip ospf interface [brief] shows the OSPF-enabled interfaces. Example 8-4 provides output for the brief version of the commands.
Table 8-6 provides an overview of the fields in the output from Example 8-3.
Field |
Description |
Interface |
Interfaces with OSPF enabled. |
Area |
The Area that this interface is associated with. Area is always displayed in dotted-decimal format. |
Cost |
Cost is used to calculate a metric for a path by the SPF algorithm. |
State |
Current interface state DR, BDR, DROTHER, LOOP, or Down. |
Neighbor |
Number of neighbor OSPF routers for a segment that have established an adjacency. |
Status |
The protocol line status for that interface. A down value reflects an interface that is not reachable. |
Example 8-5 displays the output of the show ip ospf interface command in nonbrief format. It is important to note that the primary IP address, interface network type, DR, BDR, and OSPF interface timers are included as part of the information provided.
Some network topologies require advertising a network segment into OSPF, but need to prevent neighbors from forming adjacencies on that segment. A passive interface is displayed when displaying the OSPF interfaces, so the quickest method is to check the OSPF process with the command show ip ospf [process-tag] to see whether any passive interfaces are configured. Example 8-6 displays the command and where the passive interface count is provided.
Now that a passive interface has been identified, the configuration must be examined for the following:
The interface parameter command ip ospf passive-interface, which makes only that interface passive.
The global OSPF configuration command passive-interface default, which makes all interfaces under that OSPF process passive. The interface parameter command no ip ospf passive-interface takes precedence over the global command and makes that interface active.
Example 8-7 displays the configuration on NX-1 and NX-2 that prevents the two Nexus switches from forming an OSPF adjacency. The Ethernet1/1 interfaces must be active on both switches for an adjacency to form. Move the command ip ospf passive-interface from Eth1/1 to VLAN10 on NX-1, and the command no ip ospf passive-interface from VLAN20 to Interface Eth1/1 on NX-2 to allow an adjacency to form.
A vital step in troubleshooting OSPF adjacency issues is to ensure that a device is transmitting or receiving OSPF network traffic. The command show ip ospf traffic [interface-id] [detail] displays a high-level summary of packet types that were sent or received from a device.
Example 8-8 displays the use of this command. Notice that there is a separation of errors and valid packets in the output. Executing the command while specifying an interface provides more granular visibility to the packets received or transmitted for an interface.
Debug functionality is used to acquire granularity on various processes on the router. Specifically, the command debug ip ospf {adjacency | hello | packets] displays the processing of packets that have reached the supervisor on the switch. This allows for users to verify if packets were received or advertised from a router.
Example 8-9 displays the use of the OSPF hello and packet debugs.
Note
Debug output can also be redirected to a logfile, as shown earlier in Chapter 2, “NX-OS Troubleshooting Tools.”
Table 8-7 provides a brief description of the fields that are provided in the debug output from Example 8-9.
Field |
Description |
ivl |
Provides the OSPF Hello and Dead Timers in the Hello packet. |
options |
Identifies the area associated to that interface as a regular OSPF area, OSPF Stub, or OSPF NSSA area. These values are shown in HEX, and this chapter explains later how to verify them. |
mask |
The subnet mask of primary IP address on that interface. |
priority |
The interface priority for DR/BDR elections. |
dr |
The router-id of the DR. |
bdr |
The router-id of the BDR. |
nbrs |
The number of neighbors detected on that network segment. |
Debug commands are generally the least preferred method for finding root cause because of the amount of data that could be generated while the debug is enabled. NX-OS provides event-history that runs in the background without performance hits that provides another method of troubleshooting. The command show ip ospf event-history [hello | adjacency | event] provides helpful information when troubleshooting OSPF adjacency problems. The hello keyword provides the same information as the debug command in Example 8-9.
Example 8-10 displays the show ip ospf event-history hello command. Examine the difference in the sample output on NX-1.
Performing OSPF debugs on a switch only shows the packets that have reached the supervisor. If packets are not displayed in the debugs or event-history, further troubleshooting must be taken by examining quality of service (QoS) policies, control plane policing (CoPP), or just verification of the packet leaving or entering an interface.
QoS policies may or may not be deployed on an interface. If they are deployed, the policy-map must be examined for any drop packets, which must then be referenced to a class-map that matches the OSPF routing protocol. The same process applies to CoPP policies because they are based on QoS settings as well.
Example 8-11 displays the process for checking a switch’s CoPP policy with the following logic:
Examine the CoPP policy with the command show running-config copp all. This displays the relevant policy-map name, classes defined, and the police rate.
Investigate the class-maps to identify the conditional matches for that class-map.
After the class-map has been verified, examine the policy-map drops for that class with the command show policy-map interface control-plane.
Note
This CoPP policy was taken from a Nexus 7000 switch, and the policy-name and class-maps may vary depending on the platform.
Because CoPP operates at the RP level, it is possible that the packets were received on an interface and did not forward to the RP. The next phase is to identify whether packets were transmitted or received on an interface. This technique involves creating a specific access control entity (ACE) for the OSPF protocol. The ACE for OSPF should appear before any other ambiguous ACE entries to ensure a proper count. The ACL configuration command statistics per-entry is required to display the specific hits that are encountered per ACE.
Example 8-12 demonstrates the configuration of an ACL to detect OSPF traffic on the Ethernet1/1 interface. Notice that the ACL includes a permit ip any any command to allow all traffic to pass through this interface. Failing to do so could result in the loss of traffic.
Note
There are three ACE entries for OSPF. The first two are tied to the multicast groups for DR and BDR communication. The third ACE applies to the initial Hello packets.
Note
Example 8-12 uses an Ethernet interface, which generally indicates a one-to-one relationship, but on multi-access interfaces like switched virtual interfaces (SVI), also known as interface VLANs, the neighbor may need to be specified in a specific ACE.
An alternative to using an ACL is to use the built-in NX-OS Ethanalyzer to capture the OSPF packets. Example 8-13 demonstrates the command syntax. The optional detail keyword can be used to view the contents of the packets.
OSPF routers must be able to communicate with their peer routers by using the network associated to the primary IP address. Adjacency is not formed using secondary IP addresses. OSPF Hello packets include the subnet mask from the advertising interface, which is then checked with the source IP of the packet to verify that the routers are on the same subnet.
The subnet mask was changed on NX-2 from 10.12.1.200/24 to 10.12.1.200/25 for this section. This places NX-2 on the 10.12.1.128/25 network, which is different from NX-1’s (10.12.1.100) network.
Examining the OSPF neighbor table does not reflect any entries on either switch. Now examine the OSPF Hello packets with the command show ip ospf event-history, as shown in Example 8-14. Notice that OSPF was able to detect the wrong subnet mask between the routers.
In the event that the problem was due to a blatant subnet mismatch, the Hello packets are not recognized in OSPF debug or event-history. Verifying connectivity by the ping neighbor-ipaddress or show ip route neighbor-ipaddress will reflect that the networks are not on matching networks. Ensuring that the OSPF routers' primary interfaces are on a common subnet ensures proper communication.
Note
OSPF RFC 2328 allows neighbors to form an adjacency using disjointed networks only when using the ip unnumbered command on point-to-point OSPF network types. NX-OS does not support IP unnumbered addressing, so this use case is not applicable.
The OSPF header of the DBD packets includes the interface MTU. OSPF DBDs are exchanged in the EXSTART and EXCHANGE Neighbor State. Routers check the interface’s MTU that is included in the DBD packets to ensure that they match. If the MTUs do not match, the OSPF devices do not form an adjacency.
Example 8-15 displays that NX-1 and NX-2 have started to form a neighbor adjacency over 3 minutes ago and are stuck in the EXSTART state.
Examine the OSPF event-history to identify the reason the switches are stuck in the EXSTART state. Example 8-16 displays the OSPF adjacency event-history on NX-1, in which the MTU from NX-2 has been detected as larger than the MTU on NX-1’s interface.
Note
The MTU messages appear only on the device with the smaller MTU.
MTU is examined on both switches by using the command show interface interface-id and looking for the MTU value as shown in Example 8-17. The MTU on NX-2 is larger than NX-1.
The OSPF protocol itself does not know how to handle fragmentation. It relies on IP fragmentation when packets are larger than the interface. It is possible to ignore the MTU safety check by placing the interface parameter command ip ospf mtu-ignore on the switch with the smaller MTU. Example 8-18 displays the configuration command on NX-1 that allows it to ignore the larger MTU from NX-2.
This technique allows for adjacencies to form, but may cause problems later. The simplest solution is to change the MTU to match on all devices.
Note
If the OSPF interface is a VLAN interface (SVI), make sure that all the Layer 2 (L2) ports support the MTU configured on the SVI. For example, if VLAN 10 has an MTU of 9000, configure all the trunk ports to support an MTU of 9000 as well.
The RID provides a unique identifier for an OSPF router. A Nexus switch drops packets that have the same RID as itself as part of a safety mechanism. The syslog message using our routerid, packet dropped is displayed along with the interface and RID of the other device. Example 8-19 displays what the syslog message looks like on NX-1.
The RID is checked by viewing the OSPF process with the command show ip ospf, as displayed in Example 8-20.
Using the command router-id router-id in the OSPF process sets the RID statically and is considered a best practice. After changing the RID on one of the Nexus switches, an adjacency should form.
Note
The RID is a key component of the OSPF topology table that is built from the LSDB. All OSPF devices should maintain a unique RID.
More information on how to interpret the OSPF topology table is found in Chapter 7, “Advanced OSPF” of the Cisco Press book IP Routing on Cisco IOS, IOS-XE, and IOS XR.
OSPF requires that the area-id match in the OSPF Hello packets to form an adjacency. The syslog message received for wrong area is displayed along with the interface and area-id of the other device.
Example 8-21 displays what the syslog message looks like on NX-1 and NX-2.
When this happens, check the OSPF interfaces to detect which area-ids are configured by using the command show ip ospf interface brief. Example 8-22 shows the output from NX-1 and NX-2. Notice that the area is different on NX-1 and NX-2 for the Ethernet1/1 interface.
Changing the interface areas to the same value on NX-1 and NX-2 allows for an adjacency to form between them.
Note
The area-id is always stored in dot-decimal format on Nexus switches. This may cause confusion when working with other devices that store the area-id in decimal format. To convert decimal to dot-decimal, follow these steps:
Step 1. Convert the decimal value to binary.
Step 2. Split the binary value into four octets starting with the furthest right number.
Step 3. Add zeroes as required to complete each octet.
Step 4. Convert each octet to decimal format, which provides dot-decimal format.
The OSPF Hello packet contains an Options field, specifically the E-bit, which reflects the area’s ability to contain Type-5 LSAs (Stub capability) settings. The interfaces in an area must be in the following types to form an adjacency:
Normal: External routes (Type-5 LSAs) are allowed in this area.
Stubby/Totally Stubby: External LSAs (Type-5 LSAs) are not allowed in this area. No redistribution is allowed in this area.
Not So Stubby Area (NSSA)/Totally NSSA: External LSAs (Type-5 LSAs) are not allowed in this area. Redistribution is allowed in this area.
The OSPF Hello event-history detects a mismatched OSPF area setting. Example 8-23 displays the concept where NX-1 has detected a different area flag from what is configured on its interface.
Verify the area settings on the two routers that cannot form an adjacency. Example 8-24 displays that NX-1 has Area 1 configured as a stub, whereas NX-2 does not.
Setting the area to the same stub setting on both routers allows for the area flag check to pass and the routers to form an adjacency.
Different media types can provide different characteristics or might limit the number of nodes allowed on a segment. Table 8-8 defines the five OSPF network types—which ones are configurable on NX-OS and which network types can peer with other network types.
Interface Type |
Configurable on NX-OS |
DR/BDR Field in OSPF Hellos |
Can Establish Peering With |
Broadcast |
Yes |
Yes |
Broadcast, no changes necessary Non-Broadcast, OSPF timers need modification |
Non-Broadcast |
No |
Yes |
Non-Broadcast, no changes necessary Broadcast, OSPF timers need modification |
Point-to-Point |
Yes |
No |
Point-to-Point, no changes necessary Point-to-Multipoint, OSPF timers need modification |
Point-to- Multipoint |
No |
No |
Point-to-Multipoint, no changes necessary Point-to-Point, OSPF timers need modification |
Loopback |
No |
N/A |
N/A |
Ethernet provides connectivity to more than two OSPF devices on a network segment, therefore requiring a DR. The default OSPF network type for Nexus switches is the Broadcast OSPF network type because all its interfaces are Ethernet, and the Broadcast network type provides a DR.
Note
On OSPF network segments that require a DR (Broadcast/Non-Broadcast), an adjacency does not form if a router cannot be elected a DR because the OSPF priority has been set to zero for all interfaces. Neighbors are stuck in a 2WAY state in this scenario.
There are times when a Nexus switch forms only one OSPF adjacency for that interface. An example is two Ethernet ports configured as Layer 3 (L3) with a direct cable. In scenarios like this, setting the OSPF network type to point-to-point (P2P) provides advantages of faster adjacency (no DR Election) and not wasting CPU cycles for DR functionality.
OSPF can form an adjacency only if the DR and BDR Hello options match. Example 8-25 displays NX-1 stuck in INIT state with NX-2. NX-2 does not consider NX-1 an OSPF neighbor. Scenarios like this indicate incompatibility in OSPF network types.
The Ethernet1/1 OSPF interface network type is confirmed with the command show ip ospf interface. NX-1 is configured for Broadcast (DR required), whereas NX-2 is configured as a point-to-point (DR not required). The mismatch of DR requirements is the reason that the adjacency failed. Example 8-26 displays the discrepancy in OSPF network types.
The OSPF network type needs to be changed on one of the devices, because both Nexus switches are using L3 Ethernet ports. Configuring both switches to use an OSPF point-to-point network type is recommended. The command ip ospf network point-to-point configures NX-1’s Ethernet1/1 interface as an OSPF point-to-point network type. This allows for both switches to form an adjacency. Example 8-27 displays the configuration for NX-1 and NX-2 that allows them to form an adjacency.
A secondary function to the OSPF Hello packets is to ensure that adjacent OSPF neighbors are still healthy and available. OSPF sends Hello packets at set intervals called the Hello Timer. OSPF uses a second timer called the OSPF Dead Interval Timer, which defaults to four times (4x) the Hello Timer. Upon receipt of the Hello packet from a neighboring router, the OSPF Dead Timer resets to the initial value and starts to decrement again.
Note
The default OSPF Hello Timer interval varies upon the OSPF network type. Changing the Hello Timer interval modifies the default Dead Interval, too.
If a router does not receive a Hello before the OSPF Dead Interval Timer reaches zero, the neighbor state changes to Down. The OSPF router immediately sends out the appropriate LSA reflecting the topology change, and the SPF algorithm processes on all routers within the area.
The OSPF Hello Time and OSPF Dead Interval Time must match when forming an adjacency. In the event the timers do not match, timers are displayed in the OSPF Hello packet event history. Example 8-28 shows that NX-1 is receiving a Hello packet with different OSPF timers.
The OSPF interfaces of both switches need to be examined with the command show ip ospf interface to view the Hello and Dead Timers. Example 8-29 displays NX-1 and NX-2 OSPF timers for Ethernet1/1. Notice that the Hello and Dead Timers are different between the two switches.
Example 8-30 displays the configuration on both switches for examination to identify a fix. NX-2 has the command ip ospf hello-interval 15 on the Ethernet1/1 interface to modify the Hello interval. Removing the ip ospf hello-interval command on NX-2 or setting the same timers on NX-1 allows the switches to form an adjacency.
Note
IOS routers support OSPF fast-packet Hellos for subsecond detection of neighbors with issues. Nexus and IOS XR do not support OSPF fast-packet Hellos. The use of bidirectional forwarding detection (BFD) provides fast convergence across IOS, IOS XR, and Nexus devices and is the preferred method of subsecond failure detection.
OSPF supports two types of authentication: plaintext and a MD5 cryptographic hash. Plaintext mode provides little security, because anyone with access to the link can see the password with a network sniffer. MD5 crytographic hash uses a hash instead, so the password is never sent out the wire, and this technique is widely accepted as being the more secure mode.
OSPF authentication operates on an interface-by-interface basis or all interfaces in an area. The password is set only as an interface parameter and must be set for every interface. Missing an interface sets the default password to a null value.
Plaintext authentication is enabled for an OSPF area with the command area area-id authentication, and the interface parameter command ip ospf authentication sets plaintext authentication only on that interface. The plaintext password is configured with the interface parameter command ip ospf authentication-key password.
Example 8-31 displays plaintext authentication on NX-1’s Ethernet1/1 interface and all Area 0 interfaces on NX-2 using both commands explained previously.
Notice the authentication error that NX-1 produced upon enabling authentication. When there is a mismatch of OSPF authentication parameters, the Nexus switch produces the syslog message that contains bad authentication, which requires verification of the authentication settings.
Authentication is verified by looking at the OSPF interface and looking for the authentication option. Example 8-32 verifies the use of OSPF plaintext passwords on NX-1 and NX-2 interfaces.
It is important to note that the password is stored in encrypted format. It may be easier to reconfigure the password when explicitly configured on an interface. Example 8-33 displays how the password can be viewed.
MD5 authentication is enabled for an OSPF area with the command area area-id authentication message-digest, and the interface parameter command ip ospf authentication message-digest sets MD5 authentication for that interface. The MD5 password is configured with the interface parameter command ip ospf message-digest-key key# md5 password or set by using a key-chain with the command ip ospf authentication key-chain key-chain-name. The MD5 authentication is a hash of the key number and password combined. If the keys do not match, the hash is different between the nodes.
Note
Detailed instruction on key chain creation was provided in Chapter 7, “Troubleshooting Enhanced Interior Gateway Routing Protocol (EIGRP).”
Example 8-34 displays encrypted OSPF authentication on NX-1’s Ethernet1/1 interface and all Area 0 interfaces on NX-2 using both commands previously explained. NX-2 is using a key chain to maintain the password.
Example 8-35 provides verification that encrypted password authentication is enabled. NX-2 directly states the key-chain name used for authentication. Notice how VLAN20 on NX-2 has encrypted authentication enabled, but a password is not identified. This is because it is still using the default key id of zero.
A benefit to using keychains is that passwords are verified as shown in Example 8-36. This allows for network engineers to examine a password, versus forcing them to reenter the password.
Upon enabling authentication, it is important to check the syslog for error messages that indicate bad authentication. For those that do, the authentication options and password need to be verified on all peers for that network link.
After explaining how to troubleshoot OSPF adjacencies, this chapter explains how to troubleshoot missing routes.
Network engineers who do not fully understand OSPF design may create a topology such as the one illustrated in Figure 8-3. Although NX-2 and NX-3 have OSPF interfaces in Area 0, traffic from Area 12 must cross Area 23 to reach Area 34. An OSPF network with this design is discontiguous because interarea traffic is trying to cross a nonbackbone area.
Example 8-37 shows that NX-2 and NX-3 appear to have full connectivity to all networks in the OSPF domain. NX-2 maintains connectivity to the 10.34.1.0/24 network and 192.168.4.4/32 network, and NX-3 maintains connectivity to the 10.12.1.0/24 network and 192.168.1.1/32 network.
Example 8-38 shows the route tables for NX-1 and NX-4. NX-1 is missing route entries for Area 34, and NX-4 is missing route entries for Area 12. When Area 12’s Type-1 LSAs reach NX-2, NX-2 generates a Type-3 LSA into Area 0 and Area 23. NX-3 receives the Type-3 LSA and inserts it into the LSDB for Area 23. NX-3 does not create a new Type-3 LSA for Area 0 or Area 34.
OSPF ABRs use the following logic for Type-3 LSAs when entering another OSPF Area:
Type-1 LSAs received from a nonbackbone area create Type-3 LSAs into backbone area and nonbackbone areas.
Type-3 LSAs received from Area 0 are created for the nonbackbone area.
Type-3 LSAs received from a nonbackbone area only insert into the LSDB for the source area. ABRs do not create a Type-3 LSA for the other nonbackbone areas.
The simplest fix for a discontiguous network is to install a virtual link between NX-2 and NX-3. Virtual links overcome the ABR limitations by extending Area 0 into a nonbackbone area. It is similar to running a virtual tunnel for OSPF between an ABR and another multi-area OSPF router. The virtual link extends Area 0 across Area 23, making Area 0 a contiguous OSPF area.
The virtual link configuration is applied to the OSPF routing process with the command area area-id virtual-link endpoint-rid. The configuration is applied on both end devices as shown in Example 8-39.
Example 8-40 displays the routing table of NX-1 after the virtual link is configured between NX-2 and NX-3. Notice that the 192.168.4.4 network is present. In addition, the virtual link appears as an OSPF interface.
Router IDs (RID) play a critical role for the creation of the topology. If two adjacent routers have the same RID, an adjacency does not form as shown earlier. However, if two routers have the same RID and have an intermediary router, it prevents those routes from being installed in the topology.
The RID act as a unique identifier in the OSPF LSAs. When two different routers advertise LSAs with the same RID, it causes confusion in the OSPF topology, which can result in routes not populating or packets being forwarded toward the wrong router. It also prevent LSA propagation because the receiving router may assume that a loop exists.
Figure 8-4 provides a sample topology in which all Nexus switches are advertising their peering network and their loopback addresses in the 192.168.0.0/16 network space. NX-2 and NX-4 have been configured with the same RID of 192.168.4.4. NX-3 sits between NX-2 and NX-4 and has a different RID, therefore allowing NX-2 and NX-4 to establish full neighbor adjacencies with their peers.
From NX-1’s perspective, the first apparent issue is that NX-4’s loopback interface (192.168.4.4/32) is missing. Example 8-41 displays NX-1’s routing table.
On NX-2 and NX-4, there are complaints about LSAs and Possible router-id collision syslog messages, as shown in Example 8-42.
Example 8-43 displays the routing table of the two Nexus switches with the Possible router-id collision syslog messages. Notice that NX-2 is missing NX-1’s loopback interface (192.168.1.1/32) and NX-4’s loopback interface (192.168.4.4/32); whereas NX-4 is missing the 10.12.1.0/24 and NX-2’s loopback interface (192.168.2.2/32) network interface.
A quick check of the RIDs is done by examining the OSPF processes on both Nexus switches that reported the Possible router-id collision using the show ip ospf command. Notice that in Example 8-44, NX-2 and NX-4 have the same RID.
Remember that the RID can be dynamically set or statically set. Generally, this problem is a result of a configuration being copied from one router to another and not changing the RID. The RID is changed using the command router-id router-id under the OSPF process. The OSPF process restarts upon changing the RID on a Nexus switch.
NX-OS provides multiple methods of filtering networks after they are entered into the OSPF database. Filtering of routes occurs on ABRs for internal OSPF networks and ASBRs for external OSPF networks. The following includes some configurations that should be examined when routes are present in one area but not present in a different area.
Area Filtration: Routes are filtered upon receipt or advertisement to an ABR with the process level configuration command area area-id filter-list route-map route-map-name {in|out}.
Route Summarization: Internal routes are summarized on ABRs using the command area area-id range summary-network [not-advertise]. If the not-advertise keyword is configured, a Type-3 LSA is not generated for any of the component routes; thereby hiding them to only the area of origination.
External routes are summarized on ASBRs using the command summary-address summary-network [not-advertise]. The not-advertise keyword stops the generation of any Type-5/Type-7 LSAs for component routes within the summary network.
Note
ABRs for NSSA areas act as an ASBR when the Type 7 LSAs are converted to Type 5 LSA. External summarization is performed only on ABRs when they match this scenario.
Redistributing into OSPF uses the command redistribute [bgp asn | direct | eigrp process-tag | isis process-tag | ospf process-tag | rip process-tag | static] route-map route-map-name. A route-map is required as part of the redistribution process on Nexus switches.
Every protocol provides a seed metric at the time of redistribution that allows the destination protocol to calculate a best path. OSPF uses the following default settings for seed metrics:
The network is configured as an OSPF Type-2 external network.
The default redistribution metric is set to 20 unless the source protocol is BGP which provides a default seed metric of 1.
The default seed metrics can be changed to different values for OSPF external network type (1 versus 2), redistribution metric, and a route-tag if desired.
Example 8-45 provides the necessary configuration to demonstrate the process of redistribution. NX-1 redistributes the connected routes for 10.1.1.0/24 and 10.11.11.0/24 in lieu of them being advertised with the OSPF routing protocol. Notice that the route-map can be a simple permit statement without any conditional matches.
OSPF Type-5 LSAs include a field known as the forwarding address that optimizes forwarding traffic when the source uses a shared network segment. The forwarding address scenario defined in RFC 2328 is not common, but Figure 8-5 provides a sample topology. The following is included in this topology:
OSPF is enabled on all the links in Area 0 (10.13.1.0/24, 10.24.1.0/24, and 10.34.1.0/24).
Users are trying to connect to the proxy server that is located in a DMZ (172.16.1.1) off of the firewall.
NX-1 has a static route for the 172.16.1.0/24 network pointing toward the firewall (10.120.1.10).
NX-1 is redistributing the route into OSPF as a Type-1 External route.
NX-1 and NX-2 have direct connectivity using VLAN 120 (10.120.1.0/24) to the firewall.
Example 8-46 displays NX-1’s configuration for advertising the 172.16.1.0/24 network into the OSPF domain. In addition, NX-1’s static route is verified for installation into the OSPF database and is then checked on NX-3.
Example 8-47 displays the Type-5 LSA for the external route for the 172.16.1.0/24 network to the proxy server. The ASBR is identified as NX-1 (192.168.1.1), which is the device that all Nexus switches forward packets to in order to reach the 172.16.1.0/24 network. Notice that the forwarding address is the default value of 0.0.0.0.
Traffic from NX-2 (and NX-4) takes the non-optimal route (NX-2→NX-4→NX-3→ NX-1→FW), as shown in Example 8-48. The optimal route would allow NX-2 to use the directly connected 10.120.1.0/24 network toward the firewall.
The forwarding address in OSPF Type-5 LSAs is specified in RFC 2328 for scenarios such as this. When the forwarding address is 0.0.0.0, all routers forward packets to the ASBR, introducing the potential for suboptimal routing.
The OSPF forwarding address changes from 0.0.0.0 to the next-hop IP address in the source routing protocol when the following occurs:
OSPF is enabled on the ASBR’s interface that points to the next-hop IP address. In this scenario, NX-1’s VLAN120 interface has OSPF enabled, which correlates to the 172.16.1.0/24 static route’s next-hop address of 10.120.1.10.
That interface is not set to passive.
That interface is a broadcast or nonbroadcast OSPF network type.
Now OSPF is enabled on the NX-1’s and NX-2’s VLAN120 interface, which has been associated to area 120. Figure 8-6 illustrates the current topology. VLAN interfaces default to the broadcast OSPF network type, and all conditions were met to set the FA to an explicit IP address.
Example 8-49 displays the Type-5 LSA for the 172.16.1.0/24 network. Now that OSPF is enabled on NX-1’s 10.120.1.1 interface and the interface is a broadcast network type, the forwarding address changed from 0.0.0.0 to 10.120.1.10.
Example 8-50 verifies that connectivity from NX-2 and NX-4 now takes the optimal path because the forwarding address changed to 10.120.1.10.
A junior network engineer identified that the 10.120.1.0/24 network is no longer needed. The engineer implemented filtering on Area 120 LSAs from being advertised into Area 0, as shown in Example 8-51.
After the junior network engineer made the change, the 172.16.1.0/24 network disappeared on all the routers in Area 0. Only the other peering network is present, as shown in Example 8-52.
If the Type-5 LSA forwarding address is not a default value, the address must be an intra-area or inter-area OSPF route. If the FA is not resolved, the LSA is ignored and does not install into the RIB. The FA provides a mechanism to introduce multiple paths to the external next-hop address. Otherwise, there is not a reason to include the FA in the LSA. Removing the filtering on NX-1 and NX-2 restores connectivity.
Note
In the scenario provided, there was not any redundancy to provide connectivity in the event that NX-1 failed. Typically, the configuration is repeated on other routers, which provides resiliency. Be considerate of the external networks when applying filtering of routes on ABRs.
OSPF executes Dijkstra’s Shortest Path First (SPF) algorithm to create a loop-free topology of shortest paths. All routers use the same logic to calculate the shortest path for each network. Path selection prioritizes paths by using the following order of path selection:
Intra-Area
Inter-Area
External Type-1
External Type-2
The following sections explain each component in detail.
Routes advertised via a Type-1 LSA for an Area are always preferred over Type-3 and Type-5 LSAs. If multiple intra-area routes exist, the path with the lowest total path metric is installed in the RIB. If there is a tie in metric, both routes install into the RIB.
Note
Even if the path metric from an intra-area route is higher than an inter-area path metric; the intra-area path is selected.
Inter-area routes take the lowest total path metric to the destination. If there is a tie in metric, both routes install into the RIB. All inter-area paths for a route must go through Area 0.
In Figure 8-7, NX-1 is computing the path to NX-6. NX-1 uses the path NX-1→ NX-3→NX-5→NX-6 because its total path metric is 35 versus the NX-1→NX-2→ NX-4→NX-6 path with a metric of 40.
Earlier in this chapter, OSPF external routes were briefly explained as Type-1 or Type-2. The main differences between Type-1 and Type-2 external OSPF routes include the following:
Type-1 routes are preferred over Type-2.
The Type-1 path metric equals the following: redistribution metric + total path metric to reach the ASBR.
The Type-2 path metrics equals only the redistribution metric.
Another critical factor to identify is whether the devices are operating in RFC 1583 or RFC 2328 mode. Cisco NX-OS switches operate in 2328 mode by default, whereas Cisco IOS, IOS XE, and IOS XR operate only in 1583 mode. The following subsection explains the path selection logic depending on whether the device is operating in RFC 1583 or RFC 2328 mode.
The following are the differences in path selection for OSPF External Type-1 routes:
RFC 1583 Mode: External OSPF Type-1 route calculation uses the redistribution metric + the lowest path metric to reach the ASBR that advertised the network. Type-1 path metrics are lower for routers closer to the originating ASBR, whereas generally the path metric is higher for a router 10 hops away from the ASBR.
If there is a tie in the path metric, both routes install into the RIB. If the ASBR is in a different area, the path of the traffic must go through Area 0. An ABR router does not install an O E1 and O N1 route into the RIB at the same time. O N1 is given preference for a typical NSSA area and prevents the O E1 from installing on the ABR.
RFC 2328 Mode: Preference first goes to the ASBR in the same area as the calculating router. In the event that the ASBR is not in the same area as the calculating router, the rules for calculating the best path follow those as RFC 1583 Mode.
Note
There is an option with NSSA areas that prevents the redistributed routes from being advertised outside of the NSSA area (setting the P-bit to zero), which may change the behavior. This concept is outside of the scope of this book; it is explained in depth in RFC 2328 and 3101.
Figure 8-8 shows the topology for NX-1 and NX-3 computing a path to the external network (100.65.0.0/16) that is being redistributed on NX-6 and NX7.
The path NX-1→NX-2→NX-4→NX-6 has a metric of 50, which is less than the path NX-1→NX-3→NX-5→NX-7, which has a path metric of 90. NX-1 selects the NX-1→NX-2→NX-4→NX-6 path to reach the 100.65.0.0/16 network, whereas NX-3 selects the NX-3→NX-5→NX-7 path that has a higher metric.
The decisions were made based upon RFC 2328 logic because NX-1 is not in an area with an ASBR, whereas NX-3 is in the same area as NX-7. Example 8-53 displays the routing tables and path metrics from NX-1 and NX-3’s perspective.
Here are the differences in path selection for OSPF External Type-2 routes:
RFC 1583 Mode: External OSPF Type-2 routes do not increment in metric respective of the path metric to the ASBR. If there is a tie in the redistribution metric, the router compares the forwarding cost. The forwarding cost is the metric to the ASBR that advertised the network, and the lower forwarding cost is preferred. If there is a tie in forwarding cost, both routes install into the routing table. An ABR router does not install an O E2 and O N2 route into the RIB at the same time. O N2 is given preference for a typical NSSA area and prevents the O E2 from installing on the ABR.
RFC 2328 Mode: Preference first goes to the ASBR in the same area as the calculating router. In the event that the ASBR is not in the same area as the calculating router, the rules for calculating the best path follow those as RFC 1583 Mode.
Reusing the topology from Figure 8-6, all paths reflect a metric of 20. The first deciding step is to check to see if the ASBR for the 100.65.0.0/16 network is in the same area as the ASBR. NX-1 is not, so it selects the path based on forwarding cost. Forwarding cost is calculated on NX-OS.
Example 8-54 walks through the steps for calculating the forwarding cost.
Step 1. The ASBRs must be identified by looking at the OSPF LSDB with the command show ip ospf database external network.
Step 2. The metric reported by the ABR for the ASBR address (Type-4 LSA) is examined with the command show ip ospf database asbr-summary detail. (This provides the path metric from the ASBR to the area’s ABR.)
Step 3. Find the metric to the ABR of the Type-4 LSA with the command show ip ospf database router abr-ip-address detail.
Step 4. Combine the two metrics to calculate a forwarding cost of 30 from NX-1 to NX-6, and a forwarding cost of 70 from NX-1 to NX-7. The path to NX-6 is the lowest and is selected by NX-1.
NX-3’s path is selected based on RFC 2328’s guidelines because NX-3 is in the same area as NX-7. Example 8-55 confirms the path from NX-3 → NX-5 → NX-7.
RFC 2328 logic is generally sufficient for finding the next-hop for external routes, but it could lead to suboptimal paths (as shown in the previous section) or cause routing loops when combined with devices that do not use RFC 2328 logic. Figure 8-9 displays a sample topology that creates a routing loop because IOS routers operate with RFC 1583 logic.
NX-3 selects R7 as the ASBR for the 100.65.0.0/16 network using RFC 2328 standards and forwards packets toward R5. R5 uses RFC 1583 standards and forwards packets back to NX-3, causing a loop. Example 8-56 verifies that the loop exists using a simple traceroute from NX-3 toward the 100.65.0.0/16 network.
The solution involves placing the Nexus switches into RFC 1583 mode with the OSPF command rfc1583compatibility. Example 8-57 displays the configuration to remove the routing loop.
Note
Another significant change between RFC 1583 and RFC 2328 is the summarization metric. With RFC 1583, an ABR uses the lowest metric from any of the component routes for the metric of the summarized network. RFC 2328 uses the highest metric from any of the component routes for the metric of the summarized route. Deploying rfc1583compatibility on the ABR changes the behavior.
Interface cost is essential component for Dijkstra’s SPF calculation because the shortest path metric is based on the cumulative interface cost (metric) from the router to the destination. OSPF assigns the OSPF link cost (metric) for an interface using the following formula:
Cost = Interface Bandwidth/Reference Bandwidth
The default reference bandwidth for NX-OS is 40 Gbps, whereas for other Cisco OSs (IOS and IOS XR) it is 100 Mbps. Table 8-9 provides the OSPF cost for common network interface types using the default reference bandwidth.
Interface Type |
Default NX-OS OSPF Cost |
Default IOS OSPF Cost |
T1 |
N/A |
64 |
Ethernet |
4000 |
10 |
FastEthernet |
400 |
1 |
GigabitEthernet |
40 |
1 |
10-GigabitEthernet |
4 |
1 |
40-GigabitEthernet |
1 |
1 |
100-GigabitEthernet |
1 |
1 |
Notice in Table 8-9 that there is no differentiation in the link cost associated to a FastEthernet interface and a 100-Gigabit Ethernet interface on IOS routers. This can result in suboptimal path selection and is magnified when a NX-OS switch is inserted into a path.
Figure 8-10 displays a topology that introduces problems because of the reference bandwidth not being set properly. Connectivity between the two WAN service providers should take the 10 Gigabit Path (R1→NX-3→NX-4→R2) and use the 1 Gigabit link between R1 and R2 only as a backup path, because traffic is likely be dropped by the QoS policy to support only business-critical traffic.
Example 8-58 displays the routing table of R1 with the default reference bandwidth. Traffic between 172.16.1.0/24 and 172.32.2.0/24 flows across the backup 1 Gigabit link (10.12.1.0/24), which does not follow the intended traffic patterns. Notice that the OSPF path metric is 2 to the 172.32.2.0/24 network using the 1 Gigabit link.
Now let’s shut down the 1 Gigabit link and examine the OSPF metrics using the 10 Gigabit path. Example 8-59 displays the process. Notice that R1’s path metric is 10 to the 172.32.2.0/24 network using the 10 Gigabit link path.
R1 and R2 are taking the suboptimal path because of the differences in reference bandwidth. Change the reference bandwidth to match the NX-OS’s default setting of 40 Gbps. The reference bandwidth on IOS and NX-OS devices is set with the command auto-cost reference-bandwidth speed-in-megabits. Example 8-60 displays the reference bandwidth being changed on R1 and R2.
Now let’s examine the new OSPF metric cost using the 10 Gigabit path, and then reactivate the 1 Gigabit link on R1. Example 8-61 demonstrates this change and then verifies which path is now used to connect the 172.16.1.0/24 and 172.32.2.0/24 networks.
The path between 172.16.1.0/24 and 172.32.2.0/24 continues to use the 10 Gigabit path because the path metric cost using the 1 Gigabit path would be 41 ((1,000/40,000) + 1 (for loopback).
Note
Another solution involves statically setting the OSPF cost on an interface with the command ip ospf cost 1-65535 for NX-OS and IOS devices.
This chapter provided a brief review of the OSPF routing protocols, and then explored the methods for troubleshooting adjacency issues between devices, missing routes, and path selection.
The following parameters must be compatible for the two routers to become neighbors:
Interfaces must be Active.
Connectivity between devices must exist using the primary subnet.
MTU matches between devices.
Router-IDs are unique.
Interface Area must match.
Need for Designated Router matches based on OSPF network types.
OSPF stub area flags match.
OSPF is a link state routing protocol that builds a complete map based on LSAs. Routes are missing from the OSPF routing domain typically because of bad network design or through filtering of routes as they are advertised across area boundaries. This chapter provided some common bad OSPF designs that cause loss of path information.
OSPF builds a loop-free topology from the computing router to all destination networks. All routers use the same logic to calculate the shortest-path for each network. Path selection prioritizes paths by using the following logic:
Intra-Area
Inter-Area
External Type-1
External Type-2
When the redistribution metric is the same, Nexus switches select external paths using RFC 2328 by default, which states to prefer intra-area connectivity over inter-area connectivity when multiple ABSRs are present. Cisco IOS and IOS XR routers use RFC 1583 external path selection, which selects an ABSR by the lowest forwarding cost. This can cause routing loops when Nexus switches are intermixed with IOS or IOS XR routers, but the Nexus switches can be placed in RFC 1583 compatibility mode.
RFC 1583, OSPF Version 2. IETF, http://www.ietf.org/rfc/rfc1583.txt, March 1997.
RFC 2328, OSPF Version 2. IETF, http://www.ietf.org/rfc/rfc2328.txt, April 1998.
Edgeworth, Brad, Aaron Foss, Ramiro Garza Rios. IP Routing on Cisco IOS, IOS XE and IOS XR. Indianapolis: Cisco Press, 2014.
Cisco. Cisco NX-OS Software Configuration Guides, http://www.cisco.com.