Computer Networking › Section D · The network layer: data plane › Topic D.1
Forwarding, routing, and network service
The transport layer talks process to process, but something has to carry each packet across dozens of separate networks from one host to another. That is the network layer, and it splits its work into two very different jobs: forwarding and routing.
Where the network layer lives
Unlike the application and transport layers, which run only in end hosts, the network layer runs in every host and every router on a path. A sending host takes a transport-layer segment, wraps it in a network-layer header to make a datagram, and hands it to its first-hop router. Each router on the way reads that header, decides which of its links leads closer to the destination, and passes the datagram on. The receiving host strips the header and delivers the segment up to TCP or UDP. A plain router in the middle never looks inside the segment: for traffic passing through, they use only the network layer and the layers below it.
Forwarding: a local, per-packet decision
Forwarding is what one router does when a datagram arrives on an input link: it reads header values, looks them up in its forwarding table, and moves the datagram to the correct output link. A router might also drop the datagram or send copies out of several links. Forwarding happens for every single packet, so it must be extremely fast, typically a few nanoseconds per packet, and it is usually built into dedicated hardware rather than software. Many engineers say switching when they mean forwarding; the two words are interchangeable here.
Routing: a network-wide computation
Routing is the process of working out which path datagrams should take from source to destination across the whole network. It answers questions such as: if the link between two cities fails, what path should traffic for a given destination use now? Routing algorithms run in software and take milliseconds to seconds, because they react to changes in topology rather than to individual packets. The result of routing is the content of the forwarding tables. Think of an airport baggage system: each junction on the conveyor reads a bag's tag and pushes it left or right (forwarding), while planners decide in advance which junctions lead to which gates (routing).
Data plane and control plane
The per-router forwarding function is called the data plane. The network-wide logic that decides what goes into forwarding tables is called the control plane. In the traditional design, every router runs its own piece of the control plane: routing software on each router exchanges messages with neighbouring routers and computes that router's table locally. In software-defined networking (SDN), the control plane moves out of the routers into a logically centralised remote controller, often in a data centre, which computes forwarding tables and installs them in each router. The routers then only forward. Both approaches feed the same kind of table to the same kind of data plane.
Worked example: data plane or control plane?
Classify each event in a small ISP. 1. A router receives a datagram for 198.51.100.7 and sends it out of interface 3: this is a per-packet table lookup, so it is forwarding, the data plane. 2. Two routers exchange messages reporting that a link's cost has changed: this feeds route computation, so it is the control plane. 3. A router recomputes its best paths after that message and rewrites five table entries: control plane. 4. The next datagram for 198.51.100.7 now leaves by interface 1: data plane, using the new entry. Check: every action that touches one packet is the data plane; every action that changes the table is the control plane.
Why the two run at different speeds
A router's data plane has to keep pace with its links. A 10 Gbps link carrying full-size 1,500-byte packets delivers \(\frac{10^{10}}{1500 \times 8} \approx 833{,}000\) packets every second, about one every 1.2 microseconds. With tiny 64-byte packets on a 400 Gbps link, ignoring link-layer framing overhead, a new packet can arrive every 1.28 nanoseconds. No general-purpose processor can make a software decision that fast, so lookups run in specialised chips. Routing, by contrast, only needs to respond when links or neighbours change, which happens far less often, so it runs comfortably on an ordinary CPU inside the router or on a remote controller.
The network service model
The service model describes what the network layer promises the transport layer about end-to-end delivery. A network could, in principle, offer guaranteed delivery; guaranteed delivery within a delay bound, such as 50 milliseconds; in-order delivery; a guaranteed minimum bandwidth, so the path behaves like a dedicated link of a set rate; or encryption of every datagram. Each guarantee needs extra state or reserved capacity inside the network, which costs money and complexity. Different network architectures have made different choices, and the choice shapes everything built above.
The internet's choice: best effort
The internet's network layer, IP, offers a single service called best effort. It promises none of the guarantees above: datagrams may be lost, delayed by varying amounts, duplicated or delivered out of order, and there is no minimum bandwidth. Older architectures such as ATM offered stronger guarantees, and proposals such as the IETF's Integrated Services tried to add reservations to IP, but best effort won in practice. Generous link capacity, plus transport protocols and applications that adapt, such as TCP retransmission and adaptive-bitrate video, have proved good enough for streaming, calls and gaming.
Worked example: what best effort means for an application
A host sends five datagrams, numbered 1 to 5, to a server. 1. The server receives 1, 3, 2 and 5, in that order, and 4 never arrives. 2. Has IP broken its promise? No: best effort allows loss and reordering, and IP will not tell the sender that 4 was lost. 3. If the data travelled over UDP, the application sees exactly this sequence and must cope itself, perhaps by ignoring the gap in a voice call. 4. Over TCP, the receiving TCP holds 3 and 5 until 2 and a retransmitted 4 arrive, then delivers 1 to 5 in order. Check: reliability is added at the end hosts, never inside IP.
Common mistakes to avoid
First, using forwarding and routing as synonyms: forwarding moves one packet through one router; routing chooses paths across the network. Second, thinking the routing algorithm runs for each packet; it runs when the network changes and leaves its results in the forwarding table. Third, assuming SDN removes forwarding tables; it only moves the control plane that fills them. Fourth, believing IP is reliable because web pages arrive intact; TCP at the end hosts repairs IP's losses. Fifth, confusing a router's physical ports, its network interfaces, with transport-layer port numbers.
Key takeaways
The network layer runs in every host and router and carries datagrams host to host. Forwarding is the per-packet, per-router move from input link to output link, done in hardware in nanoseconds; it forms the data plane. Routing computes paths network-wide, in software over milliseconds to seconds, and fills the forwarding tables; it forms the control plane. Traditionally each router runs its own control plane; SDN moves it to a remote controller. A service model lists what delivery the network guarantees, and the internet's IP offers only best effort, leaving reliability to TCP and to applications.
Flashcards
Flashcard
Carries datagrams from host to host across many networks
Test your understanding
Question 1 of 5
A router receives a datagram, looks up its destination address and sends it out of interface 2. Which function is this?
Question 2 of 5
In software-defined networking, what moves out of the individual routers?
Question 3 of 5
A server receives datagrams 1, 3, 2 and 5 from a sender, and datagram 4 never arrives. Which statement about IP is correct?
Question 4 of 5
Roughly how many full-size 1,500-byte packets per second can arrive on one 10 Gbps link?
Question 5 of 5
Why does a router's routing software not need to run at the speed of its links?
