Overview
of link-state routing
Link-state
routing protocol features
How
routing information is maintained
Advantages
and disadvantages of link-state routing
Compare
and contrast distance vector and link-state routing
Comparing
OSPF with distance vector routing protocols
Steps
in the operation of OSPF
Configuring
OSPF routing process
Configuring
OSPF loopback address and router priority
Configuring
OSPF authentication
OSPF,
propagating a default route
Common
OSPF configuration issues
Verifying
the OSPF configuration
The two main classes of interior gateway routing protocols (IGP) are distance vector and link-state. Both types of routing protocols are concerned with finding routes through autonomous systems. Distance vector and link-state routing protocols use different methods to accomplish the same tasks.
Link-state routing algorithms, also known as shortest path first (SPF) algorithms, maintain a complex database of topology information. A link-state routing algorithm maintains full knowledge of distant routers and how they interconnect. In contrast, distance vector algorithms provide non-specific information about distant networks and no knowledge of distant routers.
Understanding the operation of link-state routing protocols is critical in understanding how to enable, verify, and troubleshoot their operation. This module explains how link-state routing protocols work, outlines their features, describes the algorithm they use, and points out the advantages and disadvantages of link-state routing.
Early routing protocols like RIP were all distance vector protocols. Many of the important protocols in use today are also distance vector protocols, including RIP v2, IGRP, and EIGRP. However, as networks grew in size and complexity, some of the limitations of distance vector routing protocols became apparent. Routers in a network using a distance vector scheme could only guess at the network topology based on the full routing tables received from neighbouring routers. Bandwidth usage is high because of periodic exchange of routing updates, and network convergence is slow resulting in poor routing decisions.
Link-state routing protocols differ from distance vector protocols. Link-state protocols flood routing information allowing every router to have a complete view of the network topology. Triggered updates allow efficient use of bandwidth and faster convergence. Changes in the state of a link are sent to all routers in the network as soon as the change occurs.
One of the most important link-state protocols is Open Shortest Path First (OSPF). OSPF is based on open standards, which means it can be developed and improved by multiple vendors. It is a complex protocol that is a challenge to implement in a large network. The basics of OSPF are covered in this module.
OSPF configuration on a Cisco router is similar to the configuration of other routing protocols. As with other routing protocols, the OSPF routing process must be enabled and networks must be identified that will be announced by OSPF. However, OSPF has a number of features and configuration procedures that are unique. These features make OSPF a powerful choice for a routing protocol and make OSPF configuration a very challenging process.
In complex large networks, OSPF can be configured to span many areas and several different area types. The ability to design and implement large OSPF networks begins with the ability to configure OSPF in a single area. This module also discusses the configuration of single area OSPF.
Students completing this module should be able to:
Link-state routing protocols perform in a very different way from distance vector protocols. Understanding the difference between distance vector and link-state protocols is vital for network administrators. One essential difference is that distance vector protocols use a simpler method of exchanging routing information. Figure 2.1 outlines the characteristics of both distance vector and link-state routing protocols.

Figure 2.1
Link-state routing algorithms maintain a complex database of topology information. While the distance vector algorithm has non-specific information about distant networks and no knowledge of distant routers, a link-state routing algorithm maintains full knowledge of distant routers and how they interconnect.
Link-state routing protocols collect routing information from all other routers in the network or within a defined area of the network. Once all of the information is collected, each router, independently of the other routers, calculates its best paths to all destinations in the network. Because each router maintains its own view of the network, it is less likely to propagate incorrect information provided by any of its neighbouring routers.
Link-state routing protocols perform the following functions:

Figure 3.2
Each router keeps track of the state or condition of its directly connected neighbours by multicasting hello packets. Each router also keeps track of all the routers in its network or area of the network by using link-state advertisements (LSAs). The hello packets contain information about the networks that are attached to the router. In Figure 3.3, P4 knows about its neighbours, P1 and P3, on Perth3 network. The LSAs provide updates on the state of links that are interfaces on other routers in the network.
A router running a link-state protocol has the following features:

