How do routers work, really?

Click for: original source

This is the inside view of how exactly a router operates. You only need to know this if you are poking inside a router implementation. If that is the case, my condolences. By Kamila Součková.

The packet has a destination IP address. This is matched in the routing table, using a longest-prefix match (LPM), i.e. it matches IP address prefixes. It may either be for a host the router is directly connected to (on some interface), or it may need to be sent further, through a gateway (through some interface). Therefore: The routing table maps a prefix to either a next hop through a gateway and an interface, or a direct connection through an interface.

The guide is split into:

  • Some terminology
  • The data plane: life of a packet
    • It needs to be routed: L3/router
    • It needs to be passed down: L2.5/ARP glue
    • It needs to be forwarded: L2/switch
    • The logic: Applying the tables
  • The control plane: how to fill the tables
    • L3 / routing table
    • L2.5 / ARP table
    • L2 / MAC table

You will also get code (in P4 - P4 programs specify how a switch processes packets.) accompanying the explanations and demonstrating implementation. The author promises to provide the complete source code to a functional router in near future. Good read!

[Read More]

Tags cloud infosec miscellaneous learning servers browsers distributed