Sub topic 11
Control plane versus data plane
This chapter assumes you know how longest prefix match picks a route, what a next hop is, and the per-packet forwarding steps from earlier chapters. You should also be comfortable reading ip route show output.
Two jobs, two planes
A router does two different kinds of work. The first is deciding where traffic should go. The second is moving each packet toward that destination. Networking splits these into two planes.
- The control plane builds the routing table. It runs routing protocols, reads configuration, and reacts to link changes. It works on routes, not on individual packets.
- The data plane (also called the forwarding plane) handles every transit packet. It does the lookup, decrements the TTL, rewrites the Layer 2 header, and sends the packet out an interface.
The data plane has to be fast and predictable, because it runs for every packet. The control plane can be slower and more complex, because it runs only when the network changes.
What each plane contains
| Plane | Main work | Runs when | Typical speed need |
|---|---|---|---|
| Control | Learn routes, choose the best one, build tables | A route or link changes | Seconds to milliseconds |
| Data | Look up, decrement TTL, rewrite frame, transmit | Every packet | Nanoseconds to microseconds |
Some traffic crosses the boundary. A packet addressed to the router itself, such as a routing protocol message, an SSH session, or a ping to its own address, is sent up to the control plane. Packets that are only passing through stay in the data plane.
The link between them: the forwarding table
The control plane may hold many candidate routes to the same prefix, learned from different sources. It picks the best one for each prefix and installs only that choice into the data plane's forwarding table, usually called the FIB (Forwarding Information Base). The FIB is a compact copy of the decisions, arranged for fast longest prefix match lookups.
On Linux you can see both roles on one machine. The kernel's forwarding path is the data plane. Routes you add with ip route are control-plane input that the kernel uses for lookups.
# Ask the data plane which route it would use for this destination
ip route get 8.8.8.8
# Allow the kernel to forward packets between interfaces
sudo sysctl -w net.ipv4.ip_forward=1If ip_forward is 0, the machine behaves like an end host. It accepts packets for itself and drops everything else, even when its routing table is correct. The control plane can be perfect while the data plane refuses to forward.
Why the split matters
- Speed. Hardware can forward packets using the FIB without involving the router's general-purpose CPU.
- Stability. Routers keep forwarding with the last installed FIB entries while the control plane recalculates routes. A busy control plane does not have to slow down transit traffic.
- Diagnosis. A fault can sit in either plane. A missing route is a control-plane problem. A route that exists but is not used, or a packet dropped despite a correct table, points to the data plane.
A related failure is a stale entry. If the control plane has withdrawn a route but the FIB has not yet been updated, packets follow the old path until the update is installed.
Exercise
A Linux router has the correct route to 10.2.0.0/16 shown by ip route show, but packets from a client to 10.2.5.5 never get through, and the client's packets reach the router's own interface. Which plane is the likely problem, and what is the first setting you would check?
Show answer
The data plane is the likely problem. The control plane has the right route, so check that IPv4 forwarding is enabled with sysctl net.ipv4.ip_forward. If it is 0, the router accepts packets for itself but does not forward transit packets.