Figure 3.3
Link-state routing uses the following features:

Figure 3.4
Link-state routing protocols were designed to overcome the limitations of distance vector routing protocols. For example, distance vector protocols only exchange routing updates with immediate neighbours while link-state routing protocols exchange routing information across a much larger area.
When a failure occurs in the network, such as a neighbour becomes unreachable, link-state protocols flood LSAs using a special multicast address throughout an area. Each link-state router takes a copy of the LSA and updates its link-state, or topological database. The link-state router will then forward the LSA to all neighbouring devices. LSAs cause every router within the area to recalculate routes. Because LSAs need to be flooded throughout an area, and all routers within that area need to recalculate their routing tables, the number of link-state routers that can be in an area should be limited.
A link is the same as an interface on a router. The state of the link is a description of an interface and the relationship to its neighbouring routers. For example, a description of the interface would include the IP address of the interface, the subnet mask, the type of network to which it is connected, the routers connected to that network, and so on. The collection of link-states forms a link-state database, sometimes called a topological database. The link-state database is used to calculate the best paths through the network. Link-state routers find the best paths to destinations. Link-state routers do this by applying the Dijkstra shortest path first (SPF) algorithm against the link-state database to build the shortest path first tree, with the local router as the root. The best paths are then selected from the SPF tree and placed in the routing table.
Link-state routing algorithms maintain a complex database of the network topology by exchanging link-state advertisements (LSAs) with other routers in a network. This section describes the link-state routing algorithm.
Link-state routing algorithms have the following characteristics:
Unlike distance vector protocols, link-state protocols develop and maintain full knowledge of the network routers as well as how they interconnect. This is achieved through the exchange of link-state advertisements (LSAs) with other routers in a network.
Each router that exchanges LSAs constructs a topological database using all received LSAs. An SPF algorithm is then used to compute reachability to networked destinations. This information is used to update the routing table. This process can discover changes in the network topology caused by component failure or network growth.
LSA exchange is triggered by an event in the network instead of periodic updates. This can greatly speed up the convergence process because there is no need to wait for a series of timers to expire before the networked routers can begin to converge.
If the network shown in Figure 3.5 uses a link-state routing protocol, there would be no concern about connectivity between routers A and D. Depending on the actual protocol employed and the metrics selected, it is highly likely that the routing protocol could discriminate between the two paths to the same destination and try to use the best one.

Figure 3.5
Shown in Figure 3.6 are the routing entries in the table for Router A, to Router D. In this example, a link-state protocol would remember both routes. Some link-state protocols provide a way to assess the performance capabilities of the two routes and choose the best one. If the route through Router C was the more preferred path and experienced operational difficulties, such as congestion or component failure, the link-state routing protocol would detect this change and begin forwarding packets through Router B.

Figure 3.6
The following list contains many of the advantages that link-state routing protocols have over the traditional distance vector algorithms, such as Routing Information Protocol (RIP v1) or Interior Gateway Routing Protocol (IGRP):
The relative advantages and disadvantages are shown in the table below.

Figure 3.7
All distance vector protocols learn routes and then send these routes to directly connected neighbours. However, link-state routers advertise the states of their links to all other routers in the area so that each router can build a complete link-state database. These advertisements are called link-state advertisements (LSAs). Unlike distance vector routers, link-state routers can form special relationships with their neighbours and other link-state routers. This is to ensure that the LSA information is properly and efficiently exchanged.
The initial flood of LSAs provides routers with the information that they need to build a link-state database. Routing updates occur only when the network changes. If there are no changes, the routing updates occur after a specific interval. If the network changes, a partial update is sent immediately. The partial update only contains information about links that have changed, not a complete routing table. An administrator concerned about WAN link utilization will find these partial and infrequent updates an efficient alternative to distance vector routing, which sends out a complete routing table every 30 seconds. When a change occurs, link-state routers are all notified simultaneously by the partial update. Distance vector routers wait for neighbours to note the change, implement the change, and then pass it to the neighbouring routers.

