KEYWORDS: OSPF , CCNA, CCNP , LSA, LSDB , Dijkstra , MPLS, DBD
Do you recall Dijkstra’s algorithm, shortest path first algorithm in your engineering and CCNA preparation . Its time to know its one of the interesting application .
OSPF is an interior gateway protocol that helps to facilitate the routing information in for the form of LSA (Link state Advertisement) within a single routing domain. It gathers LSA from available routers and constructs a topology map of the network.The same topology map is shared between all the devices with an Area . OSPF was designed to support (VLSM) or (CIDR) addressing models.
OSPF senses changes in the state of the link , such as link failures, quickly and converges on a new loop-free routing structure. It uses the Dijkstra’s algorithm to find the shortest path tree for each route.
The link-state information is maintained on each router as a link-state database (LSDB) which is a tree-image of the entire network topology. Identical copies of the LSDB are periodically updated through flooding on all OSPF routers.
The best routes are selected by the OSPF by discovering the paths with the lowest cost to a destination. The route cost includes the cost which is configured on interface on which the Link State Advertisement is received by the OSPF and the cost configured on the outbound links operating between the destination network and the router.
A close look inside a OSPF packet suggests the field that constitutes the OSPF packet .
The fields on the OSPF header are as follows:
- Version number – Version for IPv4 .I.E 2
- Type –There are different types of ospsf packets (Hello, DBD, LSR, LSU, LSack)
- Packet Length – length of the OSPF packet
- Router ID – Router ID of source Router
- Area ID – The OSPF area in which the packets originated
- Check sum – Used in error detection.
- Authentication Type – Describes either no authentication, cleartext passwords, or encrypted Message Digest 5 (MD5) for router authentication.
- Authentication – Used with authentication type.
- Data – Contains different information, depending on the OSPF packet type:
- Hello – A list of known neighbors.
- DBD – Summary of the LSDB, which includes all known router IDs and their last sequence number, among a number of other fields.
- LSR – Contains the type of LSU needed and the router ID of the router that has the needed LSU
- LSU – Contains the full LSA entries. Multiple LSA entries can fit in one OSPF update packet.
- LSack – Empty.
How to Configure OSPF on Cisco Router?
Following commands should be entered in Router configuration mode on Cisco router to enable OSPF,
Router(config)# router ospf 1 (this command enables OSPF on router where 1 is the process ID)
Router(config-router)# network 10.1.1.1 0.0.0.255 area 0 (network specified in this command on which OSPF has to be enabled)
Router(config-router)# network 10.2.1.1 0.0.0.255 area 0 (network specified in this command on which OSPF has to be enabled)
OSPF Neighbor states in case of Adjacency
In order to determine the neighbor state of OSPF, you have to run the following command,
Rotuer# Show ip ospf neighbor
OSPF Multicast Address
OSPF routers sends and listens OSPF message on following multicast address .
- 18.104.22.168 –all OSPF routers Multicast Address
- 22.214.171.124 –the DR and BDR multicast Address
OSPF Challenges and Troueblshooting
Most of the engineers find it difficult to troubleshoot the OSPF if the goes down or is not coming up . Although from Practical expereince it is not difficult if you know how OSPF works and what happens of each stage.
OSPF Neighbor Adjacency States
- Down State – An OSPF intial process before any exchange of information starts .The exchange process begins when router sending a hello out each interface that is configured for OSPF. The hello packet is sent out multicast address 126.96.36.199.
- Init State – An ospf speaking router receives a packet from another OSPF router . These routers will add the originating router to their list of neighbors. This state is the init state.
- Two-way State – When the originating router obtains the hello back from the neighbors as well, it notices that its ownRouter ID is included in the list of neighbors. At this point a two-way state is reached. They now have two way communication.
- On a broadcast link type, such as an Ethernet LAN and multi-access medium, a DR and BDR must be elected. The DR will form a bi-directional adjacency with each routers on the LAN link.
- If a new router joins the broadcast network in which a DR and BDR already exist, it will get to the two-way state with all the routers, including the DR and BDR, and those that are DROTHER. The new router will form a bidirectional adjacency with only the DR and BDR.
- Every 10 seconds, the routers exchange hello packets to ensure there is still communication established.
- The routers proceeds in the exstart state once the DR and BDR are elected. After that they exchange LSAs and populate the LSDBs.
- Loading State – if the router finds that the DBD contains a more updated information, it sends an LSR to the other router. The process of sending the LSR is called the loading state.
- The routers are considered synchronized and in full state once all LSRs have been received and updated.
From troubleshooting perspective you can run the command “ Sh ip ospf nei “ . it will show the the neighbor states and their status.
Wish you a happy learning !!!
For more updates on the Data Center world,visit Data Center Talk.