Community discussions

MikroTik App
 
tobcon
just joined
Topic Author
Posts: 18
Joined: Sun Mar 06, 2022 6:57 pm

Bridge usage with VLAN setups

Tue Jan 07, 2025 3:30 pm

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?
 
holvoetn
Forum Guru
Forum Guru
Posts: 6873
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Bridge usage with VLAN setups

Tue Jan 07, 2025 3:36 pm

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.
 
tobcon
just joined
Topic Author
Posts: 18
Joined: Sun Mar 06, 2022 6:57 pm

Re: Bridge usage with VLAN setups

Tue Jan 07, 2025 3:44 pm

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?
 
holvoetn
Forum Guru
Forum Guru
Posts: 6873
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Bridge usage with VLAN setups

Tue Jan 07, 2025 4:56 pm

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.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 13130
Joined: Thu Mar 03, 2016 10:23 pm

Re: Bridge usage with VLAN setups

Tue Jan 07, 2025 6:46 pm

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).
 
tobcon
just joined
Topic Author
Posts: 18
Joined: Sun Mar 06, 2022 6:57 pm

Re: Bridge usage with VLAN setups

Tue Jan 07, 2025 8:02 pm

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?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 13130
Joined: Thu Mar 03, 2016 10:23 pm

Re: Bridge usage with VLAN setups

Tue Jan 07, 2025 8:21 pm

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.
 
MetalKalic
just joined
Posts: 7
Joined: Sun Jan 05, 2025 7:50 pm

Re: Bridge usage with VLAN setups

Tue Jan 07, 2025 8:23 pm

The same question from me yesterday, but when I create VLANs on Bridge Interface, Hotspot function is not working. :-(
viewtopic.php?t=213709
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22207
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Bridge usage with VLAN setups

Wed Jan 08, 2025 5:38 pm

 
LeahBrock
just joined
Posts: 1
Joined: Thu Jan 02, 2025 8:29 am

Re: Bridge usage with VLAN setups

Fri Jan 10, 2025 1:17 pm

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?
Last edited by LeahBrock on Tue Jan 21, 2025 8:29 am, edited 2 times in total.
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 3083
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: Bridge usage with VLAN setups

Fri Jan 10, 2025 1:27 pm

Suggested articles read and "use your force LeahBrock" :)