Messages in this thread | | | Date | Fri, 28 Jan 2000 11:18:45 -0800 (PST) | From | Linux Lists <> | Subject | Re: all zeroes/all ones used in host IP's... |
| |
On Fri, 28 Jan 2000, Mike A. Harris wrote:
> On another mailing list I'm on there is a small discussion about > using "0's" in IP addresses. Nobody could categorically say > wether or not they are allowed or not including myself, so I > hunted down RFC 1123, and found the relevant section. > > Here it is: > > IP addresses are not permitted to have the value 0 or -1 for > any of the <Host-number>, <Network-number>, or <Subnet- > number> fields (except in the special cases listed above). > This implies that each of these fields will be at least two > bits long. > > Now I interpreted that as meaning that none of the octets in an > IP address could be 0 or "-1" in either the network/subnet or > host portions of a valid host IP. The definition of "-1" is "all > ones" in the host or network/subnet portion. > > I interpret the above as meaning that it is not legal to have a > network like this: > > 192.168.0.0/24 or 23.0.0.0/24 > > with hosts 192.168.0.1 through 192.168.0.254 or with hosts > 23.0.0.1 through 23.0.0.254.
Let's consider the host 23.0.0.2 w/ subnet 255.255.255.0 (which is in the network 23.0.0.0/24). From what I know about IP (which could be wrong, so please correct me if this is the case), we have:
- Host-number = 0x02 (last 8 bits, as defined by subnet mask) - Network-number = 0x170000 (first 24 bits, as defined by the subnet mask) - Subnet-number = 0xFFFFFF00
None of them is 0 or -1 and, thus, the IP address is valid.
I hope this clarifies your doubt. Be careful with name definitions ... ;)
Regards, Ivan
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |