cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
424
Views
1
Helpful
7
Replies

Why switches send traffic to Router if it has a MAC ADD Table?

uiteqerson
Level 1
Level 1

Excuse the terrible title. My question is if a Switch has two data VLANs (Accounting/Marketing) and it maintains a MAC Address Table, When a switch receives traffic from an end user device connected to the switch and the device its trying to send traffic to on the same switch but a different VLAN, does the switch not just send the data to the interface that receiving device belongs to? Why does it route traffic on a different network if we are dealing Mac Address not IP.

I passed my CCENT years ago, but this question just came up as I am studying for my CCNA and I cannot find this answer anywhere. Thank you.

7 Replies 7

balaji.bandi
Hall of Fame
Hall of Fame

check how the inter-vlan works :

https://www.ciscopress.com/articles/article.asp?p=3089357

check good example video :

https://www.youtube.com/watch?v=bdNS0K4Bt8U

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Joseph W. Doherty
Hall of Fame
Hall of Fame

Because L3 takes precedence over L2.

For example, what if you had two hosts in the same VLAN, but in different networks?

Sending host first needs to resolve whether destination L3 address is with same network? In this example, it's not, so it sends to L3 gateway.

L3 gateway sends to destination host but it may also inform sending host destination can be reached directly as it's in same L2 domain.  In that happens, transmitting host can send directly to other host.  But, sending host needs gateway to so inform it.

NB: forgoing assumes hosts are configured with a gateway and gateway will send a redirect.

Excuse the terrible title. My question is if a Switch has two data VLANs (Accounting/Marketing) and it maintains a MAC Address Table, When a switch receives traffic from an end user device connected to the switch and the device its trying to send traffic to on the same switch but a different VLAN, does the switch not just send the data to the interface that receiving device belongs to? Why does it route traffic on a different network if we are dealing Mac Address not IP.

I passed my CCENT years ago, but this question just came up as I am studying for my CCNA and I cannot find this answer anywhere. Thank you.

Well, although switch has both MACs, logically they are kept separate, grouped by VLAN.  If fact, you can't have the same MAC in separate VLANs, which needs to be unique per VLAN.  A switch does not transfer between VLANs without a L3 hop.  What you're asking is an illegitimate operation.

Additionally, even for two hosts in same VLAN, even if switch knows both their MACs, generally L3 has to be mapped out before hosts will construct frames to MAC within same VLAN. Once that's done switch will forward frames, but, again, only within same VLAN.  Different VLANs require L3 hop.

Ramblin Tech
Spotlight
Spotlight

There are two answers to this "why" question:

1 - Why? Because that is how L2 bridging and L3 routing work: a VLAN defines the extent of a broadcast domain; MAC address uniqueness is only guaranteed within a broadcast domain; forwarding between broadcast domains/subnets must occur at L3 using unique "network" addresses; bridging between VLANs defeats the purpose of VLANs, etc.

2 - Scale is "why"; scale is the fundamental problem of non-trivial networks.

In the 1980s to 1990s, when computer networking was still young, some network designers seriously contemplated enormous, "flat" networks where MAC addresses would be the primary identifier of nodes on the network, and bridges would organize themselves into loop-free topologies and learn the MAC addresses of thousands, if not tens of thousands of nodes. I even heard the then chairman of the IEEE 802 committee muse at a conference that the entire world, potentially millions of devices, would be networked at L2. Of course, this never happened and the world now has many billions of devices networked.

So why cannot we just have all applications communicate over MAC addresses at L2? Because broadcast domains, spanning-tree, and address MAC learning do not scale. At L2, BUM traffic (Broadcast, Unknown unicast, Multicast) traffic must be flooded throughout the broadcast domain to ensure connectivity between all nodes. The aggregation of BUM traffic becomes a significant impediment to network throughput as the number of nodes in the broadcast domain grows. In addition to shear BUM traffic volume, broadcast traffic causes an interrupt to *all* nodes on the network in order for them to inspect the broadcast frame to determine if they should act on it (multicast frames are filtered in hardware at the NIC level). Imagine your computer broadcasting a frame that causes an interrupt in every other computer on the world-wide L2 network. Now imagine this happening hundreds of thousands, if not millions, of times per second.

Even if the L2 broadcast issue was solved (IPv6 eliminated its use of broadcasts entirely), there is still the issue of MAC addresses not being hierarchical. That is, with MAC addresses being more or less randomly assigned, switches cannot effectively learn and maintain MAC address tables for very large L2 networks, as the tables would be in a constant state of churn (leading to increased BUM traffic). By contrast, IP networks use hierarchical addresses/prefixes that can be summarized/aggregated. Consequently, IP addressing scales to millions/billions of devices.

Back to your specific example... why can't your switch just bridge between VLANs at L2? It could in theory, but doing so would break the paradigm of hierarchical IP routing between subnets. This paradigm scales from networks with just two subnets all the way up to the Internet with billions of devices, all while keeping the same fundamental technologies in place.

Disclaimer: I am long in CSCO

Jim has provided much great detail, but thought I mentioned some of Cisco's early multi layer switching did, sort of, do what you propose.

A L2 switch could switch a frame between VLANs. This might be done after a router on a stick routed the first flow's packet between VLAN/networks.  The L2 switch would bypass the router for the following flow's packets.

Take special note, a L3 hop was required for the first packet.

Hey Joe. You might remember that 30 years ago this month Cisco released "CiscoFusion", their marketecture for supporting workgroup-based VLANs distributed across a campus, and L3 switching between them. This involved the Cisco 7000 router (IIRC, their first with h/w-assisted forwarding), an ATM switch, and Crescendo Ethernet switches (Catalyst switches were born of the new Crescendo acquisition).

Thankfully, by the end of the '90s, the idea of cross-campus affinity-based VLANs was no longer in the mainstream among mainstream vendors, and focus shifted to locality-based VLANs and "route where you can, switch where you must". L2 flat networks, which espoused the opposite ("switch where you can, route where you must"), were melting down everywhere and were on the wane.

From what I understand (not being an enterprise type for some time now), the "fusion" term is still a thing in Cisco's marketing, though I believe it has a different meaning now.

Disclaimer: I am long in CSCO
Review Cisco Networking for a $25 gift card