Figure 3.8
The benefits of link-state routing over distance vector protocols include faster convergence and improved bandwidth utilization. Link-state protocols support classless interdomain routing (CIDR) and variable-length subnet mask (VLSM). This makes them a good choice for complex, scalable networks. In fact, link-state protocols generally outperform distance vector protocols on any size network. Link-state protocols are not implemented on every network because they require more memory and processing power than distance vector protocols and can overwhelm slower equipment. Another reason they are not more widely implemented is the fact that link-state protocols are quite complex. This would require well-trained administrators to correctly configure and maintain them.
Open Shortest Path First (OSPF) is a link-state routing protocol based on open standards. It is described in several standards of the Internet Engineering Task Force (IETF). The most recent description is RFC 2328. The Open in OSPF means that it is open to the public and is non-proprietary.
OSPF is becoming the preferred IGP protocol when compared with RIP v1 and RIP v2 because it is scalable. RIP is limited to 15 hops, it converges slowly, and it sometimes chooses slow routes because it ignores critical factors such as bandwidth in route determination. OSPF overcomes these limitations and proves to be a robust and scalable routing protocol suitable for the networks of today. OSPF can be used and configured as a single area for small networks, see figure 3.9. It can also be used for large networks. OSPF routing scales to large networks if hierarchical network design principles are used.

Figure 3.9

Figure 3.10
Large OSPF networks use a hierarchical design. Multiple areas connect to a distribution area, area 0, also called the backbone. This design approach allows for extensive control of routing updates. Defining areas reduces routing overhead, speeds up convergence, confines network instability to an area and improves performance.
As a link-state protocol, OSPF operates differently from distance vector routing protocols. Link-state routers identify neighbouring routers and then communicate with the identified neighbours. OSPF has its own terminology. The new terms are shown in Figure 3.11.

Figure 3.11
Information is gathered from OSPF neighbours about the status, or links, of each OSPF router, see figure 3.12. This information is flooded to all its neighbours. Flooding is a process that sends information out all ports, with the exception of the port on which the information was received. An OSPF router advertises its own link states and passes on received link states, see figure 3.13.

Figure 3.12

Figure 3.13
The routers process the information about link-states and build a link-state database, see figure 3.14.

Figure 3.14
Every router in the OSPF area will have the same link-state database, see figure 3.15. Every router has the same information about the state of the links and the neighbours of every other router.

Figure 3.15
Then each router runs the SPF algorithm on its own copy of the database. This calculation determines the best route to a destination. The SPF algorithm adds up the cost, which is a value that is usually based on bandwidth, see figure 3.16. The lowest cost path is added to the routing table, which is also known as the forwarding database, see figure 3.17.

Figure 3.16

Figure 3.17
OSPF routers record information about their neighbours in the adjacency database, see figure 3.18.

Figure 3.18
To reduce the number of exchanges of routing information among several neighbours on the same network, OSPF routers elect a Designated Router (DR) and a Backup Designated Router (BDR) that serve as focal points for routing information exchange, see figure 3.19.

Figure 3.19
OSPF uses link-state technology, compared with distance vector technology such as RIP. Link-state routers maintain a common picture of the network and exchange link information upon initial discovery or network changes. Link-state routers do not broadcast their routing tables periodically as distance vector protocols do, see figure 3.20. Therefore, link-state routers use less bandwidth for routing table maintenance.

Figure 3.20
RIP is appropriate for small networks, and the best path is based on the lowest number of hops. OSPF is appropriate for the needs of large scalable internetworks, and the best path is determined by speed. RIP and other distance vector protocols use simple algorithms to compute best paths. The SPF algorithm is complex. Routers implementing distance vector routing may need less memory and less powerful processors than those running OSPF.
OSPF selects routes based on cost, which is related to speed. The higher the speed, the lower the OSPF cost of the link.
OSPF selects the fastest loop-free path from the shortest-path first tree as the best path in the network.
OSPF guarantees loop-free routing. Distance vector protocols may cause routing loops, see figure 3.21.

