Chapter recap
Chapter 3.3 showed how RFC 1918 private blocks (10/8, 172.16/12, 192.168/16) and Port-Based NAT (NAPT) allow hundreds of internal hosts to share a single public IPv4 address by rewriting (IP, Port) pairs and checksums at the border router.
Practice questions
- MCQ · 1 mark
What is the exact CIDR prefix for the Class B private IPv4 address range 172.16.0.0 – 172.31.255.255?
- 172.16.0.0/16
- 172.16.0.0/12
- 172.16.0.0/8
- 172.16.0.0/14
- MSQ · 2 marks
Which of the following IPv4 addresses belong to an RFC 1918 private address block?
- 10.0.200.1
- 172.15.255.254
- 172.31.0.1
- 192.168.255.1
- MCQ · 2 marks
Host 192.168.1.5 (port 4100) sends a packet to server 198.51.100.10 (port 80) via a NAPT router with public IP 203.0.113.9, which assigns external port 6200. What are the Source and Destination IP:Port on the reply arriving AT the NAPT router’s WAN interface from the server?
- Src 198.51.100.10:80, Dst 192.168.1.5:4100
- Src 198.51.100.10:80, Dst 203.0.113.9:6200
- Src 203.0.113.9:6200, Dst 198.51.100.10:80
- Src 198.51.100.10:6200, Dst 203.0.113.9:80
- NAT · 1 mark
How many bits long is the port number identifier used in a NAPT translation table?
Write your answer before opening the key.
- NAT · 2 marks
An IPv4 datagram carrying 3000 bytes of payload (plus a 20-byte header) is fragmented over a link with MTU = 1500 bytes. What is the Total Length (in bytes, including header) of the 3rd (last) fragment?
Write your answer before opening the key.
- MCQ · 1 mark
If the 4-bit HLEN field of an IPv4 packet contains binary 0111, how many bytes of options are present in the header?
- 7 bytes
- 8 bytes
- 28 bytes
- 0 bytes
- NAT · 1 mark
How many /24 blocks are contained inside the private address block 192.168.0.0/16?
Write your answer before opening the key.
- MSQ · 2 marks
When a NAPT router forwards a packet from an internal private host to the public Internet, which of the following fields in the IPv4 header are modified by the router?
- Source IPv4 Address
- Time to Live (TTL)
- Header Checksum
- Destination IPv4 Address
Answer key
Try the questions first. Open when you are ready to check.
- B — 16 to 31 in the 2nd octet spans 16 values (00010000₂ to 00011111₂), so the first 8 + 4 = 12 bits are fixed → 172.16.0.0/12.
- A: /16 covers only 172.16.x.y.
- C: /8 would cover 172.0.0.0 – 172.255.255.255.
- D: /14 covers only 172.16..19.x.y.
- ACD — 10.0.200.1 is in 10/8; 172.31.0.1 is in 172.16/12 (16..31); 192.168.255.1 is in 192.168/16. 172.15.255.254 has 2nd octet 15 < 16, so it is public.
- B: 172.15.x.y is just below 172.16.0.0/12.
- B — The external server only knows the NAPT router’s public address and port (203.0.113.9:6200), so its reply has Src 198.51.100.10:80 and Dst 203.0.113.9:6200 before the NAPT router translates it back.
- A: That is the packet AFTER the NAPT router translates it onto the LAN.
- C: That was the outgoing request.
- D: Swaps the server and client port numbers.
- 16 — A port number is a 16-bit unsigned integer (0 to 65535).
- 60 — d_max = 1480 B. Frag 1 carries 1480 B, Frag 2 carries 1480 B (total 2960 B). Frag 3 carries the remaining 3000 − 2960 = 40 B of data + 20 B header = 60 bytes.
- B — HLEN = 0111₂ = 7 → Total header length = 7 × 4 = 28 bytes. Subtracting the 20-byte fixed header leaves 8 bytes of options.
- A: 7 is HLEN in words.
- C: 28 bytes is the total header length including the 20B base header.
- D: 0 bytes of options corresponds to HLEN = 5.
- 256 — 2²⁴⁻¹⁶ = 2⁸ = 256 blocks of /24 (192.168.0.0/24 through 192.168.255.0/24).
- ABC — An outgoing packet through a NAPT router has its Source IP replaced by the public IP, its TTL decremented by 1, and its Header Checksum recomputed. The Destination IP (the external server) is not changed.
- D: Destination IP is only modified on incoming replies from the server.