OSPF v2 Overview¶
OSPF is the most known routing protocol among the family of so called Link State routing protocols. The OSPF algorithm is based on the Dijkstra algorithm.
OSPF was developed by the IETF in 1988. It is described in RFC 2328. OSPF v2 was designed as an IGP which addresses issues like scalability and convergence.
To understand OSPF advantages, it is common to compare it to the RIP routing protocol (which is a distance vector routing protocol). Compared to RIP, OSPF has the following advantages:
OSPF is scalable, there is no hop count limitation, while RIP is limited to 15,
As a link state protocol, OSPF converges very rapidly in comparison to RIP (which is a Distance Vector protocol),
OSPF introduces the notion of PATH cost, while RIP only considers the cost in term of hop count,
OSPF networks can be large and complex. This is possible thanks to the concept of OSPF areas. RIP doesn’t offer this facility.
OSPF terminology¶
It is important to understand the OSPF terminology. In this paragraph we will give the most important concepts.
- Link
An interface or router,
- Link state
The status of the link,
- Link state databaseLSD
It gathers all LSA entries. This database is common for a defined area.
- Cost
The cost of the link, which mainly depends on the speed of interfaces. Cost is associated to interfaces, or paths.
- Area
Collection of networks or routers that have the same area identifier. 0 value is reserved for backbone operations.
Note
Within an area, each router has the same link-state information.
- Backbone area
In a multi-area environnement, it is the transit area to which all other areas are connected (area 0)
- Stub area
Routers in this area accept routing information only from OSPF routers
- Internal router
Router having all its interfaces in a single area.
- Backbone router
Router having at least one interface in the backbone area.
- BDR
Designated router backup (Backup)
- DR
Designated router (DR Other) Router designated by the others to represent a network. The election takes place generally by taking the lowest OSPF router-id. The election can be modified by configuring the priority of OSPF.
- ASBR
Autonomous system border router is defined by some routing information that is external to the OSPF domain.
OSPF operation¶
The OSPF operation for a defined area is based on the Dijkstra algorithm. The detailed description of this mechanism in a single area or in multiple areas is out of the scope of this document.
OSPF runs directly over IP and uses protocol number 89.
OSPF packets¶
OSPF exchanges information through various kinds of messages. First of all, OSPF
sends type 1 hello messages to 224.0.0.5
broadcast IP address. The hello message
contains information about DR and BDR. Hello message has specific fields that
designates the master router and the designated backup router. Those fields are
filled in by exchanging those hello messages. Note that the 224.0.0.5
broadcast
address it not the only one to be used. Specific broadcast information to DR and
BDR is using 224.0.0.6
.
OSPF is a connection oriented protocol. once hello messages have been exchanged, OSPF exchanges unicast packets. Various message types can then be exchanged:
type 2 database description. It describes the link-state database of OSPF devices. This information is sent by OSPF routing device itself.
type 3 link state requests (LSA. It is a request from one OSPF device that needs a specific link-state database information of a remote peer.
type 4 link state update. It is the information about link state advertisements. The LSA provides information to reach the ASBR.
type 5 link state ack. This message acknowledges thanks to a sequence number the previous reception of a link state update.
There are subtypes of link state updates. As remind, OSPF is used to share link state database, based on the local and remote devices interfaces ( including IP, neighbors ..). On most cases, following link state updates can be found:
type 1 router link entry
type 2 network link entry generated by DR
Those above types can be found in configurations where backbone area is used.
If more areas are configured, a type 3 message named Summary LSA can be sent by ABR. Type 4 message ( gives summary LSA information to reach the ASBR) and type 5 message (external LSA) are used on some specific cases ( this can be routes imported from other protocols like static routes, but also RIP or BGP).