Introduction
15 GATE-pattern questions (1-mark and 2-mark; MCQ, MSQ, and NAT) covering all of Phase 3: IPv4 addressing, subnetting, CIDR & route aggregation, Longest Prefix Match, VLSM, IPv4 header & fragmentation, NAT/NAPT, Distance Vector, and Link State routing.
Practice questions
- MCQ · 1 mark
Which of the following IPv4 addresses is a valid Class B directed broadcast address (assuming default classful masks)?
- 172.25.255.255
- 192.168.1.255
- 255.255.255.255
- 126.255.255.255
- NAT · 1 mark
A network has subnet mask 255.255.254.0. How many usable host addresses exist in this subnet?
Write your answer before opening the key.
- MCQ · 2 marks
An IPv4 host has address 150.80.100.50 and subnet mask 255.255.224.0. What are the subnet network address and directed broadcast address of its subnet?
- 150.80.96.0 and 150.80.127.255
- 150.80.64.0 and 150.80.95.255
- 150.80.100.0 and 150.80.100.255
- 150.80.96.0 and 150.80.96.255
- MCQ · 2 marks
An ISP holds four contiguous /23 blocks: 200.50.8.0/23, 200.50.10.0/23, 200.50.12.0/23, and 200.50.14.0/23. What is their single aggregated CIDR prefix?
- 200.50.8.0/20
- 200.50.8.0/21
- 200.50.0.0/20
- They cannot be aggregated into one prefix.
- MCQ · 2 marks
A router forwarding table contains: (1) 192.168.32.0/19 → E0, (2) 192.168.48.0/20 → E1, (3) 192.168.52.0/22 → E2, (4) 0.0.0.0/0 → E3. Which interface is chosen for a packet with destination IP 192.168.56.10?
- E0
- E1
- E2
- E3
- NAT · 2 marks
Using largest-first VLSM on the block 192.168.0.0/24, we allocate subnets for three departments requiring 60, 28, and 12 usable hosts respectively. What is the 4th octet of the directed broadcast address of the second subnet (for 28 hosts)?
Write your answer before opening the key.
- NAT · 1 mark
An IPv4 datagram has Total Length = 1200 bytes and carries 1164 bytes of data payload. What is the decimal value of its 4-bit HLEN field?
Write your answer before opening the key.
- NAT · 2 marks
An IPv4 datagram of Total Length 2500 bytes (20-byte header, 2480-byte payload) crosses a link with MTU = 700 bytes. What is the Fragment Offset of the 4th (last) fragment?
Write your answer before opening the key.
- NAT · 2 marks
A datagram carrying 3000 bytes of payload (plus a 20-byte header) traverses Link A (MTU = 1500 B) and then Link B (MTU = 520 B). How many fragments arrive at the final destination?
Write your answer before opening the key.
- MSQ · 2 marks
Which of the following statements about IPv4 datagrams and fragmentation are TRUE?
- If the last fragment of a datagram has Offset = 150 and Total Length = 220 (with HLEN = 5), the original datagram carried 1400 bytes of payload.
- Every router along a path reassembles fragments before forwarding them to the next hop.
- If any single fragment of an IPv4 datagram is lost in the network, the entire original datagram fails to be delivered to the upper layer by IP.
- In every non-final fragment, (Total Length − 4 × HLEN) must be divisible by 8.
- MCQ · 1 mark
Which header fields are modified by a NAPT router on an INCOMING reply packet arriving from an external server on the WAN and forwarded to an internal host on the LAN?
- Source IP, Source Port, TTL, and Checksums
- Destination IP, Destination Port, TTL, and Checksums
- Only the Destination MAC address
- Only the Source IP and Destination IP
- NAT · 2 marks
Router X has direct links to A (cost 2), B (cost 5), and C (cost 3). Initially A, B, C advertise distances 4, 2, 5 to destination D (so X routes to D via A with cost 6). In the next update, A advertises distance 8, B advertises 2, and C advertises 3. What is X’s new shortest distance to D?
Write your answer before opening the key.
- MCQ · 2 marks
Why does Split Horizon with Poison Reverse fail to prevent count-to-infinity in a 3-router loop (such as a triangle A–B–C where C connects to D and link C–D fails)?
- Because Poison Reverse only works when infinity = 32.
- Because A routes to D via C (not via B), so A does not poison its advertisement of D to B; B then routes via A while A’s route through C is actually dead.
- Because 3-router networks use Dijkstra instead of Bellman-Ford.
- Because Split Horizon disables TTL decrementing.
- NAT · 2 marks
A 5-router network has undirected edge costs: (S,A)=3, (S,B)=7, (A,B)=2, (A,C)=6, (B,C)=1, (B,D)=5, (C,D)=2. Using Dijkstra’s algorithm from source S, what is the shortest-path cost from S to D?
Write your answer before opening the key.
- MSQ · 2 marks
Which of the following correctly compare Distance Vector (DV) and Link State (LS) routing?
- DV exchanges vectors only with direct neighbours, whereas LS floods link-state packets to all routers in the area.
- In LS, sequence numbers prevent LSPs from circulating forever during flooding.
- RIP is a Link State protocol, whereas OSPF is a Distance Vector protocol.
- Once all LSPs have arrived, every router in LS computes a loop-free shortest-path tree locally using Dijkstra’s algorithm.
Answer key
Try the questions first. Open when you are ready to check.
- A — 172 is in 128–191 (Class B, 16 net bits, 16 host bits). Setting all 16 host bits to 1 gives 172.25.255.255.
- B: 192.168.1.255 is a Class C directed broadcast.
- C: 255.255.255.255 is the limited broadcast address.
- D: 126 is Class A.
- 510 — 254 = 11111110₂ → 23 ones (/23), leaving h = 32 − 23 = 9 host bits. Usable hosts = 2⁹ − 2 = 512 − 2 = 510.
- A — In the 3rd octet, stride Δ = 256 − 224 = 32. Multiples of 32 are 0, 32, 64, 96, 128. Since 96 ≤ 100 < 128, the subnet starts at 150.80.96.0 and its broadcast address is 150.80.127.255.
- B: 64..95 is the previous subnet.
- C: Treats the mask as /24 instead of /19.
- D: Forgets that the 3rd octet has 5 host bits.
- B — Four = 2² contiguous /23 blocks cover 8 octets in the 3rd byte (8..15). Since the starting 3rd octet (8) is divisible by 8, they merge into a single /(23 − 2) = /21 block: 200.50.8.0/21.
- A: /20 would be 16 octets (and 8 is not divisible by 16).
- C: Starts at .0.0, which includes extra addresses .0..7.
- D: 8 is divisible by 8, so alignment holds.
- B — Check 3rd octet = 56: (3) /22 (stride 4) covers 52..55 (no match). (2) /20 (stride 16) covers 48..63 (matches, n=20). (1) /19 (stride 32) covers 32..63 (matches, n=19). Longest matching prefix is /20 → E1.
- A: Matches (/19), but /20 is a longer match.
- C: /22 only covers 52..55, so 56 does not match.
- D: Default route (/0) loses to /19 and /20.
- 95 — 60 hosts → size 64 (.0/26, covering 0..63). 28 hosts → size 32 (.64/27, covering 64..95). Thus the broadcast address of the second subnet is 192.168.0.95 (4th octet = 95).
- 9 — Header length = 1200 − 1164 = 36 bytes. Since HLEN counts 4-byte words, HLEN = 36 / 4 = 9.
- 255 — MTU − H = 700 − 20 = 680 B, which is divisible by 8 (680 / 8 = 85). After 3 fragments of 680 B each (3 × 680 = 2040 B), the 4th fragment starts at byte 2040 → Offset = 2040 / 8 = 255.
- 7 — Link A (d_max = 1480): splits 3000B into 1480B, 1480B, and 40B (3 fragments). Link B (520 − 20 = 500 → d_max = ⌊500/8⌋×8 = 496B): each 1480B fragment splits into ⌈1480/496⌉ = 3 sub-fragments (496, 496, 488), while the 40B fragment (len 60 ≤ 520) passes unchanged. Total = 3 + 3 + 1 = 7 fragments.
- ACD — Original payload = 150×8 + (220 − 20) = 1200 + 200 = 1400 B; losing one fragment causes reassembly timeout of the whole datagram; non-final payload must be a multiple of 8. Reassembly happens ONLY at the final destination host.
- B: Routers never reassemble fragments; only the destination host reassembles.
- B — On incoming reply packets (WAN → LAN), the NAPT router looks up the destination NAT port and rewrites the Destination IP and Destination Port to the internal host’s private IP and port, decrements TTL, and recomputes the IPv4 and transport checksums.
- A: Source IP and Source Port are rewritten on outgoing packets (LAN → WAN).
- C: That is a normal L2/L3 hop without NAT.
- D: The port number and checksums must also be updated.
- 6 — Recompute all three branches: via A = 2 + 8 = 10; via B = 5 + 2 = 7; via C = 3 + 3 = 6. Minimum is 6 (now via C).
- B — Poison Reverse only poisons advertisements sent to the direct next hop (C). Since A’s next hop is C, A still advertises its old finite cost to B; when C–D breaks, B picks A (which goes via C) and A–B–C count to infinity.
- A: Infinity value only changes when the loop stops, not whether it forms.
- C: DV can run on any graph.
- D: TTL is a data-plane header field unrelated to Split Horizon.
- 8 — S → A (3) → B (+2 = 5) → C (+1 = 6) → D (+2 = 8), beating S → A → B → D (10) and S → A → C → D (11).
- ABD — DV is neighbour-only, LS floods LSPs with sequence numbers and runs Dijkstra locally. RIP is DV and OSPF is LS.
- C: Reversed: RIP is Distance Vector, OSPF is Link State.