Open In App

How Does a Router Work?

A Router is a networking device that forwards data packets between computer networks. One or more packet-switched networks or subnetworks can be connected using a router. By sending data packets to their intended IP addresses, it manages traffic between different networks and permits several devices to share an Internet connection. Although there are many kinds of routers, the majority of them transfer data between LANs (local area networks) and WANs (wide area networks). 

A LAN is a collection of linked devices confined to a certain region. Typically, a LAN needs just one router. In comparison, a WAN is a sizable network dispersed across a sizable geographic area. For example, large organizations and businesses with numerous sites across the nation will require individual LANs for each location, which connect to the other LANs to form a WAN. A WAN frequently requires numerous routers and switches due to its wide distribution.



Working of Router:

Consider a router as an air traffic controller, and consider data packets as planes flying to various airports (or networks). Each packet must be directed as quickly as possible to its destination, just as each plane has a distinct destination and travels a distinct route. A router assists in guiding data packets to their intended IP address, just like an air traffic controller ensures that aircraft reach their destinations without getting lost or experiencing significant disruptions in a route.

An internal routing table, which is a list of routes to different network destinations, is used by a router to effectively direct packets. In order to determine the destination of a packet, the router first scans its header. Then, it consults the routing table. Forward packet to next packet.



Steps of Routing Packet from a Source to a Destination:

Step 1: Send packet to router Computers send the first packet to the nearest router. A router is a type of computing device used in computer networks that helps move the packets along.

You likely have a router in your home or classroom right now, and that’s the first stop for your current computer’s packets.

Step 2: Router gets a packet. The IP header of each packet that the router receives is examined. The destination IP address, which informs the router of the packet’s intended destination, is the most crucial field.

Serial no. Field Content
1. Source IP address 216.3.192.1
2. IP address for the destination  91.198.174.192

Step 3: Router forwards packet, The router has multiple paths it could send a packet along, and its goal is to send the packet to a router that’s closer to its final destination.
Based on the target IP address, the router can choose the next path with the use of a forwarding table. There are 2322 32 2, start superscript, 32, end superscript potential IP addresses, which are simply too many to store, hence that table does not have a row for each one. The table instead includes entries for IP address prefixes.

IP address path before:

IP addresses have levels. It frequently indicates that two IP addresses are connected to the same extensive network, such as the Comcast SF network, when their prefixes are the same. In order to store much fewer data, router forwarding tables make use of this fact.

Step 4: Final router forwards the message in step four. The packet should finally reach a router that is aware of exactly where to transmit it if everything goes according to plan.
IP address path before.

The message can now be sent from the router to the destination IP address, which may be a server or a personal.

Advantages:

Disadvantages:

Article Tags :