your image

Unicast Routing - Link State Routing - GeeksforGeeks

Aniket singh
greeksforgeeks
Related Topic
:- computer network routers

Unicast Routing – Link State Routing

  • Difficulty Level : Hard
  • Last Updated : 16 Aug, 2021

Prerequisite – Distance Vector RoutingDijkstra algorithmDistance vector routing v/s Link state routingOSPFRIP 
Unicast – Unicast means the transmission from a single sender to a single receiver. It is a point-to-point communication between sender and receiver. There are various unicast protocols such as TCP, HTTP, etc.  

  • TCP is the most commonly used unicast protocol. It is a connection-oriented protocol that relies on acknowledgement from the receiver side. 
  • HTTP stands for HyperText Transfer Protocol. It is an object-oriented protocol for communication. 
     

There are three major protocols for unicast routing: 

 

  1. Distance Vector Routing
  2. Link State Routing
  3. Path-Vector Routing

Link State Routing – 
Link state routing is the second family of routing protocols. While distance-vector routers use a distributed algorithm to compute their routing tables, link-state routing uses link-state routers to exchange messages that allow each router to learn the entire network topology. Based on this learned topology, each router is then able to compute its routing table by using the shortest path computation. 

 

 

 

Features of link state routing protocols – 

  • Link state packet – A small packet that contains routing information. 
     
  • Link state database – A collection of information gathered from the link-state packet. 
     
  • Shortest path first algorithm (Dijkstra algorithm) – A calculation performed on the database results in the shortest path 
     
  • Routing table – A list of known paths and interfaces. 
     

Calculation of shortest path – 
To find the shortest path, each node needs to run the famous Dijkstra algorithm. This famous algorithm uses the following steps: 

  • Step-1: The node is taken and chosen as a root node of the tree, this creates the tree with a single node, and now set the total cost of each node to some value based on the information in Link State Database
  • Step-2: Now the node selects one node, among all the nodes not in the tree-like structure, which is nearest to the root, and adds this to the tree. The shape of the tree gets changed.
  • Step-3: After this node is added to the tree, the cost of all the nodes not in the tree needs to be updated because the paths may have been changed.
  • Step-4: The node repeats Step 2. and Step 3. until all the nodes are added to the tree

Link State protocols in comparison to Distance Vector protocols have: 

  1. It requires a large amount of memory. 
     
  2. Shortest path computations require many CPU circles. 
     
  3. If a network uses little bandwidth; it quickly reacts to topology changes 
     
  4. All items in the database must be sent to neighbors to form link-state packets. 
     
  5. All neighbors must be trusted in the topology. 
     
  6. Authentication mechanisms can be used to avoid undesired adjacency and problems. 
     
  7. No split horizon techniques are possible in the link-state routing. 
    • Open Shortest Path First (OSPF) is a unicast routing protocol developed by a working group of the Internet Engineering Task Force (IETF).
    • It is an intradomain routing protocol.
    • It is an open-source protocol.
    • It is similar to Routing Information Protocol (RIP)
    • OSPF is a classless routing protocol, which means that in its updates, it includes the subnet of each route it knows about, thus, enabling variable-length subnet masks. With variable-length subnet masks, an IP network can be broken into many subnets of various sizes. This provides network administrators with extra network configuration flexibility. These updates are multicasts at specific addresses (224.0.0.5 and 224.0.0.6).
    • OSPF is implemented as a program in the network layer using the services provided by the Internet Protocol
    • IP datagram that carries the messages from OSPF sets the value of the protocol field to 89
    • OSPF is based on the SPF algorithm, which sometimes is referred to as the Dijkstra algorithm
    • OSPF has two versions – version 1 and version 2. Version 2 is used mostly

OSPF Messages – OSPF is a very complex protocol. It uses five different types of messages. These are as follows:

  1. Hello message (Type 1) – It is used by the routers to introduce themselves to the other routers. 
     
  2. Database description message (Type 2) – It is normally sent in response to the Hello message. 
     
  3. Link-state request message (Type 3) – It is used by the routers that need information about specific Link-State packets. 
     
  4. Link-state update message (Type 4) – It is the main OSPF message for building Link-State Database. 
     
  5. Link-state acknowledgement message (Type 5) – It is used to create reliability in the OSPF protocol. 
     

Comments