| ~ By
Charlie Schluting Open
Shortest Path First (OSPF)
is a robust link-state interior gateway protocol
(IGP). People
use OSPF when they discover that Routing Information
Protocol (RIP)
just isn’t going to work for their larger network, or when they need
very fast
convergence.
OSPF is the most widely used IGP.
When we discuss IGPs, we’re talking about one routing domain, or
Autonomous System (AS).
Imagine a medium-sized company with multiple buildings and
departments, all connected and sharing two redundant
Internet
links. All of the buildings on-site are part of the same AS. With
OSPF, however, we also have the concept of an Area, which allows
further segmentation, perhaps by department in each building.
To understand the design needs for areas in OSPF, let’s start with
discussing how OSPF works. There is some terminology you may not
have encountered before, including the following:
- Router ID: In OSPF this
is a unique 32-bit number assigned to each router. This is
chosen as the highest IP address on a router, and can be set
large by configuring an address on a loopback interface of the
chosen router.
- Neighbor Routers: two
routers with a common link that can talk to each other.
- Adjacency: a two-way
relationship between two neighbor routers. Neighbors don’t
always form adjacencies.
- LSA: Link State
Advertisements are flooded; they describe routes within a given
link.
- Hello Protocol: This is
how routers on a network determine their neighbors and form LSAs.
- Area: a hierarchy. A set
of routers that exchange LSAs, with others in the same area.
Areas limit LSAs and encourage aggregate routes.
OSPF is a link-state routing
protocol, as we’ve said. Think of this as a distributed map of the
network. To get this information distributed, OSPF does three
things. |
Key Terms To
Understanding OSPF Routing:
routing
In internetworking, the process of moving a packet of data from
source to destination. Routing is usually performed by a dedicated
device called a router. Routing is a key feature of the Internet
because it enables messages to pass from one computer to another and
eventually reach the target machine.
Open Shortest Path First - OSPF
An interior gateway routing protocol developed for IP networks based
on the shortest path first or link-state algorithm.
interior gateway
protocol - IGP
A generic term for a routing protocol that is used to exchange
routing information among routers in an autonomous network, such as
a enterprise’s LAN. IGPs typically support confined geographical
areas.
Routing Information Protocol -RIP
An interior gateway protocol defined by RFC 1058 that specifies how
routers exchange routing table information. |
First, when a
router running
OSPF comes up it will send hello
packets to
discover its neighbors and elect a designated router. The hello packet
includes link-state information, as well as a list of neighbors. Providing
information about your neighbor to that neighbor serves as an
ACK, and proves that
communication is bi-directional. OSPF is smart about the layer 2 topology:
if you’re on a point-to-point link, it knows that this is enough, and the
link is considered “up.” If you’re on a broadcast link, the router must wait
for an election before deciding if the link is operational.
The election ballot can be stuffed, with a Priority ID, so that you can
ensure that your beefiest router is the Designated Router
(DR). Otherwise, the largest
IP address
wins. The key idea with a DR and backup DR (BDR) is that they are the ones
to generate LSAs, and they must do database exchanges with other routers in
the subnet. So, non-designated routers form adjacencies with the DR. The
whole DR/BDR design is used to keep the protocol scalable. The only way to
ensure that all routers have the same information is to make them
synchronize their databases. If you have 21 routers, and want to bring
another one up, then you’d have to form 21 new adjacencies. If you
centralize the database, with a backup (just in case), then adding more
becomes an easy to manage linear problem.
The database exchange is part of bringing up adjacencies after the hello
packets are exchanged, and it’s very important. If the databases are out of
sync, we could risk routing loops, blackholes and other perils. The third
part of bringing up an adjacency is Reliable Flooding, or LSA exchange. The
LSA area zero is special, and if you have multiple areas, they must all
touch area zero. This is also called the Backbone Area. There are different
types of areas in OSPF, and it can get really crazy when you throw in
Virtual Links to allow two areas to speak without hitting area zero.

Image Source (1): AVICI
Systems. Avici Systems Inc., is a leading provider of
purpose-built carrier-class routing solutions for the Internet.
There also are different types of routers in
OSPF:
- ABR: An Area Border Router is a
router that is in area zero, and one or more other areas.
- DR, BDR: A Designated Router, as
we said, is the router that keeps the database for the subnet. It sends
and receives updates (via multicast) from the other routers in the same
network.
- ASBR: The Autonomous System
Boundary Router is very special, but confusing. The ASBR connects one or
more AS, and exchanges routes between them. The ASBR’s purpose is to
redistribute routes from another AS into its own AS.
The concept of redistribution finally rears
its head: let’s say we have a router, an internal-only router, not a BR, and
we want to connect it to a new network that we don’t control. After this
connection is made, we have a few options. We can fire up a non-IGP routing
protocol, like BGP, to exchange routes. Alternatively, we could decide that
a summary route is good enough, and hard-code a static route to the new
network in this router. Anything directly using this router for this
destination would be able to get to the new network, but OSPF doesn’t know
about it. To make that happen, we redistribute the miscellaneous information
into OSPF. We wouldn’t want to feed 200K+ routes from BGP into OSPF, but if
we went the static route, we’d definitely want to propagate that information
so everyone in our AS could get to the new place. As soon as we tell our
internal router that it should redistribute static routes into OSPF, it
becomes an ASBR, and the entire network can now reach the new network.
|
Did You Know...
OSPF is a fast-converging, link-state IGP used by millions. OSPF
forms adjacencies with neighbors and shares information via the
DR and BDR using Link State Advertisements. Areas in OSPF are
used to limit LSAs and summarize routes. Everyone connects to
area zero, the backbone. |
~ By Charlie Schluting
This article originally appeared on
EnterpriseNetworkingPlanet.com as a part of their Networking 101 Series.
You can read the original article
here. Last updated: June 23, 2006
(1)
AVICI Systems - OSPF Documentation
Open Shortest Path First (OSPF) is a link-state routing protocol. It maintains a
routing table by exchanging link-state information with neighboring routers.
More Networking 101 Articles by Charlie
Schluting

Networking 101: IP Addresses
Networks don't work without addresses: Whenever you are sending something, you
need to specify where it should go and where it came from.
Networking 101: Subnets and CIDR
Let's get one thing straight: there is no "Class" in subnetting.
Networking 101: Subnets
This edition of Networking 101 will expand on Subnets and CIDR, in the interest
of promoting a thorough understanding of subnetting.
Networking 101: The Data Link Layer
Layer 2, the Data Link layer, is where Ethernet lives. We'll be talking about
bridges, switching and VLANs with the goal of discovering how they interact.
Networking 101: ICMP
Even though IP is unreliable and doesn't guarantee delivery, it is important to
notify the sender when something goes wrong. The Internet Control Message
Protocol (ICMP) is the mechanism used to give feedback about network problems
that are preventing packet delivery.
The Internet Protocol
Networking 101: TCP, the Protocol
TCP is used everywhere, and understanding how TCP operates enables network and
systems administrators to properly troubleshoot network communication issues.
Networking 101: Routing
Routing, in essence, is the act of finding a path from one place to another on
which a packet can travel. To find this path, we need algorithms. They will
generally be distributed among many routers, allowing them to jointly share
information. |