Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
OSPF uses several different message types to establish and maintain its neighbor relationships and to maintain correct routing information. When preparing for the exam, be sure you understand each OSPF packet type and the OSPF neighbor establishment procedure.
OSPF uses five packet types. It does not use UDP or TCP for transmitting its packets. Instead, it runs directly over IP (IP protocol 89) using an OSPF header. One field in this header identifies the type of packet being carried. The five OSPF packet types follow:
Hello: Identifies neighbors and serves as a keepalive.
Link State Request (LSR): Request for a Link State Update (LSU). Contains the type of LSU requested and the ID of the router requesting it.
Database Description (DBD): A summary of the LSDB, including the RID and sequence number of each LSA in the LSDB.
Link State Update (LSU): Contains a full LSA entry. An LSA includes topology information; for example, the RID of this router and the RID and cost to each neighbor. One LSU can contain multiple LSAs.
Link State Acknowledgment (LSAck): Acknowledges all other OSPF packets (except Hellos).
OSPF traffic is multicast to either of two addresses: 224.0.0.5 for all OSPF routers or 224.0.0.6 for all OSPF DRs.
OSPF routers send out periodic multicast packets to introduce themselves to other routers on a link. They become neighbors when they see their own router ID included in the Neighbor field of the Hello from another router. Seeing this tells each router that they have bidirectional communication. In addition, two routers must be on a common subnet for a neighbor relationship to be formed. (Virtual links are sometimes an exception to this rule.)
Certain parameters within the OSPF Hellos must also match for two routers to become neighbors. They include
Hello/dead timers
Area ID
Authentication type and password
Stub area flag
OSPF routers can be neighbors without being adjacent. Only adjacent neighbors exchange routing updates and synchronize their databases. On a point-to-point link, an adjacency is established between the two routers when they can communicate. On a multiaccess link, each router establishes an adjacency only with the DR and the backup DR (BDR).
Hellos also serve as keepalives. A neighbor is considered lost if no Hello is received within four Hello periods (called the dead time). The default Hello/dead timers are as follows:
10 seconds/40 seconds for LAN and point-to-point interfaces
30 seconds/120 seconds for nonbroadcast multiaccess (NBMA) interfaces
The process of neighbor establishment and route exchange between two OSPF routers is as follows:
Step 1. | Down state: OSPF process not yet started, so no Hellos sent. |
Step 2. | Init state: Router sends Hello packets out all OSPF interfaces. |
Step 3. | Two-way state: Router receives a Hello from another router that contains its own router ID in the neighbor list. All other required elements match, so routers can become neighbors. |
Step 4. | Exstart state: If routers become adjacent (exchange routes), they determine which one starts the exchange process. |
Step 5. | Exchange state: Routers exchange DBDs listing the LSAs in their LSD by RID and sequence number. |
Step 6. | Loading state: Each router compares the DBD received to the contents of its LS database. It then sends a LSR for missing or outdated LSAs. Each router responds to its neighbor’s LSR with a Link State Update. Each LSU is acknowledged. |
Step 7. | Full state: The LSDB has been synchronized with the adjacent neighbor. |