4.2 Open Shortest Path First (OSPF)
Like distance vector protocols, link-state protocols use routing tables that are populated with the currently-best routes. Link-state protocols, however, differ from Distance vector protocols in the methods they use to build their routing tables. The biggest difference between the two is that distance vector protocols advertise little information.
Unlike distance vector protocols, link-state protocols do not receive metrics in the routing table updates. Instead they must calculate the metric form the topology information learned by a router, which includes a cost associated with each link in the network. A router totals the cost associated with each link in each route to find the metric associated with that route. Link-state protocols use the Shortest Path First (SPF) algorithm, which is also called the Dijkstra SPF algorithm, to calculate route metrics. The two popular link-state protocols are Open Shortest Path First (OSPF) and Intermediate System to Intermediate System (IS-IS).
Topology and Routing Databases |
---|
The topology database, which sometimes referred to as the link-state database, is the router's view of the network within the area. It includes every OSPF router within the area and all the connected networks. This database is a routing table for which no path decisions have been made. The topology database is updated by link-state advertisements (LSAs). Each router within the area has exactly the same topology database. The synchronization of the topology maps is ensured by the use of sequence numbers in the LSA headers. A routing database is constructed from the topology map. This database is unique to each router, which creates a routing database by running the shortest path first (SPF) algorithm to determine the best path to each network and creates an SPF tree on which it places itself at the top. If there are equal metrics for a remote network, OSPF includes all the paths and load balances the routed data traffic among them. |
OSPF, which is defined in RFC 2328, is a classless link-state routing protocol that uses Dijkstra's shortest path first (SPF) algorithm to calculate paths to destinations. Because OSPF is classless, it has support for VLSMs. It also supports equal-cost multipath load balancing and neighbor authentication. OSPF uses multicast addresses to communicate between routers and runs over IP protocol 89.
In OSPF, each router sends link-state advertisements about itself and its links to all its adjacent routers. Each router that receives a link-state advertisement records the information in its own topology database and sends a copy of the link-state advertisement to each of its adjacencies except the router that sent the advertisement originally. In this way, all the link-state advertisements reach all the routers in an area and ensures that every router in the area has an identical topology database. Once the topology databases are complete, each router uses the SPF algorithm to calculate a loop-free, shortest-path tree to each destination, and builds the routing table is built from the shortest-path tree.
When a new router that is configured with a link-state protocol is booted for the first time, it does not start broadcasting topology information out every interface. Instead, the router uses the Hello protocol to send and receive a small Hello packet to discover neighbors, i.e., other routers that use the same link-state protocol and share a common subnet. It has a source address of the router and a multicast destination address set to AllSPFRouters (224.0.0.5). All routers running OSPF or the SPF algorithm listen for the hello packet and send their own hello packets periodically. Once a router identifies a neighbor, the two routers exchange routing information, which is called the topology database, and then run the SPF algorithm to calculate new routes. When their topology databases are synchronized, the neighbors are said to be fully adjacent. The Hello protocol continues to transmit the Hello packets periodically. The transmitting router and its networks reside in the topology database for as long as the other routers receive the Hello protocol. This provides another mechanism for determining that a router has gone down, i.e., when the neighbor no longer sends Hello packets.
The routing updates sent by an OSPF router are called link-state updates (LSUs), and the items sent in an LSU include individual link-state advertisements (LSAs). OSPF uses a reliable protocol to exchange routing information, ensuring that lost LSU packets are retransmitted. OSPF routers can, thus, determine whether a neighbor has received all the LSAs.
OSPF Terminology
Term | Meaning |
---|---|
Adjacency | The situation that takes place when two OSPF routers have exchanged information that results in the two routers having identical topology tables. |
Area | The grouping of networks and routers that have the same link state information and area ID number. OSPF routers must reside in an Area |
Area Border Router (ABR) | This refers to those routers who exist on the border of more than one OSPF area that connects to routers to the backbone. |
Autonomous System (AS) | This refers a group of routers that form part of the same network management and administration, who share OSPF routing information. |
Autonomous System Boundary Router (ASBR) | This refers an Autonomous System Boundary Router (ASBR) that exists between an OSPF Autonomous System (AS) and a non OSPF network that executes several or multiple routing protocols. |
Backbone | This is the foremost path or route that is used for network traffic. The backbone is that segment of the network that is most frequently resourced from. |
Backup Designated Router (BDR) | This is a standby Designated Router (DR) that receives that same information as a DR so that it can function when there is a DR failure. |
Cost | This refers to the metric utilized by OSPF that is symbolized by a numerical value and is allocated to a particular link. Cost is based on connection output speed. |
Designated Router | This is an OSPF router that performs numerous functions is a multiaccess network. A DR decreases traffic, as well as the size of the topology database. |
Hello | This is a packet that is utilized by OSPF to create and administer relation-ships with neighbor devices. |
Neighbor | This refers to two routers who have links on a shared network |
Link | This refers to the interface between a connected network and an OSPF router |
Link State | This refers to the circumstance or condition of a particular link between two routers that share link state advertisements. A link state can be in the full state, down, loading, init, two, exstart, or exchange condition. |
Link State Advertisement (LSA) | This refers to the situation whereby OSPF broadcasts packets that hold updates that is utilized to sustain routing tables. Remember that Routing Tables contain information about path costs and neighbors. |
Router ID | This is an exclusive number on a Cisco router. The Router ID is
configured by the:
|
Router Priority | This is an 8-bit number that specifies the priority of the router during the DR and BDR election method. When the need arises, the Router Priority can be manually reconfigured. |
Routing Table / Forwarding Database | This refers to the table that is established when the SPF algorithm is performed on the link-state database |
Topology Table / Link State Database | This is that table that contains each link in the whole network. |
4.2.1 Building OSFP Routing Tables
Five packets are used to build the routing table on a new OSPF-configured router. These are the Hello protocol; the database descriptor, which is used to send summary information to neighbors to synchronize topology databases; the link-state request, which works as a request for more detailed information that is sent when the router receives a database descriptor that contains new information; the link-state update, which works as the link-state advertisement (LSA) packet issued in response to the request for database information in the link-state request packet; and the link-state acknowledgement, which acknowledges the link-state update.
When the new OSPF-configured router is connected to the network, it must learn the network from the routers that are up and running. The router goes through three stages while exchanging information: the down state, the init stage, and the two-way state. You can check what stage an interface running OSPF is in by using the show ip ospf neighbor command or the debug ip ospf adjacency command.
The DR and the BDR |
The designated router (DR) is a router on broadcast multi-access network that is responsible for maintaining the topology table for its segment. This router can be dynamically elected through use of the Hello protocol, or can be designated by the network administrator. Redundancy is provided by the Backup Designated Router (BDR). |
The new router starts in a down state. It transmits its own Hello packets to introduce itself to the segment and to find any other OSPF-configured routers. This is sent out as a Hello to the multicast address 224.0.0.5 (AllSPFRouters). It sets the designated router (DR) and the backup designated router (BDR) in the Hello to 0.0.0.0. While the new router waits for a reply, which usually is four times the length of the Hello timer, the router is in the init state. Within the wait time, the new router hears a Hello from another router and learns the DR and the BDR. If there is no DR or BDR stated in the incoming Hello, an election takes place.
Once the new router sees its own router ID in the list of neighbors, and a neighbor relationship is established, it changes its status to the two-way state.
The new router and the DR have now established a neighbor relationship and need to ensure that the new router has all the relevant information about the network. The DR must update and synchronize the topology database of the new router. This is achieved by using the exchange protocol with the database description packets (DDPs). There are four different stages that the router goes through while exchanging routing information with a neighbor: the exstart state, the exchange state, the loading state, and the full state.
During the exstart state, one of the routers will take seniority and become the master router, based on highest IP interface address.
Both routers will send out database description packets, changing the state to the exchange state. At this stage, the new router has no knowledge and can inform the DR only of the networks or links to which it is directly connected. The DR sends out a series of DDPs containing the networks, referred to as links that are held in the topology database. Most of these links have been received from other routers via link-state advertisements (LSAs). The source of the link information is referred to by the router ID. Each link will have an interface ID for the outgoing interface, a link ID, and a metric to state the value of the path. The DDPs will contain a summary rather than all the necessary information. When the router has received the DDPs from the neighboring router, it compares the received network information with that in its topology table. In the case of a new router, all the DDPs are new.
If the new router requires more information, it will request that particular link in more detail using the link-state request packet (LSR). The LSR will prompt the master router to send the link-state update packet (LSU). This is the same as a LSA used to flood the network with routing information. While the new router is awaiting the LSUs from its neighbor, it is in the loading state.
When these LSRs are received and the databases are updated and synchronized, the neighbors are fully adjacent. This is the full state.
4.2.2 OSPF Steady-State Operation
Link-state protocols keep in touch with their neighbors by periodically exchanging small packets rather than complete routing updates. In OSPF, these packets are called Hello packets, which identify the subnet, the router sending the packets and a few other details. These Hello packets serve the same purpose as timed, regular full routing updates serve for distance vector protocols. When a router fails to hear Hellos from a neighbor for an interval called the dead interval, the router assumes that the silent router has failed. OSPF then marks the silent router as "down" in its topology database. The other router then runs the SPF algorithm to calculate new routes, based on the fact that one of the network's routers is now unavailable. In addition, the router that notices the failure immediately floods the new router or link status to its neighbors, with those routers forwarding the updated status to their neighbors, eventually flooding the new status information to all the routers in the network. This quick convergence of link-state protocols prevents the occurrence of loops.
4.2.3 OSPF Areas
There are a number of problems associated with using OSPF. These problems are related to the network size. The larger the network, the greater the probability of a network change, which would require a recalculation of the whole area. This increases the frequency with which the SPF algorithm is being run. In addition, each recalculation will take longer. As the network grows, the size of the routing table will increase. Although the complete routing table is not sent out as in a distance vector routing protocol, the greater the size of the table, the longer each lookup becomes. The memory requirements on the router will also increase. Furthermore, the topological database will increase in size and will eventually become unmanageable. As the various databases increase in size and the calculations become increasingly frequent, the CPU utilization will increase as more of the available memory I consumed. This will have a negative impact on network response time, not because of congestion on the line but because of congestion within the router itself.
Using multiple OSPF areas solves most of the common problems with running OSPF in larger networks. The division of a large single area network into multiple areas allows routers in each area to maintain their own topological databases. This limits the size of the topological databases within an area, which results in routers requiring less memory and processing time to run SPF, and a decrease in convergence time. Summary and external links ensure connectivity between areas and networks outside the autonomous area (AS). This is achieved by creating areas from groups of subnets. Each area is treated internally as a small entity on its own. It communicates with the other areas, exchanging routing information which is kept to a minimum by allowing only that information that is required for connectivity.
There are two approaches to implementing multiple area networks. The first approach is to grow a single area until it becomes unmanageable. This approach requires less initial work and configuration but care should be put into the design of the network because this may cause problems in the future, particularly in addressing. The second approach is to design the network with multiple areas, which are very small, in anticipation that the networks will grow to fit comfortably into their areas. In practice, many companies convert their networks into OSPF from a distance vector routing protocol when they realize that they have outgrown the existing routing protocol. This allows the planned implementation of the second approach.
4.2.3.1 OSPF Area Types
Regardless of which approach is used, a multiple area OSP network has a hierarchical structure and consists a number of distinct areas. These areas are:
The backbone area, which is also referred to as Area 0. All other areas must connect to the backbone area. Hence, this area is obligatory.
An ordinary or standard area, which is an area that connects to the backbone (Area 0) and is treated as a separate entity. All routers in a standard area have the same topological database, but their routing tables will be based on the routers position in the standard area and will thus be unique to the router.
A stub area, which is an area that does not accept external summary routes. A router within a stub area can only see outside the autonomous system if a default route has been configuration for it.
A totally stubby area, which is similar to a stub area. In this area, the default route must be configured as 0.0.0.0. This type of area is useful for remote sites that have few networks and limited connectivity with the rest of the network and is a Cisco proprietary solution.
A not so stubby area (NSSA), which is a stub area that can receive external routes but will not propagate those external routes into the backbone area.
4.2.3.2 Router Responsibilities
Because of the hierarchical nature of a multiple area OSPF network, routers have different responsibilities, depending on their position and functionality within the hierarchical design. These routers have different designations such as internal routers, backbone routers, area border routers (ABR), and autonomous system boundary routers (ASBR).
The Internal Router exists within an area. It is responsible for maintaining a current and accurate database of every subnet within the area. It is also responsible for forwarding data to other networks by the shortest path. Flooding of routing updates is confined to the area. All interfaces on this router are within the same area.
The Backbone Router exists within the backbone area, which is also called Area 0. The design rules for OSPF require that all the areas be connected through a single area, known as Area 0. Area 0 is also known as Area 0.0.0.0 on other routers. A router within this area is referred to as a backbone router. It may also be an internal router or an Area Border Router.
The Area Border Router (ABR) is responsible for connecting two or more areas. It holds a full topological database for each area to which it is connected and sends LSA updates between the areas. These LSA updates are summary updates of the subnets within an area. It is at the area border that summarization should be configured for OSPF because this is where the LSAs make use of the reduced routing updates to minimize the routing overhead on both the network and the routers.
The Autonomous System Boundary Router (ASBR) is used to connect to a network or routing protocol outside the OSPF domain. OSPF is an interior routing protocol or Interior Gateway Protocol (IGP); gateway is an older term for a router. If there is any redistribution between other protocols to OSPF on a router, it will be an ASBR. This router should reside in the backbone area but you can place it anywhere in the OSPF hierarchical design.
4.2.4 Differences between OSFP and RIP Routing Protocols
There are a number of differences between OSFP and RIP. These include the following:
OSPF converges faster than RIPv1. It transmits changes straight away and fewer packets are lost.
There is no limitation to the size of an OSFP network. A RIPv2 network cannot expand bigger than 15 hops.
OSPF transmits a multicast update when there is a topology change while RIP, by default, broadcasts the whole routing table each 30 seconds.
OSPF and RIPv2 support Variable Length Subnet Mask (VLSM). RIPv1 does not support VLSM.
Bandwidth cost and delay concerns are not taken into account by RIP. The routing decision is solely based on hop count as a metric. OSPF can use VLSM masks for route summaries. This decreases the routing table entries and the quantity of update traffic and router operating costs.
OSPF and RIPv2 provide authentication in the packet. RIPv1 does not provide this authentication.
RIP is easier to configure, troubleshoot and monitor than OSPF. However, Cisco IOS provides a more advanced and affluent suite of configuring, troubleshooting and monitoring capabilities with OSPF than RIP.
OSPF can use a substantial quantity of CPU.
4.2.5 Intra-Area OSPF
There are a number of problems associated with using OSPF. These problems are related to the network size. The larger the network, the greater the probability of a network change, which would require a recalculation of the whole area. This increases the frequency with which the SPF algorithm is being run. In addition, each recalculation will take longer. As the network grows, the size of the routing table will increase. Although the complete routing table is not sent out as in a distance vector routing protocol, the greater the size of the table, the longer each lookup becomes. The memory requirements on the router will also increase. Furthermore, the topological database will increase in size and will eventually become unmanageable. As the various databases increase in size and the calculations become increasingly frequent, the CPU utilization will increase as more of the available memory I consumed. This will have a negative impact on network response time, not because of congestion on the line but because of congestion within the router itself.
Using multiple OSPF areas solves most of the common problems with running OSPF in larger networks. The division of a large single area network into multiple areas allows routers in each area to maintain their own topological databases. This limits the size of the topological databases within an area, which results in routers requiring less memory and processing time to run SPF, and a decrease in convergence time. Summary and external links ensure connectivity between areas and networks outside the autonomous area (AS). This is achieved by creating areas from groups of subnets. Each area is treated internally as a small entity on its own. It communicates with the other areas, exchanging routing information which is kept to a minimum by allowing only that information that is required for connectivity.
There are two approaches to implementing multiple area networks. The first approach is to grow a single area until it becomes unmanageable. This approach requires less initial work and configuration but care should be put into the design of the network because this may cause problems in the future, particularly in addressing. The second approach is to design the network with multiple areas, which are very small, in anticipation that the networks will grow to fit comfortably into their areas. In practice, many companies convert their networks into OSPF from a distance vector routing protocol when they realize that they have outgrown the existing routing protocol. This allows the planned implementation of the second approach.
4.2.5.1 OSPF Across Nonbroadcast Multiaccess Networks (NBMA)
A nonbroadcast multiaccess (NBMA) network is a network that has multiple destinations but cannot carry broadcast traffic. Examples of NBMA networks include Frame Relay, X.25, and ATM. The solution to how OSPF operates using multicast traffic to exchange network information and to create adjacencies to synchronize databases across this WAN cloud without using the multicast addresses, depends on the technology involved and the network design. The modes available fall into two technologies, within which there are additional options. The two technologies are point-to-point and NBMA.
The NBMA technology is then subdivided into two categories, under which different configuration options are available. These two categories are the RFC-compliant solution and the Cisco-specific solution:
The RFC-compliant category offers a standard's solution, which is independent of the vendor platform. The configuration options are NBMA and point-to-multipoint.
The Cisco-specific configuration options are proprietary to Cisco and include point-to-multipoint nonbroadcast, broadcast, and point-to-point.
The option selected depends on the network topology that is in use. The OSPF technology is separate from the physical configuration, and the choice of implementation is based on the design topology.
The Frame Relay topologies include:
Full mesh, in which every router is connected to every other router. This solution provides redundancy, and it may allow load sharing. This is the most expensive solution.
Partial mesh, in which some routers are connected directly; others are accessed through another router.
Star, or hub and spoke, in which one router acts as the connection to every other router. This is the least expensive solution because it requires the fewest number of permanent virtual circuits (PVCs). Here a single interface is used to connect to multiple destinations.
The considerations in choosing the OSPF topology depend on its method of updating the network and its effect on network overhead. In a point-to-point circuit no DR or BDR is required, each circuit will have an adjacency, which will create many more adjacencies on the network and will increase the need for network resources. In an NBMA environment a DR and a BDR may be required, unless the underlying technology is point-to point. This is economical for most routers, requiring only two adjacencies, except for the DR and BDR. However, it may require more administration in terms of configuration.
4.2.5.2 Physical Interface and Logical Subinterfaces
On a Cisco router, it is possible to configure a physical interface to be many logical interfaces. This is useful in a WAN environment and means that the logical topology is independent of the physical configuration. These subinterfaces can be configured to be point-to-point or point-to-multipoint. One of the main determining factors is the number of subnets to be used. A point-to-point interface requires its own subnet to identify it.
If the point-to-point option is selected, the routers at each end create adjacencies. This however requires more network overhead and restricts some communication. In a point-to-point network, the concept of a broadcast is not relevant because the communication is directly to another router. In a point-to-multipoint network, although OSPF simulates a broadcast, multicast environment, the network traffic is replicated and sent to each neighbor.
For serial interfaces with HDLC encapsulation, the default network type is point-to-point. For serial interfaces with Frame Relay encapsulation, the default network type is nonbroadcast. For serial interfaces with Frame Relay encapsulation and using point-to-point subinterfaces, the default network type is point-to point. For serial interfaces with Frame Relay encapsulation and using point-to-multipoint subinterfaces, the default network type is nonbroadcast.
4.2.5.3 Problems with Intra-Area OSPF
There are a number of limitations to using OSPF in a single area. These problems are related to the growth of the network. The larger the network, the greater the probability that the network will change and that a recalculation of the entire area will be required. This increases the frequency with which the SPF algorithm is being run. In addition, each recalculation will also take longer. As the network grows, the size of the
routing table will increase. The routing table is not sent out wholesale as in a distance vector routing protocol; however, the greater the size of the table, the longer each lookup becomes. The memory requirements on the router will also increase. Furthermore, the topological database will increase in size and will eventually become unmanageable. Also, as the various databases increase in size and the calculations become increasingly frequent, the CPU utilization will increase as the available memory decreases. This will make the network response time sluggish not because of congestion on the line, but because of congestion within the router itself.
Note: You can check the CPU and the memory utilization on the router by using the show cpu process and the show memory commands
4.2.5.4 Configuring Intra-Area OSPF
There are a few simple commands that are used to configure a Cisco router for OSPF within a single area.
4.2.5.4.1 Configuring OSPF on an Internal Router
An internal router within a single area needs to understand how to participate in the OSPF network. Therefore, it requires the OSPF process, i.e., the routing protocol needs to be started on the router; the participating router interfaces used to send or receive OSPF routing updates; the identification of the area; and a router ID, which allows the router to be identified by the other routers in the network.
The Process ID, the Router ID, and the Area ID |
---|
The Process ID, the Router ID, and the Area ID are not related in any way. The process ID is a mechanism to allow more than one process to be configured on a router. The router ID is the mechanism by which a router is identified within the OSPF domain, and the area ID is a mechanism of grouping routers that share full knowledge of OSPF-derived routes within the OSPF domain. |
The router ospf process_id command is used to configure OSPF as the routing protocol. By default, there is no IP routing protocol running on the Cisco router. The process_id is a number local to the router. It is possible to have more than one process running on a router. The process number does not have to be the same on every router in the area or the autonomous system.
The network network_number wildcard_ma.sk command specifies the networks that are to participate in the OSPF updates and the area that they reside in. The network command in OSPF is similar to that of the network command in RIP or IGRP. The difference is the level of granularity afforded in OSPF. In RIP and IGRP, the network command is defined at the class level. In OSPF, it is possible to define the network command at the level of the specific address of an interface. After the network command has been entered, OSPF identifies which interfaces are participating in OSPF by comparing the interface IP address with the address given in the network command, filtered through the w+idcard_mask. The w+idcard_mask indicates how much of the address to pay attention to. This could a class of address, such as everything in network 10.0.0.0 or it can be more specific and identify an interface address. All interfaces that match the given network number will reside in the area specified in the network command.
After identifying the interfaces on the router that are participating in the OSPF domain, updates will be received on the interface, updates will be sent out of the interfaces, the interface will be placed in the defined area. In addition, the Hello protocol, if appropriate, will be propagated and, depending on the interface type, a default hello and dead interval are defined.
The Default Hello and Dead Time Intervals
Interface TypePoint-point Nonbroadcast | Hello Interval | Dead Interval |
---|---|---|
Point-point Nonbroadcast | 30 seconds | 120 seconds |
Point-to-point | 10 seconds | 40 seconds |
Broadcast | 30seconds | 40 seconds |
NBMA | 30seconds | 120 seconds |
Point-to Multipoint | 30seconds | 120 seconds |
4.2.5.4.2 Configuring OSPF on the External Router
Configuring OSPF on an internal router is not necessary to make OSPF function properly within an area. It may, however, be useful in your network design.
The interface loopback interface_number ip address ip_address subnet_mask command
gures a loopback interface on the router. The Cisco rule states that the router ID will be taken from the address of the loopback interface as there is no command to define the OSPF router ID. However, the router needs a Router ID to participate in the OSPF domain. The loopback interface is a virtual interface that does not exist physically but has an IP address. If no loopback interface is defined, the router uses the highest IP address configured on the router as its router ID.
The ip ospf cost value command used to override the default cost that the router assigns to an interface. The default cost is calculated based on the speed of the outgoing interface. A lower cost increases the likelihood that the interface will be selected as the shortest path. The range of values configurable for the cost of a link is 1 to 65535.
The auto-cost reference-bandwidth global configuration command is used to specify how OSPF calculates the default cost for the interface. The default path cost in Cisco routers is calculated using the 108/ bandwidth formula. The value set by the ip ospf cost command overrides the cost calculated using the auto-cost reference-bandwidth command. Table 9.3 lists the default costs in OSPF.
Note: In the Cisco IOS documentation, the auto-cost command is documented as ospf auto-cost; however, ospf auto-cost is not recognized in the Cisco IOS. The auto-cost command is actual command to use in the Cisco IOS.
Default Costs in OSPF
Link Type | Default Cost |
---|---|
56-kbps serial link | 1785 |
T1 (1.544-Mbps serial link) | 64 |
Ethernet | 10 |
The priority command is used to determine the designated router (DR) and backup designated router (BDR) on a multiaccess link. The Hello protocol is the mechanism by which the designated routers are elected; however, to eligible for election, the router must have a priority of between 1 and 255. If the priority is 0, the router will not participate in the election. The higher the priority, the greater the likelihood of the router being elected. If no priority is set, all Cisco routers have a default priority of 1, and the highest router ID, i.e., the highest IP address of all interfaces on the router, is used.
You may want to change the router priority if the router has greater CPU and memory than the others do on the LAN; if the router is the most reliable router on the segment; if all the other routers on the LAN connect to stub networks and form the access layer of the network; if there are point-to-multipoint connections in an NBMA cloud, and the hub router needs to be configured as the centralized resource, requiring it to be the designated router; or if the router is an ABR, and you do not want it to consume more resources as a DR.
4.2.5.4.3 Configuring OSPF over an NBMA Topology
The design considerations of running OSPF over an NBMA topology are important because it influences the configuration choices that will be made. If the network is partially meshed, then the choice to use only point-to-point subnets can waste addresses. If a point-to-multipoint configuration is chosen, the network uses one subnet, and there is no DR/BDR negotiation. This has the advantage of saving addresses but behaving as if it is a series of point-to-point links. When the decision is made as to which technology is to be implemented, the configuration is straightforward. The choice is defined on the interface as a network command. The network command syntax is:
ip ospf network { broadcast | non-broadcast |
{ point-to-point | point-to-multipoint [ non-broadcast ] } }
The parameters in this command are:
broadcast, which sets the network mode to broadcast;
-broadcast, which sets the network mode to nonbroadcast multiaccess (NBMA mode). This is the default mode for serial interfaces with Frame Relay encapsulation and point-to-multipoint subinterfaces;
point-to-point, which sets the network mode to point-to-point. This is the default mode for point-to-point subinterfaces; and
point-to-multipoint, which sets the network mode to point-to-multipoint. When this parameter is used with the optional [ non-broadcast ] parameter, it sets the network mode to point-to-multipoint nonbroadcast.
4.2.5.4.4 Configuring OSPF in NBMA Mode
NBMA mode is used by default; therefore there is no need to configure it using the ip ospf network non-broadcast command. In NBMA mode, the design considerations are imperative because the selection of the DR and BDR need to have physical connectivity to all routers in the NBMA cloud. This is a nonbroadcast environment, so the DR and BDR must be configured with a static list of the other routers attached to the cloud so that they can become neighbors and create adjacencies. This is achieved with the use of the neighbor command. The syntax of the neighbor command is:
neighbor ip_address
The neighbor command must specify an ip_address which is the interface IP address for the neighbor. In addition, the neighbor command can take a number of optional keywords. These optional parameters are:
[ priority priority_number ] which can be used to affect outcome of the BDR or the DR election. The default is 0.
[ poll-interval poll_intervai ] which is an integer value reflecting the poll interval. The default is 120 seconds. If a neighboring router becomes inactive and no hello packets been seen for the router dead interval, it may still be necessary to send hello packets to the dead neighbor. These hello packets will be sent at the rate specified by the poll-interval keyword.
4.2.5.4.5 Configuring OSPF in Point-to-Multipoint Mode
An OSPF point-to-multipoint interface is seen as one or more numbered point-to-point interfaces. The cloud is configured as one subnet. A host route will be added for each router involved in the OSPF cloud.
By default, the network is considered to be a series of point-to-point interfaces. There is no need to specify neighbors because the neighbors will see each other and simply become adjacent, with no need for the election of a DR or a BDR. However, you can specify neighbors using the neighbor command, in which case you should specify a cost to each neighbor. You are not required to have a fully meshed topology, which reduces the number of PVCs needed and the number of neighbor entries in the neighbor table. It is possible to change the default by using the command ip ospf network non-broadcast. The point-to-multipoint network is then considered a nonbroadcast network. The neighbor command is required to identify neighbors in a nonbroadcast network. In this case, assigning a cost to a neighbor is optional.
In Point-to-Point Mode on a Frame Relay Subinterface, the adjacency created between the routers is automatic because each subinterface behaves as a physical point-to-point network. Therefore, the communication is direct and automatic. To configure OSPF point-to-point mode on subinterfaces you must create a subinterface at the interface level, remove any network layer (Layer 3) address assigned to the physical interface by using the no ip address command and assign the Layer 3 address to the subinterface. Then configure Frame Relay encapsulation, the subinterfaces, and the Layer 3 and Layer 2 (DLCI) addresses on the subinterface. Point-to-point mode is the default OSPF mode for point-to-point subinterfaces, so no further configuration is required.
4.2.5.4.6 Configuring OSPF in Broadcast Mode
You can use broadcast mode to avoid the use of the neighbor command and all the attendant configurations. This mode works best with a fully meshed network.
4.2.5.5 Verifying the OSPF Configuration on a Single Router
There are a number of show ip commands that are particularly useful in troubleshooting the OSPF network. These commands are:
show ip ospf, which provides information about the OSPF process and its details.
show ip ospf database, which provides information about the contents of the topological database.
show ip ospf interface, which provides information on how OSPF has been configured on each interface.
show ip ospf neighbor, which displays all the information about the relationship that the router has with its neighbors.
show ip protocols, which displays the IP configuration on the router, including the interfaces and the configuration of the IP routing protocols.
show ip route, which provides detailed information on the networks that the router is aware of and the preferred paths to those networks. It also gives the next logical hop as the next step in the path.
4.2.6 Inter-Area OSPF
An area is a logical grouping of routers that are running OSPF with identical topological databases. It is a subdivision of the greater OSPF domain. The creation of multiple areas solves the problem of a large network outgrowing its capacity to communicate the details of the network to the routing devices charged with maintaining control and connectivity throughout the network. The division of the AS into areas allows routers in each area to maintain their own topological databases. This limits the size of the topological databases, and summary and external links ensure connectivity between areas and networks outside the AS.
There are two approaches to implementing multiple area networks. The first approach is to grow a single area until it becomes unmanageable. The second approach is to design the network with multiple areas, which are very small, in the expectation that the networks will grow to fit comfortably into their areas. The first approach requires less initial work and configuration. Great care should be put into the design of the network, however, because this may cause problems in the future, particularly in addressing. In practice, many companies convert their networks into OSPF from a distance vector routing protocol when they realize that they have outgrown the existing routing protocol. This allows the planned implementation of the second approach.
As mentioned earlier, there are a number of limitations to using OSPF in a single area. These problems are related to the growth of the network. One of the main features of OSPF is its ability to scale and to support large networks. It achieves this by creating areas from groups of subnets. The area is seen internally as a small entity on its own. It communicates with the other areas, exchanging routing information; this exchange is kept to a minimum, however, allowing only that which is required for connectivity. All computation is kept within the area. In this way, a router is not overwhelmed by the entirety of the organization's network. This is important because a link-state routing protocol is CPU- and memory-intensive.
4.2.6.1 Router Types
Because of the hierarchical nature of the OSPF network, routers have different responsibilities, depending on their position and functionality within the OSPF hierarchical design. These routers have different designations such as internal routers, backbone routers, area border routers (ABR), and autonomous system boundary routers (ASBR).
The Internal Router exists within an area. It is responsible for maintaining a current and accurate database of every subnet within the area. It is also responsible for forwarding data to other networks by the shortest path. Flooding of routing updates is confined to the area. All interfaces on this router are within the same area.
The Backbone Router exists within the backbone area, which is also called Area 0. The design rules for OSPF require that all the areas be connected through a single area, known as Area 0. Area 0 is also known as Area 0.0.0.0 on other routers. A router within this area is referred to as a backbone router. It may also be an internal router or an Area Border Router.
The Area Border Router (ABR) is responsible for connecting two or more areas. It holds a full topological database for each area to which it is connected and sends LSA updates between the areas. These LSA updates are summary updates of the subnets within an area. It is at the area border that summarization should be configured for OSPF because this is where the LSAs make use of the reduced routing updates to minimize the routing overhead on both the network and the routers.
The Autonomous System Boundary Router (ASBR) is used to connect to a network or routing protocol outside the OSPF domain. OSPF is an interior routing protocol or Interior Gateway Protocol (IGP); gateway is an older term for a router. If there is any redistribution between other protocols to OSPF on a router, it will be an ASBR. This router should reside in the backbone area but you can place it anywhere in the OSPF hierarchical design.
4.2.6.2 Link-State Advertisements
Five commonly used types of link-state advertisements (LSAs) sent between routers in the same area and on
the same segment are used in the OSPF domain. These are:
The router link, which is generated for each area to which the router belongs. This LSA gives the link states to all other routers within an area. It is flooded into an area and is identified as a Type 1 LSA.
The network link, which is sent out by the designated router and lists all the routers on the segment for which it is the designated router and has a neighbor relationship. This LSA is flooded to the whole area and is identified as a Type 2 LSA.
The network summary link, which is sent between areas and summarizes the IP networks from one area to another. It is generated by an ABR and is identified as a Type 3 LSA.
The AS external ASBR summary link, which is sent to a router that connects to the outside world (ASBR). It is sent from the ABR to the ASBR. This LSA contains the metric cost from the ABR to the ASBR and is identified as a Type 4 LSA.
The external link, which is originated by AS boundary routers and is flooded throughout the AS. Each external advertisement describes a route to a destination in another autonomous system. Default routes for the AS can also be described by AS external advertisements. This LSA is identified as a Type 5 LSA.
The NSSA External LSA, which is created by the ASBR residing in a not so stubby area (NSSA). It is very similar to an autonomous system external LSA, except that this LSA is contained within the NSSA area and is not propagated into other areas. This LSA is identified as a Type 7 LSA.
4.2.6.3 OSPF Path Selection Between Areas
The OSPF routing table that exists on a router depends on the position that the router has in the area and the status of the network; the type of area that the router is located in; whether there are multiple areas in the domain; and whether there are communications outside the autonomous system. The router receives LSAs. It builds the topological database. Then it runs the Dijkstra algorithm, from which the shortest path first is chosen and entered into the routing table. The routing table is therefore the conclusion of the decisionmaking process. It holds information on how that decision was made by including the metric for each link. This enables the network administrator to view the operation of the network.
Different LSAs hold different weighting in the decision-making process. It is preferable to take an internal route (within the area) to a remote network rather than to traverse multiple areas just to arrive at the same place. Not only does multiple-area traveling create unnecessary traffic, but it also can create a loop within the network. The routing table, thus, reflects the network topology information and indicates where the remote network sits in relation to the local router.
The costs of paths to networks in other areas and paths to networks in another AS are calculated differently.
4.2.6.3.1 The Path to A different Area
The path to another area is calculated as the smallest cost to the ABR, added to the smallest cost to the backbone. Thus, if there were two paths from the ABR into the backbone, the shortest or lowest-cost path would be added to the cost of the path to the ABR.
4.2.6.3.2 The Path to Another AS
The path to another AS are routes passed between a router within the OSPF domain and a router in another autonomous system or routing domain. The routes discovered by OSPF in this way can have the cost of the path calculated in one of two ways:
The cost of the path to the ASBR is added to the external cost to the next-hop router outside the AS. This is known as E1.
The cost of the path to the ASBR is all that is considered in the calculation. This is the default configuration and is used when there is only one router advertising the route and no selection is required. This is known as E2.
If both an E1 and an E2 path are offered to the remote network, the E1 path will be used.
4.2.6.4 Summarization
Two types of summarization exist in multiple area OSPF: interarea summarization, which is performed at the ABR and creates Type 3 LSAs and Type 4 LSAs; and external summarization, which is performed at the ASBR and creates Type 5 LSAs. Both types of summarization have the same fundamental requirement of contiguous addressing.
OSPF is stringent in its demand for a solid hierarchical design-so much so that it has devised some commands to deal with situations that break its rules of structure.
4.2.6.5 The Virtual Link
OSPF require that all areas in the multiple area network must all connect directly to the backbone area. The connection to the backbone area is via an ABR, which is resident in both areas and holds a full topological database for each area. When this requirement cannot be met, you can use a virtual link, which is a tunnel connection to an area that does have direct connectivity to the backbone. In this configuration, a tunnel is created to the ABR in the intermediary area. From the viewpoint of OSPF, it has a direct connection.
4.2.6.6 OSPF over an NBMA Network
An NBMA network can be included as part of the OSPF domain if the NBMA network is created as Area 0;
or if the NBMA network is a hub-and-spoke topology.
If the NBMA network is created as Area 0, the NBMA is used to connect all remote sites and all traffic will have to traverse the NBMA network. This option is ideal in a full-mesh environment, although it will result in a large number of LSAs being flooded into the WAN and puts extra demands on the routers connecting to the NBMA network.
If the NBMA network is a hub-and-spoke topology, it makes sense to assign the hub network as Area 0 with the other remote sites and the NBMA network as other areas. This is ideal design if the satellite areas are stub areas because it means that the routing information is kept to a minimum over the NBMA cloud.
4.2.6.7 Configuring Inter-Area OSPF
Some of the commands used to configure OSPF in a single area are also used to configure OSPF in multiple area networks.
The network command for OSPF in a multiple area network is similar to that of the network command for OSPF in a single area. The difference is that while the network command for OSPF in a single area identified the interfaces that participated in the OSPF routing process, the network command for OSPF in a multiple area network identifies not only the interfaces that are sending and receiving OSPF updates, but also the area in which they reside. This configuration is used on an ABR. The syntax for this command is:
network network number wildcard mask area area number
After this network command has been entered, OSPF identifies which interfaces are participating in OSPF by comparing the interface IP address with the address given in the network command, filtered through the wiidcard_mask. The wiidcard_mask indicates how much of the address to pay attention to. This could a class of address, such as everything in network 10.0.0.0 or it can be more specific and identify an interface address. All interfaces that match the given network number will reside in the area specified in the network command.
The area range command is configured on an ABR because it dictates the networks that will be advertised out of the area. The range keyword is used to consolidate and summarize routes at an area boundary. The syntax for this command is:
area area_id range ip_address subnet_mask
The no form of this command, as in no area area_id range ip_address subnet_mask can be used to disable this function for the specified area.
In the area range command, the area_id parameter specifies the identifier (ID) of the area for which routes are to be summarized. This can be specified either as a decimal value or as an IP address. The ip_address parameter specifies the IP address while the subnet_mask parameter specifies the IP subnet mask.
The summary-address command is used on the ASBR to summarize the networks to be advertised outside the OSPF domain. The syntax for this command is:
summary-address ip_address subnet_mask
The area command configures the area type. After designing the addressing scheme for the network, it should be clear which areas should be configured as a stub area, a totally stubby area, or not so stubby area. These areas can be configured using the area command.
The syntax for the area command for a stub area is: area area_id stub. All OSPF routers inside a stub area must be configured as stub routers.
The syntax for the area command for a totally stubby area is similar to that of used to configure a stub area. The difference being the addition of a no-summary parameter informs the ABR not to send summary updates from other areas into the area. The syntax for this command is: area area-id stub no-summary. This command needs to be configured only on the ABR because it is the only router with this responsibility. Furthermore, this command is configurable only on a Cisco router because it is a proprietary command.
In addition, the area command can be used to define the cost to the default route into the area. The syntax for this command is: area area_id default-cost cost. If the cost is not specified, the path will be calculated as the internal area cost plus 1. This command needs to be configured only on the ABR because it is the only router with this responsibility.
4.2.6.8 Configuring a Virtual Link
When it is not possible to connect an area directly the backbone area, Area 0, you can create a virtual link to the backbone area. The command used to configure a virtual link is:< area area id virtual-link router id
In this command the area_id parameter specifies the area ID assigned to the transit area for the virtual link while the router_id parameter specifies the router ID of the virtual link neighbor.
This area command is given between ABRs, at least one of which must be in Area 0. The command, issued at both ABRs, states the transit area and the router ID of the remote destination ABR. This creates essentially a tunnel through the transit area, which, although it may involve many routers to forward the traffic, appears to the remote ABRs as next hops.
4.2.6.9 Verifying Inter-Area OSPF Configurat
As in the case of OSPF in a single area, there are a number of show commands that can be used to troubleshoot the OSPF configuration in a multiple area network.
The commands used to troubleshoot OSPF configurations in a single area are also useful in a multiple area configuration. These commands are:
show ip ospf, which provides information about the OSPF process and its details.
show ip ospf database, which provides information about the contents of the topological database.
show ip ospf interface, which provides information on how OSPF has been configured on each interface.
show ip ospf neighbor, which displays all the information about the relationship that the router has with its neighbors.
show ip protocols, which displays the IP configuration on the router, including the interfaces and the configuration of the IP routing protocols.
show ip route, which provides detailed information on the networks that the router is aware of and the preferred paths to those networks. It also gives the next logical hop as the next step in the path.
There are two additional commands that can be used in a multiple area configuration. These commands are:
show ip ospf border-routers, which shows the OSPF ABRs and ASBRs for which the internal router has entries in its routing table. This command is useful for troubleshooting configuration errors and understanding how the network is communicating about its routes. It is also useful for verifying that the configuration is correct and that the OSPF network is functioning properly.
show ip ospf virtual-links, which shows the virtual links that exist on the network. The show ip ospf neighbors command should be used in conjunction with this command.