OSPF Basics

Open Shortest Path First, is an IGP used to distribute routing information within a single autonomous system (AS). OSPF is based on link state technology, used shortest path first algorithm developed by Dijkstra.

Few ‘+’ about OSPF: 

  • No limitation on hop count
  • Intelligent use of VLSM similar to EIGRP
  • Uses link state updates through an multicast address
  • Allows logical division of networks into areas and overall it’s OPEN SOURCE!!!

Whats a link state ?
OSPF is based on advertising link states. Link is like an router interface, the state of the link is a description of that interface and its relationship to its neighbouring routers.
Description of interference include, IP address, subnet mask of the interface, the type of interface it is connected to etc. The collection of these link states is called an Link-state data base.

SPF Algorithm for OSPF

The OSPF enabled routers on initialization or due to change any routing information, it generates link-state advertisements (LSA). This advertisement represents the collection of all link-states on that router.
All routers exchange link-states by means of flooding. Each router that receives a link state update should store a copy in its link-state database and then propagate the update to other routers.
After the database of each router is completed, the router calculates a shortest path tree to all destinations. The router uses the Dijkstra algorithm in order to calculate the shortest path tree. The destinations, the associated cost and the next hop to reach those destinations form the IP routing table
In case no changes in the OSPF network occur, such as cost of a link or a network being added or deleted. Any changes that occur are communicated through link-state packets and the SPF algorithm is recalculated in order to find the shortest path.

OSPF is hierarchical design, uses areas. Why areas ?

  • To decrease routing overhead
  • To speed up convergence
  • To confine the (in)stability to single areas of the network

OSPF allows us to subdivide the larger internetwork into smaller internetworks called areas.
Area 0 is called backbone area, all areas MUST connect to area 0

The router that connects other areas to the backbone area within an AS is called ABR (Area border Router).
The router that connects multiple autonomous systems (AS) together is called ASBR (Autonomous system Boundary router )

Router ID: It is an IP address used to identify a router or simply its a name of the router.
> highest IP address of all configured loopback interfaces or
> highest IP address out of all active physical interfaces or
> you can assign your own IP address

Neighbor(s): are 2 or more routers that have an interface on a common network, such as two routers connected on a serial link.

To successfully establish a neighbour relationship, these MUST match
> area id
> area type (stub, NSSA) or network type
> Hello or dead interval
> subnet mask
> authentication

Adjacency: is a relationship between two OSPF routers that permits direct exchange of route updates. Not all neighbours become adjacent depedends on type of network and configuration on routers
Examples: In multi-access networks, routers form adjacencies with designated and backup designated routers
In PPP, Point to multipoint, routes form with opposite side routers.

 

A bit advanced OSPF

Adjacency Requirements

Once neighbors have been identified, adjacencies must be established so that routing (LSA) information can be exchanged. There are two steps required to change a neighboring OSPF router into an adjacent OSPF router:

  1. Two-way communication (achieved via the Hello protocol)
  2. Database synchronization, which consists of three packet types being exchanged between routers:
  1. Database Description (DD) packets
  2. Link-State Request (LSR) packets
  3. Link-State Update (LSU) packets

Once database synchronization is complete, the two routers are considered adjacent.

It is important to remember that neighbours will not form adjacency if the following do not match

  • Authentication
  • Hello and dead Intervals
  • Subnet
  • Area ID

An ABR is a router that belongs to more than one OSPF area. Maintains information from all directly connected areas in its topology table and doesn’t share the topological details between areas.
It will forward only routing information from one area to another.ABR separates LSA flooding zone, primary point for summarization and maintains LSDB for each area its connected to.
ASBR is an OSPF router with at least one interface connected to external network or different AS.
An ASBR is responsible for injecting route information learned via the external network into OSPF and doesn’t do automatically, but done through route distribution.

Link State Advertisements

Router LSA (Type 1) – Contains a list of all links local to the router, and the status and “cost” of those links. Type 1 LSAs are generated by all routers in OSPF, and are flooded to all other routers within the local area.

Network LSA (Type 2) – Generated by all Designated Routers in OSPF, and contains a list of all routers attached to the Designated Router.

Network Summary LSA (Type 3) – Generated by all ABRs in OSPF, and contains a list of all destination networks within an area. Type 3 LSAs are sent between areas to allow inter-area communication to occur.

ASBR Summary LSA (Type 4) – Generated by ABRs in OSPF, and contains a route to any ASBRs in the OSPF system. Type 4 LSAs are sent from an ABR into its local area, so that Internal routers know how to exit the Autonomous System.

External LSA (Type 5) – Generated by ASBRs in OSPF, and contain routes to destination networks outside the local Autonomous System. Type 5 LSAs can also take the form of a default route to all networks outside the local AS. Type 5 LSAs are flooded to all areas in the OSPF system