Problems in Becoming a Neighbor
Receiving a Hello from a router on the same subnet does not always result in two routers becoming neighbors. Routers on the same subnet must agree about several of the parameters exchanged in the Hello; otherwise the routers do not become neighbors. The following must match before a pair of routers become neighbors:
* Subnet mask used on the subnet.
* Subnet number (as derived using the subnet mask and each router’s interface IP address).
* Hello interval.
* Dead interval.
* OSPF area ID.
* Must pass authentication checks if used.
* Value of the stub area flag.
If any one of these parameters differ, the routers do not become neighbors. If your troubleshooting OSPF when routers should be neighbors, and they are not, check the matching items.
A potential neighbor confirms that it is in the same subnet by comparing the neighboring router’s IP address and subnet mask, as listed in the Hello message, with its own address and mask. If they are in the same subnet with the same range of addresses, this check passes.
Next, two timer settings, the Hello Interval and Dead Interval, must match. OSPF routers send Hello messages every Hello Interval. When a router no longer hears a Hello from a neighbor for the time defined by the Dead Interval, the router believes the neighbor is no longer reachable, and the router reacts and reconverges the network. On Ethernet interfaces, Cisco routers default to a Hello interval of 10 seconds and a dead interval of 4 times the Hello interval. If a router does not hear any Hello messages from that neighbor in 40 seconds, it marks the now-silent router as “down” in its neighbor table. At that point, the routers can react and converge to use the now-currently best routes.
OSPF defines a large set of potential actions that two neighbors use to communicate with each other. To keep track of the process, OSPF routers set each neighbor to one of many OSPF neighbor states. An OSPF neighbor state is the router’s perception of how much work has been completed in the normal processes done by two neighboring routers. The most common command to list the neighbors and states is show ip ospf neighbor.
Because the neighbor states reflect various points in the normal OSPF processes used between two routers, it is useful to discuss neighbor states along with these processes and OSPF messages. By understanding OSPF neighbor states and their meanings, an engineer can more easily determine if an OSPF neighbor is working normally, or if a problem exists.
The first two sates are the Down and Init state. In cases when a router previously knew about a neighbor, but the interface failed, the neighbor is listed as a Down state. As soon as the interface comes up, the two routers can send Hellos, transitioning that neighbor to an Init state. Init means that the neighboring relationship is being initialized.
A router changes from Init to a two-way state when two major facts are true: a received Hello lists that router’s RID as having been seen, and that router has checked all parameters for the neighbor and they look good. These two facts mean that the router is willing to communicate with this neighbor. To make the process work, when each router receives a Hello from a new neighbor, the router checks the neighbor’s configuration details. If all looks good, the router’s next Hello lists the neighbor’s RID in the list of “seen” routers. After both routers have checked the parameters and sent a Hello listing the other router’s RID as “seen”, both routers should have reached the two-way state. After they are in a two-way state, the two routers are ready to exchange topology information.