Network Layer Review Worksheet — Study Guide

This is the Week 11 review worksheet with each part expanded, one question per page. After each part comes the background it draws on, then a hint and the full answer, both hidden until you click them. Q1 compares four design choices from Weeks 8–10 with their alternatives. Q2 changes one thing about the network at a time and asks what follows.

Q1Why Is It Built This Way?

Each row of the grid is one design choice, compared with something the designers could have done instead. Read a finished row as a sentence: "They chose ___ over ___, which lets ___, at the cost of ___."

1Fill in what each choice buys and what it costs, compared with its alternative. The first row is done for you.

The choiceThe alternativeWhat it buysWhat it costs
Forwarding and routing are separate jobs: a router looks up each datagram in a table that routing filled in earlier.Work out the route for each datagram when it arrives.Forwarding can run in hardware, in nanoseconds per datagram. Routing can take seconds, in software.When a link changes, the table is out of date until routing catches up.
TCP senders infer congestion from loss and delay.Routers tell each sender how fast to send.
Addresses are given out in hierarchical blocks, and routers match on prefixes.Any host can have any address, and routers hold one entry per address.
Link state: every router learns the whole map and computes its own routes.Distance vector: each router tells only its neighbors its costs to each destination.

Background

Start with the example row, which Figure 1 draws as a picture. The router does two jobs at very different speeds. The data plane looks up each arriving datagram in a table and sends it out of a port. The control plane runs a routing algorithm that fills in that table §4.1. The example row says what splitting the jobs buys (fast lookups) and what it costs (a table that can be out of date).

Figure 1 · A router's control plane and data plane
control plane data plane Routing algorithm fills in the table: seconds, in software Local forwarding table header value port 0111 2 1001 3 0111 | data 1 2 3 output port look up each datagram: nanoseconds, in hardware

Everything above the dashed line is the control plane and everything below it is the data plane. A datagram arrives with the value 0111 in its header. The router finds 0111 in its local forwarding table and sends the datagram out of output port 2. The routing algorithm wrote that entry earlier, and the table is the only thing connecting the two jobs.

The other three rows work the same way. For each one, imagine the network built the other way. Which devices would have to do more work, and which would have to know more? What a choice "buys" is the work or knowledge it lets some device skip. What it "costs" is what the network gives up in exchange. Each row comes from an earlier week: TCP congestion control in Week 8 §3.7, addressing in Week 9 §4.3, and routing algorithms in Week 10 §5.2.

Hint
For each row, picture the alternative and ask who would have to do more work, and who would have to know more.
Bigger hint
Row 1 (TCP): when does a TCP sender find out about congestion, and what would every router have to track to tell it sooner? Row 2 (addresses): how many entries would a core router need with no blocks, and what happens to a customer's block when it changes ISP? Row 3 (link state): what does a link-state router have that a distance-vector router lacks, and how did it get it?
Answer
The choiceWhat it buysWhat it costs
TCP senders infer congestionRouters stay simple, with no per-connection state, and only end hosts need to change.The sender finds out late, after loss, and keeps probing for more, so its rate saws up and down.
Hierarchical blocks, prefix matchOne advertisement covers a whole block, so core tables stay small.An address says where a host is, so a customer who changes ISP renumbers or needs a more specific route that other routers must carry. Matching prefixes also takes special hardware such as a TCAM.
Link stateEach router computes its own table from the full map, so one rerun after a failure is correct, with no stale estimates, and a faulty router's errors do not pass through others' calculations.Flooding takes O(n²) messages, each router stores the whole map and runs the algorithm over all of it, and routes may oscillate if costs follow load.

Row 1, TCP inferring congestion. If routers told each sender how fast to send, every router would have to keep track of every connection through it and work out a fair rate for each. Under the choice the Internet made, a router just forwards datagrams and drops them when its buffer is full. The senders do the rest, using only what they can observe themselves: a timeout, three duplicate ACKs, or a rising RTT §3.7. The price is that a sender learns about congestion only once it has already happened. AIMD then raises the rate until the next loss and halves it, which is the sawtooth from Week 8.

