applets.

Subnet Calculator

← All apps

About Subnet Calculator

Type an IPv4 address on the yellow tape with its size: a prefix (192.168.1.37/24), a mask (192.168.1.37 255.255.255.0) or a wildcard mask as router access lists use (192.168.1.37 0.0.0.255). The port schedule shows the network it belongs to, its broadcast address, the first and last addresses a machine can have, how many hosts fit, the mask and wildcard, what kind of address it is, and its old class.

The patch panel has one port for each of the 32 bits: a lit link light is a 1. Click a port (or use the arrow keys and Space) to flip that bit. Blue inserts are the network part, orange the host part; drag the red latch, click the inserts, or use − and + to move the split.

SPLIT cuts the network into 2, 4, 8... equal subnets. VLSM takes the number of hosts each network needs and gives each the smallest block that holds it, largest first. IS IT IN? checks an address against a network and shows the sum. SUMMARISE turns a list of networks into the fewest blocks that cover exactly the same addresses, and the one block that covers them all. IPv6 writes an IPv6 address out in full and short, with its prefix.

Everything is worked out in the page; nothing is sent anywhere, and nothing is pinged. COPY LINK copies a link with the addresses typed in.

THE STORY

The Internet Protocol, version 4, was set out in RFC 791 in September 1981: every machine gets a 32-bit address, written as four numbers 0 to 255. At first the split between network and host was fixed by the first bits of the address. Class A (starting 0) had 8 network bits, so 128 networks of 16 million addresses each; class B (10) had 16, about 16,000 networks of 65,536; class C (110) had 24, two million networks of 256. Class D (1110) became multicast and class E was held back.

Three sizes fitted badly. A university with one class B network couldn't divide it into departments, so subnetting arrived in RFC 950 (1985): a subnet mask lends some host bits to the network. In 1993, with class B networks running out and routing tables growing fast, Classless Inter-Domain Routing (CIDR, RFCs 1518 and 1519) dropped the classes: any prefix length, written /24 and so on, and neighbouring networks could be summarised into one route. RFC 1918 (1996) kept three ranges, 10/8, 172.16/12 and 192.168/16, for private networks, and network address translation let whole offices share one public address.

It still wasn't enough. The central pool at IANA handed out its last blocks on 3 February 2011, one /8 to each of the five regional registries, and the regional registries have since been down to rationing or waiting lists. IPv6, with 128-bit addresses, is the long-term answer; a range for providers' own address translation (100.64/10, RFC 6598, 2012) is the stopgap. Splitting a /31 between two routers on a link, with no network or broadcast address, came in RFC 3021 (2000).

The page grew from the Python script ping_subnet.py, which takes the first three numbers of an address and pings every machine from .2 to .254 in turn. It quietly assumes a /24; this works out what the network really is first.

HOW IT WORKS

The mask is the prefix as 32 bits: that many 1s, then 0s. The network address is the address AND the mask (host bits set to 0); the broadcast is the network with every host bit set to 1. The addresses between are for machines, so a /24 has 256 addresses and 254 hosts. The wildcard is the mask turned upside down. A /31 has no room for a network and broadcast address, so on a link between two routers both addresses are used (RFC 3021); a /32 is a single machine.

VLSM (variable-length subnet masks) gives each network the smallest power of two that holds its hosts plus the two kept-back addresses, then lays them end to end, biggest first: each block then starts on its own boundary and nothing is wasted between them. Summarising sorts the networks, joins any that touch or overlap, and cuts each run into the largest aligned blocks that fit; the single covering block is the bits that the lowest and highest addresses share.

The kind of address comes from IANA's special-purpose registry (RFC 6890 and the RFCs named on the page). The IPv6 short form follows RFC 5952: lower case, no leading zeros, and the longest run of zero groups written as ::.

FURTHER WATCHING AND READING

Try
Prefix /24
Click a port to flip its bit · drag the red latch to move the split
192.168.1.37/24 PORT SCHEDULE

Split into