Suggest an editImprove this articleRefine the answer for “How do you determine the size of a subnet?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**The size of a subnet** is the number of IP addresses (or hosts) that belong to one subnet. It is determined by the subnet mask (CIDR prefix). **Key point:** the size of a subnet depends on how many bits in the IP address are allocated to hosts.Shown above the full answer for quick recall.Answer (EN)Image**The size of a subnet** is the **number of IP addresses (or hosts)** that belong to one subnet. It is determined by the **subnet mask (CIDR prefix)**. Short and simple: **the size of a subnet depends on how many bits in the IP address are allocated to hosts**. --- ## The basic principle For IPv4: - total in the address: **32 bits** - part of them: the **network** - the rest: the **hosts** Formula: ``` Number of addresses = 2^(number of host bits) Number of hosts = 2^(number of host bits) - 2 ``` The `- 2` is because: - one address is the network address - one is the broadcast address --- ## How to determine subnet size step by step ### Step 1. Look at the prefix (/24, /26, and so on) Example: ``` 192.168.1.0/24 ``` - 32 - 24 = **8 bits for hosts** --- ### Step 2. Calculate the number of addresses ``` 2^8 = 256 addresses ``` --- ### Step 3. Calculate the number of hosts ``` 256 - 2 = 254 hosts ``` --- ## Examples of the most popular subnets | Prefix | Host bits | Total addresses | Usable hosts | |---|---|---|---| | /24 | 8 | 256 | 254 | | /25 | 7 | 128 | 126 | | /26 | 6 | 64 | 62 | | /27 | 5 | 32 | 30 | | /28 | 4 | 16 | 14 | | /29 | 3 | 8 | 6 | | /30 | 2 | 4 | 2 | --- ## A quick "at a glance" method (useful for an interview) If the mask ends in: - **.0** → /24 → 254 hosts - **.128** → /25 → 126 hosts - **.192** → /26 → 62 hosts - **.224** → /27 → 30 hosts - **.240** → /28 → 14 hosts --- ## What is important to remember - the size of a subnet is **not the number of devices**, but the **maximum possible number** - the network and broadcast addresses are **always reserved** - routers operate on **subnets**, not on individual IPsFor the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.