CS Atlas GATE 2027
Computer Networks course
0 / 90 complete

Computer Networks/Phase 3 · Network Layer

Chapter review L3.3 · Item 52 of 90

Network Address Translation (NAT & NAPT)

Read at your own pace. Try the questions before opening the answers.

On this page

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

  1. 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?

    1. 172.16.0.0/16
    2. 172.16.0.0/12
    3. 172.16.0.0/8
    4. 172.16.0.0/14
  2. MSQ · 2 marks

    Which of the following IPv4 addresses belong to an RFC 1918 private address block?

    1. 10.0.200.1
    2. 172.15.255.254
    3. 172.31.0.1
    4. 192.168.255.1
  3. 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?

    1. Src 198.51.100.10:80, Dst 192.168.1.5:4100
    2. Src 198.51.100.10:80, Dst 203.0.113.9:6200
    3. Src 203.0.113.9:6200, Dst 198.51.100.10:80
    4. Src 198.51.100.10:6200, Dst 203.0.113.9:80
  4. 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.

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

  6. 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?

    1. 7 bytes
    2. 8 bytes
    3. 28 bytes
    4. 0 bytes
  7. 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.

  8. 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?

    1. Source IPv4 Address
    2. Time to Live (TTL)
    3. Header Checksum
    4. Destination IPv4 Address

Answer key

Try the questions first. Open when you are ready to check.
  1. 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.

    Review lesson 3.3

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

    Review lesson 3.3

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

    Review lesson 3.3

  4. 16 — A port number is a 16-bit unsigned integer (0 to 65535).

    Review lesson 3.3

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

    Review lesson 3.2.2

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

    Review lesson 3.2.1

  7. 256 — 2²⁴⁻¹⁶ = 2⁸ = 256 blocks of /24 (192.168.0.0/24 through 192.168.255.0/24).

    Review lesson 3.1.4

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

    Review lesson 3.3

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.