Open In App

What is Routing?

Last Updated : 16 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The process of choosing a path across one or more networks is known as Network Routing. Nowadays, individuals are more connected on the internet and hence, the need to use Routing Communication is essential.

Routing chooses the routes along which Internet Protocol (IP) packets get from their source to their destination in packet-switching networks. This article will discuss the details of the Routing Process along with its different types and working principles.

What is a Router?

Routers are specialized pieces of network hardware that make these judgments about Internet routing. It is a networking device that forwards data packets between computer networks. Also, it helps to direct traffic based on the destination IP address. It ensures that data reaches its intended destination.

As the router connects different networks, it manages data traffic between them. The Router operates at Layer 3 (the network layer) of the OSI Model. It is also responsible for determining the best path for data to travel from one network to another.

What is Routing?

Routing refers to the process of directing a data packet from one node to another. It is an autonomous process handled by the network devices to direct a data packet to its intended destination. Note that, the node here refers to a network device called - 'Router'.

Routing is a crucial mechanism that transmits data from one location to another across a network (Network type could be any like LAN, WAN, or MAN). The process of routing involves making various routing decisions to ensure reliable & efficient delivery of the data packet by finding the shortest path using various routing metrics which we will be discussing in this article.

Routing of a data packet is done by analyzing the destination IP Address of the packet. Look at the below image:

Packet-1
Routing of packets
  • The Source Node (Sender) sends the data packet on the network, embedding the IP in the header of the data packet.
  • The nearest router receives the data packet, and based on some metrics, further routes the data packet to other routers.
  • Step 2 occurs recursively till the data packet reaches its intended destination.

Note: There are limits to how many hop counts a packet can do if it is exceeded, the packet is considered to be lost.

What are Different Types of Routing?

Routing is typically of 3 types, each serving its purpose and offering different functionalities.

Types-of-Routing
Types of Routing

1. Static Routing

Static routing is also called as "non-adaptive routing". In this, routing configuration is done manually by the network administrator. Let's say for example, we have 5 different routes to transmit data from one node to another, so the network administrator will have to manually enter the routing information by assessing all the routes.

  • A network administrator has full control over the network, routing the data packets to their concerned destinations
  • Routers will route packets to the destination configured manually by the network administrator.
  • Although this type of routing gives fine-grained control over the routes, it may not be suitable for large-scale enterprise networks.

2. Dynamic Routing

Dynamic Routing is another type of routing in which routing is an autonomous procedure without any human intervention. Packets are transmitted over a network using various shortest-path algorithms and pre-determined metrics. This type of routing is majorly preferred in modern networks as it offers more flexibility and versatile functionality.

  • It is also known as adaptive routing.
  • In this, the router adds new routes to the routing table based on any changes made in the topology of the network.
  • The autonomous procedure of routing helps in automating every routing operation from adding to removing a route upon updates or any changes made to the network.

3. Default Routing

Default Routing is a routing technique in which a router is configured to transmit packets to a default route that is, a gateway or next-hop device if no specific path is defined or found. It is commonly used when the network has a single exit point. The IP Router has the following address as the default route: 0.0.0.0/0.

What is the Working Principle of Routing?

Routing works by finding the shortest path from the source node to the destination node across a network. Here's the step-by-step working of routing:

Step 1: Communication initiation

The first step that typically happens is, one node (client or server) initiates a communication across a network using HTTP protocols.

Step 2: Data Packets

The source device now breaks a big chunk of information into small data packets for reliable and efficient transmission. This process is called de-assembling and encapsulating the data payload. Then each data packet is labeled with the destination node's IP address.

Step 3: Routing Table

The Routing table is a logical data structure used to store the IP addresses and relevant information regarding the nearest routers. The source node then looks up the IP addresses of all the nodes that can transmit the packet to its destination selects the shortest path using the shortest path algorithm and then routes accordingly.

The Routing Table is stored in a router, a network device that determines the shortest path and routes the data packet.

Step 4: Hopping procedure

In the procedure or routing, the data packet will undergo many hops across various nodes in a network till it reaches its final destination node. Hop count is defined as the number of nodes required to traverse through to finally reach the intended destination node.

This hopping procedure has certain criteria defined for every data packet, there's a limited number of hops a packet can take if the packet exceeds that, then it's considered to be lost and is retransmitted.

Step 5: Reaching the destination node

Once all the data packets reach their intended destination node, they re-assemble and transform into complete information that was sent by the sender (source node). The receiver will perform various error-checking mechanisms to verify the authenticity of the data packets.

Overall, the data packet will be transmitted over the least hop-count path as well as the path on which there is less traffic to prevent packet loss.