The grid leaves out a middle ground. With Explicit Congestion Notification, routers set a bit in the IP header to warn of congestion before they drop, and the sender still decides how to react. The router marks a datagram but keeps no state about the connection §3.7.

Row 2, hierarchical blocks. Without blocks, a core router would need one entry for every host on the Internet. With them, an ISP announces one prefix for all of its customers, as Fly-By-Night does with 200.23.16.0/20 in Figure 3 under Q2 part 2 §4.3. The cost is that an address now encodes a position in the hierarchy. Move a customer and its address points to the wrong place. Matching the longest prefix, rather than an exact value, is also harder to do quickly, which is why routers use TCAMs §4.2.

Row 3, link state. A link-state router floods the costs of its own links, so every router ends up with the same complete map and runs Dijkstra on it §5.2.1. A distance-vector router knows only what its neighbors last told it, so after a failure it may act on estimates that are no longer true §5.2.2. Link state pays for its full map in messages, memory and computation at every router.

If you wrote "senders infer congestion" under what it buys, you restated the choice instead of naming what it gains. A buy must be something the alternative could not give you.

If you wrote "it uses Dijkstra" or another mechanism, you described how the choice works, not what it buys. Ask what a router can do, or skip doing, because of it.

If you wrote "inferring is cheaper" without saying for whom, the answer is incomplete. The saving is specifically that routers hold no per-connection state, while senders take on the work.

§3.7 TCP Congestion Control · video · knowledge checks · practice problems
§4.3 The Internet Protocol · video · knowledge checks · practice problems
§5.2 Routing Algorithms · video 5.2a · video 5.2b · knowledge checks · practice problems

2Each statement is false. Rewrite it so that it is true.

False statementTrue version
Longest prefix match finds the shortest path to the destination.
An IP address identifies a computer.
Distance vector is better than link state because it needs less computation.

Background

Each statement is close to something true but mixes up two ideas. To fix one, work out which two ideas it confuses and say each one correctly. For the first statement, use Figure 1: decide which side of the dashed line longest prefix match happens on, and which side picks the path. For the third, remember that Q1 part 1 asked what each routing algorithm buys and what it costs. A statement that calls one of them simply "better" is ranking a trade-off.

Hint
What does each statement confuse? Longest prefix match runs in which plane?
Bigger hint
An IP address is attached to what, and what happens to it when your laptop moves to another network?
Answer

Longest prefix match finds the most specific table entry that matches the destination. The path was chosen earlier, by routing, which filled in the table. Match runs in the data plane and path-finding in the control plane: in Figure 1, the lookup happens below the dashed line, and the path was worked out above it.

An IP address identifies an interface, at a location in the network's hierarchy §4.3. A router has one per interface, and a laptop gets a new one when it joins another network.

If you wrote "identifies a device on a network", it still names the device. A router with three interfaces has three addresses, and a laptop that moves from home to campus changes its address while staying the same computer. This worksheet leaves out NAT, where many devices share one public address §4.3.

Neither is simply better. Distance vector does less at each router per update, but convergence time varies, it can loop and count to infinity, and one router's errors spread through everyone's tables. Link state needs more messages and computation, in exchange for a full map §5.2.

If you wrote "link state is better because…", you made the same mistake in reverse. The statement is false because it ranks two trade-offs, not because it picked the wrong winner.

§4.1 Network Layer Overview · video · knowledge checks
§4.2 What's Inside a Router? · video · knowledge checks · practice problems

DDiscussion. Pick a row of the grid from part 1. Describe a network where the alternative would be the better choice. What about that network changes the trade-off?

Background

Each trade-off in the grid depends on what the Internet is like: millions of routers, run by thousands of separate operators, connecting billions of hosts. Choose a network where one of those facts is different, such as one owner or a small number of hosts, and check whether the cost in your row still matters.

