Discussion:
Valid/Invalid IP addresses
(too old to reply)
JF Mezei
2008-12-27 05:10:50 UTC
Permalink
The other day, I was trying to d some BT, and the app woiuld lock up.
Seems it was trying to connect to an IP that was invalid beause it
contained a 0 in it.

(like 74.23.0.234 )

Is it cprrect to state that an IP cannot contain a 0 in it ?



And just now, someone tryed to break in via FTP wth an IP :

Remote nodename: 58.117.255.223

I was under the impression that 255 was reserved for broadcast addresses
only. Is it legal to have it in a IP address if it is followed by non
255 bytes ?
Mike Drechsler - SPAM PROTECTED EMAIL
2008-12-27 11:11:01 UTC
Permalink
Post by JF Mezei
The other day, I was trying to d some BT, and the app woiuld lock up.
Seems it was trying to connect to an IP that was invalid beause it
contained a 0 in it.
(like 74.23.0.234 )
Is it cprrect to state that an IP cannot contain a 0 in it ?
Remote nodename: 58.117.255.223
I was under the impression that 255 was reserved for broadcast addresses
only. Is it legal to have it in a IP address if it is followed by non
255 bytes ?
Nothing wrong with those. Only the first and last IP of a subnet are
broadcast addresses. You are confusing something you might see in the
last octet and even there it would be fine as long as the size of the
subnet was larger than /24 and the particular IP was not the first or
last IP of the range covered by that subnet. There are however some
corners of the Internet that do not handle a .0 or .255 in the last
subnet properly even in the cases where it's perfectly valid.

So just knowing what the IP address is will not tell you if that .0 or
.255 is valid, you need to know the subnet mask as well.

Examples:
1.0.0.1
255.255.255.254
Both could be valid device IP's though are reserved or not currently
allocated. So you would never see them on the internet
If I suppose I have a subnet of
198.18.0.0/15 then the following are all valid devices
198.18.0.255
198.19.0.0
The broadcast and network addresses for that subnet would be
198.18.0.0 - Network
198.19.255.255 - Broadcast
Everything in between those are valid device IP's in this example.


Ranges which are currently reserved:
0.0.0.0/8 Reserved for Local identification.
10.0.0.0/8 Private IP range. People use these for internal networks and
must use NAT to connect to the rest of the Internet.
127.0.0.0/8 Reserved for Loopback address
169.254.0.0/16 Reserved for local link. (peer to peer LAN
autoconfigurations)
172.16.0.0/12 Private IP range.
192.0.2.0/24 Reserved for Test-Net
192.88.99.0/24 Reserved for 6to4 Anycast Relay
192.168.0.0/16 Private IP range. (Most popular private range used on
NAT routers)
198.18.0.0/15 Reserved for network device benchmark testing. Good for
documentation and example uses too.
224.0.0.0/4 Reserved for Multicast (Not sure why this doesn't catch on
more, I guess ISP's haven't figure out how to charge for it)
240.0.0.0/4 Reserved for future uses. (Either someone invents a new way
to route traffic on the Internet or we simply run out of IP's and need
the extra space)


Your specific examples:
58.117.255.223 is assigned to Beijing Education Information Network
74.23.0.234 is assigned to Comcast Cable
JF Mezei
2008-12-27 20:25:32 UTC
Permalink
Post by Mike Drechsler - SPAM PROTECTED EMAIL
Nothing wrong with those. Only the first and last IP of a subnet are
broadcast addresses.
OK, that is what I though, but had figured that perhaps there was some
rule about not using 255 elsewhere. I guess not.
Post by Mike Drechsler - SPAM PROTECTED EMAIL
1.0.0.1
Ok so having a zero inside an IP is also allowed I had not seen that
before. It was one night with my BT application opening a torrent,
seeing how many seeders/leachers there were, but not opening ANY
connection to any peers. But I was seeing connection attempts from IPs
wth 0s in them and figured they were probably RIAA/MPAA plants to wreck
the network. The next night, all worked fine.
Peeassha
2008-12-27 13:25:26 UTC
Permalink
Post by JF Mezei
The other day, I was trying to d some BT, and the app woiuld lock up.
Seems it was trying to connect to an IP that was invalid beause it
contained a 0 in it.
(like 74.23.0.234 )
Is it cprrect to state that an IP cannot contain a 0 in it ?
Remote nodename: 58.117.255.223
I was under the impression that 255 was reserved for broadcast addresses
only. Is it legal to have it in a IP address if it is followed by non
255 bytes ?
I guess you're learning about these file sharing programs. The programs are
written so if you don't share you don't download either. In the future try
sharing then the p2p programs will work.
chuckcar
2008-12-27 21:16:12 UTC
Permalink
Post by JF Mezei
The other day, I was trying to d some BT, and the app woiuld lock up.
Seems it was trying to connect to an IP that was invalid beause it
contained a 0 in it.
(like 74.23.0.234 )
Is it cprrect to state that an IP cannot contain a 0 in it ?
No, of course not. Try ping 127.0.0.1. Surely *that* is valid. Routing
trouble one would suspect.
Post by JF Mezei
Remote nodename: 58.117.255.223
I was under the impression that 255 was reserved for broadcast addresses
only. Is it legal to have it in a IP address if it is followed by non
255 bytes ?
You're forgetting how it works: each octet is a byte. A byte can have a
value from 0-255 the same as an ascii character. There's a valid ascii
character 0 - NUL and the same with 255 (can't recall right now what
ANSII has for that). If you removed the two end ones you'd drop the number
of available IP addresses by 132,653,040 (254^4-256^4). Net masks are for
inclusion of IP addresses *within* a network. They don't make any others
invalid.
--
(setq (chuck nil) car(chuck) )
JF Mezei
2008-12-27 23:32:48 UTC
Permalink
Post by chuckcar
No, of course not. Try ping 127.0.0.1. Surely *that* is valid. Routing
trouble one would suspect.
However, just because 127.0.0.1 is valid locally doesn't mean it is
valid for routing across the internet. (like private address space).

