Skip to content
Official PYQ · 2026

GATE CS 2026 Set 2 Q23 — Fragmentation and IP Addressing, IPv4, CIDR

Explain with AI
If an IP network uses a subnet mask of 255.255.240.0255.255.240.0, the maximum number of IP addresses that can be assigned to network interfaces is ____\_\_\_\_. (answer in integer)
View worked solution

Answer: 4094

To find the maximum number of IP addresses that can be assigned to network interfaces, we need to determine the number of host bits from the given subnet mask.

The subnet mask is given as: 255.255.240.0

Converting this subnet mask to binary representation:

  • 255→111111112255 \rightarrow 11111111_2
  • 255→111111112255 \rightarrow 11111111_2
  • 240→111100002240 \rightarrow 11110000_2
  • 0→0000000020 \rightarrow 00000000_2

Thus, the binary representation of the subnet mask is:

11111111.11111111.1111⏟20 network bits0000.00000000\underbrace{11111111.11111111.1111}_{20\text{ network bits}}0000.00000000

The number of host bits (nn) is the number of trailing zeros in the subnet mask:

n=32−20=12 bitsn = 32 - 20 = 12\text{ bits}

The total number of IP addresses in this subnet is:

212=40962^{12} = 4096

In any standard IP subnet, two addresses are reserved and cannot be assigned to network interfaces:

  1. Network Address: All host bits set to 0.
  2. Directed Broadcast Address: All host bits set to 1.

Therefore, the maximum number of assignable IP addresses is:

Assignable IP Addresses=212−2=4096−2=4094\text{Assignable IP Addresses} = 2^{12} - 2 = 4096 - 2 = 4094

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Fragmentation and IP Addressing, IPv4, CIDR questions