Answer

Any row works if the network's traits change the trade-off. One operator owning every router, as in a data center, makes routers-tell-senders practical, since every router can be upgraded together. A small LAN can use flat addresses, because a few hundred entries are cheap (Ethernet's MAC addresses, Week 15) §6.4. A small network of limited routers may prefer distance vector, since the map's cost matters more than convergence.

Figures after the authors' Chapter 4 slides, copyright © 1996–2025 J.F. Kurose and K.W. Ross.

Q2What If…?

Parts 1–3 each change one thing about the network. Say what follows, and why.

1Suppose every router keeps a copy of each datagram until the next router acknowledges it, so no link ever loses a datagram. Could TCP now drop its ACKs and retransmissions? What new work do the routers take on?

Background

Today, only the two ends of a connection check that data arrived: the receiver's TCP sends ACKs, and the sender retransmits whatever is not acknowledged §3.5. Part 1 adds a second layer of checking inside the network, one hop at a time. Figure 2 draws both on the same path.

One caution about the wording. The question says "so no link ever loses a datagram", which makes it sound as if loss happens on links. On the wired Internet it mostly does not. Most datagrams are lost when a router's buffer is full and it has nowhere to put them §4.2. So read the scheme for what it does: a router holds a copy until the next router acknowledges it, and resends if no acknowledgment comes. Then work out exactly which losses that catches and which it misses.

Figure 2 · Checking delivery end to end, or at every hop
End to end: only the laptop and the server check delivery (TCP) Laptop First-hop router Core router Web server 200.23.18.45 128.119.245.12 ACK from the web server to the laptop Hop by hop: each router checks delivery to the next device (part 1) Laptop First-hop router Core router Web server ACK ACK ACK

Both rows show the same path: a laptop, its first-hop router, a core router in the middle of the Internet (the dashed link stands for the routers in between), and the web server. Arrows below a row are acknowledgments. In the top row, which is how the Internet works today, the server's TCP acknowledges what the laptop sent. In the bottom row, the change in part 1, each device acknowledges each datagram to the one before it.

Each hop's ACK is sent once the next device has received the datagram. Before you answer, follow one datagram through the core router: what happens to it after the core router has sent its ACK back, but before the datagram leaves? Whether checking at the ends or in the network is the better design is a classic question, known as the end-to-end argument §4.5.

Hint
Once the next router acknowledges a datagram, who holds the only copy, and what can still happen to it there?
Bigger hint
Think about the next router's full output queue, a crash, and a bug that corrupts memory. Would acknowledging later, only after forwarding, close every gap?
Answer

No

What the scheme catches. It catches more than link loss. If the core router's input buffer is full and it drops the datagram, it never sends an ACK. The first-hop router times out and resends. So the scheme covers the link and drops at the next router's input.

What it misses. Once the core router has sent its ACK, the first-hop router throws away its copy, so the core router holds the only one. It can still drop that copy from a full output queue, which is where routers usually drop packets §4.2. It can also crash or corrupt the datagram in memory, and none of these is ever detected.

Acknowledging later does not fix it. Suppose each router sends its ACK only after it has forwarded the datagram, so there is always a router holding a copy. That narrows the gap but cannot close it. A router can still crash or corrupt the datagram between steps, and a routing error can deliver it reliably to the wrong place. Nothing checks the last step, from the server's network interface up to its application. Only the ends can confirm that the data arrived, which is the end-to-end argument §4.5.

What the routers take on. Each router buffers every unacknowledged datagram and runs per-hop ACKs and timers: the RDT lab, run on every link. There is a second cost too. If routers never dropped datagrams, TCP would lose loss as its congestion signal §3.7, and congestion would back up from router to router instead. Hop-by-hop recovery can still help performance on a lossy link, such as WiFi, but it cannot replace TCP's.

