Packet Forwarding Basics

blog » series » Packet Forwarding Basics

This short series of blog posts describes the basics of packet forwarding, including several methods that never worked well but nonetheless keep getting reinvented every few years (another lovely proof of RFC 1925 rule 11).

Packet Forwarding 101: Header Lookups
Packet forwarding used by bridges and routers (what marketers call Layer-2/3 switches is just a particular case of statistical multiplexing – a mechanism where many communication streams share the network resources by slicing the data into packets that are sent across the network. The packets are usually forwarded independently; every one of them must contain enough information to be propagated by each intermediate device it encounters on its way across the network.

Cache-Based Packet Forwarding
Network devices were always pushed to the bleeding edge of performance, and smart programmers always tried to optimize the CPU-intensive processes. One obvious packet-forwarding optimization relies on the fact that, within a short timeframe, most packets have to be forwarded to a small set of destinations. Welcome to the wonderful world of cache-based forwarding.

Flow-Based Packet Forwarding
Now imagine you want to implement full-featured fast packet forwarding including ingress and egress ACLs, NAT, QoS… but find the required hardware (TCAM) too expensive. Wouldn’t it be nice if we could send the first packet of every flow to a CPU to figure out what to do with it, then download the results into a high-speed flow cache so we could use them to switch subsequent packets in the same flow? Welcome to flow-based packet forwarding.

 

Sidebar