Kurose and Ross, Computer Networking: A Top-Down Approach, sections 4.1 and 5.1, cross-checked against RFC 7426 (the IRTF’s SDN layers and terminology) and RFC 791 (IPv4).
Learn the two verbs first: forwarding and routing. Every later guide in chapters 4 and 5 is about one or the other, and exam questions often just ask which one a mechanism belongs to. If you can sort a list of terms into the two columns of the table below, you are ready to move on.
The picture: a road trip and a junction#
Picture a long road trip. Before you leave, you plan the whole route on a map: which highways, which cities. That takes a while, and you only do it once. That is routing.
Then you drive. At every junction you glance at the signs and take the right exit in a second or two. You do not re-plan the trip at each junction. You just follow the plan. That is forwarding.
A router does both jobs. The planning happens in the background and the result is written into a forwarding table. The quick decision at each “junction” happens for every single packet, using that table.
Vocabulary, before anything uses it#
| Term | What it means |
|---|---|
| Network layer | Layer 3. It moves packets from the sending host (a computer or phone) to the receiving host, across many routers. It exists in every host and every router. |
| Datagram | The name for a network-layer packet. A transport-layer segment travels inside it. |
| Router | A packet switch that works at the network layer. It reads the destination IP address to decide where a datagram goes next. |
| Forwarding | Moving one arriving packet from a router’s input link to the right output link. Local and very fast. |
| Routing | Working out the paths packets take from source to destination across the whole network. Network-wide and slower. |
| Forwarding table | The lookup table inside a router: “destination like this, send it out of that link”. Routing fills it in; forwarding reads it. |
| Data plane | Everything a router does per packet, inside itself: forwarding. |
| Control plane | Everything that decides how the forwarding tables should look: routing algorithms and protocols, or an SDN controller. |
| SDN | Software-defined networking: a remote controller computes forwarding tables and installs them in routers, instead of each router computing its own. |
Forwarding vs routing, side by side#
Exams love a question that names a mechanism and asks which job it belongs to. This table answers almost all of them.
| Forwarding (data plane) | Routing (control plane) | |
|---|---|---|
| Question it answers | This packet: which output link? | Every destination: which path? |
| Where it happens | Inside one router | Across the whole network |
| How fast | Nanoseconds per packet, so it is done in hardware | Seconds, and it runs in software |
| What it uses | Header fields of the arriving packet, plus the forwarding table | Information about links and costs, gathered from other routers or a controller |
| What it produces | A packet on the correct output link | The contents of the forwarding tables |
| Examples in these guides | Longest prefix matching, switching fabrics, output queues | Dijkstra, distance vector, OSPF, BGP |
Put another way: routing writes the table, forwarding reads it.
A datagram addressed to 128.119.40.186 arrives at a router. The router looks up 128.119.40.186 in its forwarding table, finds the entry that matches best, and sends the datagram out of link 2. That whole step is forwarding. The fact that the table said “link 2” in the first place, because link 2 is on the cheapest path toward that network, is the result of routing.
Two ways to run the control plane#
Someone has to fill in the forwarding tables. There are two designs, and chapter 5 compares them.
Per-router control (the traditional Internet)
Every router runs a routing algorithm itself. The routers talk to each other, swapping information about links and costs, and each one computes its own forwarding table. OSPF and BGP work this way. No single machine is in charge.
Logically centralized control (SDN)
A separate remote controller knows the whole network. It computes the forwarding tables and installs them in the routers. Each router keeps a small control agent that talks to the controller, but the router does not compute routes itself. “Logically centralized” means it behaves like one controller, even if it is really several servers for reliability.
| Per-router control | SDN (logically centralized) | |
|---|---|---|
| Who computes the table | Each router, for itself | A remote controller, for every router |
| How routers learn about the network | By exchanging messages with neighbors | They do not need to; the controller knows |
| Strength | No single point of control; proven at Internet scale | Easy to program new behavior from one place |
What the network layer promises: best effort#
A service model is the list of promises a layer makes to the layer above it. The Internet’s network layer makes a very short list. It is called best-effort service, and it guarantees none of these:
- Delivery. A datagram may be dropped, for example when a router’s queue is full.
- Order. Datagrams may arrive in a different order from the one they were sent in.
- Timing. There is no promised delay or minimum bandwidth.
That sounds weak, and it is on purpose. Keeping the core simple made the Internet easy to build and to grow. The missing promises are added where they are needed, at the edges: TCP adds reliable, in-order delivery on the end hosts. You met that in chapter 3.
IP tries, and promises nothing. TCP, on the hosts, turns “tries” into “delivers, in order”.
Where the network layer sits in hosts and routers#
A host runs all five layers. A router only needs the bottom three: physical, link and network. It opens each frame, reads the datagram’s header to decide where it goes, wraps it in a new frame for the next link, and sends it on. In the basic model it never looks at the TCP or UDP segment inside. (NAT, covered later in chapter 4, is an exception that breaks this rule.)
| Device | Layers it uses | What it reads to make its decision |
|---|---|---|
| Host | Application, transport, network, link, physical | Everything, up to the application data |
| Router | Network, link, physical | The datagram header, mainly the destination IP address |
| Link-layer switch | Link, physical | The frame header, mainly the destination MAC address |
Forwarding is the data plane moving one packet to the right output link inside one router, fast and in hardware; routing is the control plane deciding the paths across the whole network, slower and in software, and its result is the forwarding table that forwarding reads.
Practice#
For each one, say first whether it is about forwarding or routing. That alone answers half of them.
- In one sentence each, define forwarding and routing.
- Which plane, data or control, does each of these belong to? (a) Looking up a destination address in a forwarding table. (b) Running Dijkstra’s algorithm. (c) Moving a datagram across a router’s switching fabric (the internal connections that carry a datagram from input to output). (d) Two routers exchanging BGP messages.
- Why is forwarding usually done in hardware, but routing in software?
- In an SDN network, which device computes the forwarding tables, and which device forwards the packets?
- List the three things the Internet’s best-effort service does not guarantee.
- A datagram travels from host A through three routers to host B. On which devices does the network layer run, and which of them look at the TCP segment inside?
- A web page you load crosses six routers. On how many of them does TCP run?
Solutions#
Find the first line where your working split from the solution, and redo the problem from that line. Do not just read the answer and nod.
- Forwarding: moving an arriving packet from a router’s input link to the correct output link. Routing: determining the end-to-end paths packets take across the network.
- (a) Data. (b) Control. (c) Data. (d) Control. Per-packet work inside one router is the data plane; computing paths and exchanging routing information is the control plane.
- Speed. Forwarding happens for every packet, so at high link speeds each decision must take nanoseconds, which only hardware can do. Routing happens far less often, over seconds, so software is fast enough and easier to change.
- The remote controller computes them; the routers still forward. Each router’s control agent receives its table from the controller.
- Delivery, order, and timing. A datagram may be lost, may arrive out of order, and has no guaranteed delay or bandwidth.
- On all five devices; only A and B look at the TCP segment. The three routers run the network layer and below, and read only the datagram header.
- None of them. TCP runs only on the two end hosts. The six routers run the network, link and physical layers, and forward the datagrams without opening the TCP segments inside.
Test-readiness checklist#
- ☐ I can define forwarding and routing in one sentence each.
- ☐ I can sort a mechanism into the data plane or the control plane.
- ☐ I can explain why forwarding is hardware-fast and routing is software-slow.
- ☐ I can describe per-router control and SDN control, and say who computes the table in each.
- ☐ I can list what best-effort service does and does not promise.
- ☐ I can say which layers a host, a router and a link-layer switch use, and what each one reads.
When a question names a mechanism, ask: does it handle one packet or decide paths for all packets? One packet means forwarding and the data plane. All packets means routing and the control plane.
Frequently asked questions#
What is the difference between forwarding and routing?
Forwarding is the local, per-packet action of moving a datagram from a router's input link to the correct output link, using the forwarding table. Routing is the network-wide process of choosing the paths datagrams take, and its result fills in the forwarding tables.
What is the difference between the data plane and the control plane?
The data plane is the per-router forwarding of each packet, done in hardware in nanoseconds. The control plane decides how forwarding tables are filled in, using routing algorithms in each router or a remote SDN controller.
What does SDN change?
In software-defined networking a remote, logically centralized controller computes the forwarding tables and installs them in the routers. The routers still forward packets themselves; they just stop computing their own routes.
What is best-effort service?
It is the Internet network layer's service model. It makes no guarantee that a datagram will be delivered, delivered in order, or delivered within any time or at any bandwidth. Reliability is added on the end hosts by TCP.
Does a router look at the TCP header?
Not in the basic model. A router works up to the network layer. It reads the datagram header, mainly the destination IP address, and does not need to open the TCP or UDP segment inside. NAT routers are the exception: they read and rewrite port numbers.
Something here not clear? A topic you wish we covered? Tell us. We read every message, and a request is the fastest way to get a guide written.
Test yourself on this topic
The free networking practice app has 10 questions on this guide and 500 across the whole course, each with an explanation for every answer. Offline, no ads, no account.
Practise this topic →