If you answered yes, because nothing gets lost, you took the question's "no link ever loses a datagram" to mean nothing is lost anywhere. The datagram still sits in each router's memory and queues after it has been acknowledged, and loss can happen there.

If you answered yes, if routers acknowledge only after forwarding, you closed the full-buffer gap but not the others. Crashes, memory corruption, misrouting and the last step into the server's application still need a check at the ends.

§4.5 Middleboxes and Summary · video · knowledge checks
§3.4 Principles of Reliable Data Transfer · video · knowledge checks

2In Week 9, Organization 1 kept its addresses when it moved to a new ISP, so that ISP advertised 200.23.18.0/23 separately. Suppose every organization on the Internet did this. What happens to core routers' forwarding tables? Organization 1 gets the benefit: who pays the cost?

Background

Figure 3 is the Week 9 example, before and after Organization 1 moves §4.3.

Figure 3 · Route aggregation, before and after Organization 1 changes ISP
Before: Organization 1 is a customer of Fly-By-Night-ISP Org 0 200.23.16.0/23 Org 1 200.23.18.0/23 Org 2 200.23.20.0/23 ⋮ Org 7 200.23.30.0/23 Fly-By-Night-ISP ISPs-R-Us Internet "200.23.16.0/20" "199.31.0.0/16" After: Organization 1 moves to ISPs-R-Us and keeps its block Org 0 200.23.16.0/23 Org 1 200.23.18.0/23 Org 2 200.23.20.0/23 ⋮ Org 7 200.23.30.0/23 Fly-By-Night-ISP ISPs-R-Us Internet "200.23.16.0/20" "199.31.0.0/16" "or 200.23.18.0/23"

Both panels have the same layout. On the left are four of Fly-By-Night's eight customer organizations, each with a /23 block: 512 addresses that share their first 23 bits. A quoted label on an ISP's link to the Internet is that ISP's advertisement, meaning "send me anything with addresses beginning with this prefix". Fly-By-Night's /20 covers 200.23.16.0 through 200.23.31.255, which is all eight blocks, so the rest of the Internet needs one entry for all eight organizations.

The only differences in the lower panel are the bold link and the bold advertisement. Organization 1 now connects through ISPs-R-Us but keeps 200.23.18.0/23, so ISPs-R-Us announces that block on its own. A router holding both entries sends Organization 1's traffic to ISPs-R-Us, because longest prefix match prefers the /23.

To answer the question, count entries. Count what a router elsewhere on the Internet stores for these eight organizations in each panel. Then imagine every organization on the Internet making the same move.

Hint
How many entries does a core router need for an ISP's customers before the change, and how many after?
Answer

Tables grow; every core router pays

In Figure 3, one Fly-By-Night entry covers eight organizations. If every organization kept its block when it moved, tables would grow from about one entry per ISP to one entry per organization, so hierarchy's saving is lost §4.3. Every core router pays, in table space and lookup hardware §4.2, and in updates for changes that have nothing to do with it. The organization gets the benefit, but routers everywhere bear the cost.

If you answered that only the new ISP pays, look at where the /23 goes in Figure 3: ISPs-R-Us advertises it to the whole Internet, so every router that hears it has to store it.

If you answered that longest prefix match stops working, it still works. Longest prefix match is what makes the /23 override the /20 in the first place. The problem is the number of entries, not the lookup rule.

§4.3 The Internet Protocol · video · knowledge checks · practice problems

3A compromised router lies in its routing messages to pull in traffic. How far can the lie reach under link state? Under distance vector? Why do they differ?

Background

Recall from Week 10 what each kind of router puts in its routing messages. A link-state router floods the costs of its own links to every router. Each router then assembles the full map and runs Dijkstra on it itself §5.2.1. A distance-vector router sends its neighbors its distance vector: its current estimate of the cost to every destination. Each neighbor plugs those numbers into the Bellman-Ford equation to update its own vector, then sends that on §5.2.2.

A lying router can put false numbers in whichever message it sends. Follow those numbers. Which routers use them, and does anything a router computes from them get passed along again?

