Subnetting and IP Addressing: Rules and 10 Solved MCQs

Computers · 2026-10-18 · 7 min read

Subnetting questions are among the most mechanical in networking: once you know the rules, every question is arithmetic. They appear in the computer-science part of the JKSSB SI Telecom paper and in many IT exams.

Classes and default masks

  • Class A: first octet 1 to 126, default mask 255.0.0.0 (/8)\n- Class B: first octet 128 to 191, default mask 255.255.0.0 (/16)\n- Class C: first octet 192 to 223, default mask 255.255.255.0 (/24)\n- Class D: 224 to 239 (multicast)

A fast method for network and broadcast addresses

  1. Find the block size = 2^(host bits in the changing octet). For /26 the last octet has 6 host bits, so the block size is 64\n2. The network address is the largest multiple of the block size that is not above the host's value\n3. The broadcast address is the next block start minus 1\n4. Example: 192.168.1.77/26: blocks start at 0, 64, 128, 192, so the network is 192.168.1.64 and the broadcast is 192.168.1.127

Useful numbers to remember

  • /24: 254 hosts · /25: 126 · /26: 62 · /27: 30 · /28: 14 · /29: 6 · /30: 2\n- /26 mask: 255.255.255.192 · /27: .224 · /28: .240\n- Private ranges: 10.0.0.0/8, 172.16.0.0 to 172.31.255.255 and 192.168.0.0/16

Worked examples

  • Network and broadcast: for 192.168.1.77/26, the block size is 64. The network address is 192.168.1.64 and the broadcast address is 192.168.1.127. The usable range is .65 to .126, which is 62 hosts
  • Hosts per subnet: a /27 has 5 host bits, so 2⁵ − 2 = 30 usable hosts
  • Number of subnets: borrowing 3 bits from a /24 gives 2³ = 8 subnets, with the mask /27, which is 255.255.255.224
  • Choosing a prefix: to accommodate 50 hosts you need h host bits where 2^h − 2 ≥ 50. Since 2⁶ − 2 = 62, h = 6 and the prefix is /26

Common subnet masks

  • /25: 255.255.255.128, 126 hosts
  • /26: 255.255.255.192, 62 hosts
  • /27: 255.255.255.224, 30 hosts
  • /28: 255.255.255.240, 14 hosts
  • /29: 255.255.255.248, 6 hosts
  • /30: 255.255.255.252, 2 hosts, often used for point-to-point links

Special addresses

  • Private ranges: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255 and 192.168.0.0 to 192.168.255.255
  • Loopback: 127.0.0.1, used by a device to test itself
  • Broadcast: the last address in a subnet, with all host bits set to 1
  • Network address: the first address, with all host bits set to 0

IPv4 versus IPv6

IPv4 addresses are 32 bits long and written as four decimal numbers separated by dots. IPv6 addresses are 128 bits long and written in hexadecimal groups separated by colons. IPv6 was created because IPv4 addresses are running out.

CIDR and VLSM

CIDR, Classless Inter-Domain Routing, replaces the old classes with a prefix length such as /22. VLSM, Variable Length Subnet Masking, lets you use different prefix lengths within one network so that each subnet is the right size. Allocate the largest subnet first and work down.

Common mistakes

  • Forgetting to subtract two from the host count for the network and broadcast addresses
  • Mixing the number of subnets with the number of hosts
  • Counting the bits from the wrong octet
  • Taking the first address of a subnet as usable

Questions candidates ask

Do I need to memorise all the masks? Memorise the masks from /24 to /30 and the number of hosts for each. The rest can be worked out.

How do I find the block size quickly? Take the number of host bits in the changing octet and calculate two to the power of that number.

What is the first usable address? The network address plus one.

What is the last usable address? The broadcast address minus one.

One more point to remember

Practise on paper without a calculator. Write the block sizes 128, 64, 32, 16, 8, 4 and use them to find network and broadcast addresses in under a minute.

Practise

Try the 10 MCQs below, then continue with the Internet & Networking topic for SI Telecom. For the full syllabus see the SI Telecom guide.

By Shivam · Written with AI assistance and fact-checked · Questions on this page are original · Editorial policy · Report an error

Practice questions

Q1. What is the dotted-decimal subnet mask for a /26 prefix?

  1. 255.255.255.128
  2. 255.255.255.224
  3. 255.255.255.192
  4. 255.255.255.240
Show answer

255.255.255.192 — 26 network bits: the last octet has the top two bits set, 11000000 = 192.

Q2. How many usable host addresses does a /27 network provide?

  1. 30
  2. 32
  3. 62
  4. 14
Show answer

30 — 5 host bits give 2^5 − 2 = 30.

Q3. To which class does the address 172.16.5.9 belong?

  1. Class A
  2. Class C
  3. Class D
  4. Class B
Show answer

Class B — The first octet 172 is in the range 128 to 191, which is Class B.

Q4. What is the network address of the host 192.168.1.77/26?

  1. 192.168.1.0
  2. 192.168.1.64
  3. 192.168.1.76
  4. 192.168.1.128
Show answer

192.168.1.64 — The block size is 64 and 77 lies in the block starting at 64.

Q5. What is the broadcast address of the host 192.168.1.77/26?

  1. 192.168.1.127
  2. 192.168.1.255
  3. 192.168.1.78
  4. 192.168.1.63
Show answer

192.168.1.127 — The block 64 to 127 ends at 127, which is the broadcast address.

Q6. A /24 network is split into /26 subnets. How many subnets result?

  1. 2
  2. 8
  3. 6
  4. 4
Show answer

4 — Two borrowed bits give 2^2 = 4 subnets.

Q7. What is the default subnet mask of a Class C network?

  1. 255.0.0.0
  2. 255.255.0.0
  3. 255.255.255.0
  4. 255.255.255.128
Show answer

255.255.255.0 — Class C uses 24 network bits: 255.255.255.0.

Q8. How many host bits are there in a /20 prefix?

  1. 8
  2. 10
  3. 20
  4. 12
Show answer

12 — 32 − 20 = 12 host bits.

Q9. How many usable hosts does a /30 network have, as used on point-to-point links?

  1. 2
  2. 4
  3. 6
  4. 1
Show answer

2 — 2 host bits give 2^2 − 2 = 2 usable addresses.

Q10. Which of these is a private IPv4 address?

  1. 172.32.0.1
  2. 172.20.4.1
  3. 192.169.1.1
  4. 11.0.0.1
Show answer

172.20.4.1 — 172.16.0.0 to 172.31.255.255 is private; 172.32.0.1 is outside that range.

Practice this topic

Related articles

Study guides

Back to the blog