## Main Question or Discussion Point

Dear PF Forum,
I want to understand computer networking.
There's a problem that I'd like to know the answer. This problem might not come out in day to day practice, but by having the answer of this problem, I hope I can, at least, understand how router works.

Consider there are 3 computer. A, B and C.

My question is.
1. Can A ping B?
My reasoning is this.
A will see that B(IP) AND A(Mask) = A(IP) AND A(Mask) = 192.168.0.0
So basically A will consider B in the same network.
And so does B will see that A is at the same network. A(IP) AND B(Mask) = 192.168.1.0

2. Can B ping A?

3. Can A ping C?
My reasoning is this.
A will see that C(IP) AND A(Mask) = A(IP) AND A(Mask) = 192.168.0.0
So basically A will consider C in the same network.
Although C will see that A is at different network. A(IP) and C(Mask) = 192.168.1.0

Thank you very much.

Related Computing and Technology News on Phys.org
fresh_42
Mentor
2018 Award
Haven't pinged an internal IP on my network before (only the likes of websites). However trying now it appears you can, so I've learned something new today!

Haven't pinged an internal IP on my network before (only the likes of websites). However trying now it appears you can, so I've learned something new today!
Yeah, it's like reverse engineering. I have a theory, why it can/can't connect.
If it can then... (this is the theory)
If it cannot then...(this is the other theory).
I should have tried it in my office.
Thanks anyway.

Simply put in my opinion,
1. Yes
2. Yes
3. No
Explanation: 1 and 2 share the same network 192.168.1.x whereas 3 stays in a different one 192.168.2.x

Explanation: 1 and 2 share the same network 192.168.1.x whereas 3 stays in a different one 192.168.2.x

A: 192.168.0.0
B: 192.168.1.0
Different, are you sure?

A: 192.168.0.0
B: 192.168.1.0
Different, are you sure?
Let's do a simple experiment to verify this.
Use 2 routers (uh oh what is your pronunciation of this word ? mine is /rounter/ ) and nat your network with them, one is 192.168.0.x and the other 192.168.1.x . And try pinging a computer in one network to another in the other network. The pinging would fail. I am sure about this. My ways to answer questions might make readers think I seem unsure about what I say but that is who I am, a humble person with a true sense to pursue beauty to its lair.

Good idea, I'll try it. Thanks.

Svein
The network mask only shows the IP handler which hosts (IP dialect for computer) it can reach without going through a router. Thus:

