Kestrel Exams kestrel logo KESTREL EXAMSPRACTICE TO PASS
Networking10 min read

The Network Layer: Forwarding vs Routing, Data Plane vs Control Plane

Every router does two jobs. One is fast and local: move this packet to the right exit. The other is slow and network-wide: work out which exits are right. Chapters 4 and 5 are built on that split, so it is worth getting straight first.

Practice this topic in the free app →All Networking guides

Chapter 4 · The network layer
Built from

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).

How to use it

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#

TermWhat it means
Network layerLayer 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.
DatagramThe name for a network-layer packet. A transport-layer segment travels inside it.
RouterA packet switch that works at the network layer. It reads the destination IP address to decide where a datagram goes next.
ForwardingMoving one arriving packet from a router’s input link to the right output link. Local and very fast.
RoutingWorking out the paths packets take from source to destination across the whole network. Network-wide and slower.
Forwarding tableThe lookup table inside a router: “destination like this, send it out of that link”. Routing fills it in; forwarding reads it.
Data planeEverything a router does per packet, inside itself: forwarding.
Control planeEverything that decides how the forwarding tables should look: routing algorithms and protocols, or an SDN controller.
SDNSoftware-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 answersThis packet: which output link?Every destination: which path?
Where it happensInside one routerAcross the whole network
How fastNanoseconds per packet, so it is done in hardwareSeconds, and it runs in software
What it usesHeader fields of the arriving packet, plus the forwarding tableInformation about links and costs, gathered from other routers or a controller
What it producesA packet on the correct output linkThe contents of the forwarding tables
Examples in these guidesLongest prefix matching, switching fabrics, output queuesDijkstra, distance vector, OSPF, BGP

Put another way: routing writes the table, forwarding reads it.

Worked example

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 controlSDN (logically centralized)
Who computes the tableEach router, for itselfA remote controller, for every router
How routers learn about the networkBy exchanging messages with neighborsThey do not need to; the controller knows
StrengthNo single point of control; proven at Internet scaleEasy to program new behavior from one place
Do not confuse these
SDN does not remove the data plane. Routers still forward every packet themselves, at hardware speed. Only the job of computing the table moves to the controller.

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.

Memory line

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.)

DeviceLayers it usesWhat it reads to make its decision
HostApplication, transport, network, link, physicalEverything, up to the application data
RouterNetwork, link, physicalThe datagram header, mainly the destination IP address
Link-layer switchLink, physicalThe frame header, mainly the destination MAC address
Do not confuse these
A router and a switch are both packet switches, but they work at different layers. A router forwards datagrams using IP addresses (layer 3). A link-layer switch forwards frames using MAC addresses (layer 2).
One sentence to carry into the exam

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.

  1. In one sentence each, define forwarding and routing.
  2. 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.
  3. Why is forwarding usually done in hardware, but routing in software?
  4. In an SDN network, which device computes the forwarding tables, and which device forwards the packets?
  5. List the three things the Internet’s best-effort service does not guarantee.
  6. 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?
  7. A web page you load crosses six routers. On how many of them does TCP run?

Solutions#

Best study method

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.

  1. 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.
  2. (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.
  3. 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.
  4. The remote controller computes them; the routers still forward. Each router’s control agent receives its table from the controller.
  5. Delivery, order, and timing. A datagram may be lost, may arrive out of order, and has no guaranteed delay or bandwidth.
  6. 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.
  7. 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.
One last rule

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.

Suggest a change

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 →