What this topic covers
7 subtopics- Subnetting18
- CIDR8
- IPv4 basics7
- Masks5
- Forwarding3
- Classful addressing2
- VLSM2
- Beginner 15
- Intermediate 15
- Advanced 15
About this topic
Subnetting is the most common networking topic in placement tests and a reliable GATE numerical: find the network and broadcast address, count usable hosts, choose a mask, summarise routes or pick the forwarding entry by longest-prefix match. Every answer here was computed with Python's own ipaddress module. Usable hosts in a subnet = 2^(32 − prefix) − 2, because the all-zeros (network) and all-ones (broadcast) addresses are reserved.
Free preview
Sample questions
Try each one first, then open the answer for the explanation and why the other options are wrong.
Which of these are private (RFC 1918) addresses?
Show answer and explanation
Explanation
The private blocks are 10.0.0.0/8, 172.16.0.0/12 (172.16 – 172.31) and 192.168.0.0/16. 172.32.0.1 is just outside the /12; 11.0.0.1 is public.
192.168.5.0/24 must be split into equal subnets that each hold at least 50 hosts. What is the maximum number of such subnets?
The answer is a number – work it out, then open the solution.
Show answer and explanation
Explanation
50 hosts need 6 host bits (2⁶ − 2 = 62), so the prefix is /26: 2² = 4 subnets of 62 hosts.
172.16.0.0/16 uses the subnet mask 255.255.255.224. How many subnets does that give?
The answer is a number – work it out, then open the solution.
Show answer and explanation
Explanation
The mask is /27: 27 − 16 = 11 subnet bits → 2¹¹ = 2048 subnets, each with 30 usable hosts.