Unicast Communication and Link State Routing (original) (raw)

Last Updated : 11 Feb, 2026

Unicast means the transmission from a single sender to a single receiver. It is a point-to-point communication between the sender and receiver. There are various unicast protocols such as TCP, HTTP, etc.

unicast_example

Unicast Routing

Major Protocols of Unicast Routing

  1. **Distance Vector Routing: Distance-Vector routers use a distributed algorithm to compute their routing tables.
  2. **Link-State Routing: Link-State routing uses link-state routers to exchange messages that allow each router to learn the entire network topology.
  3. **Path-Vector Routing: It is a routing protocol that maintains the path that is updated dynamically.

Link State Routing is a protocol where each router learns the entire network topology instead of just neighbor information. Using this knowledge, routers calculate the shortest path to every destination with Dijkstra’s algorithm.

**Key Features:

  1. **Neighborhood Knowledge: Each router shares information about its directly connected links (cost and identity) rather than the full routing table.
  2. **Flooding: This information is broadcast to all routers in the network so that everyone has the same view of the topology.
  3. **Information Sharing: Updates are sent only when changes occur (not periodically).

**Phases of LSR:

  1. **Reliable Flooding: Every router eventually learns the complete network graph.
  2. **Route Calculation: Each router applies Dijkstra’s algorithm to compute the optimal path to every other node.

Features

Calculation of Shortest Path

To find the shortest path, each node needs to run the famous Dijkstra algorithm. Let us understand how can we find the shortest path using an example.

**Note: We use a boolean array **sptSet[] to represent the set of vertices included in SPT. If a value **sptSet[v] is true, then vertex v is included in SPT, otherwise not. Array **dist[] is used to store the shortest distance values of all vertices.

Consider the below graph and src = 0.

Shortest Path Calculation - Step 1

Shortest Path Calculation - Step 1

**STEP 1: Initially, the shortest path tree set (**sptSet) is empty, and the distances are:
{0, ∞, ∞, ∞, ∞, ∞, ∞, ∞} (where ∞ = infinity).

The vertex with the **minimum distance is chosen **vertex 0.
Add vertex 0 to sptSet i.e sptSet = {0}.
Update distances of vertices adjacent to 0:

So, the distance array is updated to:
{0, 4, ∞, ∞, ∞, ∞, ∞, 8}

The following subgraph shows vertices and their distance values. Vertices included in SPT are included in GREEN color.

Shortest Path Calculation - Step 2

Shortest Path Calculation - Step 2

**STEP 2: Pick the vertex with minimum distance value and not already included in SPT (not in sptSET). The vertex 1 is picked and added to sptSet. So sptSet now becomes {0, 1}. Update the distance values of adjacent vertices of 1. The distance value of vertex 2 becomes 12.

Shortest Path Calculation - Step 3

Shortest Path Calculation - Step 3

**STEP 3: Pick the vertex with minimum distance value and not already included in SPT (not in sptSET). Vertex 7 is picked. So sptSet now becomes {0, 1, 7}. Update the distance values of adjacent vertices of 7. The distance value of vertex 6 and 8 becomes finite (15 and 9 respectively).

Shortest Path Calculation - Step 4

Shortest Path Calculation - Step 4

**STEP 4: Pick the vertex with minimum distance value and not already included in SPT (not in sptSET). Vertex 6 is picked. So sptSet now becomes {0, 1, 7, 6}. Update the distance values of adjacent vertices of 6. The distance value of vertex 5 and 8 are updated.

Shortest Path Calculation - Step 5

Shortest Path Calculation - Step 5

We repeat the above steps until sptSet includes all vertices of the given graph. Finally, we get the following Shortest Path Tree (SPT).

Shortest Path Calculation - Step 6

Shortest Path Calculation - Step 6

Characteristics

  1. Open Shortest Path First (OSPF)
  2. Intermediate System to Intermediate System (IS-IS)

Open Shortest Path First (OSPF)

Intermediate System to Intermediate System (IS-IS)