Hot Downloads

Welcome, Guest
Username: Password: Remember me

TOPIC: Question about switch operation..

Question about switch operation.. 7 years 4 months ago #30370

  • LooseEnd
  • LooseEnd's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
Why cant 2 PC's in 2 different networks connected to a single switch communicate(Ping) each other?
The administrator has disabled public write access.

Re: Question about switch operation.. 7 years 4 months ago #30373

  • S0lo
  • S0lo's Avatar
  • Offline
  • Moderator
  • Posts: 1577
  • Thank you received: 7
  • Karma: 3
Because when the PC finds out that the other PC's IP is on a different network it will send the Ethernet frame to the default gateway.

So to let this work, the default gateway (router) will have to forward the packet to the same interface it came from. You might be able to do this if you define the router interface to be a supernet (aggregation) of both of the PCs networks (For example 192.168.1.0/24 is a supernet of 192.168.1.0/25 and 192.168.1.128/25). However, this is not the normal behavior nor the best practice to do.
Studying CCNP...

Ammar Muqaddas
Forum Moderator
www.firewall.cx
The administrator has disabled public write access.

Re: Question about switch operation.. 7 years 4 months ago #30375

  • LooseEnd
  • LooseEnd's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
Ok then imagine this scenario.

PC1 - 192.168.1.1 /24
PC2 - 192.168.2.1/24

PC1 default gateway - 192.168.2.1
PC2 default gateway - 192.168.1.1

Why cant they communicate in this case? Also please note that in this scenario no router is involved..
The administrator has disabled public write access.

Re: Question about switch operation.. 7 years 4 months ago #30376

  • S0lo
  • S0lo's Avatar
  • Offline
  • Moderator
  • Posts: 1577
  • Thank you received: 7
  • Karma: 3
So to let this work, the default gateway (router) will have to forward the packet to the same interface it came from. You might be able to do this if you define the router interface to be a supernet (aggregation) of both of the PCs networks.

First I have to correct my self :oops:. In order for the above to work the router has to be able to have 2 IPs on the same interface. This is not typical on Cisco routers. So I might be wrong.

Ok then imagine this scenario.

PC1 - 192.168.1.1 /24
PC2 - 192.168.2.1/24

PC1 default gateway - 192.168.2.1
PC2 default gateway - 192.168.1.1

Why cant they communicate in this case? Also please note that in this scenario no router is involved..

If there is no router involved then there is no device to forward the packets between the two networks. Second, when PC1 ARPs for the MAC address of 192.168.2.1 it will not get a response, and same thing goes for PC2.

I know this a little brief but I'm in a little hurry now, gota go. I hope some one else can help.
Studying CCNP...

Ammar Muqaddas
Forum Moderator
www.firewall.cx
The administrator has disabled public write access.

Re: Question about switch operation.. 7 years 4 months ago #30380

  • LooseEnd
  • LooseEnd's Avatar
  • Offline
  • New Member
  • Posts: 7
  • Karma: 0
Second, when PC1 ARPs for the MAC address of 192.168.2.1 it will not get a response, and same thing goes for PC2.

This is just the case, why wont PC2 respond to a arp sent for him?

Consider PC1 pinging to PC2.

Isnt this what is supposed to happen?

(1)PC1 checks destination network.
(2)Since destination is not in the same network, sends an arp to default gateway IP, (In this case PC2's IP)
(3)Switch will flood this in all its interfaces except the one it came.
(4)So PC2 will get the arp packet.
(5)Since the arp is for him PC2 will respond.
(6)Switch will forward the response to PC1 port.
(7)PC1 will get the mac of PC2.
(8)By this time logically switch's MAC table is updated with both PC1 and PC2's ports.

So logically they should be able to communicate. But I know that they can't.

So what's the error in the above procedure?
The administrator has disabled public write access.

Re: Question about switch operation.. 7 years 4 months ago #30382

  • KiLLaBeE
  • KiLLaBeE's Avatar
  • Offline
  • Expert Member
  • Posts: 466
  • Karma: 0
Hope this helps:
Basically, a computer can only directly communicate DIRECTLY with a node that's on the same network as its on. If the two nodes are on different networks, then a router MUST be involved because a router CAN identify multiple different networks (and route packets between them), whereas a computer can't identify two separate networks, unless the computer has routing software and separate NICs. I haven't tried "workarounds," such as assigning two IPs of two different networks to a single interface on a computer.

I believe that the computer determines that a node is on a different network by performing some ANDing operation involving its own subnet mask and IP address with the destination IP address to get the two separate network IDs (and to actually see that they are on separate networks). I'm not 100% sure on this, though. I'll verify this later, but for now, just keep in mind that the two nodes must be in the same network to communicate with each other.

So in your case, PC1 and PC2 are in different networks (identified by their subnetmask /24), so PC1 can't communicate with PC2 because they're on different networks. They can't communicate with their default gateway as well because the default gateways are also on separate networks.

Although OSI layer 2 seems to work, layer 3 operation isn't so the communication (ping) will not work. I'd still wait for S0lo to replies as he knows networking better than I do.
The administrator has disabled public write access.
Time to create page: 0.086 seconds

CCENT/CCNA

Cisco Routers

  • SSL WebVPN
  • Securing Routers
  • Policy Based Routing
  • Router on-a-Stick

VPN Security

  • Understand DMVPN
  • GRE/IPSec Configuration
  • Site-to-Site IPSec VPN
  • IPSec Modes

Cisco Help

  • VPN Client Windows 8
  • VPN Client Windows 7
  • CCP Display Problem
  • Cisco Support App.

Windows 2012

  • New Features
  • Licensing
  • Hyper-V / VDI
  • Install Hyper-V

Linux

  • File Permissions
  • Webmin
  • Groups - Users
  • Samba Setup