GATE / CS ARCHIVE

GATE CSE 2026 SET 2 / QUESTION 33

Usable addresses in a slash-20 subnet

Computer Networks · IP Addressing, Fragmentation & Address Resolution · Full GATE CSE 2026 Set 2 paper

GATE 2026 Set 2, Q33 1 mark · NAT
Report issue

IP Addressing, Fragmentation & Address Resolution

Question 33, GATE 2026: An IPv4 subnet has mask 255.255.240.0. Find the maximum number of conventional network-interface addresses assignable in that subnet.
Tap to enlarge
Answer & solution

Official answer: 4094

Step through it (3 steps)

Givens and goal

An IPv4 subnet has mask 255.255.240.0. Find the maximum number of conventional network-interface addresses assignable in that subnet.

Approach

Count host bits and remove the two reserved endpoint addresses.

Step-by-step solution

1. The mask in binary is 11111111.11111111.11110000.00000000. It contains 8+8+4=20 leading ones, so the prefix length is /20.
2. An IPv4 address has 32 bits. The host portion therefore has 32−20=12 bits and permits 2¹²=4096 different bit patterns.
3. The all-zero host field denotes the subnet itself, while the all-one host field is the subnet-directed broadcast address. Neither is assigned to a conventional interface in this subnet.
4. Thus the usable count is 4096−2=4094. The special treatment of /31 point-to-point links is irrelevant to a /20 subnet. Reserving addresses administratively would reduce a particular deployment’s capacity, but no such reservation is specified.

Original paper, page 23 · Answer key