1 minute read

A router is a device that connects computers that work within the framework of a network.

It is in charge of establishing the route that will be allocated to each data packet within a computer network.

How does it work?

The basic operation of a router consists of sending network packets through the most appropriate path or route at all times.

For this, it stores the received packets and processes the origin and destination information on them.

Based on this information, it forwards the packets to another router or to the final host, in an activity called ‘routing’.

Each router is in charge of deciding the next hop based on its forwarding table or routing table, which is generated by protocols that decide which is the most suitable or short path, such as protocols based on the Dijkstra algorithm.

Because they are the elements that make up the network layer, they have to be in charge of fulfilling the two main tasks assigned to it:

  • Packet forwarding: when a packet reaches the incoming link of a router, the router has to pass the packet to the appropriate outgoing link. An important characteristic of routers is that they do not broadcast traffic.
  • Packet routing: by using routing algorithms it has to determine the path that packets should follow as they flow from sender to receiver.

Therefore, we must distinguish between forwarding and routing.

Forwarding consists of taking a packet at the input and sending it through the output indicated in the table, while routing refers to the process of making that table.

Four components can be identified in a router:

  • Inbound ports: the physical layer, performs the data link layer functions necessary to interoperate with the data link layer functions on the remote side of the input link; it also performs a search and forward function so that a packet forwarded within the router's switching fabric emerges at the appropriate egress port.
  • Switch input: connects the router's input ports to its output ports.
  • Outbound ports: stores packets that have been forwarded to it through the switch port and transmits them to the outbound link. It then performs the inverse function of the physical layer
  • Routing Processor: Executes IP routing protocols, maintains routing information and forwarding tables and performs network management functions within the router.