Question about switch operation..
15 years 4 months ago #30439
by S0lo
Studying CCNP...
Ammar Muqaddas
Forum Moderator
www.firewall.cx
Replied by S0lo on topic Re: Question about switch operation..
Lets follow on emperorz example. After PC1 finds out that PC2 is on a different network, there are two cases:
1. If you don't set a gateway IP on PC1. The packet will be dropped because there is no matching route for it in PC1's internal routing table because there is no default route. (You can view the routing table on windows using route print command).
2. If you set a gateway IP on PC1 but you don't have a real router with that IP connected to the same switch. The packet will match the default route, so PC1 will ARP asking for the MAC address of the gateway's IP. But since there is no router there, there is no one to reply for the ARP (PC2 will not reply because PC1 is not asking for PC2's MAC, the ARP broadcast includes the IP of the gateway inside the message). So PC1 will not get a reply, so it will not know the MAC address of the gateway, so the packet (ping) will not be set.
As you can see, in both cases a gateway is needed. So in both cases, a layer 3 device is needed. That's the way the designers did it, it's not physically impossible, but the protocol prevents it from working.
Hope this helps.
1. If you don't set a gateway IP on PC1. The packet will be dropped because there is no matching route for it in PC1's internal routing table because there is no default route. (You can view the routing table on windows using route print command).
2. If you set a gateway IP on PC1 but you don't have a real router with that IP connected to the same switch. The packet will match the default route, so PC1 will ARP asking for the MAC address of the gateway's IP. But since there is no router there, there is no one to reply for the ARP (PC2 will not reply because PC1 is not asking for PC2's MAC, the ARP broadcast includes the IP of the gateway inside the message). So PC1 will not get a reply, so it will not know the MAC address of the gateway, so the packet (ping) will not be set.
As you can see, in both cases a gateway is needed. So in both cases, a layer 3 device is needed. That's the way the designers did it, it's not physically impossible, but the protocol prevents it from working.
Hope this helps.
Studying CCNP...
Ammar Muqaddas
Forum Moderator
www.firewall.cx
15 years 4 months ago #30445
by LooseEnd
Thank you for the replies. As you can see I have already pointed out we can set default gateways like above. What will happen then?
I can understand that a layer 3 device is needed to process packets, but I'm saying that it should not necessarily be a router. (A PC can act as a layer 3 device).
Replied by LooseEnd on topic Re: Question about switch operation..
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..
Thank you for the replies. As you can see I have already pointed out we can set default gateways like above. What will happen then?
I can understand that a layer 3 device is needed to process packets, but I'm saying that it should not necessarily be a router. (A PC can act as a layer 3 device).
15 years 4 months ago #30447
by sose
what is a router ? a pc acting as a layer 3 device automatically is a router.
Loosend , we have a networking section at the upper left corner of the site. it will surely be a good reminder about your knowledge of protocols. have a nice time
sose
Network Engineer
analysethis.co/index.php/forum/index
Replied by sose on topic Re: Question about switch operation..
I can understand that a layer 3 device is needed to process packets, but I'm saying that it should not necessarily be a router. (A PC can act as a layer 3 device).
what is a router ? a pc acting as a layer 3 device automatically is a router.
Loosend , we have a networking section at the upper left corner of the site. it will surely be a good reminder about your knowledge of protocols. have a nice time
sose
Network Engineer
analysethis.co/index.php/forum/index
15 years 4 months ago #30449
by S0lo
LooseEnd, Sorry I misread your post. You have obviously assigned each PC as the gateway of the other. Your asking why it doesn't work, Well guess what, IT DID WORK!! . Both PCs were able to ping each other. I know this might not make sense to many here, but thats what happened infront of my eyes.
I used a sniffer, and let PC1 ping PC2, it was obvious that PC1 ARPed for the MAC of PC2, and PC2 replied with it's MAC. Then ICMP was passing through.
I have to say though that it did NOT work when I tried it on Packet Tracer, PC2 was not replying for the ARP broadcasts. But on a real switch, it is surely working.
Studying CCNP...
Ammar Muqaddas
Forum Moderator
www.firewall.cx
Replied by S0lo on topic Re: Question about switch operation..
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
LooseEnd, Sorry I misread your post. You have obviously assigned each PC as the gateway of the other. Your asking why it doesn't work, Well guess what, IT DID WORK!! . Both PCs were able to ping each other. I know this might not make sense to many here, but thats what happened infront of my eyes.
I used a sniffer, and let PC1 ping PC2, it was obvious that PC1 ARPed for the MAC of PC2, and PC2 replied with it's MAC. Then ICMP was passing through.
I have to say though that it did NOT work when I tried it on Packet Tracer, PC2 was not replying for the ARP broadcasts. But on a real switch, it is surely working.
Studying CCNP...
Ammar Muqaddas
Forum Moderator
www.firewall.cx
15 years 4 months ago #30467
by LooseEnd
Wow, this is what i said over and over to my self, I said theoretically It should happen. I went over RFC826 and analyzed algorithms for ARP packet generation and receiving, I just couldn't find a thing that would say it couldn't happen. I thought maybe I'm missing something.
BTW this makes perfect sense to me. If you ask me, its the other way around that makes no sense.
I also tried this with packet tracer and it didn't work. Thank you for trying this practically s0lo. Yes this makes perfect sense.
Replied by LooseEnd on topic Re: Question about switch operation..
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
LooseEnd, Sorry I misread your post. You have obviously assigned each PC as the gateway of the other. Your asking why it doesn't work, Well guess what, IT DID WORK!! . Both PCs were able to ping each other. I know this might not make sense to many here, but thats what happened infront of my eyes.
I used a sniffer, and let PC1 ping PC2, it was obvious that PC1 ARPed for the MAC of PC2, and PC2 replied with it's MAC. Then ICMP was passing through.
I have to say though that it did NOT work when I tried it on Packet Tracer, PC2 was not replying for the ARP broadcasts. But on a real switch, it is surely working.
Wow, this is what i said over and over to my self, I said theoretically It should happen. I went over RFC826 and analyzed algorithms for ARP packet generation and receiving, I just couldn't find a thing that would say it couldn't happen. I thought maybe I'm missing something.
BTW this makes perfect sense to me. If you ask me, its the other way around that makes no sense.
I also tried this with packet tracer and it didn't work. Thank you for trying this practically s0lo. Yes this makes perfect sense.
15 years 4 months ago #30468
by sose
sose
Network Engineer
analysethis.co/index.php/forum/index
Replied by sose on topic Re: Question about switch operation..
ahah, just when we thought we understood you
sose
Network Engineer
analysethis.co/index.php/forum/index
Time to create page: 0.146 seconds