Read an Excerpt
From Chapter 11: Open Shortest Path First...The OSPF Hello header contains the following fields:
- Network mask. This field is the network mask associated with this interface. For example, if the interface is for a class B network whose third byte is used for subnetting, the network mask is 0xffffff00.
- Hello Interval. The number of seconds between this router's Hello packets.
- Options. This field is for the optional capabilities supported by the router.
- Router Priority. This field is for this router's priority and is used in (Backup) Designated Router election. If set to 0, the router is ineligible to become (Backup) Designated Router.
- Dead Interval. This field indicates the number of seconds before declaring a silent router down.
- Designated Router. This field indicates the identity of the Designated Router for this network, according to the sending router. The Designated Router is identified here by its IP interface address on the network. This field is set to 0.0.0.0 if no Designated Router exists.
- Backup Designated Router. This field indicates the identity of the Backup Designated Router for this network, according to the sending router. The Backup Designated Router is identified here by its IP interface address on the network. If this field is set to 0.0.0.0, no Backup Designated Router exists.
- Neighbor. This field contains the Router IDs of each router from whom valid Hello packets have been seen within the amount indicated as the Dead Interval time on the network.
In OSPF, the DR, whichis elected by the Hello protocol, is responsible for collecting explicit acknowledgments for each LSP from the other routers. The DR generates a link-state advertisement for the multiaccess network.
Because the DR in OSPF keeps a lot of information regarding which routers have which LSPs, a lot of time and protocol messages would be required for another router to take over if the DR crashed. Therefore, OSPF elects a backup DR. The backup DR also listens to all the explicit acknowledgments and keeps track of which routers have received which LSPs.
The DR concept enables a reduction in the number of adjacencies required on a multi-access network. This, in turn, reduces the amount of routing protocol traffic and the size of the topological database.
When a router, R, has an LSP to propagate on the LAN, R doesn't multicast the LSP to all the other routers. Instead, R transmits it to the DR. However, rather than send the LSP to the DR's personal data-link address, R transmits the LSP to the multicast address of all DRs, to which both the DR and the backup DR listen. When the DR collects ACKs for that LSP, which are transmitted to the multicast address of all the DRs. If the DR does not receive an ACK from a subset of the routers, it sends explicit copies of the LSP to each router in that subset.
The DR performs two main functions for the routing protocol:
- The Designated Router originates a network links advertisement on behalf of the network. This advertisement lists the set of routers (including the Designated Router) currently attached to the network. The Link State ID for this advertisement is the IP interface address of the Designated Router. The IP network number then can be obtained by using the subnet/network mask.
- The Designated Router becomes adjacent to all other routers on the network. Because the link-state databases are synchronized across adjacencies (through adjacency bringing up and then flooding procedure), the Designated Router plays a central part in the synchronization process.
The DR calculation calls the router doing the calculationRouter X. The list of neighbors attached to the network and having established bidirectional communication with Router X is examined. This list is precisely the collection of Router X's neighbors (on this network) whose state is greater than or equal to 2-WAY. Router X also is considered to be on the list. The calculation then discards all routers from the list that are ineligible to become DR (routers having router priority of 0).
The following steps then are executed, considering only those routers that remain on the list:
1. Note the current values for the network's DR and backup DR.
2. Calculate the new backup DR for the network as follows: if one or more of the routers have declared themselves backup DR (in their Hello packets), the one with the highest router priority is declared to be backup DR. In case of a tie, the one having the highest router ID is chosen. If no routers have declared themselves backup DR, choose the router having the highest router priority, excluding those routers who have declared themselves DR, and again use the router ID to break ties.
3. Calculate the new DR for the network as follows: if one or more of the routers have declared themselves DR (in their Hello packets), the one with the highest router priority is declared to be DR. In the case of a tie, the one having the highest router ID is chosen. If no routers have declared themselves DR, promote the new backup DR to DR.
4. If router X is now newly the DR (or the backup DR or is now no longer the DR (or the backup DR), repeat steps 2 and 3. For example, if router X is now the DR, when step 2 is repeated, X is no longer eligible for backup DR election. Among other things, this ensures that no router will declare itself both DR and backup DR.
5. As a result of these calculations, the router may now be DR or backup DR. The router's interface state should be set accordingly.
6. If the attached network in nonbroadcast, and the router itself has just become DR (or backup DR), it must start sending Hellos to those not eligible to become DR (having a router priority of 0).
7. If the preceding calculations have caused the identity of the DR (or the backup DR) to change, the set of adjacencies associated with this interface need to be modified. Some adjacencies may need to be formed, and others may need to be broken (reexamine all the neighbors', whose state is at least 2-WAY, eligibility for adjacency).
When the DR and the backup DR are elected, OSPF makes every effort to keep them, even if another router subsequently comes up with a higher priority or ID. The reason behind the election algorithm's complexity is the desire for an orderly transition from backup DR to DR, when the current DR fails. This orderly transition is ensured through the introduction of hysteresis: no new backup DR router can be chosen until the old backup accepts its new DR responsibilities.
If router X is not eligible to become DR, neither a backup DR nor a DR may be selected in this procedure. Note also that if router X is the only attached router eligible to become DR, it will select itself as DR, and no backup DR is assigned for the network...