Professional Documents
Culture Documents
Unit 4 OSPF Overview V3
Unit 4 OSPF Overview V3
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
6 6
OC12 OC12
6 6
U
OSPF U
10 10
OC3
OC3 OC3 10
5 U
10 5
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).
6 6
OC12 OC12
6 6
U
OSPF U
10 10
OC3
OC3 OC3 10
5 U
10 5
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.
6 6
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.
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.
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
6 6
OC12 OC12 Router C
Router B
6 6
U
OSPF U
10 10
OC3
OC3 OC3 10
5 U
10 5
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
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
192.168.0.0
192.168.1.0
...
192.168.15.0
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
...
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
• 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
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
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
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