0

Is specifying meaningless bits valid syntax in CIDR notation? For instance, the netmask of 192.168.13.0/16 is 255.255.0.0. In this case, the last two octets (00001101 00000000) are meaningless because any value between 192.168.0.0 and 192.168.255.255 (inclusive) is in range. I'm curious what's considered valid in CIDR notation.

1
  • 2
    Hello and welcome. They're not "meaningless bits", they're "host bits" !
    – jonathanjo
    Jul 16, 2019 at 16:31

3 Answers 3

3

Yes it's a valid syntax. Every host on a network has an IP address, and it's also important to know what subnet it's a part of. You need that information to configure the host. So 192.168.13.0/16 tells you what the host IP is and also what the subnet is.

If we follow your idea to the logical extreme, everything is in the range of 0.0.0.0/0, so we don't need to specify IP addressing at all.

3

When you specify an address longer than the bits in the mask, you are generally referring to a host address. In your example, 192.168.13.0/16 would be a host on the 192.168.0.0/16 network. That gives you the host address and mask (similar to 192.168.13.0 255.255.0.0, except in shortened form), from which you can derive all type of network information. See this two-part answer for the details.

0

I'm curious what's considered valid in CIDR notation

It depends on the context.

Afaict "CIDR notation" is not formally defined anywhere. In practice though CIDR notation is used in two different ways.

  • To identify a block of addresses, for example the target of a route or the filter for a firewall rule. In this case the convention is that the "host" bits are all zeros. The software I have tried enforces this convention, but I can't be sure all software does.
  • To specify an assignment of IP address and subnet mask to an interface. In this case the host bits are meaningful.
1
  • You should check out RFC 4632. ;-)
    – Zac67
    Jun 2 at 4:54

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.