Question about a network IP address

Yohhan

Senior member
May 17, 2002
263
0
0
I'm curious. Since a network address, ie: one ending with a "0" -- x.x.x.0 cannot be assigned to a host, what is happening when you attempt to ping it?

I've tried with a few different IP's. Sometimes I just get a 'request timeout' message. However, sometimes it appears to try and ping the IP with a random number in the host portion of the address. For example, I may try to ping x.x.x.0 and the ping program will end up trying to ping x.x.x.161. I can run traceroutes on some of these IP's as well.

What exactly is happening here?
 

Fiveohhh

Diamond Member
Jan 18, 2002
3,776
0
0
I think the zero at the end is to identify that network itself. I'm guessing if you're getting sent to another ip, its forwarded somehow. thats just a guess.
 

ToeJam13

Senior member
May 18, 2004
504
0
0
I'm curious. Since a network address, ie: one ending with a "0" -- x.x.x.0 cannot be assigned to a host, what is happening when you attempt to ping it?

If you try to PING a network address, your TCP/IP stack should return an error. This is because PING is looking for a specific device. So when you try it, you generally get an error like this:

Destination specified is invalid.

However, not all addresses that end with zero are network addresses (also, not all addresses that end with a non-zero must be a host address). When you have a netmask smaller than a 24-bit mask (255.255.255.0), then both zero and two hundred fifty-five could be a valid ending octet numeral.

In an example, let?s look at a larger subnet that uses a smaller 23-bit mask (255.255.254.0). This allows us to use 510 hosts on our network. So if I set my Windows box to something like this:

IP Address . . . . . . .: 192.168.1.0
Subnet Mask . . . . .: 255.255.254.0
Default Gateway . .: 192.168.0.1


This works because 192.168.0.0 is my network address, 192.168.1.255 is my broadcast address, and all 510 addresses in between are valid host address.

Neat, eh?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If you try to PING a network address, your TCP/IP stack should return an error. This is because PING is looking for a specific device. So when you try it, you generally get an error like this:

Not really. Noone ever said ICMP could only be unicast that I know of. Not all systems respond to broadcast pings though and oddly it seems that some respond to pings to the .255 broadcast address that don't respond to the .0 network address.

root@hostname:~# ping 10.0.0.0
Do you want to ping broadcast? Then -b
root@hostname:~# ping -b 10.0.0.0
WARNING: pinging broadcast address
PING 10.0.0.0 (10.0.0.0) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=255 time=147 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=255 time=2.54 ms
--- 10.0.0.0 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 2.546/74.996/147.446/72.450 ms

root@hostname:~# ping -b 10.0.0.255
WARNING: pinging broadcast address
PING 10.0.0.255 (10.0.0.255) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=255 time=2.60 ms
64 bytes from 10.0.0.1: icmp_seq=1 ttl=150 time=3.81 ms (DUP!)
64 bytes from 10.0.0.2: icmp_seq=2 ttl=255 time=2.54 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=150 time=3.63 ms (DUP!)
64 bytes from 10.0.0.2: icmp_seq=3 ttl=255 time=3.02 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=150 time=4.28 ms (DUP!)
--- 10.0.0.255 ping statistics ---
4 packets transmitted, 3 received, +3 duplicates, 25% packet loss, time 3003ms
rtt min/avg/max/mdev = 2.547/3.317/4.283/0.640 ms
 

ToeJam13

Senior member
May 18, 2004
504
0
0
Not really. Noone ever said ICMP could only be unicast that I know of. Not all systems respond to broadcast pings though and oddly it seems that some respond to pings to the .255 broadcast address that don't respond to the .0 network address.

I think that for the sake of simplicity, its safe to say that you usually can't ping the network address. Some stacks will reject it as an invalid destination, others will just convert it to a broadcast. Even if it does make it out to the wire, as you pointed out (and I agree), not all systems will respond to it.

I guess the real question is what the RFC says about it. Of course, that would require reading, and I'm too busy watching golf on TV to bother.
:)
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
also x.x.x.0 isn't always a network address.

10.0.1.0/23.

;)

-edit- what happens when you ping a network address? Totally up to the stack. In older days it was a broadcast.