Routing-Working
Working of Routing

In the above image, we have 3 major components

  • Sender
  • Receiver
  • Routers

The shortest path is highlighted in red, the path with the least hop count. As we can see, there are multiple paths from source to node but if all the appropriate metrics are satisfied, the data packets will be transmitted through the shortest path (highlighted in red).

What are the Main Routing Protocols?

  • RIP (Routing Information Protocol): It is a distance-vector protocol that uses hop count as a metric.
  • OSPF (Open Shortest Path First): OSPF is a link-state protocol that finds the shortest path using the Dijkstra algorithm.
  • EIGRP (Enhanced Interior Gateway Routing Protocol): It is a hybrid protocol that combines features of distance-vector and link-state.
  • BGP (Border Gateway Protocol): It is a path-vector protocol that is used for routing between different autonomous systems on the internet.
  • IS-IS (Intermediate System to Intermediate System): It is a link-state protocol that is primarily used in large networks like ISPs.

What are Different Routing Metrics?

The purpose of routing protocols is to learn about all the available paths to route data packets, build routing tables, and make routing decisions based on specified metrics. There are two primary types of routing protocols rest of them ideate from these two only.

1. Distance Vector Routing

In this type of routing protocol, all the nodes that are a part of the network advertise their routing table to their adjacent nodes (nodes that are directly connected) at regular intervals. With each router getting updated at regular intervals, it may take time for all the nodes to have the same accurate network view.

  • Uses fixed length sub-net, not suitable for scaling.
  • Algorithm used: Bellman Ford Algorithm to find the shortest path.

2. Link State Routing

Link State Routing is another type of dynamic routing protocol in which routes advertise their updated routing tables only when some new updates are added. This results in the effective use of bandwidth. All the routers keep exchanging information dynamically regarding different links such as cost and hop count to find the best possible path.

  • Uses a variable length subnet mask, which is scalable and uses addressing more effectively.
  • The algorithm used: Dijkstra's Algorithm to find the shortest path.

Let's look at the metrics used to measure the cost of travel from one node to another:-

  1. Hop Count: Hop count refers to the number of nodes a data packet has to traverse to reach its intended destination. Transmitting from one node to another node counts as 1 - hop count. The goal is to minimize the hop count and find the shortest path.
  2. Bandwidth Consumption: Bandwidth is the ability of a network to transmit data typically measured in Kbps (Kilobits per second), Mbps (Megabits per second), or Gbps (Gigabits per second). The bandwidth depends on several factors such as - the volume of data, traffic on a network, network speed, etc. Routing decision is made in a way to ensure efficient bandwidth consumption.
  3. Delay: Delay is the time it takes for a data packet to travel from the source node to its destination node. There are different types of delay such as - propagation delay, transmission delay, and queuing delay.
  4. Load: Load refers to the network traffic on a certain path in the context of routing. A data packet will be routed to the path with a lesser load so that it reaches its destination in the specified time.
  5. Reliability: Reliability refers to the assured delivery of the data packet to its intended destination although there are certain other factors, the data packet is routed in such a way that it reaches its destination. The stability and availability of the link in the network are looked over before routing the data packet from a specific path.

What are the Advantages of Routing?

  • Overall routing can be done in various ways its important to know the requirements and use the one that fits right for our specific needs, hence automated routing is typically preferred as the routing of packets is done by the algorithms defined and the manually configurable routing can give us a fine-grained control over the network.
  • Routing is a highly scalable operation for transmitting data that is, in a large-scale enterprise network it becomes crucial to manage information related to all the nodes that may be sharing sensitive and confidential information regarding the organization.
  • Load Balancing is also one of the crucial aspects taken care of by routing data packets off the routes that are generally busy as sending data through those routes will only put our data at risk of getting lost.

What are the Disadvantages of Routing?

Every type of routing comes with some pros and cons here are some of the disadvantages for specific types of routing :

  • Static Routing: This type of routing is appropriate only for smaller networks where the network administrator has an accurate view of the network & good knowledge of topology else it might raise some security concerns and complex configuration issues.
  • Dynamic Routing: Everything is done automatically by the algorithms, providing less control over the network that may not be suitable for every kind of network. It is also computationally expensive and consumes more bandwidth.
  • Default Routing: The path on which the packets are to be transmitted by default is configurable but can be a complex procedure if not defined clearly.

Conclusion

Routing is a fundamental concept in computer science that allows every network device across the world to share data across the internet. Here, the shortest path is selected by the routing algorithms when routing a data packet. So, the Routing Algorithms select the shortest path based on metrics like - hop count, delay, bandwidth, etc.


Next Article

Similar Reads