What does this mean /16 after an IP address

9,901

Solution 1

The value after the slash, i.e. the 24 in your example 192.168.1.0/24, uses CIDR notation to indicate the number of bits available for network addressing as distinct from host addressing. For IPv4 each IP address is 32 bits, so the host addressing for a /24 network would be 32 - 24 = 8 bits.

Let's look at this a bit more closely.

Take an example address 192.168.1.0/24. This says that 24 bits of the 32 are for the network address. Each octet is 8 bits so it become trivially easy to see that this means that 192.168.1 is the network address, and the remainder is for the host. Eight bits gives 28 addresses, i.e. 256. The lowest is unavailable and the highest is reserved for local network broadcasts, so that leaves room for 254 host addresses, all beginning with 192.168.1.

Now take an example address 192.168.0.0/16. Here we have 16 bits of the 32 for network addressing, leaving 16 bits for the hosts on the network. We have 216 = 65536 host addresses but, as before, two are pre-allocated so you have 65534 available addresses for hosts on this network, all starting 192.168.

This is all very easy; where it gets exciting is when the subnet field is not a multiple of eight. For example, you could have a network 192.168.1.128/26. The same rules apply though; you have 26 bits for the network address and 6 bits for the hosts on that network. 26 is 64 and two are reserved so you can have 62 hosts on such a network. Using the ipcalc tool you can see that the valid IP addresses on this network would be 192.168.1.129 to 192.168.1.190:

ipcalc 192.168.1.128/26
Address:   192.168.1.128        11000000.10101000.00000001.10 000000
Netmask:   255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Wildcard:  0.0.0.63             00000000.00000000.00000000.00 111111
=>
Network:   192.168.1.128/26     11000000.10101000.00000001.10 000000
HostMin:   192.168.1.129        11000000.10101000.00000001.10 000001
HostMax:   192.168.1.190        11000000.10101000.00000001.10 111110
Broadcast: 192.168.1.191        11000000.10101000.00000001.10 111111
Hosts/Net: 62                    Class C, Private Internet

Solution 2

An /16 is usually used to indicate the number of bits that are fixed (would not change) in a range of addresses of a network. That is a simpler syntax to express the CIDR.

Having an IP number as 1.2.255.1/16 means that any address from 1.2.0.0 up to 1.2.255.255 is part of that address range or network.

However, an IP number that starts with 255, similar to the one you wrote 255.255.255.1/16 is usually used only for netmask and means that the first 16 bits are fixed and the rest may change.

A mask of 255.255.0.0 and an a.b.c.d/16 have the exact same masking bits (or bits used).

An IP of 255.255.255.255 is reserved by IANA for future use and also called the "limited broadcast" destination address for the 0.0.0.0 network. Or, in layman terms Broadcast Address.

The full explanation is a bit longer, but this is the gist of it.

Share:
9,901

Related videos on Youtube

lsn00b
Author by

lsn00b

Updated on September 18, 2022

Comments

  • lsn00b
    lsn00b almost 2 years

    I came across an ip like this the other day 255.255.255.1/16

    I thought the /16 referred to the number of subnetting addresses the IP could generate. However, I suspect I may be horribly wrong and felt that the Linux/Unix experts on this forum could assist.