Assume that your PC has the IP address 192.168.1.17 with a subnet mask of 255.255.255.0 and a default gateway of 192.168.1.1 (this is old-fashioned IP dialect for router). Then
• If you want to connect to 192.168.1.33, the IP handler uses the subnet mask and discovers that both hosts are on the same subnet. It then establishes a connection directly with 192.168.1.33 without bothering the router at all.
• If you want to connect to 74.86.200.109 (the IP address of this forum), the IP handler uses the subnet mask and discovers that the destination host is not on the same subnet. It then sends the connection request (with the destination IP address) to the router, leaving the problem of locating the destination host to the Internet collection of routers. The routers have their own set of protocols between them (OSPF (https://en.wikipedia.org/wiki/Open_Shortest_Path_First), BGP (https://en.wikipedia.org/wiki/Border_Gateway_Protocol)) to help them find their way to the destination.

The network mask only shows the IP handler which hosts (IP dialect for computer) it can reach without going through a router. Thus:

Assume that your PC has the IP address 192.168.1.17 with a subnet mask of 255.255.255.0 and a default gateway of 192.168.1.1 (this is old-fashioned IP dialect for router). Then...
Thanks, may I discuss further?
* If you want to connect to 192.168.1.33, the IP handler uses the subnet mask and discovers that ...
192.168.1.17 and 255.255.255.0 = 192.168.1.0
192.168.1.33 and 255.255.255.0 = 192.168.1.0
both hosts are on the same subnet. It then establishes a connection directly with 192.168.1.33 without bothering the router at all.

* If you want to connect to 74.86.200.109 (the IP address of this forum), the IP handler uses the subnet mask and discovers that...
192.168.1.17 and 255.255.255.0 = 192.168.1.0
74.86.200.109 and 255.255.255.0 = 74.86.200.0

the destination host is not on the same subnet. It then...

Can I ping to target without?
Can I ping to target even with router?
Thanks.
And thanks for the wiki links.

Svein
Can I ping to target without?
Can I ping to target even with router?
Your subnet mask is the only one that matters. You promise the IP handler that you can access the complete 192.168.0.0.network directly. If you have made a false promise, change your subnet mask (255.255.252.0 will promise access to 192.168.1.0, 192.168.2.0 and 192.168.3.0).

As you state it, the IP handler will try to connect directly. Since you have promised the IP layer that you are able to connect directly, it will not try to go through a router.

Staff Emeritus
Stephanus, do you realize you are asking us "what will happen if I have a misconfigured network?"?

The subnet mask is a property of the network, not any PC on it. If you misconfigure the PCs (e.g. A is reachable from B and B is not reachable from A) you should expect problems.

Svein

The Internet Engineering Task Force (IETF) has directed the Internet Assigned Numbers Authority (IANA) to reserve the following IPv4 address ranges for private networks, as published in RFC 1918 (https://tools.ietf.org/html/rfc1918):
• 10.0.0.0 - 10.255.255.255
• 172.16.0.0 - 172.31.255.255
• 192.168.0.0 - 192.168.255.255

Thank you staffs/mentors for you advice.
I think I have to try it myself. I'm in a process of learning networking here.
Code:
A Ping to B:

All ping to 192.168.1.223

Trial 1
A: 192.168.2.222,  255.255.255.0
B: 192.168.1.223,  255.255.0.0
Result: Destination host unreachable

Trial 2
A: 192.168.1.222,  255.255.255.0
B: 192.168.1.223,  255.255.0.0
Result: Success

Trial 3
A: 192.168.1.222,  255.255.0.0
B: 192.168.1.223,  255.255.255.0
Result: Success

Trial 4
A: 192.168.2.222,  255.255.0.0
B: 192.168.1.223,  255.255.255.0
Result: Reguest time out

--------------------------------------
ping Computer_B_Name: could not find host
pinging to computer name will yield
"Could not find host",
even if pinging to IP address is successful
- Your subnet mask is the only one that matters. You promise the IP handler that you can access the complete 192.168.0.0.network directly.
Yes
No false promise. I just what to check that my promise is to 192.168.0.0, and I want to ping to a computer that promises to 192.168.1.0
I want to see if it works.
See trial 3 and 4 above.

- As you state it, the IP handler will try to connect directly. Since you have promised the IP layer that you are able to connect directly, it will not try to go through a router.

Yes, but my promise should somehow meet the other computer promise (?)
In class C
192.168.1.222 can ping to 192.168.1.223
192.168.2.222 cannot ping to 192.168.1.223

In class B
192.168.2.222 can ping to 192.168.1.223

But
192.168.2.222 (B) cannot ping to 192.168.1.223 (C)
192.168.1.222 (B) can ping to 192.168.1.223 (C)

I'm new in networking here.

Stephanus, do you realize you are asking us "what will happen if I have a misconfigured network?"?
Misconfiugre? Well..., I did it intentionally. I just want to know the effect.
(Now I have reset my IP to 10.1.xxx.xxx back, or I won't be able to answer this thread )

The subnet mask is a property of the network, not any PC on it. If you misconfigure the PCs (e.g. A is reachable from B and B is not reachable from A) you should expect problems.
That's right! And I don't want to set my network that way. I just want to understand about mask and router and IP. It turns out that network mask also plays an important role here, not just router. Less than a month ago I just understand this. Before that, I think it only takes IP to do this networking. Thanks for the tips.

The Internet Engineering Task Force (IETF) has directed the Internet Assigned Numbers Authority (IANA) to reserve the following IPv4 address ranges for private networks, as published in RFC 1918 (https://tools.ietf.org/html/rfc1918):

• 10.0.0.0 - 10.255.255.255, 16,777,716 - 2 addresses
• 172.16.0.0 - 172.31.255.255, 220 = .... 1,048,576 - 2 addresses
• 192.168.0.0 - 192.168.255.255, 65,536 - 2 addresses
Not trying to show off here, but most computer programmers will remember 224, 220, 216, 210, 28 .. 20.

Of course not. As someone working in a supermarket, it's just like item barcode.
https://en.wikipedia.org/wiki/List_of_GS1_country_codes
100: USA
300: France
49: Japan
890: India
899: Indonesia, etc...
But what if your company intends to create barcode for internal use. What kind of barcode number that will not collide other international barcode. So we have to use local barcode number: 200.
It's just like IP address that you have given us.
10.x.x.x,
172.16.x.x to 172.31.x.x,
192.168.x.x.

Svein
Just a tip: If you have several computers on your local area network, use a DHCP server to distribute correct IP information to all computers (and pads and smartphones). You give the DHCP server an address range to administer and specify the netmask and "default gateway".

If you want to know more about DHCP, check out https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol.

Just a tip: If you have several computers on your local area network, use a DHCP server to distribute correct IP information to all computers (and pads and smartphones). You give the DHCP server an address range to administer and specify the netmask and "default gateway".

If you want to know more about DHCP, check out https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol.
DHCP? Sure why not. I'm new in computer networking I just learn now.

Perhaps the reason I create this thread was I needed confirmation.
I read this two rules in computer networking.

For example
IP: 192.168.1.15

Rule B: Only computers with the same network address can communicate without router.

So according to Rule A.
Computer A with
will see that Computer B with IP: 192.168.2.223, is in the same network address/range.

But according computer B.
will see that computer A is in different network address.

Some literature in the internet don't address this issue.
But as I tried it myself yesterday, I found the answer, but still no network rule that states it can/cannot be done.

Thanks anyway @Svein