Content

| 6.1 |  | OSPF Overview |
| 6.1.3 |  | OSPF states |

OSPF routers establish relationships, or states, with their neighbors for efficiently sharing link-state information. In contrast, distance vector routing protocols, such as RIP, blindly broadcast or multicast their complete routing table out every interface, hoping that a router is out there to receive it. Every 30 seconds, by default, RIP routers send only one kind of message. This message is their complete routing table. OSPF routers, on the other hand, rely on five different kinds of packets to identify their neighbors and to update link-state routing information.

These five packet types make OSPF capable of sophisticated and complex communications. These packet types will be discussed in more detail later in the module. At this point, become familiar with the different relationships, or states, possible between OSPF routers, the different OSPF network types, and the OSPF Hello protocol.

OSPF States
The key to effectively designing and troubleshooting OSPF networks is to understand the relationships, or states, that develop between OSPF routers. OSPF interfaces can be in one of seven states. OSPF neighbor relationships progress through these states, one at a time, in the order presented in Figure .

1. Down State
   In the Down state, the OSPF process has not exchanged information with any neighbor. OSPF is waiting to enter the next state, which is the Init state.
2. Init State
   OSPF routers send Type 1 packets, or Hello packets, at regular intervals to establish a relationship with neighbor routers. These intervals are usually ten seconds. When an interface receives its first Hello packet, the router enters the Init state. This means the router knows a neighbor is out there and is waiting to take the relationship to the next step.

   The two kinds of relationships are the two-way state and adjacency. A router must receive a Hello from a neighbor before it can establish any relationship.

3. Two-Way State
   Using Hello packets, every OSPF router tries to establish a two-way state, or bidirectional communication, with every neighbor router on the same IP network. Among other things, Hello packets include a list of the sender's known OSPF neighbors. A router enters the two-way state when it sees itself in a neighbor's Hello. When RTB learns that RTA knows about RTB, RTB declares a two-way state to exist with RTA.

   The two-way state is the most basic relationship that OSPF neighbors can have, but routing information is not shared between routers in this relationship. To learn about the link states of other routers and eventually build a routing table, every OSPF router must form at least one adjacency. An adjacency is an advanced relationship between OSPF routers that involves a series of progressive states that rely not just on Hellos, but also on the other four types of OSPF packets. Routers attempting to become adjacent to one another exchange routing information even before the adjacency is fully established. The first step toward full adjacency is the ExStart state, which is described next.

4. ExStart State
   Technically, when a router and its neighbor enter the ExStart state, their conversation is characterized as an adjacency, but they have not become fully adjacent. ExStart is established using Type 2 database description (DBD) packets, also known as DDPs. The two neighbor routers use Hello packets to negotiate who is the "master" and who is the "slave" in their relationship and use DBD packets to exchange databases.

   The router with the highest OSPF router ID "wins" and becomes the master. The OSPF router ID is discussed later in this module. When the neighbors establish their roles as master and slave, they enter the Exchange state and begin sending routing information.

5. Exchange State
   In the Exchange state, neighbor routers use Type 2 DBD packets to send each other their link-state information. In other words, the routers describe their link-state databases to each other. The routers compare what they learn with their existing link-state databases. If either of the routers receives information about a link that is not already in its database, the router requests a complete update from its neighbor. Complete routing information is exchanged in the Loading state.
6. Loading State
   After the databases have been described to each router, they may request information that is more complete by using Type 3 packets, link-state requests (LSRs). When a router receives an LSR, it responds with an update by using a Type 4 link-state update (LSU) packet. These Type 4 LSU packets contain the actual link-state advertisements (LSAs), which are the heart of link-state routing protocols. Type 4 LSUs are acknowledged using Type 5 packets, called link-state acknowledgments (LSAcks).
7. Full Adjacency
   With the Loading state complete, the routers are fully adjacent. Each router keeps a list of adjacent neighbors, called the adjacency database. Do not confuse the adjacency database with the link-state database or the forwarding database.

| Interactive Media Activity Drag and Drop: OSPF Packet Types Upon completion of this activity, the student will be able to identify the different OSPF packet types.

| Interactive Media Activity Drag and Drop: OSPF States Upon completion of this activity, the student will be able to list in order the different states of OSPF.