Prerequisite – OSPF fundamentals
Open Shortest Path First (OSPF) is a link-state routing protocol which is used to find the best path between the source and the destination router using its own Shortest Path First). OSPF is developed by Internet Engineering Task Force (IETF) as one of the Interior Gateway Protocol (IGP), i.e, the protocol which aims at moving the packet within a large autonomous system or routing domain. It is a network layer protocol which works on the protocol number 89 and uses AD value 110. OSPF uses multicast address 126.96.36.199 for normal communication and 188.8.131.52 for update to designated router(DR)/Backup Designated Router (BDR).
OSPF terms –
- Router I’d – It is the highest active IP address present on the router. First, highest loopback address is considered. If no loopback is configured then the highest active IP address on the interface of the router is considered.
- Router priority – It is a 8 bit value assigned to a router operating OSPF, used to elect DR and BDR in a broadcast network.
- Designated Router (DR) – It is elected to minimize the number of adjacency formed. DR distributes the LSAs to all the other routers. DR is elected in a broadcast network to which all the other routers shares their DBD. In a broadcast network, router requests for an update to DR and DR will respond to that request with an update.
- Backup Designated Router (BDR) – BDR is backup to DR in a broadcast network. When DR goes down, BDR becomes DR and performs its functions.
DR and BDR election – DR and BDR election takes place in broadcast network or multi access network. Here is the criteria for the election:
- Router having the highest router priority will be declared as DR.
- If there is a tie in router priority then highest router I’d will be considered. First, highest loopback address is considered. If no loopback is configured then the highest active IP address on the interface of the router is considered.
OSPF states – The device operating OSPF goes through certain states. These states are:
- Down – In this state, no hello packet have been received on the interface.
Note – The Down state doesn’t mean that the interface is physically down. Her, it means that OSPF adjacency process has not started yet.
- INIT – In this state, hello packet have been received from the other router.
- 2WAY – In the 2WAY state, both the routers have received the hello packets from other routers. Bidirectional connectivity has been established.
Note – In between the 2WAY state and Exstart state, the DR and BDR election takes place.
- Exstart – In this state, NULL DBD are exchanged.In this state, master and slave election take place. The router having the higher router I’d becomes the master while other becomes the slave. This election decides Which router will send it’s DBD first (routers who have formed neighbourship will take part in this election).
- Exchange – In this state, the actual DBDs are exchanged.
- Loading – In this sate, LSR, LSU and LSA (Link State Acknowledgement) are exchanged.
Important – When a router receives DBD from other router, it compares it’s own DBD with the other router DBD. If the received DBD is more updated than its own DBD then the router will send LSR to the other router stating what links are needed. The other router replies with the LSU containing the updates that are needed. In return to this, the router replies with the Link State Acknowledgement.
- Full – In this state, synchronization of all the information takes place. OSPF routing can begin only after the Full state.
- Computer Network | Open shortest path first (OSPF) protocol fundamentals
- Computer Network | Open shortest path first (OSPF) - Set 2
- Open shortest path first (OSPF) router roles and configuration
- Computer Network | Simple network management protocol (SNMP)
- Computer Network | Password authentication protocol (PAP)
- Computer Network | File Transfer Protocol (FTP)
- Computer Network | User Datagram Protocol (UDP)
- Computer Network | Wireless Application Protocol
- Computer Network | Routing Information Protocol (RIP)
- Computer Network | Dynamic Trunking Protocol (DTP)
- Computer Network | Border Gateway Protocol (BGP)
- Computer Network | Types of Spanning Tree Protocol (STP)
- Computer Network | Voice over Internet Protocol (VoIP)
- Computer Network | Internet Protocol version 6 (IPv6) Header
- Computer Network | Dynamic Host Configuration Protocol (DHCP)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.