As mentioned previously, OSPF has five kinds of routing protocol packets, and each is identified by the Type field in the protocol header. Now, we will discuss those packet types in more detail.
The Hello Packet
OSPF Packet type 1, as shown in Figure 9-2, is the hello packet.
Figure 9-2. OSPF Hello Packet
Figure 9-2. OSPF Hello Packet
The basic function of the hello packet is to establish a neighbor relationship, to elect the designated router, and to negotiate optional capabilities. These optional capabilities include negotiating the E bit setting to determine whether the attached area is a stub, the DC bit to indicate demand circuit, the N/P bit indicating whether the router supports NSSA, and EA external attributes.
All routers connected to a common network must agree on all the parameters to form an adjacency. An adjacency is formed between two routers when complete database information is received and acknowledged. At this point, the adjacent routers agree that both of them have identical information in their databases.
Figure 9-3 shows the frequency with which hello packets are sent on different types of links. On broadcast and point-to-point links, hello packets are sent every 10 seconds, by default. On NBMA networks, hello packets are sent every 30 seconds, by default.
Figure 9-3. Frequency of Hello Packets on Various Links
This indicates the network and mask of the attached interface of the router. All routers sharing a common network interface must agree on this value. For example, if you have two routers connected on the same Ethernet, and one router has a subnet mask of 255.255.255.0, the other router that is sharing the same Ethernet should have the same subnet mask.
• Hello interval
This refers to the number of seconds between two consecutive hello packets. All routers attached to a common interface should have the same value.
• Dead interval
This interval is the amount of time before a neighbor is declared dead when a valid hello is not received from that neighbor. The default time for a dead timer is four times the hello interval.
This is a list of all attached routers from which a valid OSPF hello packet has been received recently. Each neighbor is identified by its router ID. Valid packets from the neighbor should be received within the dead interval of the router.
Recall that the hello packet informs all other routers about the identity of the DR. If the DR field is 0.0.0.0, this means that no DR currently exists for this network.
A designated router is the central point for generating link-state algorithms (LSAs) about broadcast and non-broadcast multiaccess networks (NBMA). It is responsible for synchronizing the database with all the other routers on the wire.
The hello packet informs all other routers about the identity of the DR. If the DR is already elected, all routers must accept the router as the DR. If the DR field is 0.0.0.0, this means that no DR currently exists for this network.
The DR is elected based on the following information:
• Highest priority
• Highest router ID among all routers sharing the same network
The DR is generally responsible for advertising thebroadcast/NBMA network via the network LSA, which means that every time the DR goes down, another router must be elected as the DR. This new DR then must synchronize the database with all the routers and reflood the new LSA.
During this synchronization and flooding, no data traffic passes through the transit network in question, and this delay causes scaling problems. To ensure smoother transition from a DR to a new DR during failure, the backup designated router (BDR)is used. Because all the routers on the local network already know the BDR, they do not need to synchronize the database with the BDR. Instead, the new DR simply must flood the new LSA. This provides a smoother transition and has less impact on the transit traffic.
Hello packets are sent across each medium in a slightly different manner. On broadcast media, each router advertises itself by periodically multicasting hello packets. The hello packet contains the router's view of the DR/bDR and the list of neighbors whose hello has been received within the last dead interval.
Hello packets behave differently on NBMA networks, in which they first require manual configuration (the neighbors must be specifically listed), and then each router with the potential of becoming a DR has a list of all the attached routers on the network. These routers send hello packets to all the other routers with DR potential, in order to locate the existing DR on the network. When the DR is found or elected through the election process, it sends messages to all other routers on the network.
On point-to-multipoint networks, hello packets are sent directly to the neighbors to which the router can communicate.
The database description (DBD) packet, which is OSPF packet type 2, is sent after routers have listed each other in their hello packets, and after two-way communication has been established. This is the initialization of adjacency.
DBD packets describe the contents of link-state databases; describing the entire database requires that multiple packets be sent. During the database-exchange process, one router is elected as master and the other as slave. The master is responsible for sending the DBD packets when either of the following is true:
• When the slave acknowledges the previous DBD packet by echoing the DD sequence number
• When a set number of seconds (configured by the retransmit interval) elapses without an acknowledgment, in which case the previous DBD packet is retransmitted
The slave is not allowed to form the DBD packet. DBD packets are sent in response only to DBD packets received from the master. If the DBD packet received from the master is new, a new packet is sent; otherwise, the previous DBD packet is re-sent.
If a situation arises when the master has finished sending the DBD packet, and the slave still has packets to send, the master sends an empty DBD packet with the M (more) bit set. The M bit is used to indicate that there are still more packets to send. At this point, the master sends an empty DBD packet with the M bit set.
Note that when a router receives a DBD packet that contains an MTU field larger than the largest IP datagram, the router will reject the packet. Figure 9-4 shows a DBD packet and all the fields in the packet.
Figure 9-4. A DBD Packet
Figure 9-4. A DBD Packet
The following list describes the fields in a DBD packet:
• Interface MTU
This is the largest IP datagram that can be sent across the interface without fragmentation.
When set to 1, this bit indicates the first packet in the sequence of DBD packets. M bit
When set to 1, this bit indicates that more DBD packets are to follow.
This bit indicates the status of the router. When set to 1, the router is the master. When set to 0, the router is the slave.
• DBD sequence number
This indicates the sequence of DBD packets. The initial value should be unique, and the value must be incremented until the complete database has been sent.
As the name indicates, this field consists of the header of each LSA and describes pieces of the database. If the database is large, the entire LSA header cannot fit into a single DBD packet, so a single DBD packet will have a partial database. The LSA header contains all the relevant information required to uniquely identify both the LSA and the LSA's current instance.
The link-state request packet, OSPF packet type 3, is sent in response to a router during the database exchange process. This request is sent when a router detects that it is missing parts of the database or when the router has a copy of LSA older than the one it received during the database exchange process. Figure 9-5 shows fields in the link-state request packet. The request packet contains each LSA specified by its LS type, link-state ID, and advertising router. This uniquely identifies the LSA.
Figure 9-5. Link-State Request Packet
Was this article helpful?