OSPF-2 Protocol Overview
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:
- Scalability. OSPF is specifically designed to operate with
larger networks. It does not impose a hop-count restriction
and permits its domain to be subdivided for easier
management.
- Full subnetting support. OSPF can fully support subnetting,
including VLSM and non-contiguous subnets.
- Hello packets. OSPF uses small "hello" packets to verify
link operation without transferring large tables. In stable
networks, large updates occur only once every 30 minutes.
- TOS routing. OSPF can route packets by different criterion
based on their Type Of Service (TOS) field. For example,
file transfers could be routed over a satellite link while
terminal I/O could avoid such high delays. This requires
cooperative applications on the end systems.
- Tagged routes. Routes can be tagged with arbitrary values, easing interoperation with EGPs, which can tag OSPF routes with AS numbers.
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:
- If a link goes down for twenty seconds, then comes back up,
OSPF doesn't notice.
- If a link flaps constantly, but at least one of every four
Hello packets make it across, OSPF doesn't notice.
- If a link goes down for anywhere from a minute to half an hour,
OSPF floods an LSA when it goes down, and another LSA when it comes
back up.
- If a link stays down for more than half an hour, LSAs originated
by remote routers (that have become unreachable) begin to age out.
When the link comes back up, all these LSAs will be reflooded.
- If a link is down for more than an hour, any LSAs originated by remote routers will have aged out and been flushed. When the link comes back up, it will be as if it were brand new.