Routing in a switch

Hi Folks,

I have a basic question regarding a l3 switch behaviour.

Normally, any ethernet packet that comes into a L3 switch will come to l2 which does a lookup and if there is no entry in the l2 table forwards the packet onto all but the incoming port.

Now my question is, when does the switch get to route a packet?

Thanks, Arut

Reply to
syuga2012
Loading thread data ...

The switch doesn't if we are talking functionally. A station arps for its gateway for anything that is not on its immediate subnet, and the router's SVI or local interface will respond to that ARP since it owns that IP. When the traffic is then sent to it via layer 2 for delivery, it goes up the OSI to L3 in the software and is routed to the proper VLAN or across a segment to get to the destination network.

Similarly, when the traffic comes in on an interface (say from a wan link), if the traffic is on the same vlan, it already has a destination MAC via the ARP process. Assuming its coming in an interface that is not in the vlan of the destination, the router will then arp for the destination, which the destination will reply to. Either way, the packet is then sent down the OSI to L2, which checks its table for the MAC, else it forward out all ports as you had discussed (except for the source port).

Reply to
Trendkill

yes

note you are describing 1 type of topology for a L3 switch, where sets of ports are grouped into VLANs and there is a logical router off each VLAN where you set up routing.

FWIW cisco Cat 3500 / 6500s running IOS also support a "pure" routing model where the port behaves like a conventional router - it just depends on the config for that port.

the switch decision is very simple - if the destination MAC in a packet is to the routing interface within that VLAN, then route the packet - anything else goes to the L2 switching.

broadcast gets copied to both sets of logic.

Multicast uses "router is interested in this destination MAC" logic, so it can be flooded and routed.

Reply to
Stephen

Every packet on a network has a layer 2 address (MAC) and layer 3 address (IP address). When a L3 switch receives a packet, the first thing it does is figure out where to switch the packet based upon the layer 2 destination. If the layer 2 destination is the switch itself (as would be the case if the packet needed to be routed), the packet would then be routed to it's next destination. In this case, the source L2 address would be the switch, and the destination L2 address would be the MAC of the next hop router. The source and destination L3 addresses are not changed. So in order for a switch to route a packet, the destination MAC address of the packet must be the MAC address of the switch. Also note that a switch may have multiple MAC addresses assigned to it.

Reply to
Thrill5

Thanks a lot Thrill5!

That was a wonerful and precise explanation.

Reply to
syuga2012

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.