Understanding OSPF Concepts
Understanding OSPF Concepts
Chapter 19
Understanding OSPF Concepts
Objectives
• Comparing Dynamic Routing Protocol Features
• Routed protocol and routable protocol: Both terms refer to a protocol that
defines a packet structure and logical addressing, allowing routers to
forward or route the packets. Routers forward packets defined by routed
and routable protocols. Examples include IP Version 4 (IPv4) and IP
Version 6 (IPv6).
Routing Protocol Functions
1. Learn routing information about IP subnets from neighboring routers.
3. If more than one possible route exists to reach one subnet, pick the best
route based on a metric.
▫ IGP: A routing protocol that was designed and intended for use inside a single autonomous
system (AS)
▫ EGP: A routing protocol that was designed and intended for use between different
autonomous systems
• Some routing protocols work best inside a single AS by design, these are
called IGPs
• Other routing protocols work best between ASs by design, these are called
EGPs
Comparing Locations for Using IGPs
and EGPs
IGP Routing Protocol Algorithms
• There are three main branches of routing protocol algorithms:
▫ Link-state
• Link state protocols (OSPF and IS-IS) and advanced distance vector
protocols (EIGRP) came later.
IGP Routing Protocol Metrics
• Routing protocols choose the best route to reach a subnet by choosing the
route with the lowest metric.
IGP Routing Protocol Algorithms
• With EIGRP selecting the better choice even though it goes through
multiple routers.
Other IGP Comparisons
Feature RIPv1 RIPv2 EIGRP OSPF IS-IS
Cisco-proprietary No No Yes No No
• When IOS must choose between routes learned using different routing protocols it
uses a concept called administrative distance.
▫ The routers learn a lot of information about the network (Routers, links, IP addresses, status
information, etc.)
▫ The routers then flood this information so that all routers know the same information.
▫ Each router can then calculate routes to all subnets from their own perspectives.
Topology Information and LSAs
• Each LSA is a data structure with some specific information about the
network topology.
• The flooding process has a way to prevent loops so that the LSAs do not get
flooded around in circles:
▫ Before sending an LSA to yet another neighbor, routers communicate which LSAs they already have.
• Routers reflood LSA information based on the LSAs separate aging timer
(default 30 minutes).
Applying Dijkstra Math to Find the
Best Routes
• To build routes, link state routes have to do some math based on the
topological information found in the LSDB.
• All link state protocols use a math algorithm called Dijkstra Shortest Path
First (SPF) to process the LSDB.
• The algorithm analyzes the LSDB and builds the routes that the local route
will add to the IP routing table.
Becoming OSPF Neighbors
• OSPF neighbors are routers that both use OSPF and both sit on the same
data link.
• Assuming the two neighbors have compatible OSPF parameters, the two
will form a neighbor relationship.
• The OSPF neighbor relationship lets OSPF know when a neighbor might
not be a good option for routing packets.
• This RID serves as each router’s unique name or identifier for OSPF.
• IOS chooses its OSPF RID based on an active interface IPv4 address.
• As soon as a router has chosen its OSPF RIS and some interfaces come up,
the router is ready to meet its OSPF neighbors.
Meeting Neighbors and Learning
Their Router-ID
• The 2-way state is a particularly important OSPF state, when in this state
the following statements are true:
▫ The router received a Hello from the neighbor, with that router’s own RID listed as being seen
by the neighbor.
▫ The router has checked all the parameters in the Hello received from the neighbor, with no
problems. The router is willing to become a neighbor.
▫ If both routers reach a 2-way state with each other, it means that both routers meet all OSPF
configuration requirements to become neighbors. Effectively, at that point, they are
neighbors, and ready to exchange their LSDB with each other.
Fully Exchanging LSAs with Neighbors
• After two routers decide to exchange databases, they do not simply send the
contents of their entire database:
▫ They tell each other a list of LSAs that are in their respective databases,
▫ Each router then requests only those LSAs that it does not know about yet,
• OSPF messages that actually send the LSAs between neighbors are called
Link-State Update (LSU) packets.
• Each LSU packet holds data structures called Link State Advertisements
(LSA).
OSPF Database Exchange
• When finished, the routers reach a full state, meaning they have fully
exchanged the contents of their LSDBs
Maintaining Neighbors and the LSDB
• Once two neighbors reach a full state, they have done all the initial work to
exchange OSPF information.
▫ Routers monitor each neighbor relationship using Hello messages and two related timers:
Hello Interval and Dead Interval.
▫ Routers send and expect to receive a Hello message from each neighbor based on the Hello
interval.
▫ If a neighbor is silent for the length of the Dead Interval, the router assumes the neighbor has
failed.
• On Ethernet links, OSPF elects one of the routers on the same subnet to act
as the designated router (DR).
• The DR plays a key role in how the database exchange process works.
Designated Routers on Ethernet Links
• The database exchange happens between the DR and each of the other
routers.
• The backup designated router (BDR) watches the status of the DR and
takes over for the DR if it fails.
• The DR and BDR both do full database exchanges with all other routers on
the LAN, they both reach a full state with all neighbors.
Stable OSPF Neighbor States and
Their Meanings
Calculating the Best Routes with SPF
• Once SPF has identified a route, OSPF calculates the metric for a route as
follows:
▫ The sum of the OSPF interface costs for all outgoing interfaces in the route.
OSPF Area Design
▫ Processing the larger topology database with the SPF algorithm requires processing power
that grows exponentially with the size of the topology database.
▫ A single interface status change, anywhere in the internetwork (up to down, or down to up),
forces every router to run SPF again!
OSPF Area Design
• The solution is to take one large LSDB and break it into several smaller
LSDBs by using OSPF areas.
• SPF does its complicated match on the topology inside the areas and that
area’s topology alone.
• Generally, networks larger then a few dozen routers benefit from areas.
OSPF Areas
• OSPF area design follows a couple of basic rules:
▫ Put all interfaces connected to the same subnet inside the same area.
▫ Some routers may be internal to an area, with all interfaces assigned to that single area.
▫ Some routers may be Area Border Routers (ABR), because some interfaces connect to the
backbone area, and some connect to nonbackbone areas.
▫ All nonbackbone areas must connect to the backbone area (area 0) by having at least one ABR
connected to both the backbone area and the nonbackbone area.
OSPF Areas
OSPF Design Terminology
Term Description
Area Border An OSPF router with interfaces connected to the backbone area
Router (ABR) and to at least one other area
Backbone A router connected to the backbone area (includes ABRs)
Router
Internal Router A router in one area (not the backbone area)
Area A set of routers and links that share the same detailed LSDB
information, but not with routers in other areas, for better
efficiency
Backbone Area A special OSPF area to which all other areas must connect—area
0
Intra-area route A route to a subnet inside the same area as the router
Inter-area route A route to a subnet in an area of which the router is not a part
How Areas Reduce SPF Calculation
Time
• SPF spends most of the its processing time working through all the topology
details.
• Areas reduce this workload because the LSDB only lists those routers and links
inside that area.
• While the LSDB has less topology information, it still has to have information
about all subnets in all areas.
• OSPF uses very brief summary information about the subnets to other areas.
• These LSAs do not include topology information about the other areas.
How Areas Reduce SPF Calculation
Time
OSPF Area Design Advantages
• The smaller per-area LSDB requires less memory.
• Routers require fewer CPU cycles to process the smaller per-area LSDB
with the SPF algorithm, reducing CPU overhead and improving
convergence time.
• Changes in the network (for example, links failing and recovering) require
SPF calculations only on routers connected to the area where the link
changed state, reducing the number of routers that must rerun SPF.