Networking looks like a world of jargon, but most of the maths behind it is small arithmetic: powers of two, dividing bits by a rate, and converting between units. If you can do those reliably, you can split an IP range into subnets, estimate how long a download will take, size a data plan and understand what “99.9% uptime” actually promises. This guide walks through the calculations that appear in networking courses, certification exams and everyday IT work, with every example worked out step by step.
Unit mistakes cause most errors here (bits against bytes, mega against mebi), so keep Unit Conversions and Dimensional Analysis handy. You can check your answers with the tools in Free Technology Calculators.
1. Binary and decimal basics for IPv4
An IPv4 address is 32 bits, written as four 8-bit octets. Each octet is a number from 0 to 255. Converting an octet to binary means writing it as a sum of 128, 64, 32, 16, 8, 4, 2 and 1.
Example 1. 192 = 128 + 64, so the binary is 11000000. 172 = 128 + 32 + 8 + 4, so it is 10101100. 10 = 8 + 2 = 00001010.
2. CIDR notation and subnet masks
CIDR notation writes the network size as a prefix length, such as /24, meaning the first 24 bits identify the network and the remaining bits identify hosts. The key formulas are:
Total addresses in the block = 2^(32 − prefix)
Usable hosts (typical subnet) = 2^(32 − prefix) − 2
Block size in the interesting octet = 256 − mask value in that octet
The “minus 2” removes the network address (all host bits 0) and the broadcast address (all host bits 1). Special cases such as /31 point-to-point links and /32 host routes are exceptions you will meet in more advanced work.
| Prefix | Subnet mask | Total addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
| /23 | 255.255.254.0 | 512 | 510 |
3. Worked subnetting examples
Example 2: find the network, broadcast and range. Host 192.168.10.100/26.
- /26 means 26 network bits: 24 in the first three octets and 2 more in the fourth. The fourth octet mask is 11000000 = 192, so the mask is 255.255.255.192.
- Block size = 256 − 192 = 64. The subnets start at .0, .64, .128 and .192.
- The host .100 lies in the block .64 to .127.
- Network address: 192.168.10.64. Broadcast: 192.168.10.127. Usable range: .65 to .126 (62 hosts).
Example 3: choose a prefix for a number of hosts. A branch office needs 50 hosts. Find the smallest block with at least 50 usable addresses: 25 − 2 = 30 is too small, and 26 − 2 = 62 is enough. So 6 host bits are needed and the prefix is 32 − 6 = /26.
Example 4: a bigger network. A campus needs 500 hosts. 28 − 2 = 254 is too small. 29 − 2 = 510 is enough, so 9 host bits and a /23. The mask is 255.255.254.0: the third octet has 7 network bits set (11111110 = 254), and the block size in the third octet is 256 − 254 = 2, so a /23 spans two consecutive third-octet values such as 10.1.4.0 to 10.1.5.255.
Example 5: splitting a /24 into four equal subnets. Four subnets need 2 extra network bits (22 = 4), so /24 becomes /26. Each has 64 addresses, and 192.168.10.0/24 splits into .0/26, .64/26, .128/26 and .192/26.
VLSM. Variable-length subnet masking assigns different prefix lengths to different needs, so you do not waste addresses. Allocate the largest requirement first, then the next, and so on, so the blocks align on proper boundaries. A point-to-point link between two routers needs only a /30 (2 usable hosts).
4. Private address ranges
| Range | CIDR |
|---|---|
| 10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 |
| 172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 |
| 192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 |
These ranges are not routed on the public internet and are used inside homes and offices behind NAT.
5. Bits, bytes and the Mbps versus MB/s trap
Network speeds are quoted in bits per second (Mbps, megabits per second). File sizes are quoted in bytes (MB, megabytes). One byte is 8 bits, so:
MB/s = Mbps / 8
Mbps = MB/s × 8
Example 6. A 100 Mbps plan has a theoretical maximum of 100 / 8 = 12.5 MB/s. In practice you will see less because of protocol overhead, Wi-Fi conditions, server speed and congestion. A common planning allowance is 80–95% of the theoretical rate, which is a rule of thumb, not a guarantee.
Also watch the prefixes. Network speeds use decimal prefixes (1 Mbps = 1,000,000 bits per second). Storage is sometimes shown with decimal prefixes (GB = 109 bytes) and sometimes with binary ones (GiB = 230 bytes). Check what your tool reports.
6. File transfer time
time (s) = file size (bits) / effective rate (bits per second)
file size in bits = bytes × 8
Example 7. Download a 2 GB file (decimal: 2 × 109 bytes) over a 50 Mbps link. Size = 2 × 8 × 109 = 16 × 109 bits = 16,000 megabits. Time = 16,000 / 50 = 320 s, which is 5 minutes 20 seconds at the full line rate.
Example 8: with overhead. If you only get 90% of the line rate, the effective rate is 45 Mbps. Time = 16,000 / 45 = 355.6 s, about 5 minutes 56 seconds.
Example 9: GiB instead of GB. If the file is 2 GiB, the size is 2 × 230 × 8 = 17.18 × 109 bits. At 50 Mbps, time = 17,180 / 50 ≈ 344 s, about 5 minutes 44 seconds. The unit choice changes the answer by about 7%, which is why exact work requires care.
7. Streaming and data plan maths
Example 10: storage for a video stream. A stream at 5 Mbps for one hour uses 5 × 3,600 = 18,000 megabits = 2,250 MB, or 2.25 GB.
Example 11: how long does a daily data limit last? A 1.5 GB daily limit is 12,000 megabits. At a 5 Mbps stream, it lasts 12,000 / 5 = 2,400 s = 40 minutes. At 2 Mbps it would last 100 minutes. Different quality settings change the bitrate, so check the one your app is using.
8. Bandwidth-delay product
Bandwidth is how fast data is sent. Latency is how long it takes to travel. The bandwidth-delay product (BDP) is the amount of data that can be “in flight” on the link at one time. It tells you how large the TCP window must be to fill the pipe.
BDP (bits) = bandwidth (bits/s) × round-trip time (s)
Example 12. A 100 Mbps link with a 50 ms round-trip time. BDP = 100 × 106 × 0.050 = 5 × 106 bits = 625,000 bytes, roughly 610 KiB. If the receive window is smaller than this, the sender stalls waiting for acknowledgements and you cannot use the full 100 Mbps. This is why long-distance links need window scaling or tuned buffers.
9. Serialization (transmission) delay
The time to push a packet onto the wire is size divided by rate. Example 13. A 1,500-byte Ethernet frame is 12,000 bits. At 100 Mbps, it takes 12,000 / 108 = 120 microseconds. At 1 Gbps it takes 12 microseconds. Total delay also includes propagation, processing and queuing delays, so serialization is only one part.
10. Uptime and availability
Uptime promises are percentages of time. Convert them to downtime:
Downtime = (1 − availability) × period
Year = 8,760 hours
Month = about 730 hours (43,800 minutes)
| Availability | Allowed downtime per year | Per month (approx.) |
|---|---|---|
| 99% | 87.6 hours (3.65 days) | 7.3 hours |
| 99.9% | 8.76 hours | 43.8 minutes |
| 99.99% | 52.6 minutes | 4.4 minutes |
If two independent components in series each have 99.9% availability, the combined availability is 0.999 × 0.999 = 0.998 (99.8%). Chains of dependencies reduce overall availability, while redundant components in parallel increase it.
Quick reference
| Task | Formula |
|---|---|
| Usable hosts | 2(32 − prefix) − 2 |
| Block size | 256 − mask octet value |
| MB/s from Mbps | Mbps / 8 |
| Transfer time | bits / bits per second |
| BDP | bandwidth × RTT |
| Downtime | (1 − availability) × time |
Common mistakes
- Forgetting that Mbps is bits and MB is bytes, producing an 8-times error.
- Using 2n without subtracting the network and broadcast addresses.
- Counting the block size in the wrong octet when the prefix is between /17 and /23.
- Assuming the advertised speed is what you will get end to end.
- Mixing GB and GiB in one calculation.
- Allocating small subnets before large ones in VLSM, which causes overlaps.
How to practise
Work each problem by hand first, writing the units on every line, then verify in the Free Technology Calculators app. Learn the powers of two up to 212 (4,096) by heart: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1,024, 2,048, 4,096. They make subnetting fast. For other engineering topics, see Basic Circuit Calculations and Free Calculators for Engineering Students.
Frequently asked questions
Why subtract 2 from the number of addresses?
One address identifies the network itself and one is the broadcast address, so neither can be assigned to a normal host.
How do I find the block size quickly?
Subtract the mask value in the interesting octet from 256. For a mask of 192 the block size is 64.
Why is my download slower than my plan?
Overhead, Wi-Fi signal, server limits, congestion and the bits-versus-bytes conversion all reduce the speed you see.
Does IPv6 use the same maths?
The idea is the same (prefix length and host bits), but addresses are 128 bits and subnets are usually /64, so you rarely count hosts.
Conclusion
Networking calculations reduce to powers of two, bits against bytes and division by a rate. Practise the subnetting steps until the block-size method is automatic, always write your units, and sanity-check results against real-world overhead. Then use Free Technology Calculators to confirm your answers.
Disclaimer: This article is for educational purposes. Real network performance depends on many factors that simple formulas do not capture. Confirm design decisions with a qualified network engineer.