Prerequisite – Distance Vector Routing, Dijkstra algorithm, Distance vector routing v/s Link state routing, OSPF, RIP
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 relay on acknowledgement from the receiver side.
- HTTP stands for Hyper Text Transfer Protocol. It is an object oriented protocol for communication.
There are three major protocols for unicast routing:
- Distance Vector Routing
- Link State Routing
- 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 a shortest path computation.
Features of link state routing protocols –
- Link state packet – A small packet that contains routing information.
- Link state database – A collection information gathered from link state packet.
- Shortest path first algorithm (Dijkstra algorithm) – A calculation performed on the database results into shortest path
- Routing table – A list of known paths and interfaces.
Calculation of shortest path –
To find shortest path, each node need 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 the Step 2. and Step 3. until all the nodes are added in the tree
Link State protocols in comparison to Distance Vector protocols have:
- It requires large amount of memory.
- Shortest path computations require many CPU circles.
- If network use the little bandwidth ; it quickly reacts to topology changes
- All items in the database must be sent to neighbors to form link state packets.
- All neighbors must be trusted in the topology.
- Authentication mechanisms can be used to avoid undesired adjacency and problems.
- No split horizon techniques are possible in the link state routing.
Open shortest path first (OSPF) routing protocol –
- Open Shortest Path First (OSPF) is a unicast routing protocol developed by working group of the Internet Engineering Task Force (IETF).
- It is a 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 (220.127.116.11 and 18.104.22.168).
- 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 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:
- Hello message (Type 1) – It is used by the routers to introduce itself to the other routers.
- Database description message (Type 2) – It is normally send in response to the Hello message.
- Link-state request message (Type 3) – It is used by the routers that need information about specific Link-State packet.
- Link-state update message (Type 4) – It is the main OSPF message for building Link-State Database.
- Link-state acknowledgement message (Type 5) – It is used to create reliability in the OSPF protocol.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between Distance vector routing and Link State routing
- Difference between Classful Routing and Classless Routing
- Onion Routing
- Types of Routing
- Classes of Routing Protocols
- Routing Information Protocol (RIP)
- Classification of Routing Algorithms
- Securing Routing Protocols
- Routing Information Protocol (RIP) V1 & V2
- MANET Routing Protocols
- Difference between Static and Dynamic Routing
- Fixed and Flooding Routing algorithms
- Differences between Intradomain and Interdomain Routing
- Distance Vector Routing (DVR) Protocol
- Routing Tables in Computer Network
- Classless Inter Domain Routing (CIDR)
- Inter VLAN Routing by Layer 3 Switch
- Routing v/s Routed Protocols in Computer Network
- How does Multiprotocol Label Switching (MPLS) Routing work ?
- Network Layer Services- Packetizing, Routing and Forwarding
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.