Unicast Routing – Link State Routing
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 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:
- 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 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:
- It requires a large amount of memory.
- Shortest path computations require many CPU circles.
- If a network uses 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) 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 (18.104.22.168 and 22.214.171.124).
- 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:
- Hello message (Type 1) – It is used by the routers to introduce themselves to the other routers.
- Database description message (Type 2) – It is normally sent 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 packets.
- 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.