Figure 3.21
If links are unstable, flooding of link-state information can lead to unsynchronized link-state advertisements and inconsistent decisions among routers, see figure 3.22.

Figure 3.22
OSPF addresses the following issues:
In large networks RIP convergence can take several minutes since the routing table of each router is copied and shared with directly connected routers. After initial OSPF convergence, maintaining a converged state is faster because only the changes in the network are flooded to other routers in an area.
OSPF supports VLSMs and therefore is referred to as a classless protocol. RIP v1 does not support VLSMs, however, RIP v2 does support VLSMs.
RIP considers a network that is more than 15 routers away to be unreachable because the number of hops is limited to 15. This limits RIP to small topologies. OSPF has no size limits and is suitable for intermediate to large networks.
RIP selects a path to a network by adding one to the hop count reported by a neighbour. It compares the hop counts to a destination and selects the path with the smallest distance or hops. This algorithm is simple and does not require a powerful router or a lot of memory. RIP does not take into account the available bandwidth in best path determination.
OSPF selects a path using cost, a metric based on bandwidth. All OSPF routers must obtain complete information about the networks of every router to calculate the shortest path. This is a complex algorithm. Therefore, OSPF requires more powerful routers and more memory than RIP.
RIP uses a flat topology. Routers in a RIP region exchange information with all routers. OSPF uses the concept of areas. A network can be subdivided into groups of routers. In this way OSPF can limit traffic to these areas. Changes in one area do not affect performance in other areas. This hierarchical approach allows a network to scale efficiently, see figure 3.23.

Figure 3.23
The shortest path algorithm is used by OSPF to determine the best path to a destination.
In this algorithm, the best path is the lowest cost path. The algorithm was discovered by Dijkstra, a Dutch computer scientist, and was explained in 1959. The algorithm considers a network to be a set of nodes connected by point-to-point links, see figure 3.24.

Figure 3.24
Each link has a cost. Each node has a name. Each node has a complete database of all the links and so complete information about the physical topology is known. All router link-state databases are identical. The table in Figure shows the information that node D has received. For example, D received information that it was connected to node C with a link cost of 4 and to node E with a link cost of 1.
The shortest path algorithm then calculates a loop-free topology using the node as the starting point and examining in turn information it has about adjacent nodes. In Figure 3.25, node B has calculated the best path to D. The best path to D is by way of node E, which has a cost of 4. This information is converted to a route entry in B which will forward traffic to C. Packets to D from B will flow B to C to E, then to D in this OSPF network.

Figure 3.25
In the example, node B determined that to get to node F the shortest path has a cost of 5, via node C. All other possible topologies will either have loops or a higher cost paths.
A neighbour relationship is required for OSPF routers to share routing information. A router will try to become adjacent, or neighbour, to at least one other router on each IP network to which it is connected. Some routers may try to become adjacent to all their neighbour routers. Other routers may try to become adjacent to only one or two neighbour routers. OSPF routers determine which routers to become adjacent to based on the type of network they are connected to. Once an adjacency is formed between neighbours, link-state information is exchanged.
OSPF interfaces recognize three types of networks:
A fourth type, point-to-multipoint, can be configured on an interface by an administrator, see figure 3.27.

Figure 3.26

Figure 3.27
In a multi-access network, the number of routers that will be connected in advance is unknown. In point-to-point networks, only two routers can be connected.
In a broadcast multi-access network segment, many routers may be connected. If every router had to establish full adjacency with every other router and exchange link-state information with every neighbour, there would be too much overhead. If there are 5 routers, 10 adjacency relationships would be needed and 10 link states sent. If there are 10 routers then 45 adjacencies would be needed. In general, for n routers, n*(n-1)/2 adjacencies would need to be formed, see figure 3.28.

