|
|
Installing and Administering Internet Services: HP 9000 Networking > Chapter 8 Configuring gatedConfiguring the OSPF Protocol |
|
OSPF is a link-state routing protocol designed to distribute routing information between routers in a single autonomous system (AS). Each OSPF router transmits a packet with a description of its local links to all other OSPF routers. The distributed database is built from the collected descriptions. Using the database information, each router constructs its own routing table of shortest paths from itself to each destination in the AS. OSPF allows routers, networks, and subnetworks within an AS to be organized into subsets called areas. An area is a grouping of logically contiguous networks and hosts. Instead of maintaining a topological database of the entire AS, routers in an area maintain the topology only for the area in which they reside. Therefore, all routers that belong to an area must be consistent in their configuration of the area. The topology of an area is hidden from systems that are not part of the area. The creation of separate areas can help minimize overall routing traffic in the AS. Figure 8-3 “Areas Defined in an Autonomous System” shows an example of three separate areas defined for an AS. Routers that have all their directly-connected networks in the same area are called internal routers. In Figure 8-3 “Areas Defined in an Autonomous System”, routers A, B, and H are internal routers. Routers that are connected to multiple areas are called area border routers. In Figure 8-3 “Areas Defined in an Autonomous System”, routers F and G are area border routers. Routers that connect one AS to another are called AS boundary routers. In Figure 8-3 “Areas Defined in an Autonomous System”, router D is an AS boundary router. Neighbor routers are routers that interface to a common network. OSPF uses its own Hello protocol to determine which routers are neighbors. In Figure 8-3 “Areas Defined in an Autonomous System”, routers A, B, and C are a set of neighbor routers that interface to network 1, while routers A and F are another set of neighbor routers that interface to network 2.
Multi-access networks (networks that can be accessed through two or more neighbor routers) must have one of the routers identified as a Designated Router. Designated Routers initiate OSPF protocol functions on behalf of the network. In Figure 8-3 “Areas Defined in an Autonomous System”, network 1 can be accessed through neighbor routers A, B, or C; one of these routers is elected to become the Designated Router for network 1. The set of routers that exchange OSPF protocol packets between areas in an autonomous system is called the backbone. In Figure 8-3 “Areas Defined in an Autonomous System”, routers C, D, E, F, G, and I form an AS backbone that allows protocol packets to travel between the three areas. OSPF routers exchange various types of link state advertisements to build their topological databases. Most link state advertisements are flooded (sent to every router) throughout the attached area. An exception is the link state advertisement sent out by AS boundary routers that describe routes to destinations outside the AS; these advertisements are flooded throughout the AS. Table 8-2 “Types of Link State Advertisements” shows the various types of link state advertisements used by the OSPF protocol. Table 8-2 Types of Link State Advertisements
AS boundary routers exchange routing information with routers in other autonomous systems. An AS boundary router may be an area border router or an internal router. It can be a backbone router, but it is not required that an AS boundary router be a backbone router. An AS boundary router learns about routes outside of its attached AS through exchanges with other routing protocols or through configuration information. Each AS boundary router calculates paths to destinations outside of its attached AS. It then advertises these paths to all routers in its AS. There are two levels of routing in the AS:
The following is a suggested sequence of steps in planning for OSPF routing in your autonomous system:
The default router identifier used by OSPF is the address of the first interface on the router encountered by gated. To set the router identifier to a specific address, specify the routerid interface statement in the Definition class of the /etc/gated.conf file.
The OSPF protocol is enabled for a node with the ospf statement in the Protocol class of the /etc/gated.conf file. The clause yes (or on) tells gated to enable the OSPF protocol at this node and process all OSPF packets coming in from other nodes. If you do not specify an OSPF line in your configuration file, ospf no is assumed. The clause no (or off) tells gated to disable the OSPF protocol at this node. The following is an example of the statement to enable OSPF:
Other statements that are defined for the OSPF protocol configuration are explained in the following sections. Every OSPF router is associated with one or more areas. The area statement identifies an OSPF area. The value is in the form of a dotted quad, or a number between 1 and 4294967295. To define an area, you also need to specify the following:
Note that the configuration of an area border router contains multiple area definitions; a different router interface is defined for each area. Figure 8-4 “Area Border Router Configuration Example” shows an example of an area border router that is connected to area 0.0.0.1 through interface 193.2.1.33 and to area 0.0.0.2 through interface 193.2.1.17. The following is an example of the area definitions in the router's /etc/gated.conf file:
There are various other characteristics that you can define for the area and for the interface(s). The following sections describe the configuration statements that you use in defining an area. The networks statement defines the address ranges that make up an OSPF area. This definition applies only to area border routers, where multiple areas are specified, and is required only if you need to compress a number of subnets using a network mask. Inside the networks statement, each IP address range is specified by a network address followed by a hexadecimal bit mask. For example, the following address range begins with the network address 193.2.1.16 and includes the first 15 addresses in that network (193.2.1.17 through 193.2.1.31):
Many separate networks can be specified in an address range. Area border routers advertise a single route for each address range. Figure 8-5 “Network Configuration Example” shows an example of a router that is connected to area 0.0.0.1 through interface 193.2.1.33. The attached network consists of addresses 193.2.1.33 through 193.2.1.47. The other network in the area consists of addresses 193.2.1.17 through 193.2.1.31. The following is an example of the network definition in Router A's /etc/gated.conf file:
The interface statement in the OSPF Protocol definition specifies which interface to use when communicating with the specified network(s). The interface may be specified with an address (for example, 193.2.1.36), a domain or interface name (for example, lan0 or lan1), a wildcard name (for example, lan*), or all. (The order of precedence is address, name, wildcard name, all.) Multiple interface statements may be specified with different clauses. If a clause is specified more than once, the instance with the most specific interface reference is used. The cost clause can optionally be specified to define a cost of sending a packet on the interface. This cost is advertised as the link cost for this interface. See “Cost” for more information about setting interface costs. You can also enable or disable the interface definition. If disable is not explicitly specified, an interface definition is assumed to be enabled. OSPF supports three types of network interfaces: The definition for each type of interface is described separately in the following sections. On multicast networks, an OSPF router dynamically detects its neighbor routers through the OSPF Hello message. The following statements are defined for a multicast type interface: retransmitinterval is the number of seconds between retransmission of link states, database description, and link state request packets. This value should exceed the expected round-trip delay between any two routers in the network. A sample value for a LAN is 5 seconds. transitdelay is the number of seconds it takes to transmit a Link State Update Packet over this interface. This value must take into account the transmission and propagation delays for the interface. It must be greater than 0. A sample value for a LAN is 1 second. priority should be configured only for interfaces to multi-access networks. This value specifies the priority of the router to become the Designated Router. When two routers attached to a network both attempt to become the Designated Router, the one with the highest router priority value takes precedence.
hellointerval specifies the number of seconds between transmission of OSPF Hello packets. Smaller intervals ensure that changes in network topology are detected faster; however, routing traffic can increase. A sample value for an X.25 network is 30 seconds. A sample value for a LAN is 10 seconds.
routerdeadinterval specifies the number of seconds that hello packets are not received from a router before it is considered "down" or "inactive" by its neighbors. This value should be some multiple of the hellointerval value.
authkey is the password used to validate protocol packets received on the router interface. The value is one of the following: 1 to 8 decimal digits separated by periods, a 1-byte to 8-byte hexadecimal string preceded by 0x, or a string of 1 to 8 characters in double quotes.
Figure 8-6 “Multicast Router Interface Example” shows an example of a router that is connected to a multicast network through interface 193.2.1.35. The following is an example of the multicast interface definition in the router's /etc/gated.conf file:
On NBMA networks, certain configuration information, including the routers that are attached to the network, must be supplied in order for OSPF's Hello protocol to communicate with neighbor routers. An NBMA interface definition applies to both X.25 network interfaces as well as for systems that do not support IP multicast. An NBMA type interface is defined with the same statements as for a multicast type interface, with the following additions:
Figure 8-7 “Non-Broadcast Router Interface Example” shows an example of a router (A) that is connected to an NBMA network through interface 193.2.1.35. Two other routers are also attached to the network: router B is connected through interface 193.2.1.33 and C is connected through interface 193.2.1.46. B and C are eligible to be Designated Routers. The following is an example of the non-broadcast interface definition in router A's /etc/gated.conf file:
On point-to-point networks, an OSPF router dynamically detects its neighbor router by sending OSPF Hello packets. The following statements are defined for a point-to-point interface: retransmitinterval is the number of seconds between retransmission of link states, database description, and link state request packets. This value should exceed the expected round-trip delay between any two routers in the network. A sample value for a LAN is 5 seconds. hellointerval specifies the number of seconds between transmission of OSPF Hello packets. Smaller intervals ensure that changes in network topology are detected faster; however, routing traffic can increase. A sample value for an X.25 network is 30 seconds. A sample value for a LAN is 10 seconds.
routerdeadinterval specifies the number of seconds that hello packets are not received from a router before it is considered "down" or "inactive" by its neighbors. This value should be some multiple of the hellointerval value.
A point-to-point interface can be defined with or without a nonbroadcast clause. If the nonbroadcast clause is specified, then the pollinterval statement must be defined: pollinterval specifies a rate at which hellos are sent when a neighboring router becomes inactive. (A router is considered inactive when hellos have not been received from the router for the amount of time specified by the routerdeadinterval definition.) The value of pollinterval should be larger than the value of hellointerval. A sample value for an X.25 network is 2 minutes.
If the device at the other end of the point-to-point network is not an OSPF router, you can prevent Hello packets from being sent to it. (*** This is done using the stubhosts statement. stubhosts specifies the IP address or domain name of the non-OSPF host. The cost of sending a packet to the host must also be specified. (In most cases, the host has only a single connection to the network so the cost configured has no effect on routing.) Figure 8-8 “Point-to-Point Router Interface Example” shows an example of a router (A) that is connected to a non-broadcast, point-to-point network through interface 193.2.1.1. The following is an example of the interface definition in router A's /etc/gated.conf file:
Note that if the router (A) were connected to a multicast, point-to-point network, the nonbroadcast clause and the pollinterval statement must be omitted. By default, AS external link advertisements (routes to destinations outside the AS) are propagated to every router in every area in the AS. Certain OSPF areas can be configured as stub areas. AS external link advertisements are not flooded through stub areas. This reduces the size of the topology database that must be maintained by internal routers in the stub area and reduces the protocol traffic through the area. For example, if all inter-area traffic for an area must go through a single router, then it is not necessary for all routers in the area to receive inter-area routing information. An area border router advertises in the stub area a default route as the summary of all the IP destinations that are reachable outside the AS. Summary link advertisements (routes to destinations outside the area but within the AS) continue to be sent into the stub area. The stub statement specifies that the area is a stub area. A cost clause can optionally be defined that specifies the cost associated with the default route to be advertised in the stub area. Figure 8-9 “Area Border Router Configuration Example” shows an example of an area border router that is connected to area 0.0.0.2 through interface 193.2.1.20. Since all traffic in and out of area 0.0.0.2 must pass through router A, it is not necessary for the area's internal routers, such as router B, to receive inter-area routing information. The following is an example of the stub area definition in the router's /etc/gated.conf file:
The OSPF backbone distributes routing information between areas. Backbones are defined with the same statements and clauses as areas. The stub statement may not be defined for a backbone. The backbone statement is used to define a router as a backbone router. If an OSPF internal or area boarder router is also a backbone router, the backbone statement must follow the area statement(s) in the /etc/gated.conf file. Whenever an area border router (a router connected to multiple areas) is configured, backbone information must be provided. Figure 8-10 “Backbone Configuration Example” shows an example of two area border routers that form part of a backbone. Router A has interfaces to both area 0.0.0.1 and area 0.0.0.2, while router B has interfaces to areas 0.0.0.3 and 0.0.0.4. Router A is connected to router B through interface 15.13.115.156. The following is an example of the backbone router definition for router A's /etc/gated.conf file:
If the router is directly attached via a point-to-point interface to a host that is not running OSPF, you can prevent OSPF Hello packets from being sent to the host. This is done by specifying the subhost statement with the host's address. A cost can optionally be defined. The OSPF protocol allows packets containing routing information to be authenticated. The authentication method used is configured on a per-area basis; different authentication methods may be used in different areas. gated supports a simple password authentication method. You can also choose to have no authentication. The authtype statement is used to define the authentication method used for the area. 0 or none specifies that routing exchanges in the area are not authenticated. 1 or simple specifies that network passwords of up to 64 bits (8 characters) are used to authenticate packets received from routers in the area. In the simple password authentication method, all routers that interface to a given network use the same password. The password is defined by the authkey statement in the router's interface definition. If a router is not configured with the same password as other routers in the network, the router's packets are discarded by other network routers. Note that the password is configured on a per-interface basis. If a router has interfaces to more than one network, different passwords may be configured. This is illustrated in Figure 8-11 “Simple Password Authentication”. The following example shows an authtype statement that enables a simple password authentication for the routers in the area and an authkey statement in the interface definition that defines a password ("travis") to validate protocol packets received by the router:
The outbound side of each router interface is associated with a configurable cost. Lower cost interfaces are more likely to be used in forwarding data traffic. Cost values are assigned at the discretion of the network or system administrator. While the value is arbitrary, it should be a function of throughput or capacity of the interface: the higher the value, the lower the throughput or capacity. Thus, the interfaces with the highest throughput or capacity should be assigned lower cost values than other interfaces. Interfaces from networks to routers have a cost of 0. Figure 8-12 “Cost Configuration Example” shows an example network where costs have been specified for each interface. In Figure 8-12 “Cost Configuration Example”, there are two possible packet routes between nodes A and D: one route goes through node B and the other route goes through node C. The cost of each route is calculated as follows: Node A to node B and node B to node D: 5+5 = 10 Node A to node C and node C to node D: 5+10 = 15 The lowest cost OSPF path between nodes A and D is therefore through node B. However, if there were a link failure between node B and LAN 2, packets would be rerouted through node C. There are other places in the /etc/gated.conf file where cost can optionally be defined:
AS external (ASE) routes are paths to destinations that are outside the AS. Most ASE routes are routes to specific destinations. ASE routes are learned by AS boundary routers through another routing protocol, such as EGP, or through configured routes. gated supports the use of route information from other autonomous systems that use other routing protocols, such as EGP. AS external link advertisements are sent by AS boundary routers and are flooded throughout the AS (with the exception of configured stub areas). A single AS external link advertisement is sent for each external route that the AS boundary router has learned about. Externally-defined routing information is kept separately from the OSPF routing information. In addition, the externally-defined routing information can be tagged, where the source of the information is identified and stored along with the route information. Statements in the Control class of the /etc/gated.conf file control the importing of routes from routing protocols to a gated forwarding table and the exporting of routes from the gated forwarding table. See “Importing and Exporting Routes”. The defaults statements in the OSPF protocol configuration are specified for AS boundary routers only. These statements specify how external routing information is handled by the OSPF protocol. The following can be defined in the defaults statements:
Figure 8-13 “OSPF Sample Configuration” shows an example of two areas. Area 1 is a non-stub area, while area 2 is configured as a stub area. Node B is an area border router between the two areas. Set up /etc/gated.conf as follows:
Note that the configuration shown above is for a multicast interface. For an NBMA interface, the configuration in /etc/gated.conf would be set up as follows:
Set up /etc/gated.conf as follows:
Set up /etc/gated.conf as follows:
The routing table on node A contains routes to 193.2.1.32 and 193.2.1.16. The routing table on node C in the stub area contains routes to LAN1 only and a default router. HP's gated also provides ospfagt, an OSPF Simple Management Network Protocol (SNMP) subagent that supports the OSPF MIB (Management Information Base) (see RFC 1253). The ospfagt subagent works with the HP SNMP Agent, snmpdm. If you are using an SNMP manager utility to manage your network, such as HP's OpenView Network Node Manager, you may also want to use HP's OSPF SNMP subagent. To start ospfagt automatically at system bootup, set the environment variable OSPFMIB to 1 in the file /etc/rc.config.d/netdaemons. To manually start ospfagt , enter:
Note that gated must be running before ospfagt can be started. Both gated and ospfagt must be running in order to retrieve OSPF MIB objects. To load the OSPF MIB, select "Load/Unload SNMP:MIBS ..." from the Options Menu of OpenView. |
|