Router Architecture

Overview

A router is a networking device that forwards data packets between computer networks. There are three main components involved:

  • input ports: take in packets from previous hop, send to switching fabric
  • switching fabric: transfer packets from input port to output port
  • output ports: take packets from switching fabric, send to next hop

image|w70

Input Port

The input port is usually composed of three stages:

  1. Receive light / electronic signal from physical layer, decode the signal into bit stream
  2. Assemble bit stream into link layer frames, check for errors
  3. Decide the output port base on the forwarding table, and send the packet to switching fabric

image|w70

Note

If data arrival rate > switching fabric transfer rate, the input port need to buffer the incoming packets, which is what we call input port queuing

Switching Fabric

The switching fabric is responsible for transferring packets from input ports to output ports. There are three major types of switching fabric:

Memory Switching

In memory switching, packets are transferred from input port to output port via shared memory. The packet is copied into memory at the input port and then copied out from memory to the output port.

image|w70

  • Limited by memory bandwidth and processing power
  • Packet-by-packet processing (no parallelism)
  • Processing overhead of copying packets twice

Bus Switching

Bus switching uses a shared communication bus that all input and output ports connect to. Packets are placed on the bus and addressed to the appropriate output port.

image|w70

  • All ports share the same bus, need time-division multiplexing
  • Only one packet can be transmitted on the bus at a time
  • Bus speed limits total router throughput, if there are 𝑁 ports with 𝑅 link speed, then it requires bus speed of at least 𝑁×𝑅 to keep up

Crossbar Switching

Crossbar switching uses a grid of input-output connections that can simultaneously connect multiple input ports to multiple output ports.

image|w40

  • Non-blocking architecture: real parallelism
  • Each input can connect to any unused output simultaneously
  • Does NOT scale up with the number of ports (𝑂(𝑛2) complexity growth)

Packet Scheduling

Priority Scheduling

The low priority queue will NEVER be served if there are packets in the high priority queue.

image|w50

In the priority, scheduling, scheduler is NOT preemptive, meaning that if a low priority packet is being transmitted, and a high priority packet arrives, the high priority need to wait until the low priority packet is fully transmitted.

Round Robin Scheduling

Fair Round Robin

RR try to be fair, which will poll each queue in a circular manner, and transmit one packet from each queue in each round.

image|w60

Weighted Fair Queuing (WFQ)

Each queue 𝑖 is assigned a weight 𝑀𝑖, and in each round, the scheduler will transmit 𝑀𝑖 packets from queue 𝑖.

image|w60