Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1-800-COURSES
www.globalknowledge.com
Introduction
All advanced IP routing protocols (OSPF, EIGRP, IS-IS) have several elements that are always present. This is
because the function of all routing protocols is the same, which is to find the best path to an IP destination
address.
There are four common elements:
1. Operations, processes, and rules for the exchange of packets to accomplish the routing protocol
objective.
2. Construction and maintenance of the routing protocol database (link state database [LSDB] in this case).
3. Construction and use of the data structures created by elements one and two.
4. Configuration and verification of the entire process.
The purpose of this paper is to examine these elements for the implementation of Open Shortest Path First
(OSPF).
The graphic shows the OSPF packet types, which include hello, acknowledgement, database descriptor (DBD), link
state request (LSR), and link-state update (LSU). The use of the information carried in these packets will be
described later. The exchange of packets facilitates the following:
A neighbor adjacency
Creation of a database of reachable networks
OSPF Adjacencies
Routing updates and topology information are
passed only between adjacent routers.
The graphic shows an initial exchange of hello packets to form a neighbor relationship between two routers
called an adjacency. For the neighbor relationship to be formed, several parameters in the hello packet must
Copyright 2014 Global Knowledge Training LLC. All rights reserved.
match at both ends. The default interval for the OSPF hello is 10 seconds with a dead interval of 40 seconds. If 40
seconds go by without a hello, the neighbor relationship is torn down. The following parameters in the hello
packets must match:
From the database, additional data structures are createdneighbor table, interface table, routing information
base (RIB), forwarding information base (FIB), and adjacency database.
OSPF is a reliable protocol because the DBD, LSR, and LSU packets are acknowledged and retransmitted if
necessary when errors are detected.
Pri
1
0
State
FULL/DR
FULL/ -
Dead Time
00:00:32
00:00:37
Address
10.64.0.1
10.2.1.1
Interface
FastEthernet0/0
Serial0/0/1
From this beginning, the remaining operations will take place one by one.
The OSPF SPF algorithm defines all the rules and processes that make this work.
Pacing parameters for how many updates can be sent one after the other
All of these parameters can be verified with the show ip ospf interface and show ip ospf neighbor commands.
The graphic shows DR and BDR for designated router and backup designated router. These will be described
later.
OSPF Metric
Also called cost
Defined per interface, but may be altered
Inversely proportional to the bandwidth of that
interface
COST = 100,000,000 / bandwidth [b/s]
Link Type
Default Cost
1562
64
48
Ethernet
10
Fast Ethernet
ATM
The primary purpose of any IP routing protocol is to provide the best path to an IP destination address. (Best
is expressed as a number called a metric.)
The metric is calculated in a different way by each routing protocol. With OSPF, the SPF algorithm defines the
OSPF cost as shown in the graphic.
100,000,000 is reference bandwidth and can be changed to a higher number with an IOS command. This
is necessary for the higher bandwidth services available in modern networks.
OSPF Areas
OSPF is classified as a link state routing protocol. Link state routing protocols define areas and area types. This is
sometimes called a two-layer area hierarchy.
The backbone area is always numbered as area 0. And all other areas must connect to area 0.
The areas connected to area 0 are regular or normal areas. Special area types will be described later.
Area Border Router (ABR) is a router connected to area 0 and one or more other areas
Autonomous System Boundary Router (ASBR) is a router connected to any regular area and another
routing domain
Backbone Router is a router in area 0
Internal Router is a router in a regular area
When OSPF is implemented on either an Ethernet LAN link or specific types of shared cloud WAN services that
are not point-to-point, a DR and BDR are elected by OSPF as shown in the graphic.
The purpose for this is to lower the number of OSPF neighbor adjacencies by making it more of a hub and spoke
logical topology rather than a full mesh. Even though there is a full mesh of neighbors, adjacencies are only
established to the DR and BDR.
The DR is elected based on the OSPF priority on the interface. The default is 1 and raising it causes a router to
automatically be elected. If the interface priorities are equal, the OSPF router ID (the highest is elected) is used.
OSPF routers send routing information Link State Advertisements (LSAs) using multicast address 224.0.0.5. Nondesignated routers (DR-OTHER) communicate with the DR using 224.0.0.6, and the DR relays info to the rest of
the area routers.
An OSPF router is directly connected to one or more OSPF routers in the same administrative domain, called an
Autonomous System (AS). The Layer 2 connection between the routers is either an Ethernet or Wide Area
Network (WAN) connection.
Once the physical connection is in place, OSPF hellos will go back and forth every 10 seconds by default. With the
proper matching of parameters (timers, security, area number, and area type) in the hello protocol, a neighbor
relationship is established and a neighbor table and interface table are constructed.
The graphic shows the methodology each router uses to process an incoming OSPF LSA, typically an LSU packet.
Sequence numbering is used to determine the most current information and avoid duplication. Since OSPF is a
LSP, all LSAs are flooded throughout the autonomous system. There are multiple types of LSAs that will be
described later.
Establishing Bidirectional
Communication
224.0.0.5
At this point, an OSPF router starts a several-step loading process. Once the bi-directional state is established, the
router moves to the next step as shown in the graphic.
Copyright 2014 Global Knowledge Training LLC. All rights reserved.
10
If a designated router is to be elected (typically on Ethernet links) it will happen during the exstart (exchange
start) step.
From exstart, the router moves to the exchange state. To avoid a huge number of packets to exchange
information about many destinations, a short cut method is used:
The DBD packet contains a summary of known routes in the sending router database with no added
detail on each one.
The receiving router compares the routes in the summary to existing routes in its own database. If the
route is new, the receiving router asks for additional details with an LSR packet.
The sending router then sends the details of all routes requested with an LSU packet.
11
All DBD, LSR, and LSU packets are acknowledged for reliability. When all the LSRs have been satisfied for a given
router, the adjacent routers are synchronized.
The graphic shows a summary of the router states during the OSPF loading process.
12
LSA Types
LSA Type
Description
Router LSAs
Network LSAs
3 or 4
Summary LSAs
Autonomous system
external LSAs
9, 10, 11
Opaque LSAs
The processes described so far have relied on LSAs to carry the routing protocol information. LSAs are defined by
their source or originating devices. LSA type 6, 8, 9, 10, and 11 are outside the scope of this paper and rarely used
in normal routing operations. Type 7 LSAs are used by a specific type of OSPF area called a Not So Stubby Area
(NSSA), which will be described later.
OSPF LSDB
R2#show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 2)
LSA Type 1
from area 0
Link ID
2.2.2.2
3.3.3.3
Checksum
0xCD0B
0x9057
Link ID
4.0.0.0
5.0.0.0
0)
Checksum
0xFFE6
0x8466
Link ID
9.0.0.0
Link count
2
2 LSA Type 3
for area 0
LSA Type 4
of ASBR
from ABR
LSA Type 5
from ASBR
Tag
0
As the LSAs are exchanged during the initial loading process and OSPF operations from then on, the OSPF LSDB is
constructed and updated.
13
The OSPF cost metric is used to select the best route for insertion into the routing table or RIB. Alternate routes
may be available in the database for use if the best route fails. If an equal cost (metric) exists for two paths to the
same destination (route), load balancing equal cost multi-pathing (ECMP) will be used.
Since OSPF LSA flooding occurs with each topology change, it is necessary to control it to support network
stability. Two methods are used:
The RIB is maintained as part of the routing process memory by incremental routing updates after the initial
loading process. This exchange of information necessary to maintain this table is called the control plane. Specific
LSAs cause routes to appear in the OSPF routing table as follows:
14
OSPF Commands
The following Cisco IOS commands can be
used to gather information from the OSPF
data structures or to analyze the flow of
routing information in real time.
The Cisco IOS commands to see the contents of the various data structures are shown in the graphic.
Once the tables are converged and stable, it is necessary to deal with changes in network topology (link failures,
device failures), very quickly. With all of the real-time protocols in modern networks (voice, video, multi-cast),
repair times are measured in milliseconds. Over the years, Cisco has evolved multiple features in the Cisco IOS to
address this issue.
Exchange of
Routing Information
CEF
Control Plane
Routing Protocol
IP Routing Table (RIB)
Data Plane
IP Forwarding Table (FIB)
Stored in fast
memory cache or
hardware
The latest in this evolution is Cisco Express Forwarding (CEF), which copies all of the contents of the RIB (routing
table) to a fast cache in the fastest memory location possible, such as a line module in a 6500 or Nexus multiCopyright 2014 Global Knowledge Training LLC. All rights reserved.
15
layer switch. This table is called the Forwarding Information Base (FIB) and is in the data plane. It is the table
actually consulted by the router when user data packets arrive on an interface and a routing decision is required.
The FIB is refreshed by the RIB regularly. The only time the RIB is consulted is if there is a failure of the FIB to
provide a routing entry.
Or
Enable OSPF explicitly on an interface
16
R1#
R2#
<output omitted>
interface Fast Ethernet0/0
ip address 10.64.0.1 255.255.255.0
<output omitted>
interface Fast Ethernet0/0
ip address 10.64.0.2 255.255.255.0
<output omitted>
router ospf 1
network 10.0.0.0
0.255.255.255 area 0
<output omitted>
router ospf 50
network 10.64.0.2
0.0.0.0 area 0
OSPF Router ID
The router is known to OSPF by the router ID number.
This router ID is used in LSDBs to differentiate one router from
the next.
OSPF requires at least one active interface with an IP address.
By default, the router ID is:
17
A critical feature in the OSPF routing process is the router ID. It must be unique for each OSPF router and is
selected either automatically or via a command. It is used to identify the router sending OSPF LSAs in all
databases as the advertising router. If it is automatically selected, the criteria are:
If loopback interfaces are configured when the OSPF process starts, the router will pick the highest
loopback IP address.
The graphic provides a description of the OSPF special area types. The stub, and NSSA based on the RFCs will not
be described. When running OSPF on a Cisco device, the Cisco proprietary totally stubby and NSSA totally stubby
will almost always be implemented.
The idea of stubbiness is the same as summarization. By inserting a default route (0.0.0.0) instead of external (O
E) and Inter-area (O IA) routes, the most efficient routing table possible can be created in the area.
18
As the graphic shows, once the area routers are configured as totally stubby, only Intra-area routes and the
default appear in the area routers table. Remember the rules (no virtual link and no ASBR).
area 2 stub
First command defines the totally stubby area on the ABR router
Second command defines the cost of a default route sent into the
totally stubby area (default is 1); defining the cost is optional
19
As the graphic shows, the routing table in a totally stubby router only has a minimal routing table. This leads to
smaller more efficient tables and less routing traffic.
One of the rules imposed by the OSPF standards on totally stubby areas is the inability to use an ASBR. Since
route redistribution is fairly common in most networks, this is a major restriction.
The RFCs were revised to add a new area type the NSSA totally stubby. This area type allows the use of an ASBR
in the area and introduces a new LSA type, LSA type 7, which was referred to but not described earlier.
Cisco provides a proprietary feature to make the NSSA totally stubby, so that all summary (type 3/4) and external
(type 5) are blocked and a default route is inserted instead.
Copyright 2014 Global Knowledge Training LLC. All rights reserved.
20
area 2 nssa
All other attributes of the area are the same as totally stubby areas. The configuration is shown in the graphic.
The argument no-summary is the Cisco proprietary feature to make it totally stubby.
R2#
R1#
<output omitted>
interface Fast Ethernet0/0
ip address 10.64.0.1 255.255.255.0
<output omitted>
interface Fast Ethernet0/0
ip address 10.64.0.2 255.255.255.0
<output omitted>
router ospf 1
network 10.0.0.0
0.255.255.255 area 0
<output omitted>
router ospf 50
network 10.64.0.2
0.0.0.0 area 0
The OSPF routing protocol can be verified with the show ip protocols command.
The interface information can be verified with the show ip ospf interface command.
The neighbor information can be verified with the show ip ospf neighbor command.
The routes learned can be verified with the show ip route ospf command.
The configured ip routing protocol processes can be verified with the show ip protocols and show ip
ospf commands.
21
The OSPF link state database can be seen with the show ip ospf database command.
Debug ip ospf adjacency and debug ip ospf events are helpful debug commands.
OSPF authentication
Passive interfaces
Design limitations
Issues with NBMA and multipoint WANs
OSPF over MPLS
Route Redistribution
Route filtering
Troubleshooting
Route Summarization
OSPF design
OSPF Virtual Links
Learn More
Learn more about how you can improve productivity, enhance efficiency, and sharpen your competitive edge
through training.
ROUTE - Implementing Cisco IP Routing v1.0
ARCH - Designing Cisco Network Service Architectures v2.1
SWITCH - Implementing Cisco IP Switched Networks v1.0
TSHOOT - Troubleshooting and Maintaining Cisco IP Networks v1.0
Visit www.globalknowledge.com or call 1-800-COURSES (1-800-268-7737) to speak with a Global Knowledge
training advisor.
22