The network layer moves packets from one host to another, it runs in every router as well as in every host, and it promises nothing about whether they arrive.
Words you will meet
-
Forwarding forwarding Simple Getting a packet through one router. Precise The router-local action of transferring a packet from an input link interface to the appropriate output link interface. It takes place on very short timescales — typically a few nanoseconds — and is usually implemented in hardware. introduced in ch. 4 — open in glossary — moving a packet from an input link to an output link, inside one router. Nanoseconds. Hardware.
-
Routing routing Simple Planning the whole path across the network. Precise The network-wide process that determines the end-to-end paths packets take from source to destination. It takes place on much longer timescales — typically seconds — and is often implemented in software. introduced in ch. 4 — open in glossary — working out the whole path across the network. Seconds. Software.
-
Data plane data plane Simple What each router does to each packet, on its own. Precise The per-router functions of the network layer that determine how a datagram arriving on one of a router's input links is forwarded to one of its output links. introduced in ch. 4 — open in glossary — the per-router machinery that does the forwarding.
-
Control plane control plane Simple How the routers work out where everything should go. Precise The network-wide logic that controls how a datagram is routed among routers along an end-to-end path from source host to destination host. introduced in ch. 4 — open in glossary — the network-wide logic that decides what the forwarding machinery should do.
-
Forwarding table forwarding table Simple A table in a router that says which outgoing link to use for each destination address. Precise A table in a router that maps destination addresses, or portions of destination addresses, to that router's outbound links. On arrival, the router examines the packet's destination address and searches this table to find the appropriate outbound link. introduced in ch. 1 — open in glossary — the table in a router that maps a header value to an outgoing interface.
-
Best-effort service best-effort service Simple The network tries to deliver each packet, and promises nothing about the result. Precise The service model of IP. IP makes its best effort to deliver segments between hosts but guarantees nothing: not delivery, not order, not the integrity of the data. Because it makes no guarantees, IP is called an unreliable service. Every guarantee TCP offers is built on top of this, not taken from it. introduced in ch. 3 — open in glossary — the Internet’s network-layer service model. It promises nothing.
-
Network service model network service model Simple What the network layer promises the layer above. Precise The definition of the characteristics of end-to-end delivery of packets between sending and receiving hosts. Candidates include guaranteed delivery, bounded delay, in-order delivery, minimum bandwidth and confidentiality. introduced in ch. 4 — open in glossary — the list of what a network layer does and does not guarantee.
Why this matters
Every earlier chapter ran in end systems. Open a browser, run a server, write to a socket — all of it happened on machines at the edge. The network in the middle was a cloud that either delivered your packet or did not.
This chapter opens that cloud. And the first thing to know is structural: unlike the application and transport layers, there is a piece of the network layer in every host and in every router. That is why the book calls network-layer protocols the most challenging in the stack, and why it needs two chapters rather than one.
The second thing to know is the answer to a question chapter 3 left hanging. Section 3.1 said a transport protocol cannot offer a service the network layer underneath it does not support, and then never said what the network layer does support. This section says: almost nothing. Everything TCP (Transmission Control Protocol) Transmission Control Protocol The Internet transport protocol that delivers data reliably and in order, with flow control and congestion control. introduced in ch. 1 achieves, it achieves on top of a layer that will not even promise to deliver the packet.
The network layer is in the middle, not at the edge
Figure 4.1 is one picture making one point. Two end systems, several routers between them, and each device drawn with the layers it actually implements.
End system H1 · Application — The application has a message to send. At this point it is just data — nothing has been added to it yet.
Scrub through it. The two end systems have all five layers. Every router in between has only three — and that truncated stack is the whole point of the figure.
Read all 25 steps as text
- End system H1 · Application [a segment from the transport layer] — The application has a message to send. At this point it is just data — nothing has been added to it yet.
- End system H1 · Transport [Ht | a segment from the transport layer] — The transport layer puts its header Ht in front. Everything below now treats the message as an opaque payload. This is a segment.
- End system H1 · Network [Hn | Ht | a segment from the transport layer] — The network layer adds Hn, carrying the addresses of the two hosts. This is a datagram.
- End system H1 · Link [Hl | Hn | Ht | a segment from the transport layer] — The link layer adds Hl, which describes how to cross this one link. This is a frame.
- End system H1 · Physical [Hl | Hn | Ht | a segment from the transport layer] — The physical layer puts the individual bits of the frame onto the medium.
- Router R1 · Physical [Hl | Hn | Ht | a segment from the transport layer] — The bits arrive and are reassembled into a frame.
- Router R1 · Link [Hn | Ht | a segment from the transport layer] — The old link header is removed and discarded. It described the link the frame just crossed, and that link is behind us now.
- Router R1 · Network [Ht | a segment from the transport layer] — The router reads the destination address in Hn and chooses the outgoing link. It stops here: it does not implement the transport layer, so Ht means nothing to it.
- Router R1 · Link [Hl | Ht | a segment from the transport layer] — A brand-new link header is added for the next link. It may be a completely different link technology — Ethernet here, WiFi next — and the header changes to match.
- Router R1 · Physical [Hl | Ht | a segment from the transport layer] — The frame goes out onto the next link as bits.
- a router in the core · Physical [Hl | Hn | Ht | a segment from the transport layer] — The bits arrive and are reassembled into a frame.
- a router in the core · Link [Hn | Ht | a segment from the transport layer] — The old link header is removed and discarded. It described the link the frame just crossed, and that link is behind us now.
- a router in the core · Network [Ht | a segment from the transport layer] — The router reads the destination address in Hn and chooses the outgoing link. It stops here: it does not implement the transport layer, so Ht means nothing to it.
- a router in the core · Link [Hl | Ht | a segment from the transport layer] — A brand-new link header is added for the next link. It may be a completely different link technology — Ethernet here, WiFi next — and the header changes to match.
- a router in the core · Physical [Hl | Ht | a segment from the transport layer] — The frame goes out onto the next link as bits.
- Router R2 · Physical [Hl | Hn | Ht | a segment from the transport layer] — The bits arrive and are reassembled into a frame.
- Router R2 · Link [Hn | Ht | a segment from the transport layer] — The old link header is removed and discarded. It described the link the frame just crossed, and that link is behind us now.
- Router R2 · Network [Ht | a segment from the transport layer] — The router reads the destination address in Hn and chooses the outgoing link. It stops here: it does not implement the transport layer, so Ht means nothing to it.
- Router R2 · Link [Hl | Ht | a segment from the transport layer] — A brand-new link header is added for the next link. It may be a completely different link technology — Ethernet here, WiFi next — and the header changes to match.
- Router R2 · Physical [Hl | Ht | a segment from the transport layer] — The frame goes out onto the next link as bits.
- End system H2 · Physical [Hl | Hn | Ht | a segment from the transport layer] — The bits arrive and are reassembled into a frame.
- End system H2 · Link [Hn | Ht | a segment from the transport layer] — The old link header is removed and discarded. It described the link the frame just crossed, and that link is behind us now.
- End system H2 · Network [Ht | a segment from the transport layer] — The network layer removes Hn and passes the segment up.
- End system H2 · Transport [a segment from the transport layer] — The transport layer removes Ht, checks it, and works out which application the message belongs to.
- End system H2 · Application [a segment from the transport layer] — The message arrives at the application, byte for byte what was sent.
The end systems H1 and H2 have all five layers. Every router has three: network, link, physical. The book draws them with a truncated stack on purpose — routers do not run application- and transport-layer protocols.
What the network layer does at each place:
- At H1, it takes a segment from the transport layer, wraps it in a datagram datagram Simple The network-layer packet: a segment plus a header carrying the two host addresses. Precise The network-layer packet. It encapsulates a transport-layer segment and adds network-layer header information (Hn), such as the source and destination host addresses. introduced in ch. 1 — open in glossary , and hands the datagram to the nearby router R1.
- At every router, it forwards the datagram from an input link to an output link.
- At H2, it receives datagrams, extracts the segments, and passes them up.
Compare with the transport layer, one chapter ago
Figure 3.1 is the same shape of picture with the opposite lesson. There, every router showed an empty dashed box where the transport layer would be, because a segment passes through the network untouched.
Here, the network layer box is filled in at every single hop. That is the difference between a service implemented only at the two ends and one implemented everywhere along the path. It is also why changing TCP means updating end systems, while changing IP (Internet Protocol) Internet Protocol The network-layer protocol that defines the datagram format and addressing every Internet device must use. introduced in ch. 1 means updating the entire Internet.
Forwarding and routing are not the same word
The book is blunt about this: many authors use forwarding and routing interchangeably, and this book will not.
| Forwarding | Routing | |
|---|---|---|
| What | move a packet from an input link interface to the right output link interface | determine the end-to-end path packets take from source to destination |
| Where | inside one router, local | across the whole network |
| How long | a few nanoseconds | typically seconds |
| Built from | hardware | software |
| Which plane | data plane | control plane |
Everyday picture — the drive to Florida
Chapter 1.3.1 sent a traveller from Pennsylvania to Florida.
Forwarding is getting through one interchange. The car arrives on one road, and something decides which road it leaves by. It happens in seconds, over and over, and it needs no knowledge of Florida.
Routing is planning the trip. Before setting off, the driver consults a map and picks one of many possible paths, each a series of road segments joined at interchanges.
Where the picture stops. A driver plans their own route and then executes it. In a network the two jobs are done by different machinery, on different timescales. The router doing the forwarding never sees the plan — only the one table entry that the plan produced. No driver forgets where they are going between interchanges; a router never knew.
The forwarding table is the whole decision
A router forwards a packet in three moves. It examines one or more fields in the arriving packet’s header. It uses those values to index into its forwarding table. It sends the packet out of the interface the table names.
It talks to the routing algorithms in the neighbouring routers, exchanging routing messages according to a routing protocol. This is the traditional arrangement, and it is what chapter 5 is about.
The book’s own example. A packet arrives with 0110 in the header field the router looks at. Step forward to watch the lookup, then compare with Figure 4.3 below — the bottom half of the picture never changes.
Read all steps as text
- 1 — A routing algorithm runs inside this router — It talks to the routing algorithms in the neighbouring routers, exchanging routing messages according to a routing protocol. This is the traditional arrangement, and it is what chapter 5 is about.
- 2 — It computes this router’s forwarding table — The table maps a header value to an outgoing interface. Nothing else in the router decides where packets go; the table is the decision, already made.
- 3 — A packet arrives with header value 0110 — The router does not care what the packet contains, where it came from, or what it is for. It reads one field.
- 4 — The value indexes into the table — Row two matches: header 0110, output 2. This lookup is the whole of forwarding, and on a real router it takes a few nanoseconds.
- 5 — The packet goes out on interface 2 — And that is the data plane, complete. Notice what never happened: this router did not consider the destination’s distance, the state of the wider network, or any alternative route. All of that thinking happened earlier, in the control plane.
In plain words
The router does not think. The thinking already happened, somewhere else, and its entire result is one row of a table.
This is worth holding on to, because it is what makes forwarding fast enough to be useful. A packet arriving on a 100 Gbps link leaves a few nanoseconds to decide what to do with it. There is no time to consult a map, ask a neighbour, or reconsider. There is time to read a field and look up a row.
Two ways to fill the table in
So how does the table get its contents? The book gives two answers, and the difference between them is the shape of the modern network layer.
The traditional approach
A routing algorithm runs in every router. It communicates with the routing algorithms in other routers, exchanging routing messages according to a routing protocol, and from those messages it computes its own forwarding table. Forwarding and routing both live inside the router. Sections 5.2 to 5.4 cover the algorithms and the protocols.
The software-defined approach
A physically separate, remote controller computes the forwarding tables for every router it manages. There is no routing algorithm inside this router at all.
Compare it with Figure 4.2 step 5. The data plane below the dashed line is identical, byte for byte. Only the thing above the line has moved.
Read all steps as text
- 1 — The routing computation has left the router — A physically separate, remote controller computes the forwarding tables for every router it manages. There is no routing algorithm inside this router at all.
- 2 — It distributes a table to each router — The controller has a view of the whole network, so it can compute tables that no single router could work out alone. Chapter 5 covers how, and what it costs.
- 3 — The packet arrives, and nothing below the line has changed — Same header value, same table, same lookup, same output interface. This is the point of drawing the two figures the same way: separating the control plane changes who fills the table in, and changes nothing whatsoever about how a packet is forwarded.
A physically separate, remote controller computes the forwarding tables and distributes them to every router. The routers still forward exactly as before — they simply no longer work out the tables themselves. This is SDN (Software-Defined Networking) Software-Defined Networking Separating the control plane from the data plane by computing forwarding tables in a remote controller. introduced in ch. 4 , and chapter 5 covers the controllers.
The book’s own thought experiment
Before either approach, the book asks you to imagine something deliberately absurd: a network where every forwarding table is configured by hand, by human operators standing at the routers.
It would work. No routing protocol would be needed at all. The operators would have to agree with each other so that packets actually reached their destinations — but nothing about forwarding requires an algorithm.
The point of the thought experiment is to separate two things that usually arrive together. Forwarding needs a table. It does not care where the table came from. Once you see that, a remote controller filling the table in is not a strange idea at all. It is one of the obvious options, and humans with keyboards was always the other one.
The book adds the honest caveat: hand configuration would be more error-prone and much slower to respond to a change in the network than a routing protocol.
What the network layer promises
Now the deflating part. What service does a network layer give the transport layer above it?
The book lists what a network layer could offer, then says what the Internet does offer.
| Could be offeredthe book’s list of candidates | The Internetbest-effort service | ATMa network that did offer more | |
|---|---|---|---|
| Guaranteed deliverythe packet will eventually arrive | |||
| Bounded delayand it will arrive within, say, 100 ms | |||
| In-order deliverypackets arrive in the order sent | |||
| Minimum bandwidthbehaves like a link of a stated bit rate | |||
| Confidentialitydatagrams encrypted at the source, decrypted at the destination |
Cells marked ⓘ have a reason behind them — click to read it.
Five services the book lists as possible, against the one the Internet actually offers. Click any cell for the reasoning.
The Internet’s network layer provides a single service, known as best-effort service best-effort service Simple The network tries to deliver each packet, and promises nothing about the result. Precise The service model of IP. IP makes its best effort to deliver segments between hosts but guarantees nothing: not delivery, not order, not the integrity of the data. Because it makes no guarantees, IP is called an unreliable service. Every guarantee TCP offers is built on top of this, not taken from it. introduced in ch. 3 — open in glossary . Packets are not guaranteed to arrive in the order sent, nor guaranteed to arrive at all. There is no delay bound and no minimum bandwidth.
”Best effort” is a euphemism, and the book says so
Read the definition again and notice what it excludes: nothing.
The book makes the point itself — a network that delivered no packets at all would satisfy the definition of best-effort delivery service. The name promises effort; the specification promises nothing.
This is not a criticism, and it is not an accident. It is the design decision that everything else in this book rests on. Section 4.5 comes back to it as an architectural principle. The goal is connectivity, the tool is the Internet Protocol, and the intelligence is end to end rather than hidden in the network.
So why did best effort win?
Alternatives existed and were deployed. The ATM (Asynchronous Transfer Mode) Asynchronous Transfer Mode An older network architecture, cited here for its network-assisted congestion control (§3.6.2). introduced in ch. 3 architecture provided guaranteed in-order delivery, bounded delay and guaranteed minimum bandwidth. The Intserv architecture [RFC 1633] proposed end-to-end delay guarantees for the Internet itself.
The book’s answer is not that the alternatives were wrong. It is that best effort turned out to be good enough, when combined with two other things:
- adequate bandwidth provisioning — build enough capacity and congestion becomes rare;
- bandwidth-adaptive application-level protocols — such as the DASH (Dynamic Adaptive Streaming over HTTP) Dynamic Adaptive Streaming over HTTP Chunk-by-chunk quality selection driven by the throughput the client measures. introduced in ch. 2 streaming protocol of section 2.6.2. It changes what it asks for based on what it is getting.
Between them, those two allow Netflix, video over IP (Internet Protocol) Internet Protocol The network-layer protocol that defines the datagram format and addressing every Internet device must use. introduced in ch. 1 , Skype and FaceTime to run over a network layer that guarantees them nothing at all. The book calls this “interesting”, and it is. The guarantees moved out of the network and into the applications, and the applications turned out to be a better place for them.
One piece of vocabulary, used carefully
The book warns about two pairs of words before going further.
Forwarding and switching are used interchangeably by researchers and practitioners, and the book says it will use both. This site will not. Here, forwarding is always the action, and switching fabric is the piece of hardware inside a router that carries packets across. That keeps one word for one idea, as everywhere else on this site.
Packet switch, router and link-layer switch are used carefully by the book and will be here too:
- A packet switch packet switch Simple A device that takes a packet arriving on one link and sends it out on another link. Precise A device that takes a packet arriving on one of its incoming communication links and forwards that packet on one of its outgoing communication links. The two most prominent types in today's Internet are routers and link-layer switches. introduced in ch. 1 — open in glossary is any device that transfers a packet from an input link interface to an output link interface, based on header field values.
- A router router Simple A packet switch in the network core that uses IP addresses to choose the next link. Precise A packet switch that implements layers 1 through 3 of the protocol stack and forwards datagrams using a forwarding table indexed by the destination IP address. Routers are typically used in the network core. introduced in ch. 1 — open in glossary decides using fields in the network-layer datagram. Routers are layer-3 devices.
- A link-layer switch decides using fields in the link-layer frame. Switches are layer-2 devices, and chapter 6 covers them.
Because this chapter is about the network layer, it mostly says router. Section 4.4 deliberately switches to packet switch, because the devices there match on fields from three layers at once and are honestly neither.
Check yourself
Check yourself
0 of 6 answered1.In Figure 4.1, why are the routers drawn with only three layers?
2.Which pair correctly separates forwarding from routing?
3.predictStep through Figure 4.2 and then Figure 4.3. What is different below the dashed line?
Look at the table, the lookup and the output interface in both.
4.The book imagines a network where humans configure every forwarding table by hand. What is the point of that thought experiment?
5.What exactly does the Internet's best-effort service guarantee?
6.predictATM offered guaranteed delivery, bounded delay and guaranteed bandwidth. Why did the Internet's weaker model win?
What to remember
- The network layer runs in every host and every router. The application and transport layers run only at the two ends. This is the structural difference that makes chapter 4 and chapter 5 necessary.
- Forwarding is local and fast; routing is global and slow. Nanoseconds against seconds, hardware against software. The data plane is forwarding and the control plane is routing, which is why chapter 4 is one and chapter 5 the other.
- The Internet’s network layer offers best-effort service: no guarantee of delivery, order, delay or bandwidth. A network delivering nothing would meet the definition. It was enough because capacity was provisioned generously and applications learned to adapt.