Ping problem

jbzeigler

Posts: 42   +0
I have two machines located on two different networks. I would like to ping from PC1 (network A) to PC2 (network B). I assume that this would fail using only the computer name and that an IP address would be required since anyone can name their computer almost anything.

PC1 is in a network that has a DNS server though. How does the whole name resolution/routing work for pinging using only an IP address?
 
I have two machines located on two different networks. I would like to ping from PC1 (network A) to PC2 (network B). I assume that this would fail using only the computer name and that an IP address would be required since anyone can name their computer almost anything.

PC1 is in a network that has a DNS server though. How does the whole name resolution/routing work for pinging using only an IP address?
The subject is really about Routing Tables.
Code:
Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 0f b0 3d bc 1d ...... Realtek RTL8139 Family PCI Fast Ethernet NIC - P
acket Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          [B]0.0.0.0          0.0.0.0      192.168.0.1     192.168.0.4 [/B]      20
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.0.0    255.255.255.0      192.168.0.4     192.168.0.4       20
      192.168.0.4  255.255.255.255        127.0.0.1       127.0.0.1       20
    192.168.0.255  255.255.255.255      192.168.0.4     192.168.0.4       20
        224.0.0.0        240.0.0.0      192.168.0.4     192.168.0.4       20
  255.255.255.255  255.255.255.255      192.168.0.4     192.168.0.4       1
Default Gateway:       192.168.0.1
===========================================================================
Persistent Routes:
  None
Notice the first line; 0.0.0.0 192.168.0.1 192.168.0.4
That's the default routing; everything that is unknown, goes to the gateoway (192.168.0.1) using the interface (192.168.0.4: the pc nic address assigned).

The easy part is that anything on the same subnet (in this case 192.168.0.x) is routed without any actions on our part.

Sites unknown (locally eg google.com) just flow out the gateway.

Consider this layout:
Code:
modem===router#1(lan) ----- local subnet --- my.systems
             |
             +---- (wan)secondary router#2(Lan) - - - other systems
give router#1 the address 192.168.0.1 address [ matching the table shown above]
and router#2 the address 192.168.1.1
Q? how the heck can we get to something on 192.168.1.100?

A: router#2 (Wan) side address will be an address on the router#1subnet (eg 192.168.0.50)

to pass data (ping or otherwise) to anything on 192.168.1.x, we need to add an entry to the route table that says
Code:
192.168.1.0    192.168.1.1     192.168.0.50
which says anything on 192.168.1.* goes to the router 192.168.1.1 using our local interface 192.168.0.50 (the wan side of router#2).

would fail using only the computer name and that an IP address would be required since anyone can name their computer almost anything.
or worse, duplicates!
The computer names supported by Windows are:
  • * Name service for name registration and resolution (port: 137)
  • * Datagram distribution service for connectionless communication (port: 138)
  • * Session service for connection-oriented communication (port: 139)
The Internet DNS is a port 53 request which returns the IP address associated with the name (which requires a domain name resgistration; quite different than port 137,137,139).

So if we PING GOOGLE.COM, we really make two network transactions:
  1. ask the DNS for google.com -->
  2. which replies with the real ip-address thereof <--
  3. and that is used to perform PING reply-ip-address -->
which explains why PING router#1.systemA name fails just as readily as
PING router#2.systemA; nether has a DNS entery on the Internet.

For those that have systems attached to a Domain Controller, your DNS requests flow to
the DC, not the Internet, and it can deal with Router#1.SystemA locally.
 
Back