LAN Question about layer 2 switches...please help

Unanswered Question
Sep 13th, 2007

Ok....I am arguing with a colleague at work. We have one switch and everything on it is in Vlan1 and is in the subnet. Except for 1 hub that is connected to this switch...everything on that hub is on the subnet. Now We take a PC that is connected to the switch and it has a regular IP address on the subnet but also a secondary IP address on the subnet...only 1 NIC card. Now my question is...when this PC uses software that needs to access the subnet how does the switch learn that the fa0/18 Interface where the hub is located is where that packet needs to be routed.....Please be thorough for I am having an argument and need to be able to prove this...

Thank you in advance for any and all help..

-Brandon Moore

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Francois Tallet Thu, 09/13/2007 - 13:24

I'm assuming that the hub is also connected on vlan 1. For better understanding, I think we can consider your device as an L2 switch combined with a router connected to it.

The PC is sending a packet to the router through the switch. The router determines that the packet needs to be routed back on the interface where it was received. So basically, the packet is re-injected into the same vlan on the switch. That's where the router work ends.

Now the switch looks at the L2 destination address of the frame. If it has learnt this destination mac on a port (which is most likely, because the router must have resolved the association IP address/mac address via ARP, so it has received an answer from the next hop), it will forward the frame at layer 2 to this port, else it will flood it on all the ports in the vlan.




Francois Tallet Thu, 09/13/2007 - 13:28

Btw, I was not sure from your message if it was the router or the pc that had a secondary address. If the PC has a secondary address, it ARPs directly for the destination and the router is not involved, of course. The selection of the destination port by the switch is still based on the L2 information.

bmoorewiz Thu, 09/13/2007 - 13:41

It is the PC that has the secondary IP address.

So just to be sure here...

When the first request for the comes into the switch, its going to flood an ARP out all interfaces except the one that it came in...and then the computer that has the 192.168.1 address is going to respond w/ its mac address and then it will be saved to the switch....correct? so a router is not needed at all ever for the 192.168.1 network to I correct with all of this?

and thank you for your help I really appreciate it.

Francois Tallet Thu, 09/13/2007 - 13:50

Yes. All this is only processed at L2. The switch does not even know this is an ARP request, it floods the frame. The destination host directly answer the ARP request, thus populating the cam table. The traffic between the two hosts is then forwarded at L2 with no flooding by the switch.

The router does not participate in the communication (I don't think proxy arp can kick in here because 192.1.168 is not a subnet of 10.0.0, but some L3 guys on the forum can confirm that;-)




This Discussion