You are on page 1of 17

Unit 4

OSPF Overview

Additional References:
OSPF - Anatomy of an Internet Routing Protocol John T. Moy
RFC 2328 OSPF V2
RFC 1585 MOSPF
RFC 1587 NSSA
RFC 2370 Opaque LSA

OSPF Overview Rev 3.2 Page 4- 1


OSPF Overview Unit Objectives

• Describe OSPF characteristics


• Describe basic OSPF protocol operation
• List and describe the different types of OSPF
Link State Advertisements
• List the benefits of using multiple OSPF areas
• Configure OSPF using a single area
• Use show commands to verify proper OSPF
operation

OSPF Overview Rev 3.2 Page 4- 2


OSPF Characteristics

6 6
OC12 OC12

6 6
U
OSPF U

10 10
OC3
OC3 OC3 10
5 U

10 5

• Designed for use in large IP networks


• Link state protocol based on assigned costs
• Quick convergence with minimal routing control
traffic
• Supports VLSM, address summarization and CIDR
• Supports Equal Cost Multi-Path (ECMP)

Open Shortest Path First (OSPF) is a routing protocol defined by RFC 2328, OSPF
Version 2. It is an IGP designed for use in large IP networks. It is a link state protocol
based on assigned cost that uses the Dijkstra’s algorithm to build a Shortest Path First
Tree (SPF).

OSPF Overview Rev 3.2 Page 4- 3


OSPF Protocol Overview

6 6
OC12 OC12

6 6
U
OSPF U

10 10
OC3
OC3 OC3 10
5 U

10 5

• Routers form adjacencies with neighbor routers


• Routers advertise the state of their local networks links
• Link State Database describes the state of the current
network
• Each router calculates the shortest path to each network

Routers advertise the state of their local networks via Link State Advertisements or LSAs.
These packets are flooded throughout an area.
Routers receive these LSA and build a Link State Database (LSDB). The LSDB will only
contain LSAs from a single area. If a router has interfaces in more than one area, multiple
LSDBs will be built, one per area.

OSPF Overview Rev 3.2 Page 4- 4


OSPF Configuration Information
192.168.0.1/32

6 6

192.168.0.2/32 OC12 OC12 192.168.0.3/32

6 6
U
OSPF U

10 10
OC3
OC3 OC3 10
5 U

10 5

192.168.0.4/32
• Routers are assigned a unique router id
• Routers interfaces are grouped into Areas
• Routers within an Area have identical Link State Databases
• Each interface assigned a cost

Each router running OSPF is assigned a unique, 32 bit router ID. This ID is used in OSPF
packets. By default, the ERX uses the highest IP address on the box as the router ID.
In OSPF, routers are grouped into areas. Specifically, each router interface is assigned to
an area.
In this example, all four routers are in the same area, area 0.0.0.0. Each of their
interfaces have been assigned an area address using a network range statement on the
ERX.
This network has been up and running for some time. Since this network has a single
area, all routers will have identical link-state databases that describe a complete map of
the network. Looking at this database, any router can tell how many other routers are in
the network, how many interfaces a particular router has, and whether a specific link
connects two particular routers. The database also gives the cost for each link.

OSPF Overview Rev 3.2 Page 4- 5


OSPF Operation Begins
Router A

6 6
OC12 OC12 Router C
Router B
6 6
U U

10 10
OC3
OC3 OC3 10
5 U

10 5

Router D
• Discover neighbor routers using multicast Hello packets
• Synchronize the link-state database
• Advertise the new connection in a Link State Advertisement
(LSA)
• LSA distributed to routers using ‘Reliable Flooding’ mechanism
• Run the Dijkstra’s SPF algorithm to determine
shortest path

Hello packets are sent out periodically, every 10 seconds. They are used to discover
neighbor routers as well as maintain the adjacency. If a router fails to receive a Hello
packet from a neighbor, the router will report that connection as down. This time interval
is known as the dead interval. Both of these parameters are configurable per network
segment.
Before routers can forward traffic over a new link, their link state databases must be
synchronized.
All routers within an area must have identical link-state databases. After two routers have
discovered each other using the Hello packet, they will describe the contents of their link-
state database using OSPF Database Description packets. These packets simply
describe only the LSA headers. When one router notices that some of its LSAs are out of
date or that is it missing other LSAs, it requests the LSAs using OSPF Link State Request
packets. The neighbor router then floods the requested LSAs using OSPF Link State
Update packets.
Once the database description packets and necessary link state request and update
packets and been sent and received, the routers declare the connection synchronized and
advertises that the connection is ready for data. The neighbor routers are now said to be
fully adjacent.
OSPF LSAs are distributed throughout the OSPF routing domain via a reliable flooding
mechanism. The router originating the LSA begins the flood by sending the LSA to its
neighbors. Any other router will , when receiving the LSA, acknowledged receipt of the
LSA and then compare the LSA to the contents of its present database. It the received
LSA is more recent, the receiving router will send the LSA out all interfaces other than the
one on which the LSA was received. In order to make this flood reliable, after having sent
the LSA out an interface, the router will retransmit the LSA until it is acknowledged. Each
LSA must be acknowledge explicitly. In addition, each LSA must be resent every 30
minutes, even if nothing changed.

