OSPF Designated Routers:OSPF elects a designated router (DR) on all multi-access links: broadcast and NBMA. The DR forms an adjacency with all other OSPF routers on the network, and the other routers synchronize their LS databases only with the DR. The DR represents the network to the rest of the OSPF area by producing a special LSA called a Network LSA. When routers are synchronizing their databases with the DR over a broadcast link, it would be a waste of bandwidth and interface resources for the DR to produce duplicate Update packets for each and every adjacency. To avoid this inefficiency, multicast addresses are used. The DR sends packets to the other routers on the network using a destination address of 184.108.40.206 (called AllSPFRouters); the other routers communicate with the DR by sending packets to the multicast address 220.127.116.11 (called AllDRouters). By definition, NBMA networks do not support broadcasting and multicasting, so on these networks the DR and its adjacent routers must communicate using unicast on every adjacency. (This sounds like a worse problem than it actually is. In reality, the DR election happens very fast.)
The broadcast or NBMA network represented by the DR is seen by the SPF process and the graph of nodes it derives as a single nodea pseudonode, as described in the previous section. The OSPF pseudonode is represented by the address of the DR’s interface attached to the network. This means that if the DR fails, a new DR must be elected, the other routers must synchronize their LS databases to this new DR, and the new DR must advertise its own Network LSA indicating that the pseudonode is now represented by its own interface address. The problem is that until a new DR is elected, adjacencies formed with it and databases resynchronized, and until a new Network LSA is advertised, the network might appear as unreachable to the rest of the OSPF domain.
To minimize the impact of a failed DR, OSPF elects a backup designated router (BDR) in addition to the DR. Routers that are neither the DR nor the BDR (called DROthers in OSPF parlance) form adjacencies with both the DR and the BDR. The DR and BDR are also adjacent, and the BDR synchronizes with the DR just like the DROthers. Figure 4.26 illustrates this relationship. The BDR also listens to the ALLDRouters multicast address on broadcast links. Beyond that, the job of the BDR is like that of a vice president: to read the obituaries. That is, it quietly monitors the DR and if it detects that the DR has failed, it immediately takes over the job. The DROthers are already adjacent with the BDR, and because the BDR has synchronized to the DR just as the DROthers have, everyone should have the same LS databaseresynchronization is not necessary. As a result, recovery from a DR failure should be faster.
Figure 4.26. Both the DR and the BDR have adjacencies to all other routers on a multi-access network, but the routers only synchronize with the DR.
Designated Router, and Backup Designated Router fields. These are the specific fields used for the election of DRs and BDRs. Every broadcast and NBMA interface is assigned a priority value, which can be any number between 0 and 255. The value of the priority can be manually specified, and if it is not specified most routers will use some predetermined default value. However, RFC 2328 does not specify what the default should be, so it might vary from implementation to implementation. The default priority of Cisco Systems routers, for example, is 1, whereas the default for Juniper Networks routers is 128. If an interface has an assigned priority value of 0, the router is ineligible to be a DR or BDR on the connected network. The Designated Router and Backup Designated Router fields carry the IP address of the DR and BDR, if they are known. If the addresses of either or both of these routers are not known, the corresponding field is set to 0.0.0.0.
The steps preceding the OSPF DR election process are as follows:
- When an OSPF router interface becomes active on a multi-access network, it sets the DR and BDR values in the interface data structure to 0.0.0.0 to indicate that the DR and BDR are unknown. It also starts a wait timer with the value of the interface router dead interval.
- The router begins the neighbor-discovery process. It sends Hellos with the DR and BDR fields set to 0.0.0.0.
- If the received Hellos indicate an existing DR and BDR, the wait timer is stopped and the DR/BDR advertised in the Hellos is accepted.
- If the wait timer expires without a DR being discovered, the DR election process begins.
The steps of the DR election are:
- Of all the neighbors on a link with which bidirectional communication has been established, list the neighbors that are eligible to become the DR or BDR (neighbors whose advertised priority is greater than 0). The router includes itself in this list unless its interface priority is 0.
- From this list, create a subset of routers that includes all routers except the ones listing their own address in the DR field of their Hellos (thus claiming to be the DR).
- Select from the subset all routers who claim to be the BDR by including their own address in the BDR field of their Hellos. From this subset, the router with the highest priority value becomes the BDR. If the priority values are equal, the router with the highest RID becomes the BDR.
- If no router in the list claims to be the BDR, the router on the list with the highest priority becomes the BDR. Again, if the priorities are equal, the router with the highest RID becomes the BDR.
- From the original list, select all routers claiming to be the DR. Using the same qualifications as are used for selecting the BDR (highest priority value with the highest RID used as a tie breaker), select the DR.
- If no router claims to be the DR, the newly elected BDR becomes the DR and Steps 2 through 4 are repeated to elect another BDR.
Most interesting, in light of the complexity of the procedure, is that it is unlikely to be invoked very often. When a new router becomes active on a multi-access link on which a DR and BDR already exist, no election process takes place even if the new router has a higher priority. In other words, existing DRs and BDRs are not preempted. This rule makes the multi-access link more stable by preventing an election process from taking place whenever a new router joins. On the other hand, it means that the OSPF DR election process has little meaning on a stable multi-access network: The first two DR-eligible routers to become active on the link will be the DR and BDR