Open Shortest Path First (OSPF) is a recent entry into the Internet interior routing scene. OSPF Version 2 is documented in RFC 1583 (a lengthy document that I find very difficult to read). Sanctioned by the IETF, it is intended to become Internet's preferred interior routing protocol. OSPF is a link-state routing protocol with a complex set of options and features. Not all of these features are available on all implementations, but some of its advantages are:
OSPF has some disadvantages as well. Chief among them are its complexity and its demands on memory and computation. Although link-state protocols are not difficult to understand, OSPF muddles the picture with plenty of options and features.
OSPF divides its routing domain into areas. Area 0, the backbone, is required. This divides interior routing into two levels. If traffic must travel between two areas, the packets are first routed to the backbone. This may cause non-optimal routes, since interarea routing is not done until the packet reaches the backbone. Once there, it is routed to the destination area, which is then responsible for final delivery. This layering permits addresses to be consolidated by area, reducing the size of the link state databases. Small networks can operate with a single OSPF area, which must be area 0.
OSPF divides networks into several classes, including point-to-point, multiaccess, and non-broadcast multiaccess. A serial link connecting two routers together would be a point-to-point link, while an Ethernet or Token Ring segment would be a multiaccess link. A Frame Relay or X.25 cloud would be classified as non-broadcast multiaccess.
Multiaccess networks (like Ethernet) use a designated router (DR) to avoid the problem of each router forming a link with every other router on a Ethernet, resulting in a N^2 explosion in the number of links. Instead, the DR manages all the link state advertisements for the Ethernet. Selecting the DR requires an election process, during which a Backup Designated Router (BDR) is also selected. OSPF provides a priority feature to help the network engineer influence the choice of DR and BDR, but in practice this is difficult. Link layer multicasting is also used, if available, to avoid broadcasts and better target routing updates.
Non-broadcast multiaccess networks (like X.25) also use the designated router concept, but since broadcasts (and presumably multicasts) are not supported, the identity of neighboring routers must be specified manually. A DR on such a network without a complete list of neighbors will cause a loss of connectivity, even though the network is otherwise functional. If possible, I recommend configuring such networks as a collection of point-to-point links, simply to avoid the intricacies of DR election.
OSPF's primary means of verifying continuing operation of the network is via its Hello Protocol. Every OSPF speaker sends small hello packets out each of its interfaces every ten seconds. It is through receipt of these packets that OSPF neighbors initially learn of each other's existance. Hello packets are not forwarded or recorded in the OSPF database, but if none are recieved from a particular neighbor for forty seconds, that neighbor is marked down. LSAs are then generated marking links through a down router as down. The hello timer values can be configured, though they must be consistant across all routers on a network segment.
Link state advertisements also age. The originating router readvertises an LSA after it has remained unchanged for thirty minutes. If an LSA ages to more than an hour, it is flushed from the databases. These timer values are called architectural constants by the RFC.
OSPFs various timers interact as follows: