Vlan – WHY and HOW do routers and vlans break broadcast domains

broadcastvlan

Everybody says routers (and vlans) break broadcast domains, but nobody goes into WHY that is, it seems.
What's the router logic?
Say I have three routers on my lan, with one main router and the other two merely bridged to the first (not creating different networks with different addresses, so they're not acting as gateways).
Let's say the main router sends out a broadcast. The packet gets encapsulated into a frame, and the switches will all forward the broadcast. But will these other routers, behind which I might have some more switches and devives, do the same?

What I want to understand is : do routers only break broadcast domains when they're acting as gateways and actually route between networks, in which case they'll discard the broadcast by decapsulating the frame and seeeing the address in the packet header (?), or do they always break broadcast domains, even when they're merely used more like switches, for their ports, behind a gateway?

And HOW exactly do Vlans break broadcast domains?
If vlans abstract the underlying switch and logically divide it- say, in half, why would the resulting vlans break the broadcast domain? Even if they are perceived as different switches, don't interconnected switches forward broadcasts? How does it all work here ?

Thanks in n advance

Best Answer

Let's talk about it using this topology of three networks (red / orange / blue):

enter image description here

A Router's primary function is to facilitate communication between IP networks. Which means if A wants to speak to D or B, the Router must be used.

However, a Broadcast by definition is a message intended to be sent to everyone within the sender's local network.

If Host A send a broadcast, then Host A means for the packet to only be delivered to Host C, and the Router on the left -- and no one else. The Router, by definition, does not need to, and should not, forward that broadcast anywhere.

So it isn't so much that the Router is "breaking" the Broadcast domain as much as it is that the Router is the natural boundary for the Broadcast domain. It is analogous to a wall being the natural boundary of a room.

If a Router is merely "switching" between it's interfaces and not actually routing, then you can safely consider that router as behaving like a Switch -- who's primary purpose is to facilitate communication WITHIN networks. As such, a Switch will not limit a Broadcast in any way, and in fact will help it along by flooding the broadcast out every port.


Edit: forgot your VLANs question:

And HOW exactly do Vlans break broadcast domains? If vlans abstract the underlying switch and logically divide it- say, in half, why would the resulting vlans break the broadcast domain? Even if they are perceived as different switches, don't interconnected switches forward broadcasts? How does it all work here ?

VLAN's simply break up one switch into multiple "virtual" switches. That image above with the three "switches" can also be represented as two physical switches with three VLANs:

enter image description here

In fact, you could consider this image the "Physical Topology" and the image above it as the "Logical Topology". They are essentially the same topology.

In this image, if the switches receive traffic (to include broadcasts) on VLAN 10 ports, they will only send that traffic out other VLAN 10 ports -- this is by definition of what VLANs do.

So whether there is only 1 switch or many switches in a row, Switches still only facilitate communication WITHIN networks, meaning across any number of switches you still have a single IP network.


Disclaimer: The image and links above are to my own blog. The blog is not monetized. I make no profit from you visiting and am providing the links to help the reader