OSPF is a link-state
routing protocol that employs an interior gateway protocol (IGP) to
route IP packets using the shortest path first based solely on the destination
IP address in the IP packet header. OSPF routed IP packets
are not encapsulated in any additional protocol headers as they
transit the network.
An Autonomous System (AS), or
Domain, is defined as a group of networks within a common
routing infrastructure.
OSPF is a dynamic
routing protocol that quickly detects topological changes in the
AS (such as router interface failures) and calculates
new loop-free routes after a period of convergence. This
period of convergence is short and involves a minimum of routing
traffic.
In a link-state
routing protocol, each router maintains a database, referred
to as the link-state database, that describes
the Autonomous System's topology. Each participating router
has an identical database. Each entry in this database
is a particular router's local state (for example, the router's
usable interfaces and reachable neighbors). The
router distributes its local state throughout the AS by flooding.
All routers run the
same algorithm in parallel. From the link-state
database, each router constructs a tree of shortest paths
with itself as root to each destination in the AS. Externally derived
routing information appears on the tree as leaves. The
cost of a route is described by a single dimensionless metric.
OSPF allows sets of
networks to be grouped together. Such a grouping is called
an area. The topology of this area is hidden from the rest
of the AS, which enables a significant reduction in routing
traffic. Also, routing within the area is determined
only by the area's own topology, lending the area
protection from bad routing data. An area is a generalization
of an IP subnetted network.
OSPF enables the flexible
configuration of IP subnets so that each route distributed by OSPF
has a destination and mask. Two different subnets of the
same IP network number may have different sizes (that is, different
masks). This is commonly referred to as variable-length subnetting. A
packet is routed to the best (longest or most specific) match. Host
routes are considered to be subnets whose masks are "all
ones" (0xffffffff).
OSPF traffic can be
authenticated or non-authenticated, or can use
no authentication, simple/clear text passwords, or
MD5-based passwords. This means that only trusted
routers can participate in the AS routing. You can specify
a variety of authentication schemes and, in fact, you
can configure separate authentication schemes for each IP subnet.
Externally derived
routing data (for example, routes learned from
an exterior protocol such as BGP) is advertised throughout
the AS. This externally derived data is kept separate from
the OSPF ink state data.
Each external route
can also be tagged by the advertising router, enabling
the passing of additional information between routers on the boundary
of the AS.
OSPF uses a link-state
algorithm to build and calculate the shortest path to all known destinations.