Page 1 of 1

Bridge usage with VLAN setups

Posted: Tue Jan 07, 2025 3:30 pm
by tobcon
Hello

Given a Network setup with multiple LAN VLAN's. Is it the correct way to create VLAN Interfaces onto the main Bridge, or is it better to create VLAN interfaces onto the Ethernet Interface?

I'm currently mostly doing VLAN interfaces onto the Ethernet Interface. This works fine, but it feels like it is the wrong way of doing it.

Is creating the VLAN interfaces onto the main Bridge the correct way of doing it? Is this introducing some kind of notable performance impact?

Re: Bridge usage with VLAN setups

Posted: Tue Jan 07, 2025 3:36 pm
by holvoetn
How I understood:
If you want to benefit from HW offload where possible (for those devices where it is supported), using bridge for setting up VLANs is the default way already for quite some years.

Re: Bridge usage with VLAN setups

Posted: Tue Jan 07, 2025 3:44 pm
by tobcon
How I understood:
If you want to benefit from HW offload where possible (for those devices where it is supported), using bridge for setting up VLANs is the default way already for quite some years.
I'm specifically talking about the use-case where I have a Trunk Port on my MikroTik Router which goes with a bunch of tagged VLANs to a Switch. For every VLAN there is a Interface with Address assigned on the MikroTik (LAN IP).
Is there still bridge HW offloading in such a scenario where Interfaces and not just "switching" are involved?

Re: Bridge usage with VLAN setups

Posted: Tue Jan 07, 2025 4:56 pm
by holvoetn
Read this:
https://help.mikrotik.com/docs/spaces/R ... LANRouting

Interesting part (emphasis added):
Inter-VLAN Routing
Since L3HW depends on L2HW, and L2HW is the one that does VLAN processing, Inter-VLAN hardware routing requires a hardware bridge underneath. Even if a particular VLAN has only one tagged port member, the latter must be a bridge member. Do not assign a VLAN interface directly on a switch port! Otherwise, L3HW offloading fails and the traffic will get processed by the CPU

....

Assign the VLAN interface to the bridge instead. This way, VLAN configuration gets offloaded to the hardware, and, with L3HW enabled, the traffic is subject to inter-VLAN hardware routing.

Re: Bridge usage with VLAN setups

Posted: Tue Jan 07, 2025 6:46 pm
by mkx
How I understood:
If you want to benefit from HW offload where possible (for those devices where it is supported), using bridge for setting up VLANs is the default way already for quite some years.
I'm specifically talking about the use-case where I have a Trunk Port on my MikroTik Router which goes with a bunch of tagged VLANs to a Switch. For every VLAN there is a Interface with Address assigned on the MikroTik (LAN IP).
Is there still bridge HW offloading in such a scenario where Interfaces and not just "switching" are involved?

Important thing to understand is what exactly gets offloaded from bridge to switch chip: it's passing frames between ports, attached to switch chip (typically they're either RJ45 or SFP ports, always consult block diagram of particular device), and which are members of same bridge. Additionally switch chip handles adding/stripping VLAN headers in case when port is untagged member of a particular VLAN.

However, anything related to router's IP stack (including vlan interfaces) is entirely processed by CPU (unless device is capable of L3HW offload).

So using bridge with single physical port doesn't allow any offload to hardware (untagged "VLAN" in this case doesn't need any VLAN tag manipulation and adding VLAN tag by switch chip actually means slightly more CPU processing due to use of vlan interface).

Re: Bridge usage with VLAN setups

Posted: Tue Jan 07, 2025 8:02 pm
by tobcon
Important thing to understand is what exactly gets offloaded from bridge to switch chip: it's passing frames between ports, attached to switch chip (typically they're either RJ45 or SFP ports, always consult block diagram of particular device), and which are members of same bridge. Additionally switch chip handles adding/stripping VLAN headers in case when port is untagged member of a particular VLAN.

However, anything related to router's IP stack (including vlan interfaces) is entirely processed by CPU (unless device is capable of L3HW offload).

So using bridge with single physical port doesn't allow any offload to hardware (untagged "VLAN" in this case doesn't need any VLAN tag manipulation and adding VLAN tag by switch chip actually means slightly more CPU processing due to use of vlan interface).
Thanks for this explanation. This makes a lot of sense and makes it easily understandable!

Let's evaluate it with e.g. the CCR1009 sfp-sfpplus1 interface. Would you use a bridge for Router-on-a-Stick configuration with multiple VLAN, or would you do it without a bridge?
I understand that the bridge won't gain any HW offload, but does it harm? Is it still best-practice to use a bridge for such a scenario?

Re: Bridge usage with VLAN setups

Posted: Tue Jan 07, 2025 8:21 pm
by mkx
IMO it doesn't make much sense to use bridge with single port. The only functionality bridge could offer are bridge filters ... for simplicity sake most things done by bridge filters can be done by L3 firewall.
But using bridge does insert additional step in frame/packet processing (even if CPU cycles needed are only a few).

So again unless you have very specific problem that only bridge can solve I don't see any sense in having bridge on a RoaS.

Re: Bridge usage with VLAN setups

Posted: Tue Jan 07, 2025 8:23 pm
by MetalKalic
The same question from me yesterday, but when I create VLANs on Bridge Interface, Hotspot function is not working. :-(
viewtopic.php?t=213709

Re: Bridge usage with VLAN setups

Posted: Wed Jan 08, 2025 5:38 pm
by anav

Re: Bridge usage with VLAN setups

Posted: Fri Jan 10, 2025 1:17 pm
by LeahBrock
Hello

Given a Network setup with multiple LAN VLAN's. Is it the correct way to create VLAN Interfaces onto the main Bridge, or is it better to create VLAN interfaces onto the Ethernet Interface?

I'm currently mostly doing VLAN interfaces onto the Ethernet Interface. This works fine, but it feels like it is the wrong way of doing it.

Is creating the VLAN interfaces onto the main Bridge the correct way of doing it? Is this introducing some kind of notable performance impact?








Creating VLAN interfaces on the main bridge is the recommended approach in MikroTik setups, as it centralizes traffic management and ensures proper bridging for VLAN traffic. Adding VLANs to Ethernet interfaces directly can work but may bypass bridge-level controls, potentially impacting consistency. Performance impact is minimal with proper configuration. Academized’s “Write My Research Paper” https://academized.com/write-my-research-paper service was exactly what I needed to manage my academic workload. The writer assigned to my paper was professional and delivered a well-researched, high-quality paper before the deadline. The process was easy, and their support team was always available to address my concerns. Their affordable pricing and reliable service make them a top choice for academic assistance.
The same question I had what will I do?

Re: Bridge usage with VLAN setups

Posted: Fri Jan 10, 2025 1:27 pm
by BartoszP
Suggested articles read and "use your force LeahBrock" :)