0

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.

6

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
  • @Isaac I believe I have edited the answer to address your concerns – roaima Jan 14 at 15:27
0

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.

0

The diminish following the IP address is the abbreviation for the subnet mask. ... The quantity of ones in the subnet masks is equal to the range of the abbreviation. For example, the /16 subnet masks you asked about would have sixteen ones in a row, the relaxation of the numbers being zeros. 11111111.11111111. 00000000.00000000.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.