UNIX System Administration Handbook - Evi Nemeth [218]
Designated routers
In theory, link-state protocols distribute routing information in the form of records that describe connectivity among routers; for example, “Router A is adjacent to router B, and the cost of the link is 1.” If there were 6 routers on a network, 30 different link-state advertisements would potentially need to be propagated, because each router was adjacent to 5 other routers. Even worse, the routers would all have to treat each other as neighbors and make sure that their databases were synchronized.
OSPF reduces the amount of information that is propagated by appointing one of the routers on a network to be the designated router.9
The designated router listens to link-state advertisements from all the other routers and then sends out a digest of what it has learned.
The routers on a network cooperate to elect a designated router based on a per-router priority value that is set administratively. Routers with a priority of 0 are ineligible to be the designated router. Among the remaining routers, the one with the highest priority is declared the winner. If there is a tie, a router is selected pseudo-randomly.
A backup designated router is also selected in the same way. Each router on the network maintains an ongoing relationship with both the designated router and the designated router’s backup. If the designated router should fail, the backup immediately steps in to assume control and a new backup is elected.
Designated routers handle a bit more protocol traffic than their peers, so they should be selected accordingly.
Protocol configuration for OSPF
In gated.conf, you configure OSPF options with the ospf statement:
ospf yes | no| on | off [ {
defaults {
router-prio ;
};
traceoptions trace_options ;
backbone | (area area) {
networks {
network [exact | refines] [restrict] ;
network mask mask [exact | refines] [restrict] ;
network masklen num [exact | refines] [restrict] ;
host host [exact | refines] [restrict] ;
};
stubhosts {
host cost cost ;
};
interface interface_list [cost cost] {
enable | disable ;
priority priority ;
};
};
}];
This statement is less complicated than it looks. on, off, yes, and no have the obvious meanings; the default is not to run OSPF.
In the defaults section, router-prio specifies a default router priority (to be used when electing a designated router) of 1 on all interfaces. This value may be overridden on specific interfaces if desired. The default priority is 0, which makes gated ineligible to become any network’s designated router.
The definition of each area begins with either the backbone or the area keyword. There must be one area or backbone statement for each area of which the router is a member. The backbone is defined as area 0 in the OSPF protocol specification, but gated requires you to use the backbone keyword instead of area 0.
The area may be given as a decimal number or as a four-byte number in IP address format (e.g., 128.138.45.2). The area number is never interpreted as an IP address by gated, but the dotted quad format is supported in case you want to label areas with the IP addresses of principal routers or servers.
The list of networks defines the networks that compose the area. It is only necessary to enumerate networks in the configuration files of area-border routers. The specification of addresses and masks is done exactly as for martians, as described on page 357, except that there is no allow keyword. Networks marked with the restrict option are not included in route summaries; they are “secret” networks that are reachable only within the area.
stubhosts are directly attached hosts that should be advertised as being reachable via this router with the specified cost (1 is usually fine). This feature is used primarily to support links to hosts that are connected via PPP or SLIP.
Finally, the interface list specifies the cost to the attached networks (usually 1, the default), and the priority of this gated for becoming the designated router. If an interface is set to disable, then no OSPF conversations