The IPs that Bittorrent (Transmission) was trying to connect with
diesn't seem to be traceroutable. And they contained a 0 in them, so it
got me to wonder. But it was probably some other problem. But it was
definitely blockling my app completely. (whic is a buf with the app, it
hould have still been able to connect to other peers with normal IPs).
unknown
2008-12-28 19:00:55 UTC
Permalink
Post by chuckcar
You're forgetting how it works: each octet is a byte. A byte can have a
value from 0-255 the same as an ascii character. There's a valid ascii
character 0 - NUL and the same with 255 (can't recall right now what
ANSII has for that). If you removed the two end ones you'd drop the number
of available IP addresses by 132,653,040 (254^4-256^4). Net masks are for
inclusion of IP addresses *within* a network. They don't make any others
invalid.
Wow. This is pretty tortured.

IP addresses are 32-bits. Carving it up into byte sized pieces is a
convention for writing them down, but octet boundaries have no
significance to the address. The only thing that matters is the 32-bit
address and the 32-bit netmask.

____________________________________________________________________
Gardner Buchanan gbuchana(a)teksavvy(dot)com
FreeBSD: Where you want to go. Today.
chuckcar
2008-12-28 21:16:26 UTC
Permalink
Post by unknown
Post by chuckcar
You're forgetting how it works: each octet is a byte. A byte can have a
value from 0-255 the same as an ascii character. There's a valid ascii
character 0 - NUL and the same with 255 (can't recall right now what
ANSII has for that). If you removed the two end ones you'd drop the
number of available IP addresses by 132,653,040 (254^4-256^4). Net
masks are for inclusion of IP addresses *within* a network. They don't
make any others invalid.
Wow. This is pretty tortured.
IP addresses are 32-bits. Carving it up into byte sized pieces is a
convention for writing them down, but octet boundaries have no
significance to the address. The only thing that matters is the 32-bit
address and the 32-bit netmask.
He was talking about the one or more of the octets being zero, so it
applied.
--
(setq (chuck nil) car(chuck) )
Geoffrey Welsh
2008-12-30 01:00:48 UTC
Permalink
Post by JF Mezei
Is it cprrect to state that an IP cannot contain a 0 in it ?
There are circumstances where classful (i.e., obsolete) software will choke
on the so-called 'all-zeros' and 'all-ones' subnets. That is to say, an
organization assigned a class A or B network was expected to subnet it
internally, but the difference between the classful netmask and the local
netmask was not permitted to be all ones or all zeros based on some idea
about broadcasting across multiple subnets but only within your network. I
do not know if this feature was ever used, but it has been over ten years
since I've run into equipment (a Cisco 2501 router, to be exact) that obeyed
this exception... and even then it was running old firmware which could be
configured to treat the 'special' subnets as ordinary. I have heard talk
since of people who have encountered this oddity. Obviously, this prevents
large chunks of IP address space from being utilized and has thus been
considered less than best practice for some time.

Cisco has an article on it at
http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080093f18.shtml
Post by JF Mezei
Remote nodename: 58.117.255.223
I was under the impression that 255 was reserved for broadcast
addresses only. Is it legal to have it in a IP address if it is
followed by non 255 bytes ?
Again, the all-ones subnet was subject to the same special consideration as
the all-zeros subnet at one time, but for some time has not been considered
current best practice.

For instance, if you are assigned a block of x.y.240.0 - x.y.255.255, your
broadcast address is obviously x.y.255.255 but it would be a shame to waste
1/16th of your allocation away by not using x.y.255.[0-254].
--
Geoffrey Welsh <Geoffrey [dot] Welsh [at] bigfoot [dot] com>
Under no circumstances will I ever purchase anything offered to me as
the result of an unsolicited email message. Nor will I forward chain
letters, petitions, mass mailings, or virus warnings to large numbers
of others. This is my contribution to the survival of the online
community. - Roger Ebert, Boulder Colorado 1996
Loading...