OSPF Router IDs:
OSPF uses a 32-bit number for its RID, represented in the same dotted-decimal format as an IP address. A router can find its RID in one of two ways: The RID can be administratively specified in the OSPF configuration, or an IP address configured on one of the router’s interfaces can be used as the RID. The second option is made possible because the RID format is the same as the IP address format, and because there is an assumption that an interface address is unique within the routing domain.
Which option is used to acquire a RID depends on the particular OSPF implementation. And in some cases, both options are available. For example, both Juniper Networks’ and Cisco Systems’ OSPF implementations have a prioritized RID selection process:
If a RID is administratively configured, that value is used.
If no RID is administratively configured, an IP address configured on a loopback interface is used.
If no IP address is configured on a loopback interface, an address is taken from a physical interface.
If no IP address is configured on any interface and no RID is administratively configured, OSPF cannot start.
The original logic behind Step 2, taking an address from a loopback interface, was that because a loopback interface is a logical interfaceit exists only in software and has no physical presence on the routerit is not susceptible to physical failures. So, there is no risk that an interface failure or shutdown on a router could force OSPF to find a new RID and re-advertise its LSAs using the new RID, which in turn causes SPF runs on routers throughout the area and contributes to network instability.
There are two approaches by which a particular OSPF implementation could handle the loss of a RID. One approach is that the failure of an interface will have no effect on the RID. After all, the OSPF process just needs to know some 32-bit value, with some confidence that the value is unique within the OSPF routing domain, to use as its RID at start-up. Once the value is known, it can be remembered, and the subsequent failure of the interface from which the RID was derived is irrelevant. The problem with this approach is that the loss of an IP address on an interface might not have been accidental. What if the IP address is intentionally removed from an interface and is reused on another router, and that router selects that IP address as its own RID? If the first router retains the same address as its RID, you now have duplicate RIDs in your network.
The second approach avoids the problem just described and is therefore the lesser of two evils. This approach to the loss of an IP address from which the RID is derived is to force the router to acquire a new RID from its remaining IP addresses.
Troubleshooting: Duplicate Router IDs:
Allowing more than one router in a network to use the same RID results in serious network outages, and the symptoms can be misleading. For example, in Figure 4.1, two routersR4 and R7have both been configured with the RID 192.168.254.7. The physical interfaces for R6 are shown, as are the interface addresses for R6 and its neighbors. We will observe the results of the duplicate RIDs from that router.
Figure 4.1. R4 and R7 are using the same RID.
Figure 4.2. The first display of the OSPF route entries appears normal.
Figure 4.3 shows our first indication of trouble (aside from the complaints of network users). This display of the OSPF entries in the routing table was taken just moments after the display in Figure 4.2, but most of the route entries have disappeared. After a few more moments, some but not all of the route entries have returned, as Figure 4.4 shows. But then, in Figure 4.5, most of the entries have again disappeared. This fluctuation continues, with the routing table changing almost as fast as it can be repeatedly displayed.
Figure 4.3. Here, most of the OSPF entries have disappeared from the route table.