Open Shortest Path First (OSPF) uses link-state packets (LSPs) to establish and maintain neighbour adjacencies. It also uses LSPs to exchange routing updates. There are five different OSPF packets type. The beginning of all OSPF packets is specified by the standard header of 24 bytes. A list of link state advertisements is to deal with all OSPF packets type. The figure below illustrates the five different OSPF packets types. Each link-state packet (LSPs) serves a specific purpose in the OSPF routing process:
Hello packet– This packet establishes and maintains adjacency with other Open Shortest Path First (OSPF) routers. The Open Shortest Path First (OSPF) protocol sends these packets periodically on all interfaces. This is a multicast packet discovering neighbouring routers dynamically.
Database Description (DBD) packet– This packet has an abbreviated list of the sending router’s Link-state Database (LSDBs). The receiving routers used DBD to check against the local Link-state Database (LSDBs). The Link-state Database (LSDBs); must be equal on all link-state routers within an area to build a perfect SPF tree. The database is designed from multiple packets.
Link-State Request (LSR) packet – When receiving routers read the DBD then receiving router can request more information about any entry in the DBD, sending an LSR packet. The router uses LSR packets for requesting the pieces of the neighbour’s database which are more up to date and complete. The router can also send multiple Link State Request packets.
Link-State Update (LSU) packet – This packet is used to reply link-state request (LRS) packet. The link-state update (LSU) contain further seven types of packets.
Link-State Acknowledgment (LSAck) packet – When the router receives an LSU packet, it sends an LSAck packet to the sender router to confirm receipt of the LSU packet. The LSAck data field is empty. Single Link State Acknowledgement packet can acknowledge the multiple link state advertisements.
Link-state routing protocols are also known as shortest-path first protocols. They maintain a complete picture of all the routers running a link-state routing protocol in the complete network. All routers running a link-state routing protocol originate information about themselves and their directly connected routers, links, and the state of those links as multicast messages.
The link-state router tries to maintain complete network topology by updating itself whenever a change occurs. Link-state routing protocols are based on the Shortest Path First (SPF) algorithm to find the best path to a destination. The shortest Path First (SPF) algorithm is also known as the Dijkstra algorithm. The OSPF is an example of a Link-State Routing Protocol.
Link State Process
Following is the process of the link-state routing protocol. The process is the same for both OSPF for IPv4 and OSPF for IPv6.
Link and Link-State
Link and Link-state is the first step in the routing process. Each router learns about its links and directly connected networks. When a router interface is configured with an IP address and subnet mask and also in the state of no shutdown, it becomes part of that network. Refer to the topology in the Figure below. R3 has just been added to the network, and the IP addresses on the router interface are not configured yet; only the physical connectivity has been done. So, the router is not part of Link-State.
The network administrator now configured the IP addresses of the router interfaces connected to R2 and R5 and changed the state of interfaces from shutdown to no shutdown. As they become active, R3 learns about its own directly connected networks. Without any routing protocols, these directly connected networks are now entries in the routing table.
The router’s interfaces must be accurately configured with IP addresses and subnet masks, and the link must be in the state of no shutdown before the link-state routing protocol can learn about a link. Also, like distance vector protocols, the interface must be included in one of the network router configuration statements before participating in the link-state routing process.
Link-state routers have direct information from all their neighbor routers. Each router originates information about itself, its directly connected links, and the state of those links. This information is passed around the network from router to router, and each router makes a copy of it without changing it. So, every router gets identical information about the internetwork, and each router will independently calculate its best paths.
In the reference topology, the R3 link to its directly connected networks are:
FastEthernet 0/0 – 192.168.2.0/24
FastEthernet 0/1 – 192.168.3.0/24
The link-state information includes the following information:
The interface’s IPv4 address and subnet mask
The type of network, such as Ethernet or Serial link
The cost of that link
Any neighbor routers on that link
The link state of R3 is the following:
Link1
Network: 192.168.2.0/24
IP address: 192.168.2.1
Type of network: Ethernet
Cost of that link: 10
Neighbours: None
Link2
Network: 192.168.3.0/24
IP address: 192.168.3.1
Type of network: Serial
Cost of that link: 64
Neighbours: None
Hello Protocol
The second step in the link-state routing process is the responsibility of meeting with neighbors on directly connected networks. Routers with the link-state routing protocol use a Hello protocol for establishing and maintaining router-neighbor relationships. A neighbor is any other router enabled with the same link-state routing protocol. The link-state routing protocol uses Hello packets for neighbour discovery and also for recovery.
The protocol continues exchanging Hello packets between two adjacent neighbors and serves as a keep-alive function to monitor the neighbor’s state. Suppose any router stops receiving Hello packets from a particular neighbor. This neighbor is considered unreachable, so the link-state protocol clears this router from adjacency.
Now refer to Figure 1 above, R1 sends Hello packets to it’s all interfaces when the administrator configures it, to discover the link-state neighbours .R2, and R3 respond to the Hello packet with their own Hello packets as these routers have configured with the same link-state routing protocol as shown in figure 2. The FastEthernet 0/0 interface has no neighbors. So R1 did not receive any hello on this interface; therefore, it does not continue with the link-state routing process steps for the FastEthernet 0/0 link.
OSPF Hello Packet
After the primary exchange of Hello Packet, the routers add each other to their Neighbor Tables. The Neighbour table is the list of connected OSFP-enabled routers. Hello, packets are not recorded in the OSPF database, but if the hello packet has not been received from a particular neighbor for 40 seconds. The link-state routing protocol marked this particular neighbor as down. For example, OSPF will not take any notice if a link goes down for 20 seconds and again comes back to up status.
If a link goes down from a minute to half an hour, OSPF floods an LSA when it goes down and another LSA when it is up again. If a link is down for over half an hour, LSAs originated by remote routers begin to age out. When the link returns, all these LSAs will be flooded again. If a link is down for over an hour, any LSAs originated by remote routers will have aged out and been flushed. The link will be like a new OSPF route when it comes back up.
Building the Link State Packet (LSP)
The third step in the link-state routing process is building the link-state packet (LSP) containing the state of each directly connected link. It carries the information a network router generates in a link-state routing protocol that lists the router’s neighbors. It is a datagram determining the names of routers, including the cost or distance to any neighboring routers and linked local networks. It can also choose a new neighbor In case of link failure. The LSP also determines what the new neighbor is if a link fails and the cost of changing a link if required.
LSPs are queued for transmission and must time out at about the same time. The network is used to distribute the LSP but cannot use the routing database. When a router has established adjacencies to other routers, it can build its LSP containing the link-state information about its links. Now refer to the figure below. The LSP from R1 should contain the information like the following:
R1; FastEthernet network 192.168.0.0/24; Cost 1
R1 -> R2; Serial point-to-point network; 192.168.1.0/24; Cost 1
R1 -> R3; Serial point-to-point network; 192.168.3.0/24; Cost 1
Flooding LSP
After building the LSP, each router floods the LSP to all neighbours in the link-state routing process. This is the fourth step in the link-state routing process. The neighbor routers receive the LSP and save it in the database. All routers in the same routing area flood the link-state information to each other.
When a router receives the LSP from any of its interfaces, then the receiving router immediately sends that LSP out to all interfaces except the receiving interface. This process continues from router to router in the same area until all routers receive the LSP. When flooding LSP is completed then the link-state routing protocol calculates the SPF algorithm, thus the link-state routing convergence speed is very high.
The routers do not send LSPs periodically like the hello packet. They are only sent during the initial startup of the routing protocol on the router. After that, the LSPs are needed to flood when network changes occur in the topology. They are also required when a network breakdown occurs or after the network comes back.
The LSPs also included information, such as sequence numbers and aging information, to help manage the flooding LSP process. Each router uses this information to determine if it has received the LSP from another router or has new and updated information than the LSP already contained in the link-state database. This process allows a router to keep only the most current information in its link-state database. Suppose we discuss the topology in the previous lesson, building the Link State Packet. The R1 will flood the LSP packet to all its interfaces containing the following data.
R1; FastEthernet network 192.168.0.0/24; Cost 1
R1 -> R2; Serial point-to-point network; 192.168.1.0/24; Cost 1
R1 -> R3; Serial point-to-point network; 192.168.3.0/24; Cost 1
Building the SPF Tree
The routers in the same area use the link-state database and SPF algorithm to build the SPF tree. For example, in the figure below, R1 builds the SPF tree using the link-state information from all other routers. The SPF algorithm reads the router’s LSP to recognize networks and the link’s costs.
In the first step, R1 identifies its directly connected networks and their costs. After identifying the directly connected network, R1 begins identifying unknown networks from R2 and R3. Then, the SPF algorithm calculates the shortest paths to reach each network.
The SPF algorithm then calculates the shortest paths to reach each network. Each router in the area builds its own SPF tree separately from all other routers. To ensure accurate routing, the link-state databases used to construct those trees must be identical on all routers.
Building the Link-State Database
Link-state database building is the last step in the link-state routing process. Each router in the link-state uses the database to build a complete map of the topology and computes the best path to each destination network. All routers receive LSPs from every other link-state router in the same routing area. the
These LSPs are stored in the link-state database. Each router maintains a separate link-state database for every area to which it belongs, in case more than one area is configured in the network. The link-state database is also referred to as the topological database, and routers belonging to the same area have the same topological database for the area.
The databases for each area always process separately and calculate the link-state shortest path separately for each area and the topological database. The shortest path is flooded throughout the respected area only. The area database build of router links advertisements, network links advertisements, and summary link advertisements included external routes in all non-stub area databases.
Summary of Link-State Process
Every router in an OSPF area will complete the following link-state process to exchange a state of convergence:
Each router learns about its own directly connected networks and Links by detecting the interfaces in the upstate.
All routers are responsible for “saying hello” to their neighbors on directly connected networks.
Each router builds a Link-State Packet (LSP) containing the state of each directly connected link—the LSP contains neighbor, neighbor ID, link type, and link bandwidth.
Each router floods the LSP to all neighbors. Those neighbors store all LSPs received in a database. They then flood the LSPs to their neighbors until all area routers have received them LSPs. Each router stores a copy of each LSP received from its neighbors in a local database.
Each router floods the LSP to all neighbors, storing all LSPs received in a database.
All routers use the database to build a complete topology map and calculate the best path to each destination network using Dijkstra’s Algorithm.
Important Term of Link-State Protocol
Topological database – It is a set of information collected from LSAs.
SPF algorithm– The shortest path first (SPF) algorithm is a calculate the SPF tree on the bases of information in the database.
Routing tables – A list of the known paths and interfaces.
LSA – A link-state advertisement (LSA); is a small packet of routing information that is sent among routers. It is a basic communication way of the OSPF routing protocol for the Internet Protocol (IP). It communicates the router’s local routing topology to all other local routers in the same OSPF area.
LSP – It is a packet containing information generated by a network router in a link-state routing protocol that lists the router’s neighbours. It is a special datagram determining the names of routers including the cost or distance to any neighbouring routers and linked local networks. It can also determine the new neighbour In case of link failure.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.