Question about CCR2116, wan<=> lan, and L3 hw offloading

Hello,

Context : home user with a 8gb/sec wan link.

I just migrated from a CCR1036, to a CCR2116, for the single cpu core performances and play with containers.

All is working good, except cpu usage is pretty high when I'm using a lot of bandwitdh. If I do a speedtest, I hit my 8gb/sec no problem, but single core usage is higher than with my CCR1036. Both have fast track activated and working.

Now, I noticed that fast track hw offloading is not working (counter "Fasttrack HW Offloaded" at O) on my 2116, even with "hw offload" ticked in the fasttrack rule.

I Believe it's because I can't use a bridge in my case ?

The 2116 setup is pretty simple :

ISP => Vlan Interface tagged 100 => physical interace (sfp+ 2) with a DHCP client <=> LAN on interface sfp+1 (after that it’s going to a CRS309 for the lan). HW L3 offloading enabled on the switch (and the physical port, I tried on/off, same behaviour).

But I read that, for hw offloading to act, I need everything on the same bridge ? But a wan must be outside of the bridge right… So, am I missing something, or it is what it is ?

Thx you.

Yes, HW offload only works on the single HW offloaded bridge. (Only one bridge can be HW offloaded, and all ports between which you want HW offloaded routing or fasttrack must be part of it.)

This implies that all such routing is inter-vlan, so you will have to rearrange your configuration to this setup if you want to take advantage of the offloading. This means a vlan-filtered bridge.

To be a bit more philosophical: your device is fairly powerful and it already handles everything you want, there really isn't much point in changing things. It has plenty of cpu available for other uses too.

1 Like
  • a short basic diagram of the setup because I for one understood nothing on how your CCR2116 is connected to what

  • a config export, at least the relevant parts: /interfaces and /ip firewall;

You sure? You can also offload a few fasttracked connections.

The example in the docs covers this setup actually L3 Hardware Offloading - RouterOS - MikroTik Documentation

/interface ethernet
…
set [ find default-name=sfp-sfpplus1 ] comment="LAN 10G" l2mtu=9570 mtu=9014
set [ find default-name=sfp-sfpplus2 ] auto-negotiation=no comment=WAN-10G \

…

/interface vlan
add interface=sfp-sfpplus2 name=Fibre_ByTel_vl100 vlan-id=100

The dhcp client for internet access is listening on this vlan interface.

I think my problem is I need a vlan interface attached to the sfp2 port, since my isp need a vlan to work…

For testing l3hw offloaded fasttracked connections you don’t even need l3-hw-offloading=yes on the ports. But for sure you don’t need it on the WAN port, so at least:

/interface/ethernet/switch/port/set sfp-sfpplus2 l3-hw-offloading=no

You DO need :

/interface ethernet switch
set 0 l3-hw-offloading=yes

and optional:
/interface ethernet switch l3hw-settings
set autorestart=yes

And adjust your firewall rules:

/ip/firewall/filter
add action=fasttrack-connection chain=forward connection-state=established,related hw-offload=yes protocol=tcp
add action=fasttrack-connection chain=forward connection-state=established,related hw-offload=no
add action=accept chain=forward connection-state=established,related

This only offloads TCP to l3hw, leaving the rest fasttracked only.

To see the l3hw offloaded connections in terminal:

/ip/firewall/connection/print where hw-offload=yes

Yeah I read that, on even with this configuration, it doesn’t work :confused:

Export a full, sanitized config then.

And

/interface/ethernet/switch/print

also

/interface/ethernet/switch/port print

And what RouterOS version?

Your reference certainly points to HW offloaded fasttrack being available on non-bridge ports as well.

OP will probably still have to make the WAN port a part of the bridge because of the vlan tagging... but that's not the rationale I mistakenly stated.

022016epure.rsc (6.3 KB)

I removed a lot of useless stuff from the config. RouterOS version is 7.21.3 (I have the same behaviour under 7.20.8).

[admin@MikroTik] > /interface/ethernet/switch/print
Columns: NAME, TYPE, L3-HW-OFFLOADING, QOS-HW-OFFLOADING

