The Week 12 quiz with each question expanded, one question per page. The eight questions cover MAC addresses against IP addresses, ARP on one subnet and across a router, how a switch learns and forwards, switches against routers, the hidden-terminal problem in WiFi, handover in 5G, and the addresses on one datagram as it crosses a WiFi link, an access point and a router.
You unplug your laptop in a GW lab and connect it to the network at a coffee shop. Its network card uses the MAC address burned in at the factory. Which of the laptop's addresses are different at the coffee shop?
Background
Every network interface has two addresses. The IP address is used by routers to get a datagram to the right subnet and then to the right interface on it §4.3. The MAC address is used inside one subnet, to get a frame from one interface to the next §6.4.1. The two are built differently, and that difference decides this question.
Each box is one network interface on the subnet in the middle. Its top line is its IP address and its bottom line is its MAC address, written as six bytes in hexadecimal.
All four IP addresses begin with 137.196.7, the subnet's prefix: an IP address says which subnet an interface is attached to, the way a postal address says which street a house is on. The four MAC addresses have nothing in common. A MAC address is flat: the manufacturer burns it into the card from a block of addresses it bought from the IEEE, and it says nothing about where the card is.
Before answering, ask of each address: would it still be correct if this interface were attached to a different subnet?
B
An IP address depends on the subnet the interface is attached to, so the coffee shop's DHCP server hands the laptop a new one with the coffee shop's prefix §4.3. The MAC address is flat and burned into the card, so it moves with the laptop. The book calls this property portability §6.4.1.
If you answered A, you swapped the two. The MAC address is the one tied to the card; the IP address is the one tied to where the card is attached.
If you answered C, you may have been thinking of phones and laptops that pick a random MAC address for each network they join, for privacy. They do, but the question rules that out by saying the card uses its factory address. Joining a new network does nothing else to change a MAC address.
If you answered D, that is true of the MAC address but not of the IP address. If the laptop kept the GW address at the coffee shop, routers would deliver its traffic to GW's subnet, not to the coffee shop's.
§6.4.1 Link-Layer Addressing and ARP · video · knowledge checks · practice problems
Figures after the authors' Chapter 6 and Chapter 7 slides, copyright © 1996–2025 J.F. Kurose and K.W. Ross.
Hosts A and B are on the same subnet. A has a datagram for B, but B's MAC address is not in A's ARP table, so A sends an ARP query and B answers it. Where does each frame go at the link layer?
Background
To put a datagram in a frame, A needs the MAC address of the interface that should receive the frame. A knows B's IP address but not its MAC address. ARP, the Address Resolution Protocol, finds it, and A keeps the result in its ARP table so it does not have to ask again for every datagram §6.4.1.
An ARP message is itself carried in a frame, and every frame needs a destination MAC address. The question asks what that destination is for each of the two ARP messages. Think about what A knows when it sends the query, and what B knows when it sends the reply.
| IP address | MAC address | TTL |
|---|---|---|
137.196.7.88 | 0C-C4-11-6F-E3-98 | 13 min |
137.196.7.14 | 58-23-D7-FA-20-B0 | 20 min |
Each row maps the IP address of another interface on the same subnet to its MAC address. The TTL (time to live) is how long until the row is deleted; a new entry typically starts at about 20 minutes. A node that wants to send to an IP address with no row here has to send an ARP query first.
C
A cannot address the query to B's MAC address, because that is what it is asking for. So it sends the query to the broadcast address FF-FF-FF-FF-FF-FF, and every node on the subnet receives it. Only B, the owner of the IP address being asked about, answers. The query carried A's MAC address as its source, so B sends the reply to A alone §6.4.1. ARP needs no server: the owner of the IP address answers for itself.
If you answered A, you addressed the query to the very thing the query is trying to find out. A has no MAC address for B to put there.
If you answered B, you remembered that ARP uses broadcast, which is true of the query only. Once B has the query, it knows A's MAC address, so there is nothing to gain by interrupting every other node on the subnet with the reply.
If you answered D, you treated ARP like DNS, where a server looks a name up for you. No node keeps a directory of MAC addresses, and a router is involved in ARP only when the destination is on a different subnet, which is Q3.
§6.4.1 Link-Layer Addressing and ARP · video · knowledge checks · practice problems
Host A is 10.0.1.15 on subnet 10.0.1.0/24. Its first-hop router's interface on that subnet is 10.0.1.1. A has a datagram for host B at 10.0.7.40, on a different subnet. A's ARP table is empty. Which IP address does A put in its ARP query?
Background
A link-layer frame travels across one subnet only. A router sits where two subnets meet, with one interface on each. When a datagram reaches a router, the router takes it out of the frame it arrived in and sends it on in a new frame on the next subnet §6.4.1. A uses its IP address and subnet mask to tell that B is not on its own subnet, so it forwards to its first-hop router, as in Weeks 9 and 10 §4.3.
The question asks which IP address A asks about in the query, not where the query frame goes. Look at Figure 3 and ask which interfaces A's query can reach.
Boxes are interfaces and lines are links. The router has two interfaces: 10.0.1.1 on A's subnet, and another, whose address the question does not give, on B's subnet. The brackets show which interfaces belong to which subnet.
A frame A sends, including a broadcast, reaches only the interfaces under the left bracket. B is under the right one.
B
A's frame can only cross A's own subnet, so it must be addressed to the router's MAC address, and the MAC address A needs is the router's, not B's. So A asks for 10.0.1.1. The datagram inside the frame still has destination IP 10.0.7.40: the IP address says where the datagram is going in the end, and the MAC address says which interface takes it next §6.4.1.
If you answered A, you asked about the datagram's final destination. That is the natural guess, and the most common one. But the query is broadcast only on A's subnet, and no interface there owns 10.0.7.40, so nobody would reply. Even if one did, B's MAC address would be no use to A, because no frame from A can reach B.
If you answered C, you mixed up where the query frame goes with what it asks about. The query is sent to the broadcast MAC address, as in Q2, but the IP address inside it is the one whose MAC address A wants. 255.255.255.255 is not anyone's address.
If you answered D, A already knows its own MAC address, and the router does not know B's: B is on the router's other subnet, and the router only learns B's MAC address when it ARPs for it there. That is the second ARP exchange in Q8.
§6.4.1 Link-Layer Addressing and ARP · video · knowledge checks · practice problems
A switch has four ports. Its switch table has one entry: MAC address Z is on port 3. A frame from X to Y arrives on port 1. Select every action the switch takes.
Background
An Ethernet switch connects several links and moves frames between them. Its switch table says which port each MAC address can be reached through. Nobody configures this table: the switch builds it from the frames that pass through it, which is why it is called self-learning §6.4.3.
Every time a frame arrives, the switch does two separate things with it: it uses the frame's source address to update the table, and it uses the frame's destination address to decide where the frame goes. "Select all" here means checking both.
The switch is the shaded box; the small numbers are its ports. X is on port 1 and Z on port 3. Ports 2 and 4 lead to other parts of the network that the switch knows nothing about yet. The arrow is the frame arriving from X, addressed to Y. The table at right is the switch table as it stands before the frame arrives: one row, saying Z is reached through port 3.
Note that Y appears nowhere in the table.
A and B
Both are required, with nothing else. The switch learns from the source address: a frame from X just arrived on port 1, so X can be reached through port 1. Then it looks up the destination, Y, finds no entry, and floods: it sends the frame out every port except the one it arrived on §6.4.3. If Y replies, the switch will learn Y's port from that reply, and later frames to Y go out that port alone.
If you left out A, you answered only the forwarding half. Learning happens on every frame, whatever its destination, and it is the first thing the switch does.
If you ticked C, you flooded back out the arrival port. Whatever is on port 1 has already seen the frame, since that is where it came from, so sending it back there only wastes the link.
If you ticked D, you treated the one entry in the table as a default route. The entry says where Z is; it says nothing about Y, which could be through port 2, 3 or 4.
If you ticked E, you reached for ARP, which maps IP addresses to MAC addresses. The switch already has Y's MAC address, in the frame, and it never reads IP addresses at all. Flooding is how a switch handles a destination it has not learned.
§6.4.3 Link-Layer Switches · video · knowledge checks · practice problems
Select every statement that is true of an Ethernet switch but not of a router.
Background
Switches and routers both take in packets on one port and send them out another, using a forwarding table. They differ in which layer they work at, and so in what they read and how their tables get filled §6.4.3.
The item asks for statements true of a switch and false of a router. Each statement needs two checks, one for each device.
Each column is one device and each box is a layer that device implements. A packet goes down the sending host's stack, across the links, up through each device in the middle as far as that device's top layer, and back down.
The switch's top layer is the link layer, so it reads only frame headers, which carry MAC addresses. The router's top layer is the network layer, so it reads the datagram's header, which carries IP addresses.
A and B
Both are required, with nothing else. A: a switch learns its table from the frames it sees, as in Q4, while a router's table is computed by a routing algorithm such as link state or distance vector §5.2. B: a switch is transparent. Hosts do not know it is there and address their frames to the next host or router, never to the switch. A router is addressed directly: in Q3, A put the router's MAC address on its frame.
If you ticked C, that statement is true, but of both devices. Switches and routers are both store-and-forward: each receives a whole packet before sending any of it on §1.3.
If you ticked D, that describes a router. As Figure 5 shows, a switch never reads the IP header; it forwards on the destination MAC address.
If you left out B, it may have seemed too negative to be a property. Being invisible to the hosts is exactly what lets a switch be plugged into a network without anyone reconfiguring anything.
§6.4.3 Link-Layer Switches · video · knowledge checks · practice problems
Laptops A and C are on opposite sides of access point B. Each laptop can hear B, but A and C cannot hear each other. Both laptops listen before they send (carrier sensing). What goes wrong?
Background
A radio signal gets weaker the further it travels. Past some distance it is too weak for a receiver to detect at all §7.2. Carrier sensing means a sender listens first and only transmits if it hears no one else; it is how a shared channel avoids two senders talking at once. A collision matters where a frame is being received: two signals that arrive at the same receiver at the same time interfere there, and neither can be decoded.
The horizontal axis is position along a line, with A, the access point B and C marked on it. The vertical axis is how strong a signal is at each position, on a log scale. The solid line is A's signal, strongest at A and fading with distance; the dashed line is C's. The horizontal dashed line is the detection threshold: a radio can only hear a signal above it.
Read off three things before answering: is A's signal above the threshold at B? At C? And where are both signals above the threshold at once?
A
Carrier sensing only detects signals the sender itself can hear. In Figure 6, A's signal is below the threshold at C, so while A is sending, the channel seems idle to C and C starts sending too. Both signals are above the threshold at B, so both frames arrive there at once and interfere. A and C are hidden terminals to each other §7.2.
If you answered B, you put the collision in the wrong place. A's signal is too weak at C to be heard, and so too weak to interfere with anything C receives. The only place both signals are strong is B, which is also where both frames are meant to be received.
If you answered C, the setup rules it out: each laptop can hear B, so B's frames reach C as well as A. The trouble is with frames going to B, not from it.
If you answered D, an access point is not a repeater that echoes a signal while it is still arriving. It receives a whole frame and only then sends anything, so there is nothing for C to hear during the moment it decides whether to send.
The quiz stops at the problem. 802.11 works around it with CSMA/CA, which acknowledges every frame and waits a random time before sending, and with optional RTS/CTS, where the AP announces who may send so that hidden laptops hear the AP instead of each other §7.3. Neither was covered this term.
§7.2 Wireless Links and Network Characteristics · knowledge checks · practice problems
A phone is streaming a video when it hands over from base station 1 to base station 2. Which change makes the video's datagrams from the Internet arrive at base station 2 from then on?
Background
A 5G network splits its core into two kinds of function, the same control-plane and data-plane split met in Week 10 §7.4. The UPF (User Plane Function) is the data plane: it is where the phone's datagrams enter and leave the Internet. The AMF (Access and Mobility Management Function) and the SMF (Session Management Function) are the control plane: they keep track of where the phone is and tell the UPF what to do.
Between the UPF and the base station, the phone's datagrams travel in a tunnel: each one is wrapped in a second IP datagram addressed from the UPF to the base station. Handover is the moment the phone switches base station. The question asks what has to change so that datagrams follow it.
Solid lines carry the video's datagrams; the dashed line from the SMF is control messages, not data. The double line is the tunnel, which is how datagrams get from the UPF to the base station the phone is using. The phone is drifting toward base station 2, which is not yet carrying anything.
The phone's IP address is handed out by the network the UPF belongs to, so to the rest of the Internet the phone is "behind" the UPF wherever it is. Before answering, ask which line in the figure has to be redrawn after handover, and which component is told to redraw it.
B
Datagrams from the Internet always reach the phone's UPF, which tunnels them to whichever base station the phone is using. At handover, base station 2 tells the AMF and SMF that it is now serving the phone, and the SMF has the UPF move the far end of the tunnel to base station 2 §7.6. The phone keeps its IP address, so neither the video server nor any Internet router sees a change. In Figure 7, only the tunnel is redrawn.
If you answered A, that is what happens when a laptop moves to a new WiFi network, as in Q1. A phone that changed its IP address mid-video would break the connection to the server, since a connection is identified by the two ends' IP addresses and ports §3.2. 5G keeps the address stable precisely so this does not happen.
If you answered C, Internet routers forward on address prefixes, and the phone's address sits inside the operator's prefix, which leads to the UPF no matter where the phone is. Changing routes across the Internet for every phone at every handover would not scale §7.5.
If you answered D, that forwarding does happen, but only for a moment: while the handover is under way, base station 1 passes on datagrams it has already received. Once the tunnel is moved, datagrams go straight from the UPF to base station 2. Keeping the detour for the whole session would add delay and load on base station 1 for no reason.
§7.4 Cellular Networks: 4G and 5G · knowledge checks · practice problems · §7.6 Mobility Management in Practice · practice problems
Laptop H1 is on WiFi. Its access point, AP, connects by Ethernet to router R1. Server S is on R1's other subnet, also by Ethernet. H1 sends one datagram to S. H1's and R1's ARP tables start empty. Each MAC address is written as a single letter.
| Device | IP address | MAC |
|---|---|---|
| H1 | 10.1.1.20 | a |
| AP | (none used here) | b |
| R1, left interface | 10.1.1.1 | c |
| R1, right interface | 10.1.2.1 | d |
| S | 10.1.2.50 | e |
Reference:
1Draw every frame, from H1's first ARP query until the datagram reaches S. Draw each frame as an arrow from the device that sends it to the device that receives it. Number the arrows in the order they are sent and label each one "ARP query", "ARP reply" or "DATA", e.g. "1 ARP query".
Background
This is Q2 and Q3 put together, with one more device in the path. Two ideas from those questions do the work here. A frame only crosses one subnet, so the datagram needs a new frame on each subnet, and whoever sends that frame needs the next interface's MAC address. And a node only ARPs when it has a datagram in hand and no entry for the address it needs.
The AP is new. It is not a router: it has no IP address in play and starts no ARP of its own. It sits between H1 and R1 at the link layer, so every frame between them is received by the AP and sent again §7.3.
The same four devices as the timeline, drawn as a network instead of over time. The dashed line is the WiFi link and the solid lines are Ethernet. R1 is split down the middle into its two interfaces, each with its MAC letter and IP address. The brackets show which interfaces share a subnet.
Before drawing arrows, work out which MAC address H1 needs and which subnet it is on, then the same for R1. Each answer is one ARP exchange.
Nine frames
Black arrows are ARP frames; green arrows carry the datagram. S is not on H1's subnet, so H1 ARPs for its first-hop router's interface, 10.1.1.1, exactly as A did in Q3. The query is broadcast over the air and the AP relays it onto the Ethernet (1, 2); R1 replies with c, and the AP relays the reply back (3, 4). Now H1 can send the datagram, again through the AP (5, 6). R1 does not need S's MAC address until the datagram is in its hands, so its own ARP exchange on the right-hand subnet comes next (7, 8), and only then does the datagram reach S (9) §6.4.1. Each subnet resolves its own next hop.
If your first query asked for S, see Q3: nobody on H1's subnet owns 10.1.2.50, so it would go unanswered.
If you drew arrows straight from H1 to R1, you skipped the AP. H1's radio only reaches the AP; everything H1 sends to R1 is received by the AP and sent again on the Ethernet, so each such frame is two arrows.
If you put R1's ARP before the datagram arrived, R1 had no reason to send it yet. The reference box says a node ARPs only when it has a datagram to send, and R1 has nothing to send to S until arrow 6.
If you left out R1's ARP, you let H1's ARP exchange cover the whole path. It only told H1 one thing, c, on H1's subnet. R1 needs e, on a different subnet, and has to find it itself.
§6.4.1 Link-Layer Addressing and ARP · video · knowledge checks · practice problems
2Fill in the addresses on the frames that carry the datagram. Use the MAC letters from the table.
| Link | Address 1 / Dest MAC | Address 2 / Source MAC | Address 3 | Source IP | Destination IP |
|---|---|---|---|---|---|
| H1 → AP (WiFi) | |||||
| AP → R1 (Ethernet) | — | ||||
| R1 → S (Ethernet) | — |
Background
The three rows are arrows 5, 6 and 9 from part 1. Each row has two kinds of address. The MAC addresses belong to the frame, which is built new on each link. The IP addresses belong to the datagram inside it. Fill the IP columns by asking what the datagram says, and the MAC columns by asking, for that one link, who is transmitting and who is receiving.
A WiFi frame has three address fields where Ethernet has two, because over the air the AP is the receiver, but the AP is not where the frame is going next. The third address carries that §7.3.
Each box is one field of the frame header, in the order it is sent; the number under it is its size in bytes. The three shaded fields are the ones the quiz's reference box defines: address 1 is the device receiving the frame over the air, address 2 the device transmitting it, and address 3 the router interface the AP is attached to. Address 4 is used only when WiFi devices talk to each other without an AP, and can be ignored here.
| Link | Address 1 / Dest MAC | Address 2 / Source MAC | Address 3 | Source IP | Destination IP |
|---|---|---|---|---|---|
| H1 → AP (WiFi) | b | a | c | 10.1.1.20 | 10.1.2.50 |
| AP → R1 (Ethernet) | c | a | — | 10.1.1.20 | 10.1.2.50 |
| R1 → S (Ethernet) | e | d | — | 10.1.1.20 | 10.1.2.50 |
Over the air, the AP is the receiver (address 1) and H1 the transmitter (address 2). Address 3 carries c, the router's MAC address that H1 learned in arrows 1–4, so the AP knows where the frame goes next. On the Ethernet side the AP builds an ordinary Ethernet frame to c, but it keeps H1 as the source, because the AP only relays the frame; it did not originate it §7.3. R1 is a router, so it takes the datagram out and builds a new frame from its own right interface, d, to S, e §6.4.1. The IP addresses are the same on every row: only the frame changes hop by hop.
If row 1's address 1 was c, you addressed the WiFi frame to where it is ultimately going on this subnet. Over the air, though, the frame's receiver is the AP. The router's address belongs in address 3.
If row 2's source was b, you treated the AP like a router that sends its own frames. The AP is a link-layer relay, so the frame still comes from H1, a. This is where an AP differs from R1, which does put its own address, d, on row 3.
If row 3's source was a or c, you let a frame survive the router. R1 builds a brand-new frame on its right-hand subnet, sent from the interface on that subnet.
If any row's destination IP was 10.1.1.1, you put the next hop in the IP header. That is the mistake from Q3 in the other direction: the router appears only in MAC addresses, and the datagram names S from start to finish.
§7.3 WiFi: 802.11 Wireless LANs · knowledge checks · §6.4.1 Link-Layer Addressing and ARP · video
3One minute later, H1 sends a second datagram to S. Which arrows from part 1 happen again? Give their numbers.
Arrows:
Background
Go back to Figure 2: an ARP table keeps what a node has learned for a while. Ask what H1's and R1's ARP tables hold after the first datagram, and how long those entries last compared with one minute. Then ask which arrows in part 1 are there because of an ARP table that was empty.
5, 6 and 9
H1 and R1 kept the MAC addresses they learned, and ARP entries last much longer than a minute, typically about 20 minutes §6.4.1. So no ARP frames are sent, and the second datagram crosses the same three links in the same three frames as the first.
If you included 1–4 or 7–8, you had each datagram start from an empty ARP table. Caching the answer is the reason an ARP table exists; without it every datagram would cost two extra frames on every subnet.
§6.4.1 Link-Layer Addressing and ARP · video · knowledge checks · practice problems
GW CSCI 4431/6431 Computer Networks · Week 12 Link Layer Quiz