Skip to content
  • There are no suggestions because the search field is empty.

The Role of a Router in a Network

Routers are an essential piece of hardware that plays an extremely important role in networks. They preserve the knowledge of the network topology and use that information to forward packets to their destination. This is done using the best routes across the network, regardless of the number of routes available.

A router will forward packets between different networks based on the knowledge it has in the routing table. The information in the routing table constantly updates and reflects on the topology changes.

Each interface on the router belongs to a different network and, therefore, internetwork communication between these networks is supported by default. As a result, directly connected networks are always available in the routing table, and the router can forward data toward endpoints or other networking devices that belong there.

Routing table basic network topology connecting two computers via two switches and a router

The figure above shows that the router (R1) has two directly connected networks, 192.168.1.0/24 toward SW1 and 192.168.2.0/24 toward SW2. As a result, PC1 and PC2, which are part of these two networks, can communicate with each other.

Router Functions

Routers perform two important functions to exchange packets between different networks:

  • Path determination
  • Packet forwarding 

Path determination is based on the data available in the routing table, which contains information about all directly connected and learned routes. When a router receives a packet, it examines the destination IP address inside the L3 header and searches for the best (longest) match across the networks in the routing table.

Packet forwarding happens after the router finds a matching route that should be used for the destination network. Once the router determines the next-hop address or interface for the destination IP defined in the packet, it forwards it accordingly.

Based on the network, whether directly connected or learned, the packet is sent to the destination IP (host) or toward the next-hop router, which then forwards it to the destination.