Figure 3.28
The solution to this overhead is to hold an election for a designated router (DR). This router becomes adjacent to all other routers in the broadcast segment. All other routers on the segment send their link-state information to the DR. The DR in turn acts as the spokesperson for the segment. Using the example numbers above, only 5 and 10 sets of link states need be sent respectively. The DR sends link-state information to all other routers on the segment using the multicast address of 224.0.0.5 for all OSPF routers.
Despite the gain in efficiency that electing a DR provides, there is a disadvantage. The DR represents a single point of failure. A second router is elected as a backup designated router (BDR) to take over the duties of the DR if it should fail. To ensure that both the DR and the BDR see the link states all routers send on the segment, the multicast address for all designated routers, 224.0.0.6, is used.
On point-to-point networks only two nodes exist and no DR or BDR is elected. Both routers become fully adjacent with each other.
When a router starts an OSPF routing process on an interface, it sends a hello packet and continues to send hellos at regular intervals. The rules that govern the exchange of OSPF hello packets are called the Hello protocol.
At Layer 3 of the OSI model, the hello packets are addressed to the multicast address 224.0.0.5. This address is “all OSPF routers”. OSPF routers use hello packets to initiate new adjacencies and to ensure that neighbour routers are still functioning. Hellos are sent every 10 seconds by default on broadcast multi-access and point-to-point networks. On interfaces that connect to NBMA networks, such as Frame Relay, the default time is 30 seconds.
On multi-access networks the Hello protocol elects a designated router (DR) and a backup designated router (BDR).
Although the hello packet is small, it consists of the OSPF packet header, see figure 3.29. For the hello packet the type field is set to 1.

Figure 3.29
The hello packet carries information that all neighbours must agree upon before an adjacency is formed, and link-state information is exchanged, see figure 3.30.

Figure 3.30
OSPF routers send Hello packets on OSPF enabled interfaces. If all parameters in the OSPF Hello packets are agreed upon, the routers become neighbours. On multi-access networks, the routers elect a DR and BDR. On these networks other routers become adjacent to the DR, see figures 3.31 and 3.32.

Figure 3.31

Figure 3.32
Adjacent routers go through a sequence of states. Adjacent routers must be in the full state before routing tables are created and traffic routed. Each router sends link-state advertisements (LSA) in link-state update (LSU) packets. These LSAs describe all of the routers links. Each router that receives an LSA from its neighbour records the LSA in the link-state database. This process is repeated for all routers in the OSPF network.
When the databases are complete, each router uses the SPF algorithm to calculate a loop free logical topology to every known network. The shortest path with the lowest cost is used in building this topology, therefore the best route is selected, see figure 3.33.

Figure 3.33
Routing information is now maintained. When there is a change in a link state, routers use a flooding process to notify other routers on the network about the change. The Hello protocol dead interval provides a simple mechanism for determining that an adjacent neighbour is down, see figure 3.34.

Figure 3.34
OSPF routing uses the concept of areas. Each router contains a complete database of link-states in a specific area. An area in the OSPF network, it may be assigned any number from 0 to 65,535. However a single area is assigned the number 0 and is known as area 0. In multi-area OSPF networks, all areas are required to connect to area 0. Area 0 is also called the backbone area.
OSPF configuration requires that the configuration be enabled on the router with network addresses and area information, see figure 3.35. Network addresses are configured with a wildcard mask and not a subnet mask. The wildcard mask represents the links or host addresses that can be present in this segment. Area IDs can be written as a whole number or dotted decimal notation, see figure 3.36.

Figure 3.35