OSPF Overview Rev 3.2 Page 4- 6


Forming an Adjacency
U U

Router A Router B
Down Down
Hello
Attempt Init
Hello
2-Way 2-Way

DB Description
Ex-Start Ex-Start
DB Description
DB Description
Exchange Exchange
DB Description

Link State Request


Loading Loading
Link State Update

Link State Request


Link State Update

Full (Adjacency Up) Full


Hello
Hello

OSPF Overview Rev 3.2 Page 4- 7


OSPF Link State Advertisements
Router A

6 6
OC12 OC12 Router C
Router B
6 6
U
OSPF U

10 10
OC3
OC3 OC3 10
5 U

10 5

• Router Links Router D


- Describes the state and cost of a router’s interfaces within an
area
• Network Links
- Originated for multi-access networks (FDDI, Ethernet, etc.)
- Generated by the Designated Router (DR) indicating all
routers on the segment

OSPF Overview Rev 3.2 Page 4- 8


OSPF Steady State Operations
Router A

6 6
OC12 OC12 Router C
Router B
6 6
U
OSPF U

10 10
OC3
OC3 OC3 10
5 U

10 5

Router D

• Exchange periodic Hello Packets between


neighbors
• Refresh link state advertisements every 30 minutes

OSPF Overview Rev 3.2 Page 4- 9


OSPF Basics - Link Failure Occurs
Router A

6 6
OC12 OC12 Router C
Router B
6 6
U U

10 10
OC3
OC3 OC3 10
5 U

10 5

Router D
• Physical or data-link detects failure or OSPF Hello timeout
occurs
• Router B and C transmit new router LSA indicating
connectivity to Router A and D
• LSA flooded throughout area
• Router recalculate shortest path based on change
in network

OSPF Overview Rev 3.2 Page 4- 10


Single OSPF Area
Network Range Destination Network
192.168.0.0 - Router A
192.168.0.0/24
192.168.1.0/24
192.168.255.255 192.168.2.0/24
Area 0.0.0.0 192.168.3.0/24
192.168.4.0/24

Router B Router C
Routing Table
U U

192.168.0.0
192.168.1.0
...
192.168.15.0
U

• Single Area Router D

• Identical link-state database on every router in the


area
• Large Routing Table
• Every router knows about every network

OSPF Overview Rev 3.2 Page 4- 11


Network Expansion
Destination Network
192.168.0.0/24
192.168.1.0/24
Network Range 192.168.48.0 …
192.168.0.0 - 192.168.49.0 192.168.16.0/24
... 192.168.17.0/24
192.168.255.255 192.168.63.0 …
Area 0.0.0.0 192.168.32.0/24
192.168.33.0/24
Router A …
192.168.48.0/24
192.168.49.0/24
Router C ...
Router B Routing Table
192.168.16.0 U U
192.168.32.0
192.168.17.0 192.168.0.0 192.168.33.0
... 192.168.1.0 ...
192.168.31.0 ... 192.168.47.0
192.168.15.0
Destination Network
U
U

192.168.0.0/24
192.168.1.0/24
...
192.168.16.0/24
Router D 192.168.17.0/24 Router E
• Single Area ...
192.168.32.0/24
• Large, identical link-state database 192.168.33.0/24

• Large Routing Table 192.168.48.0/24
• Every router knows about every network 192.168.49.0/24
...

OSPF Overview Rev 3.2 Page 4- 12


Multiple OSPF Areas
Destination Network
Area 0.0.0.3 192.168.0.0/24
Network Range 192.168.48.0 192.168.1.0/24
192.168.0.0 - 192.168.49.0 …
... 192.168.16.0/20
192.168.255.255 192.168.63.0 192.168.32.0/24
192.168.33.0/24

192.168.48.0/20

Router C
Routing Table
Area 0.0.0.1 Area 0.0.0.2
192.168.16.0
U U
192.168.32.0
Area 0.0.0.0
192.168.17.0 192.168.33.0
192.168.0.0
... ...
192.168.1.0
192.168.31.0 192.168.47.0
...
192.168.15.0
U U

