Working Principle of Routing
Routing works by finding a shortest path from the source node to the destination node across a network. Here’s step-by-step working of routing:
Step1: Communication initiation
The first step that typically happens is, one node (client or server) initiates a communication across a network using HTTP protocols.
Step2: 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 is called de-assembling and encapsulating the data payload. And then each data packet is labelled with the destination node’s IP address.
Step3: Routing Table
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 for the IP addresses of all the nodes that can transmit the packet to its destination and selects the shortest path using the shortest path algorithm and then routes accordingly.
Routing Table is stored in a router, a network device that determines the shortest path and routes the data packet.
Step4: Hopping procedure
In the procedure or routing, the data packet will undergo many hops across various different 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 a certain criteria defined for every data packet, there’s a limited number of hops a packet can take if the packet exceeds that, then its considered to be lost and it is retransmitted.
Step5: 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 mechanism to verify the authenticity of the data packets.
Overall, the data packet will be transmitted over least hop-count path as well as the path on which there is less traffic to prevent packet loss.
In the above image, we have 3 major components
- Sender
- Receiver
- Routers
The shortest path is highlighted in red, the path with 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 is Routing?
The process of choosing a path across one or more networks is known as network routing. Any kind of network, including public transit and phone networks, can use the routing principles. Routing chooses the routes along which Internet Protocol (IP) packets get from their source to their destination in packet-switching networks, such as the Internet. Routers are specialized pieces of network hardware that make these judgments about Internet routing.