Figure 3.36
To enable OSPF routing, use the global configuration command syntax:
Router(config)#router
ospf process-id
The process ID is a number that is used to identify an OSPF routing process on the router. Multiple OSPF processes can be started on the same router. The number can be any value between 1 and 65,535. Most network administrators keep the same process ID throughout an autonomous system, but this is not a requirement. It is rarely necessary to run more than one OSPF process on a router. IP networks are advertised as follows in OSPF:
Router(config-router)#network
address wildcard-mask area area-id
Each network must be identified with the area to which it belongs. The network address can be a whole network, a subnet, or the address of the interface. The wildcard mask represents the set of host addresses that the segment supports. This is different than a subnet mask, which is used when configuring IP addresses on interfaces.
When the OSPF process starts, the Cisco IOS uses the highest local active IP address as its OSPF router ID. If there is no active interface, the OSPF process will not start. If the active interface goes down, the OSPF process has no router ID and therefore ceases to function until the interface comes up again.
To ensure OSPF stability there should be an active interface for the OSPF process at all times. A loopback interface, which is a logical interface, can be configured for this purpose. When a loopback interface is configured, OSPF uses this address as the router ID, regardless of the value. On a router that has more than one loopback interface, OSPF takes the highest loopback IP address as its router ID.
To create and assign an IP address to a loopback interface use the following commands:
Router(config)#interface
loopback number
Router(config-if)#ip
address ip-address subnet-mask
It is considered good practice to use loopback interfaces for all routers running OSPF. This loopback interface should be configured with an address using a 32-bit subnet mask of 255.255.255.255. A 32-bit subnet mask is called a host mask because the subnet mask specifies a network of one host. When OSPF is requested to advertise a loopback network, OSPF always advertises the loopback as a host route with a 32-bit mask, see figure 3.37.

Figure 3.37
In broadcast multi-access networks there may be more than two routers. OSPF elects a designated router (DR) to be the focal point of all link-state updates and link-state advertisements. Because the DR role is critical, a backup designated router (BDR) is elected to take over if the DR fails.
If the network type of an interface is broadcast, the default OSPF priority is 1. When OSPF priorities are the same, the OSPF election for DR is decided on the router ID. The highest router ID is selected.
The election result can be determined by ensuring that the ballots, the hello packets, contain a priority for that router interface. The interface reporting the highest priority for a router will ensure that it becomes the DR, see figure 3.38.

Figure 3.38
The priorities can be set to any value from 0 to 255. A value of 0 prevents that router from being elected. A router with the highest OSPF priority will be selected as the DR. A router with the second highest priority will be the BDR. After the election process, the DR and BDR retain their roles even if routers are added to the network with higher OSPF priority values.
Modify the OSPF priority by entering global interface configuration ip ospf priority command on an interface that is participating in OSPF, see figure 3.39.

Figure 3.39
The command show ip ospf interface will display the interface priority value as well as other key information, see figure 3.40.

Figure 3.40
Router(config-if)#ip
ospf priority number
Router#show
ip ospf interface type number
OSPF uses cost as the metric for determining the best route. Cost is calculated using the formula 108/bandwidth, where bandwidth is expressed in bps. The Cisco IOS automatically determines cost based on the bandwidth of the interface, see figure 3.41. It is essential for proper OSPF operation that the correct interface bandwidth is set.

Figure 3.41
Router(config)#interface
serial 0/0
Router(config-if)#bandwidth
64
The default bandwidth for Cisco serial interfaces is 1.544 Mbps, or 1544 kbps.
Cost can be changed to influence the outcome of the OSPF cost calculation. A common situation requiring a cost change is in a multi-vendor routing environment. A cost change would ensure that one vendor’s cost value would match another vendor’s cost value. Another situation is when Gigabit Ethernet is being used. The default cost assigns the lowest cost value of 1 to a 100 Mbps link. In a 100-Mbps and Gigabit Ethernet situation, the default cost values could cause routing to take a less desirable path unless they are adjusted. The cost number can be between 1 and 65,535, see figure 3.42.

Figure 3.42
Use the following interface configuration command to set the link cost:
Router(config-if)#ip
ospf cost number
By default, a router trusts that routing information is coming from a router that should be sending the information. A router also trusts that the information has not been tampered with along the route.
To guarantee this trust, routers in a specific area can be configured to authenticate each other.
Each OSPF interface can present an authentication key for use by routers sending OSPF information to other routers on the segment. The authentication key, known as a password, is a shared secret between the routers. This key is used to generate the authentication data in the OSPF packet header, see figure 3.43.