Destination Network
192.168.0.0/20
192.168.16.0/20
• Reduce the size of link-state database 192.168.32.0/24 Router E
- Unique link state database per area 192.168.33.0/24

Routing Table
• Reduce the size of the routing table 192.168.48.0/20

• Hide details of other areas


• IP addressing scheme must be designed to support
summarization

OSPF Overview Rev 3.2 Page 4- 13


OSPF Link State Advertisements
Destination Network
192.168.0.0/24
Network Range 192.168.1.0/24
192.168.0.0 - …
192.168.16.0/20
192.168.255.255 Router A 192.168.32.0/24
192.168.33.0/24

AS 192.168.48.0/20
External
Links
Router C
Routing Table
Area 0.0.0.1 Area 0.0.0.2
192.168.16.0
U U
192.168.32.0
Area 0.0.0.0
192.168.17.0 192.168.33.0
192.168.0.0 Summary
... ...
192.168.1.0 Links
192.168.31.0 192.168.47.0
...
192.168.15.0 U

• Summary Links
- Originated by Area Border Routers (ABR) Router E
- Describes networks in an area to routers outside that area
• AS External Links
- Originated by Autonomous System Border Routers (ASBR)
- Describes routes to networks not running OSPF
- Flooded throughout the OSPF routing domain

OSPF Overview Rev 3.2 Page 4- 14


Basic OSPF Configuration - Router C

Area 0.0.0.2
192.168.1.0 Router C 192.168.32.0
192.168.15.1 192.168.33.0
U
...
Area 0.0.0.0
192.168.47.0
192.168.0.0
192.168.1.0
192.168.32.0
...
192.168.15.0 U

U 192.168.2.0

• Configure Router ID
- ip router-id 192.168.15.1 Router E

• Define OSPF Process


- router ospf 1
• Define OSPF Networks and assign to appropriate OSPF
Area
- network 192.168.0.0 0.0.15.255 area 0.0.0.0
- network 192.168.32.0 0.0.15.255 area 0.0.0.2

OSPF Overview Rev 3.2 Page 4- 15


Advanced OSPF Configuration - Router C
192.168.32.0/255.255.240.0

Area 0.0.0.2
192.168.1.0 Router C 192.168.32.0
192.168.33.0
OC12 OC12
U U
...
Area 0.0.0.0
192.168.47.0
192.168.0.0
192.168.1.0 192.168.2.0 192.168.16.0
...
192.168.15.0 OC12 U

OC12 U

Router E

• Modify OSPF Interface Parameters


- Cost
- Timers
• Modify Global OSPF Parameters
- Configure OSPF Route Summarization on Area Border Routers
- Enable ECMP or Maximum paths
- Route redistribution

OSPF Overview Rev 3.2 Page 4- 16


How can I tell if OSPF is working?

• View OSPF Global Information


- show ip ospf
• Verify Neighbor Adjacencies
- show ip ospf neighbors
• Examine the OSPF Link-state database
- show ip ospf database
- show ip ospf database router
- show ip ospf database external
• Examine the IP routing table
- show ip route
• Examine OSPF Interface statistics
- show ip ospf interface
• Logging
- ospfPktsSent, ospfPktsRcvd
• Debug Commands
- Remember to configure the log destination first!
- debug ip ospf packets-sent severity <0-7>
- debug ip ospf packets-rcvd severity <0-7>

RX-0-70-D0:vr2#show ip ospf
Routing Process OSPF 1 with Router ID 192.168.24.2
OSPF Statistics:
Rcvd: 13536 total, 0 checksum errors
13314 hello, 14 database desc, 4 link state req
141 link state updates, 63 link state acks
Sent: 26454 total, 0 pkts dropped
26238 hello, 11 database desc, 2 link state req
151 link state updates, 52 link state acks
Supports only single TOS(TOS0) routes
SPF schedule delay 0 secs, Hold time between two SPFs 3 secs
Maximum path splits 4
Area BACKBONE(0.0.0.0)
Area is a transit area
SPF algorithm executed 15 times
ABDR count 0
ASBDR count 1
LSA Count 4
Number of interfaces in this area is 5
Area ranges are:
Number of active areas in this router is 1
1 normal, 0 stub, 0 NSSA.
RX-0-70-D0:vr2#show ip ospf neigh
Neighbor ID Pri State Address Interface
192.168.8.2 1 FULL 192.168.9.1 serial4/0:3/1.1
192.168.8.2 1 FULL 192.168.10.1 serial4/0:3/1.2
192.168.33.1 1 FULL 192.168.34.1 atm2/0.3

OSPF Overview Rev 3.2 Page 4- 17

You might also like