menu
A general introduction of routers
The router receives data packets from its input port, checks its header, performs some basic functions, such as checking the checksum, then looks up the routing table, finds the appropriate output port to dump the data packets, and forwards the data packets to that output port.

A router is a network device that forwards data packets between computer networks.

 

 

A very general example lets us understand this. Suppose you search www.google.com in your web browser, and then this will be a request from your system that will be sent to Google's server service page. Now your request is just a series of packets, not just Google's servers. Immediately they experience a series of network devices called routers to accept this packet and forward them to the correct path, So it reaches the destination server.

 

 

 

A router has many interfaces through which it can connect to many host systems.

 

 

Router functions:

 

 

Routers have two main functions:

 

 

1. Forwarding 

 

The router receives data packets from its input port, checks its header, performs some basic functions, such as checking the checksum, then looks up the routing table, finds the appropriate output port to dump the data packets, and forwards the data packets to that output port.

 

 

2. Routing

 

 

Routing is the process by which a router determines the best path for a packet to reach its destination. It maintains a routing table composed of different algorithms used by the router.

 

 

Router architecture:

 

 

1. Input port

 

 

This is the interface where data packets are allowed to enter the router. It performs several key functions, such as terminating a physical link on the router. This is accomplished by the leftmost part in the figure below. The middle part completes interoperability with the link layer, such as de encapsulation. The forwarding table is found in the last part of the input port, and is used to determine the appropriate output port based on the destination address.

 

 

2. Exchange fabric

 

 

This is the core of a router, which connects input and output ports. It is a network in a network device. Switching structures can be implemented in various ways, some of which are prominent:

 

 

Through memory switching: In this case, we have a processor that copies packets from the input port and sends them to the appropriate output port. It works like a traditional CPU, with input and output ports acting as input and output devices

 

 

Through bus switching: In this implementation, we have a bus that connects all input ports to all output ports. When receiving a packet and determining which output port it must be delivered to, the input port places a specific token on the packet and transmits it to the bus. All output ports can see the data packet, but it will be delivered to the output port that has placed the token, and then the output port will scrape the token, and the data packet will be forwarded

 

 

Switching through an interconnection network: This is a more complex network, where we use a 2N bus to connect n input ports to n output ports, rather than a single bus.

 

 

3. Output port

 

 

This is the segment of data packets sent from the router. The output port checks its queue buffer (when multiple data packets must be transmitted through the same output port, a queue buffer is formed), receives the data packets, performs link layer functions, and finally transmits the data packets to the outbound link

 

 

4. Routing Processor

 

 

It implements routing protocols and works like a traditional CPU. It uses a variety of routing algorithms such as link state algorithm, distance vector algorithm, and other routing algorithms to compile a forwarding table, and determines routing and output ports by looking up the forwarding table.