Figure 3.43
The password can be up to eight characters. Use the following command syntax to configure OSPF authentication:
Router(config-if)#ip
ospf authentication-key password
After the password is configured, authentication must be enabled:
Router(config-router)#area
area-number authentication
With simple authentication, the password is sent as plain text. This means that it can be easily decoded if a packet sniffer captures an OSPF packet.
It is recommended that authentication information be encrypted. To send encrypted authentication information and to ensure greater security, the message-digest keyword is used. The MD5 keyword specifies the type of message-digest hashing algorithm to use, and the encryption type field refers to the type of encryption, where 0 means none and 7 means proprietary.
Use the interface configuration command mode syntax:
Router(config-if)#ip
ospf message-digest-key key-id md5 encryption-type key
The key-id is an identifier and takes the value in the range of 1 through 255. The key is an alphanumeric password up to sixteen characters. Neighbour routers must use the same key identifier with the same key value.
The following is configured in router configuration mode, see figure 3.44:

Figure 3.44
Router(config-router)#area
area-id authentication message-digest
MD5 authentication creates a message digest. A message digest is scrambled data that is based on the password and the packet contents. The receiving router uses the shared password and the packet to re-calculate the digest. If the digests match, the router believes that the source and contents of the packet have not been tampered with. The authentication type identifies which authentication, if any, is being used. In the case of message-digest authentication, the authentication data field contains the key-id and the length of the message digest that is appended to the packet. The message digest is like a watermark that cannot be counterfeited.
OSPF routers must have the same hello intervals and the same dead intervals to exchange information. By default, the dead interval is four times the value of the hello interval. This means that a router has four chances to send a hello packet before being declared dead.
On broadcast OSPF networks, the default hello interval is 10 seconds and the default dead interval is 40 seconds. On nonbroadcast networks, the default hello interval is 30 seconds and the default dead interval is 120 seconds. These default values result in efficient OSPF operation and seldom need to be modified.
A network administrator is allowed to choose these timer values. A justification that OSPF network performance will be improved is needed prior to changing the timers. These timers must be configured to match those of any neighbouring router.
To configure the hello and dead intervals on an interface, use the following commands, see figure 3.45:

Figure 3.45
Router(config-if)#ip
ospf hello-interval seconds
Router(config-if)#ip
ospf dead-interval seconds
OSPF routing ensures loop-free paths to every network in the domain. To reach networks outside the domain, either OSPF must know about the network or OSPF must have a default route. To have an entry for every network in the world would require enormous resources for each router.
A practical alternative is to add a default route to the OSPF router connected to the outside network. This route can be redistributed to each router in the AS through normal OSPF updates, see figure 3.46.

Figure 3.46
A configured default route is used by a router to generate a gateway of last resort. The static default route configuration syntax uses the network 0.0.0.0 address and a subnet mask 0.0.0.0:
Router(config)#ip
route 0.0.0.0 0.0.0.0 [interface | next-hop address]
This is referred to as the quad-zero route, and any network address is matched using the following rule. The network gateway is determined by ANDing the packet destination with the subnet mask.
The following configuration statement will propagate this route to all the routers in a normal OSPF area:
Router(config-router)#
default-information
originate
All routers in the OSPF area will learn a default route provided that the interface of the border router to the default gateway is active.
An OSPF router must establish a neighbour or adjacency relationship with another OSPF router to exchange routing information. Failure to establish a neighbour relationship is caused by any of the following reasons, see figure 3.47:

Figure 3.47
In OSPF routing it is also important to ensure the following:
To verify the OSPF configuration a number of show commands are available. Figure 3.48 lists these commands. Figure 3.49 shows commands useful for troubleshooting OSPF.

Figure 3.48

Figure 3.49
An understanding of the following key points should have been achieved: