# What does /16,/24 mean with regards to ip addresses

ipnetworking

I am trying to understand how network topologies work in large scale networks such as college campuses.

I often see the phrases /16,/24 with regards to ip addresses.

I would like to know what /16 and /24 etc. mean. I understand it has something to do with subnet masks, but my question is different.

Let's say one of /24 ip address is 124.125.126.* with subnet mask 255.255.255.0, and it can have 256-2 hosts.

I am assuming we are talking about public ips here.

What does hosts mean here? Is it 254 router can be assigned public ips here? We don't assign public ips to end user devices, they only get private ips. so I am confused what does hosts refer to here?

• /16, /24 is called CIDR notation, it's a different way to express the subnet mask.

A subnet mask can be used for any IP, public, private, etc.; the /X has nothing do really whether the IP is public or private.

Electronic equipment processes IP addresses as a string of 32 bits that can either be 1 or 0. It only cares about the 1's and 0's; writing it as decimal numbers is for our benefit, not any router, computer, phone, etc.

The 4 decimal numbers in an IPv4 is just a shorter way to write them so we don't have to write all the 0's and 1's.

The way the 4 decimal numbers relate to those 0's or 1's is like the below. Wherever there is a 1, add that number to that set of 8 bits to get the decimal number for that "octet".

``````1                 1                 1                 1
2 6 3 1           2 6 3 1           2 6 3 1           2 6 3 1
8 4 2 6 8 4 2 1 . 8 4 2 6 8 4 2 1 . 8 4 2 6 8 4 2 1 . 8 4 2 6 8 4 2 1

--------------- . --------------- . --------------- . ---------------

1 1 0 0 0 0 0 0   1 0 1 0 1 0 0 0   0 0 0 0 0 0 0 0   0 0 0 0 0 1 0 1

--------------- . --------------- . --------------- . ---------------

192             . 168             . 0               . 5
``````

Net masks are always a long string of 1's followed by a long string of 0's. It determines what part of the IP identifies the network (the 1's) and what part identifies the computer/phone/host/etc.

That works like this:

``````1                 1                 1                 1
2 6 3 1           2 6 3 1           2 6 3 1           2 6 3 1
8 4 2 6 8 4 2 1 . 8 4 2 6 8 4 2 1 . 8 4 2 6 8 4 2 1 . 8 4 2 6 8 4 2 1

--------------- . --------------- . --------------- . ---------------

1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 0 0 0 0 0 0 0 0

--------------- . --------------- . --------------- . ---------------

255             . 255             . 255             . 0

1 1 1 1 1 1   1 1 1 1 2 2 2 2   2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7   8 9 0 1 2 3 4 5   6 7 8 9 0 1 2 3   4 5 6 7 8 9 0 1

--------------- . --------------- . --------------- . ---------------

_ _ _ _ _ _ _ _   _ _ _ _ _ _ _ _   _ _ _ _ _ _ _ _   *

or /24
``````

CIDR just says we can simply say the number of 1 bits without writing out the four decimal numbers of the subnet mask. So you can write 192.168.0.5/24 instead of 192.168.0.5/255.255.255.0.