04-25-2018 07:49 AM - edited 03-05-2019 10:20 AM
Hi All,
I am a newbie who has picked Networking just Last Week for career change, mostly reading on my own.
I have few very basic questions which I would like your help with. These may seem stupid to learned ones but please bear with me. I am putting my first question in this forum where I am trying to understand how the traffic flow between 2 routers connected via switch. I am not looking for any ready-made answer hence I have put my understanding for you all to correct/amend. Thanks in advance.
Let’s assume, I have two routers connected via switch as -
Router 1 -> Switch 1 -> Router 2 ->Service Provider Network
Situation 1 -> Both Routers are on same subnet (say 200.10.1.0/24) and no VLAN defined on switch.
Steps -
Question - If there are multiple switch connected to R1, is there any routing need to be defined in R1 to send the packet for R2 via S1? I believe, there should at least be a routing for R2 IP in R1?
Situation 2 -> Both Routers are on different subnet (R1 - 200.10.1.0/24, R2 - 200.10.2.0/24) and no VLAN on switch.
Steps – No difference from Situation1.
Situation 3 -> Both Routers are on same/different subnet and they are on different VLANs (VLAN 10 – R1 and VLAN 20-R2)
Steps –
Hopefully this should clear out my understanding of basic routing.
Regards,
JRS
Solved! Go to Solution.
04-25-2018 08:06 AM
Hello
Situation 1: Whether or not there are one or more switches between R1 & R2, if they are on the same subnet and a common VLAN they should be able to reach each other without any routing protocol.
Situation 2: If the routers are on different subnets on a common VLAN there may be some erroneous communication due to the fact that they'll see each other's broadcasts. However, you won't be able establish routing between the two.
Situation 3: The only ARPiing that will occur is the routers will ARP the switch for the respective L3 VLAN IP MACs. Once the routers have this information, any packets that need to go to the other subnet will have the destination IP of the other subnet host with the destination MAC address of the switch's VLAN interface.
Hope this helps (happy networking)
04-25-2018 08:06 AM
Hello
Situation 1: Whether or not there are one or more switches between R1 & R2, if they are on the same subnet and a common VLAN they should be able to reach each other without any routing protocol.
Situation 2: If the routers are on different subnets on a common VLAN there may be some erroneous communication due to the fact that they'll see each other's broadcasts. However, you won't be able establish routing between the two.
Situation 3: The only ARPiing that will occur is the routers will ARP the switch for the respective L3 VLAN IP MACs. Once the routers have this information, any packets that need to go to the other subnet will have the destination IP of the other subnet host with the destination MAC address of the switch's VLAN interface.
Hope this helps (happy networking)
04-25-2018 11:05 AM
Thanks Chrihussey, looks like I was almost there and then missed it. Can you help me with some more clarifications around your response. They are inline to your reply. Thanks, in advance.
@chrihussey wrote:
Hello
Situation 1: Whether or not there are one or more switches between R1 & R2, if they are on the same subnet and a common VLAN they should be able to reach each other without any routing protocol.
<JRS> Was I correct in the steps part? Also, If there are more than one switch directly connected to R1, how will R1 know which switch to send the packet 2 to reach R2.
Situation 2: If the routers are on different subnets on a common VLAN there may be some erroneous communication due to the fact that they'll see each other's broadcasts. However, you won't be able establish routing between the two.
<JRS> Although this is a fictitious scenario, what is the way to overcome this and establish the routing?
Situation 3: The only ARPiing that will occur is the routers will ARP the switch for the respective L3 VLAN IP MACs. Once the routers have this information, any packets that need to go to the other subnet will have the destination IP of the other subnet host with the destination MAC address of the switch's VLAN interface.
<JRS> So do you mean, only R1 will ARP to get S1's MAC? Once the packet reaches S1 using R2 IP and S1 MAC, how will S1 know the MAC of R2 for second leg of packet i.e. to R2, as there could be multiple host connected to switch in R2 subnet?
Hope this helps (happy networking)
<JRS> Many Thanks
04-25-2018 11:34 AM
<JRS> Was I correct in the steps part? Also, If there are more than one switch directly connected to R1, how will R1 know which switch to send the packet 2 to reach R2.
Yes, you were correct on the steps.
In the simplest terms a router cannot have two interfaces sharing the same network. (It primary function is to "route" packets). So if a router is directly connected to more than one switch, then the interfaces would belong to different networks (or VLANs on the switches). The routing configuration would determine which interface to use.
<JRS> Although this is a fictitious scenario, what is the way to overcome this and establish the routing?
There are probably several ways, but the easiest that comes to mind would be to give both routers a secondary IP so that each of the interfaces would have the IPs in both subnets. This way they could communicate across a single VLAN with both networks. (Technically no routing required)
<JRS> So do you mean, only R1 will ARP to get S1's MAC? Once the packet reaches S1 using R2 IP and S1 MAC, how will S1 know the MAC of R2 for second leg of packet i.e. to R2, as there could be multiple host connected to switch in R2 subnet?
So once the packet gets from R1 to S1, S1 then needs to route the packet to the other VLAN. If S1 does not know the IP/MAC of R2, then S1 will send an ARP request. Once R2 replies, S1 will forward the packet from R1, but change the MAC address in the L2 header to that of R2. In addition, R2 will also learn the IP/MAC combo of the S1 interface through this process to send return packets to R1.
04-26-2018 01:12 AM
04-26-2018 02:51 AM
If R1 and R2 are on he same subnet, yet on different VLANs on the switch they will not communicate. You cannot have the same network in two different places.
04-26-2018 04:47 AM
Thanks much, I now have the clarity.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide