Ok, So I've got 10.x.y.0/24 - what can i do with it?

By now you've probably seen confusing mixes of numbers, dots and slashes flying about on the mailing list and your probably wondering what they are, hopefully this document will help...

Each and every computer on the Internet needs an unique identifier to identify itself to other machines with which it wishes to communicate (don't worry about NAT for the moment!). In the current version of the Internet Protocols (IP), version 4, (aka IPv4) this identifier is a 32 bit number.

This allows us to have about 4 and a quarter billion machines on the net, though for various reasons the actual number is less than that.

By convention these 32 bit numbers are displayed as 4 8 bit chunks divided by dots, e.g. 10.1.2.3, or 212.25.240.34. Since each chunk is only 8 bits long the values can only be between 0 and 255. So the lowest ip address is 0.0.0.0 and the highest is 255.255.255.255. (In reality all ip addresses starting with 0 or 255 aren't in general use. 0.0.0.0 and 255.255.255.255 are used by machines that don't know what ip address to use and want to get one, e.g. from a DHCP server).

To try to keep network traffic flowing as smoothly and quickly as possible these 4 billion numbers are divided into networks (sometimes called subnets, or net-blocks).

In the early days of the Internet there where only 3 sizes of network, called Class A (24 million addresses), Class B (65 thousand addresses), and Class C (256 addresses).

After using this scheme for a while people started to realize that it had some problems:

This and various other problems led to the introduction of the subneting scheme used on the Internet today: Classless Inter-Domain Routing

In both CIDR and the old Classful addressing schemes networks are defined by a base address (or network address) and a network mask (almost always just called a netmask).

The network mask, like an ip address, is a 32 bit value, and is also displayed as 4 8 bit numbers separated by dots. But rather than being a number that represents a unique host the individual bits in the netmask are used to divide the network address into a network region (if the bit is set), and a host region (if the bit is unset).

The number of unset bits (i.e. the host region) tells you how many ips the subnet has.

This arangement gives subnets two properties

The second point could probably do with some explanation. probably the best way is to just show you this table which shows you all the ways you can split a /24 (a Class C). I haven't bothered going beyond /30 because the table would get far too wide to fit on the page.

Netmask Mask Length Num. of networks in a /24 Number of ip's
255.255.255.0 /24 1 256
255.255.255.128 /25 2 128 128
255.255.255.192 /26 4 64 64 64 64
255.255.255.224 /27 8 32 32 32 32 32 32 32 32
255.255.255.240 /28 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
255.255.255.248 /29 32 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
255.255.255.252 /30 64 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

You can see that if you used the first 64 ip's for one subnet (a /26), and the last for a second, you couldn't then use the middle 128 ip's for one subnet, you'd have to move both /26's to the beginning of the range.

Key
Can't use
In use

e.g.

wrong:

/25 128 128
/26 64 64 64 64

Right:

/25 128 128
/26 64 64 64 64

Here are some easy things to check to make sure that you've got the subnet split properly:

Note that in any ip network (apart from unnumbered point to point links) you lose 2 ip's - one for the network address (the smallest one), and one for the broadcast address (the highest one). You can use the network address for a host under some circumstances, but it's best to leave it alone.

You'll also need an ip for the default router (if it's just a stub network), so the number of ip's usable for hosts is total - 3.


Here's a complete list of all the subnet sizes you can have in IPv4, from smallest to largest:

Number of ip's per Net Number of Net's of this
size in the entire Net
Netmask /bits Notes
14294967296255.255.255.255/32 Aka a 'host' route
22147483648255.255.255.254/31 Not really usable.
41073741824255.255.255.252/30 Smallest usable subnet
8536870912255.255.255.248/29
16268435456255.255.255.240/28  
32134217728255.255.255.224/27 This is a good size of network to use on a wireless subnet - allowing you to have 29 clients.
6467108864255.255.255.192/26 This is also good with 61 clients.
12833554432255.255.255.128/25  
25616777216255.255.255.0/24 Traditional class C
5128388608255.255.254.0/23  
10244194304255.255.252.0/22 (current) RIPE default initial allocation size
20482097152255.255.248.0/21
40961048576255.255.240.0/20  
8192524288255.255.224.0/19 Old RIPE default initial allocation size
16384262144255.255.192.0/18
32768131072255.255.128.0/17  
6553665536255.255.0.0/16 Traditional Class B
13107232768255.254.0.0/15
26214416384255.252.0.0/14
5242888192255.248.0.0/13
10485764096255.240.0.0/12
20971522048255.224.0.0/11
41943041024255.192.0.0/10
8388608512255.128.0.0/9  
16777216256255.0.0.0/8 Traditional Class A
33554432128254.0.0.0/7
6710886464252.0.0.0/6
13421772832248.0.0.0/5
26843545616240.0.0.0/4
5368709128224.0.0.0/3  
10737418244192.0.0.0/2 A quarter of the net.
21474836482128.0.0.0/1 Half the 'net
429496729610.0.0.0/0 All the hosts on the net, aka the 'Default route'.

If you want to find out more about this then type 'CIDR' into your personal favorite search engine, there is plenty of info out there.