Overview
24.1 Link-State
Routing Protocol
24.1.1 Overview
of link-state routing
24.1.2 Link-state
routing protocol features
24.1.3 How
routing information is maintained
24.1.4 Link-state
routing algorithms
24.1.5 Advantages
and disadvantages of link-state routing
24.1.6 Compare and
contrast distance vector and link-state routing
24.2 Single-Area
OSPF Concepts
24.2.1 OSPF
overview
24.2.2 OSPF
terminology
24.2.3 Comparing
OSPF with distance vector routing protocols
24.2.4 Shortest
path algorithm
24.2.5 OSPF
network types
24.2.6 OSPF Hello
protocol
24.2.7 Steps in
the operation of OSPF
24.3 Single-Area
OSPF Configuration
24.3.1
Configuring OSPF routing process
24.3.2
Configuring OSPF loopback address and router priority
24.3.3 Modifying
OSPF cost metric
24.3.4 Configuring
OSPF authentication
24.3.5
Configuring OSPF timers
24.3.6 OSPF,
propagating a default route
24.3.7 Common
OSPF configuration issues
24.3.8 Verifying
the OSPF configuration
Summary
Overview
The two main
classes of IGPs are distance vector and link-state. Both types of routing
protocols find 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 nonspecific
information about distant networks and no knowledge of distant routers.
It is important
to understand how link-state routing protocols operate in order to configure,
verify, and troubleshoot them. 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 such as RIP v1 were all distance vector protocols. There are many
distance vector routing protocols in use today such as RIP v2, IGRP, and the
hybrid routing protocol EIGRP. As networks have grown larger and more complex,
the limitations of distance vector routing protocols have become apparent.
Routers that use a distance vector routing protocol learn about the network
topology from the routing table updates of neighbor routers. Bandwidth usage is
high because of the periodic exchange of routing updates, and network
convergence is slow which results in poor routing decisions.
Link-state
routing protocols differ from distance vector protocols. Link-state protocols
flood route information, which allows 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.
OSPF is one of
the most important link-state protocols. 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. Similarly, OSPF must be enabled on a router and the networks
that will be advertised by OSPF must be identified. OSPF has a number of
features and configuration procedures that are unique. These features make OSPF
a powerful choice for a routing protocol, but also make it a challenge to
configure.
In 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.
This module
covers some of the objectives for the CCNA 640-801 and ICND 640-811 exams.
Students who
complete this module should be able to perform the following tasks:
- Identify key link-state routing
protocol features
- Explain how link-state routing information
is maintained
- Discuss the link-state routing
algorithm
- Examine the advantages and
disadvantages of link-state routing protocols
- Compare and contrast link-state
routing protocols with distance vector routing protocols
- Enable OSPF on a router
- Configure a loopback address to
set router priority
- Modify the cost metric to
change OSPF route preference
- Configure OSPF authentication
- Change OSPF timers
- Describe the steps to create
and propagate a default route
- Use show commands to verify
OSPF operation
- Configure the OSPF routing
process
- Define key OSPF terms
- Describe the OSPF network types
- Describe the OSPF Hello
protocol
- Identify the basics steps in
the operation of OSPF
24.1
Link-State Routing Protocol
24.1.1
Overview of link-state routing
Link-state
routing protocols perform differently than distance vector protocols. This page
will explain the differences between distance vector and link-state protocols.
This information is vital for network administrators. One essential difference
is that distance vector protocols use a simpler method to exchange route
information. Figure outlines the
characteristics of both distance vector and link-state routing protocols.
Link-state
routing algorithms maintain a complex database of topology information. While
the distance vector algorithm has nonspecific 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.
24.1
Link-State Routing Protocol
24.1.2
Link-state routing protocol features
This page will
explain how link-state protocols route data.
Link-state
routing protocols collect route 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 calculates the best paths to all destinations in the
network. Since each router maintains its own view of the network, it is less
likely to propagate incorrect information provided by any of its neighboring
routers.
The following are
some link-state routing protocol functions:
- Respond quickly to network
changes
- Send triggered updates only
when a network change has occurred
- Send periodic updates known as
link-state refreshes
- Use a hello mechanism to
determine the reachability of neighbors
Each router
multicasts hello packets to keep track of the state of the neighbor routers.
Each router uses LSAs to keep track of all the routers in its area of the
network. The hello packets contain information about the networks that are
attached to the router. In Figure , P4 knows about its neighbors, P1 and P3, on
the Perth3 network. The LSAs provide updates on the state of links that are
interfaces on other routers in the network.
Routers that use
link-state routing protocols have the following features:
- Use the hello information and
LSAs received from other routers to build a database about the network
- Use the SPF algorithm to
calculate the shortest route to each network
- Store the route information in
the routing table
24.1
Link-State Routing Protocol
24.1.3
How routing information is maintained
This page will
explain how link-state protocols use the following features:
- The LSAs
- A topological database
- The SPF algorithm
- The SPF tree
- A routing table of paths and
ports to determine the best path for packets
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 neighbors while link-state routing protocols exchange
routing information across a much larger area.
When a failure
occurs in the network, such as a neighbor becomes unreachable, link-state
protocols flood LSAs with a special multicast address throughout an area. This
process sends information out all ports, except the port on which the
information was received. Each link-state router takes a copy of the LSA and
updates its link-state, or topological database. The link-state router then
forwards the LSA to all neighbor devices. LSAs cause every router within the
area to recalculate routes. For this reason, the number of link-state routers
within 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 the neighbor routers. For example, a
description of the interface would include the IP address of the interface, the
subnet mask, the type of network that it is connected to, the routers connected
to that network, and so on. The collection of link-states form a link-state
database which is sometimes called a topological database. The link-state
database is used to calculate the best paths through the network. Link-state
routers apply the Dijkstra shortest path first algorithm against the link-state
database. This builds the SPF tree with the local router as the root. The best
paths are then selected from the SPF tree and placed in the routing table.
24.1
Link-State Routing Protocol
24.1.4
Link-state routing algorithms
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 page describes the link-state routing algorithm.
Link-state
routing algorithms have the following characteristics:
- They are known collectively as
SPF protocols.
- They maintain a complex
database of the network topology.
- They are based on the Dijkstra
algorithm.
Link-state
protocols develop and maintain full knowledge of the network routers and how
they interconnect. This is achieved through the exchange of LSAs with other
routers in the network.
Each router
constructs a topological database from the LSAs that it receives. The SPF algorithm
is then used to compute the reachability of 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.
An LSA exchange
is triggered by an event in the network instead of periodic updates. This
speeds up the convergence process because there is no need to wait for a series
of timers to expire before the routers can converge.
If the network
shown in Figure uses a link-state
routing protocol, there is no concern about connectivity between routers A and
D. Based on the protocol that is employed and the metrics that are selected,
the routing protocol can discriminate between two paths to the same destination
and use the best one. In Figure there
are two routing entries in the table for the route from Router A to Router D.
In this figure, the routes have equal costs so the link-state routing protocol
records 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
preferred route through Router C experiences operational difficulties such as
congestion or component failure, the link-state routing protocol can detect
this change and route packets through Router B.
24.1
Link-State Routing Protocol
24.1.5
Advantages and disadvantages of link-state routing
This page lists
the advantages and disadvantages of link-state routing protocols. The following
are advantages of link-state routing protocols:
- Link-state protocols use cost
metrics to choose paths through the network. The cost metric reflects the
capacity of the links on those paths.
- Link-state protocols use
triggered updates and LSA floods to immediately report changes in the
network topology to all routers in the network. This leads to fast
convergence times.
- Each router has a complete and
synchronized picture of the network. Therefore, it is very difficult for
routing loops to occur.
- Routers use the latest
information to make the best routing decisions.
- The link-state database sizes
can be minimized with careful network design. This leads to smaller
Dijkstra calculations and faster convergence.
- Every router, at the very
least, maps the topology of its own area of the network. This attribute
helps to troubleshoot problems that can occur.
- Link-state protocols support
CIDR and VLSM.
The following are
some disadvantages of link-state routing protocols:
- They require more memory and
processor power than distance vector protocols. This makes it expensive to
use for organizations with small budgets and legacy hardware.
- They require strict
hierarchical network design, so that a network can be broken into smaller
areas to reduce the size of the topology tables.
- They require an administrator
who understands the protocols well.
- They flood the network with
LSAs during the initial discovery process. This process can significantly
decrease the capability of the network to transport data. It can
noticeably degrade the network performance.
24.1 Link-State
Routing Protocol
24.1.6
Compare and contrast distance vector and link-state routing
This page will
compare distance vector and link-state routing protocols.
All distance
vector protocols learn routes and then send these routes to directly connected
neighbors. 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
or LSAs. Unlike distance vector routers, link-state routers can form special
relationships with their neighbors 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. Network administrators
concerned about WAN link utilization will find these partial and infrequent
updates an efficient alternative to distance vector routing protocols, which send
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 neighbors to note the change, implement the change, and then
pass the update to the neighbor routers.
The benefits of
link-state over distance vector protocols include faster convergence and
improved bandwidth utilization. Link-state protocols support CIDR and VLSM.
This makes them a good choice for complex and 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 processor 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. Link-state routing
protocols require well-trained administrators to correctly configure and
maintain them.
24.2 Single-Area OSPF Concepts
24.2.1
OSPF overview
This page will
introduce OSPF. OSPF is a link-state routing protocol that is based on open
standards. It is described in several standards of the Internet Engineering
Task Force (IETF). The Open in OSPF means that it is open to the public and is
non-proprietary.
OSPF, when
compared to RIP v1 and v2, is the preferred IGP 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. A
drawback to using OSPF is that it only supports the TCP/IP protocol suite. OSPF has overcome these limitations and is
a robust and scalable routing protocol that is suitable for modern networks.
OSPF can be used and configured as a single area for small networks. It can also be used for large networks.
As shown in
Figure , large OSPF networks use a hierarchical design. Multiple areas connect
to a distribution area, or area 0 which is also called the backbone. The design
approach allows for extensive control of routing updates. Area definition
reduces routing overhead, speeds up convergence, confines network instability
to an area, and improves performance.
24.2
Single-Area OSPF Concepts
24.2.2
OSPF terminology
This page will
introduce some terms that are related to OSPF.
Link-state
routers identify neighboring routers and then communicate with the identified
neighbors. OSPF has its own terminology. The new terms are shown in Figure .
OSPF gathers
information from neighbor routers about the link status of each OSPF
router. This information is flooded to
all its neighbors. An OSPF router advertises its own link-states and passes on
received link-states.
The routers
process the information about link-states and build a link-state database. Every router in the OSPF area will have the
same link-state database. Therefore,
every router has the same information about the state of the links and the
neighbors of every other router.
Each router then
applies 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. The lowest cost path is added to the routing
table, which is also known as the forwarding database.
Each router keeps
a list of adjacent neighbors, called the adjacency database. The adjacency
database is a list of all the neighbor routers to which a router has
established bidirectional communication. This is unique to each router.
To reduce the
number of exchanges of routing information among several neighbors 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.
24.2
Single-Area OSPF Concepts
24.2.3
Comparing OSPF with distance vector routing protocols
This page will
explain how OSPF compares to distance vector protocols 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
routing tables periodically as distance vector protocols do. Therefore, link-state routers use less
bandwidth for routing table maintenance.
RIP is
appropriate for small networks, and the best path is based on the lowest number
of hops. OSPF is appropriate for large, scalable internetworks, and the best
path is determined by the speed of the link. RIP and other distance vector
protocols use simple algorithms to compute best paths. The SPF algorithm is
complex. Routers that implement distance vector protocols need less memory and
less powerful processors than those that implement 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 SPF tree as the best path in the network.
OSPF guarantees
loop-free routing. Distance vector protocols may cause routing loops.
If links are
unstable, flooding of link-state information can lead to unsynchronized
link-state advertisements and inconsistent decisions among routers.
OSPF addresses
the following issues:
- Speed of convergence
- Support for Variable Length
Subnet Mask (VLSM)
- Network size
- Path selection
- Grouping of members
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 neighbor. 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.
24.2
Single-Area OSPF Concepts
24.2.4
Shortest path algorithm
This page will
explain how OSPF uses the shortest-path algorithm to determine the best path to
a destination.
In this
algorithm, the best path is the lowest cost path. Edsger Wybe Dijkstra, a Dutch
computer scientist, formulated the shortest path-algorithm, also known as
Dijkstra's algorithm. The algorithm considers a network to be a set of nodes
connected by point-to-point links. 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, within a given area, 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
, 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.
In the example,
node B determined that to get to node F the shortest path has a cost of 5,
through node C. All other possible topologies will either have loops or a
higher cost paths.
24.2
Single-Area OSPF Concepts
24.2.5
OSPF network types
This page will
introduce the three types of OSPF networks.
A neighbor
relationship is required for OSPF routers to share routing information. A
router will try to become adjacent, or neighbor, to at least one other router
on each IP network to which it is connected. OSPF routers determine which
routers to become adjacent to based on the type of network they are connected
to. Some routers may try to become adjacent to all neighbor routers. Other
routers may try to become adjacent to only one or two neighbor routers. Once an
adjacency is formed between neighbors, link-state information is exchanged.
OSPF interfaces
automatically recognize three types of networks:
- Broadcast multi-access, such as
Ethernet
- Point-to-point networks
- Nonbroadcast multi-access (NBMA),
such as Frame Relay
A fourth type,
point-to-multipoint, can be manually configured on an interface by an
administrator.
In a multi-access
network, it is not known in advance how many routers will be connected. 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 neighbor, 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.
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. 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.
24.2
Single-Area OSPF Concepts
24.2.6
OSPF Hello protocol
This page will
introduce hello packets and the Hello protocol.
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 neighbor 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. For the hello packet the type field is set to
1.
The hello packet
carries information that all neighbors must agree upon before an adjacency is
formed, and link-state information is exchanged.
24.2
Single-Area OSPF Concepts
24.2.7
Steps in the operation of OSPF
This page will
explain how routers communicate in an OSPF network.
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 set of rules that govern the
exchange of OSPF Hello packets is called the Hello protocol. On multi-access
networks, the Hello protocol elects a designated router (DR) and a backup
designated router (BDR). The Hello carries information about which all
neighbors must agree to form an adjacency and exchange link-state information.
On multi-access networks the DR and BDR maintain adjacencies with all other
OSPF routers on the network.
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
neighbor 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.
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 neighbor is down. -
24.3
Single-Area OSPF Configuration
24.3.1
Configuring OSPF routing process
This page will
teach students how to configure OSPF.
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 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 OSPF routing process be enabled on the router
with network addresses and area information specified. 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.
To enable OSPF
routing, use the global configuration command syntax:
Router(config)#router
ospfprocess-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.
24.3
Single-Area OSPF Configuration
24.3.2
Configuring OSPF loopback address and router priority
This page will
explain the purpose of an OSPF loopback interface. Students will also learn how
to assign an IP address to a loopback interface.
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.
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.
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.
The command show ip ospf interface will display the interface priority
value as well as other key information.
Router(config-if)#ip
ospf prioritynumber
Router#show ip
ospf interfacetype number
The Lab Activity
will teach students to configure loopback interfaces for OSPF as well as
observe the election process for DR and BDR.
24.3
Single-Area OSPF Configuration
24.3.3
Modifying OSPF cost metric
This page will
teach students how to modify cost values on network interfaces.
OSPF uses cost as
the metric for determining the best route. A cost is associated with the output
side of each router interface. Costs are also associated with externally
derived routing data. In general, the path cost is calculated using the formula
10^8/ bandwidth, where bandwidth is expressed in bps. The system administrator
can also configure cost by other methods. The lower the cost, the more likely
the interface is to be used to forward data traffic. The Cisco IOS
automatically determines cost based on the bandwidth of the interface. It is essential for proper OSPF operation
that the correct interface bandwidth is set.
Router(config)#interface
serial 0/0
Router(config-if)#bandwidth
56
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.
Use the following
interface configuration command to set the link cost:
Router(config-if)#ip
ospf costnumber
The Lab
Activities will show students how to modify the OSPF cost metric of an
interface.
24.3
Single-Area OSPF Configuration
24.3.4
Configuring OSPF authentication
This page will
explain why OSPF authentication keys are used and how they are configured.
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. The password can be up to eight characters.
Use the following command syntax to configure OSPF authentication:
Router(config-if)#ip
ospf authentication-keypassword
After the
password is configured, authentication must be enabled:
Router(config-router)#areaarea-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-keykey-id encryption-type md5key
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. Neighbor routers must use the
same key identifier with the same key value.
The following is
configured in router configuration mode:
Router(config-router)#areaarea-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.
24.3
Single-Area OSPF Configuration
24.3.5
Configuring OSPF timers
This page will
explain how the hello and dead intervals are configured on an OSPF network.
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 neighboring
router.
To configure the
hello and dead intervals on an interface, use the following commands:
Router(config-if)#ip
ospf hello-intervalseconds
Router(config-if)#ip
ospf dead-intervalseconds
The Lab
Activities will help students understand how to configure OSPF timers to
enhance network efficiency.
24.3
Single-Area OSPF Configuration
24.3.6
OSPF, propagating a default route
This page will
teach students how to configure a default route for an OSPF router.
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.
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.
24.3
Single-Area OSPF Configuration
24.3.7
Common OSPF configuration issues
This page will
discuss some configuration issues that could prevent communications between
OSPF routers.
An OSPF router
must establish a neighbor or adjacency relationship with another OSPF router to
exchange routing information. Failure to establish a neighbor relationship is
caused by any of the following reasons:
- Hellos are not sent from both
neighbors.
- Hello and dead interval timers
are not the same.
- Interfaces are on different
network types.
- Authentication passwords or
keys are different.
In OSPF routing
it is also important to ensure the following:
- All interfaces have the correct
addresses and subnet mask.
- network area statements have
the correct wildcard masks.
- network area statements put
interfaces into the correct area.
24.3
Single-Area OSPF Configuration
24.3.8
Verifying the OSPF configuration
This page will
explain how show commands can be used to troubleshoot OSPF.
To verify the
OSPF configuration a number of show commands are available. Figure lists these commands. Figure shows commands useful for troubleshooting
OSPF.
Summary
This page
summarizes the topics discussed in this module.
An essential
difference between link-state routing protocols and distance vector protocols
is how they exchange routing information. Link-state routing protocols respond
quickly to network changes, send triggered updates only when a network change
has occurred, send periodic updates known as link-state refreshes, and use a
hello mechanism to determine the reachability of neighbors.
A router running
a link-state protocol uses the hello information and LSAs it receives from
other routers to build a database about the network. It also uses the shortest
path first (SPF) algorithm to calculate the shortest route to each network.
To overcome the
limitations of distance vector routing protocols, link-state routing protocols
use link-state advertisements (LSAs), a topological database, the shortest path
first (SPF) algorithm, a resulting SPF tree, and a routing table of paths and
ports to each network to determine the best paths for packets.
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 neighboring routers. Link-state routers
advertise with LSAs the states of their links to all other routers in the area
so that each router can build a complete link-state database. They form special
relationships with their neighbors and other link-state routers. Link state
routers are a good choice for complex, scalable networks. 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).
Open Shortest
Path First (OSPF) is a link-state routing protocol based on open standards. The
Open in OSPF means that it is open to the public and is non-proprietary. OSPF
routers elect a Designated Router (DR) and a Backup Designated Router (BDR)
that serve as focal points for routing information exchange in order to reduce
the number of exchanges of routing information among several neighbors on the
same network. OSPF selects routes based on cost, which in the Cisco
implementation is related to bandwidth. 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. 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. If all
parameters in the OSPF Hello packets are agreed upon, the routers become
neighbors.
Each router sends
link-state advertisements (LSA) in link-state update (LSU) packets. Each router
that receives an LSA from its neighbor 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.
This routing
information is 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 neighbor is down.
No comments:
Post a Comment