Hint
What does each kind of router actually advertise, and what do other routers do with it?
Bigger hint
In distance vector, a neighbor's number goes straight into your own vector.
Answer

Link state: limited. Distance vector: spreads.

Link state: it can misreport only the costs of its own links, and each router still computes its own table, so the lie is limited to what those links affect §5.2.1. Distance vector: it can claim a low-cost path to every destination ("black-holing"). Neighbors build that number into their own vectors and pass it on, so the error spreads through the network §5.2.2. They differ because distance vector routers use each other's results, while link-state routers share only raw link costs.

If you answered that both are equally bad, compare what each router copies. A link-state router copies a neighbor's link costs and does its own computation, while a distance-vector router copies a neighbor's finished answer.

If you answered that link-state routers are immune, they are not. Every router believes the liar's report about its own links, so traffic that would cross those links can still be pulled in.

§5.2 Routing Algorithms · video 5.2a · video 5.2b · knowledge checks · practice problems

4A laptop fetches a page from a web server, across many routers. Mark ✓ for each device that needs this fact to handle the laptop's first request. A row can have any number of marks, including none.

FactLaptopFirst-hop routerCore routerWeb server
The laptop's IP address
The server's IP address
The laptop's TCP congestion window
Which outgoing link the core router uses for this destination
Whether a given datagram reached the server
The complete list of routers on the path

Background

The four devices are the ones in Figure 2, so picture the laptop's first datagram crossing that path. The question asks which devices need each fact. A device needs a fact if it would have to use that fact to do its own job for this request. A device can carry or see a fact without needing it. For each cell, ask what that device does with the request: the laptop sends it, the routers forward it, and the server answers it. Then ask whether that job uses the fact.

Hint
What would each device do with this fact?
Bigger hint
To forward a datagram, a router looks up the destination and picks an outgoing link. It does not track TCP connections.
Answer
FactLaptopFirst-hop routerCore routerWeb server
The laptop's IP address✓✓
The server's IP address✓✓✓✓
The laptop's TCP congestion window✓
Which outgoing link the core router uses for this destination✓
Whether a given datagram reached the server✓✓
The complete list of routers on the path

Forwarding uses only the destination and the next hop, as in Figure 1. Routers see the laptop's address without needing it; the server needs it to reply. The congestion window belongs to the sender, and proof of delivery to the ends, via the ACK in the top row of Figure 2. No one needs the whole path, not even a link-state router that could compute it.

If you ticked the routers for the laptop's address because it is in the header, you marked who sees the fact rather than who needs it. The routers carry the laptop's address on the way out, but they never use it to make a decision. The discussion below turns on that difference.

If you ticked the routers for the congestion window, recall Q1 row 1: routers keep no per-connection state. The window lives only in the sender's TCP.

If you ticked a link-state router for the complete path, it could compute the whole path from its map, but forwarding uses only the next hop.

§4.1 Network Layer Overview · video · knowledge checks
§3.7 TCP Congestion Control · video · knowledge checks

DDiscussion. A router needs only the destination address to forward a datagram, yet the source address rides along past every router on the path. Why not leave it out? If you did not want the web server to learn your address, what could you do instead?

Background

This item follows on from part 4. In part 4 you decided which devices need the laptop's address. Here you ask why that address travels in every datagram, and what it would take to keep it from the server. Project 2 is built on the answer.

Hint
Look back at the first row of the part 4 table: which device needs the laptop's address, and what does it use it for? If your address were not in the datagram, what address would the server reply to?
Answer

The server needs the source address to reply, so it cannot simply be left out. Sending through a relay works: the server replies to the relay's address, and the relay passes the reply back. But now the relay knows who you are and where you are going. Splitting that knowledge across two relays, so that neither knows both, is Project 2.

GW CSCI 4431/6431 Computer Networks · Week 11 Network Layer Review Worksheet

1 / 2