Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ping - strange problem (10.10.10.10. != 10.10.10.010?)

1 view
Skip to first unread message

Sponegbob

unread,
Nov 4, 2004, 8:49:36 AM11/4/04
to
Hi everybody,

i have a problem with the Windows utillity PING.

if i try to ping an ip-adress (i.e 10.10.10.10) everything works
correct: the host with the ip adress 10.10.10.10 answers.

now i try to ping the adress 10.10.10.010 -> this should be the same
host as the one mentioned above. But in this case the host with the
ip-adress 10.10.10.8 (!!!) answers!

My Question: what is the difference between 10.10.10.10 and
10.10.10.010?

This problem appears with multiple ip-adresses: have a try?

Thx,

Chris

Johan van Selst

unread,
Nov 4, 2004, 8:54:18 AM11/4/04
to
Once upon a newsgroup, Sponegbob claimed:
] now i try to ping the adress 10.10.10.010 -> this should be the same

] host as the one mentioned above. But in this case the host with the
] ip-adress 10.10.10.8 (!!!) answers!
] My Question: what is the difference between 10.10.10.10 and
] 10.10.10.010?

Numbers starting with '0' are interpreted as octal numbers (base 8)
rather than decimal numbers (base 10). '10' is the octal representation
for decimal '8'. So 0377 corresponds to 255 decimal, etc.


Greetings,
Johan
--
Why do we always come here - I guess we'll never know.
It's like a kind of torture to have to watch the show.

Bulent Murtezaoglu

unread,
Nov 4, 2004, 8:57:25 AM11/4/04
to
>>>>> "S" == Sponegbob <spon...@canadamail.de> writes:
[...]
S> now i try to ping the adress 10.10.10.010 -> this should be the
S> same host as the one mentioned above. But in this case the host
S> with the ip-adress 10.10.10.8 (!!!) answers! [...]

The 0 is causing the last octet to be read in octal (base-8) where 010
is decimal 8. This bites everyone at one time, and baffles
non-programmers. Don't use leading 0's and you'll be fine.

cheers,

BM


glen herrmannsfeldt

unread,
Nov 6, 2004, 3:49:23 AM11/6/04
to
Sponegbob wrote:

(snip)

> now i try to ping the adress 10.10.10.010 -> this should be the same
> host as the one mentioned above. But in this case the host with the
> ip-adress 10.10.10.8 (!!!) answers!

And you can put a 0x prefix on hex numbers.

Also, there are rules for dotted IP addresses with fewer than
four components, including writing the whole thing as a
single 32 bit number. 0x0a0a0a0a will also find your
10.10.10.10 server, as will 10.10.2570, 10.0xa0a0a
and 0xa.657930 and 10.02405012

-- glen

0 new messages