NAME TYPE L3-HW-OFFLOADING QOS-HW-OFFLOADING

0 switch1 Marvell-98DX3255 yes yes

admin@MikroTik] > /interface/ethernet/switch/port print
Flags: R - RUNNING
Columns: NAME, SWITCH, L3-HW-OFFLOADING, STORM-RATE

NAME SWITCH L3-HW-OFFLOADING STORM-RATE

0 R sfp-sfpplus1 switch1 yes 100
1 R sfp-sfpplus2 switch1 no 100
2 sfp-sfpplus3 switch1 yes 100
3 sfp-sfpplus4 switch1 yes 100
4 ether1 switch1 yes 100
5 ether2 switch1 yes 100
6 ether3 switch1 yes 100
7 ether4 switch1 yes 100
8 ether5 switch1 yes 100
9 ether6 switch1 yes 100
10 ether7 switch1 yes 100
11 R ether8 switch1 yes 100
12 ether9 switch1 yes 100
13 ether10 switch1 yes 100
14 ether11 switch1 yes 100
15 ether12 switch1 yes 100
16 R switch1-cpu switch1 100

But what bridge ? i don’t have one, and afaik, wan and lan port should not be on the same bridge. So I don’t get how have a bridge with only the wan port, and the vlan interfacce attached to this bridge, will help ?

Use a bridge for LAN and set your VLANs (7 and 24) to your bridge properly. And add your sfp1 to that bridge obviously.

Set l3-hw-offloading=no on all the ports.

Disable qos-hw-offloading for now, make it work with the bare minimum and then complicate the config.

See “Typical Misconfiguration” in the link I’ve mentioned above. There’s a “correct configuration” there also.

Adapt it for your case.

And I’m guessing you have some rules in the NAT section in your firewall and just omitted them, right?

And the firewall does have more rules than that?

add action=fasttrack-connection chain=forward comment=
"activation fasttrack tcp hwoffload" connection-mark=no-mark
connection-state=established,related hw-offload=yes protocol=
tdp

What’s tdp? you’ve edited too much :slight_smile:

Yep it was tcp :smiley:

I’ve nat and firewall rules yes, nothing particular.

In the “correct configuration”, I don’t see a way to adapt to my situation. But I will read it again.

Well I won’t guide you on how to add a bridge with bridge vlan-filtering enabled and two vlans tagged on your sfp1. Not the point of this topic. But for your own piece of mind, set an IP on an used port so that you can use that port if you get locked out of the router by mistake.

Thx for the help :slight_smile:

Of course. What I meant was, vlan 7 and 24 are not the point, I don’t care about that performances wise. My main lan is not behind a vlan interface for now. If I do a bridge with my lan ports (i’ve done that in the past), what do I do with the wan port ? And I have to attach a vlan interface (100) somewhere for my isp to work. I don’t see attaching it to the bridge since it for lan… I said beforce, I believe you can’t have LAN ports and WAN ports on the same bridge. Is that wrong ? And there is the constraint that I need a dhcp client runing on the vlan 100 interface too.

Anyway, I’ll thing on it :slight_smile:

I didn’t say anything for the WAN port or your VLAN 100, you can leave them as they are.

Then we have a vlan interface attached to a physical interface (vlan 100 to the wan port sfp2), and it won’t work If I understand the doc :

“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:

/interface/vlan add interface=ether2 name=vlan20 vlan-id=20

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.”

I have LAN and WAN in the same bridge, each being a VLAN. Works for years no problem.

Question to you please, is CCR2116 noisy because of fans?

1 Like

You're getting it.

Having a vlan attached to a bare port relegates the untagging to being processed on the CPU, and anything after that can't be offloaded.

You want L3 HW Offloaded FastTrack Connections.

Forget about Inter-VLAN hardware routing for now.

/interface/ethernet/switch/port set [find] l3-hw-offloading=no

You can’t do “hardware routing” between your WAN and your LAN. You need NAT, that requires a firewall that does the NAT. :upside_down_face: