/interface/ethernet/switch/port> print stats
name: sfp-sfpplus1 sfp-sfpplus2 sfp-sfpplus3 sfp-sfpplus4 sfp-sfpplus5 sfp-sfpplus6 sfp-sfpplus7 sfp-sfpplus8 ether1 switch1-cpu
driver-rx-byte: 0 452 976 691 0 0 0 0 0 1 086 224 642 130 375
driver-rx-packet: 0 773 965 0 0 0 0 0 945 811 689
driver-tx-byte: 0 1 188 556 474 0 0 0 0 0 453 023 932 39 675
driver-tx-packet: 0 1 055 283 0 0 0 0 0 675 260 214
rx-bytes: 0 527 365 820 0 0 0 0 0 1 369 898 664 137 181 0
rx-too-short: 0 0 0 0 0 0 0 0 0 0
rx-too-long: 0 0 0 0 0 0 0 0 0 0
rx-unicast: 0 912 412 0 0 0 0 0 1 185 318 7 0
rx-broadcast: 0 1 120 0 0 0 0 0 1 218 209 0
rx-pause: 0 0 0 0 0 0 0 0 0 0
rx-multicast: 0 7 748 0 0 0 0 0 1 908 518 0
rx-error-events: 0 0 0 0 0 0 0 0 0 0
rx-fcs-error: 0 0 0 0 0 0 0 0 0 0
rx-fragment: 0 0 0 0 0 0 0 0 0 0
rx-overflow: 0 0 0 0 0 0 0 0 0 0
rx-jabber: 0 0 0 0 0 0 0 0 0 0
tx-bytes: 0 1 473 609 464 0 0 0 0 0 523 059 415 40 531 0
tx-unicast: 0 1 295 077 0 0 0 0 0 818 688 12 0
tx-broadcast: 0 115 0 0 0 0 0 3 99 0
tx-pause: 0 0 0 0 0 0 0 0 0 0
tx-multicast: 0 1 967 0 0 0 0 0 2 103 0
tx-underrun: 0 0 0 0 0 0 0 0 0 0
tx-collision: 0 0 0 0 0 0 0 0 0 0
tx-late-collision: 0 0 0 0 0 0 0 0 0 0
tx-drop: 0 0 0 0 0 0 0 0 0 0
tx-rx-64: 0 39 293 0 0 0 0 0 101 104 63 0
tx-rx-65-127: 0 714 147 0 0 0 0 0 432 308 101 0
tx-rx-128-255: 0 71 389 0 0 0 0 0 152 504 647 0
tx-rx-256-511: 0 29 741 0 0 0 0 0 23 809 137 0
tx-rx-512-1023: 0 26 816 0 0 0 0 0 19 827 0 0
tx-rx-1024-max: 0 1 337 053 0 0 0 0 0 1 277 585 0 0
tx-queue0-packet: 0 1 297 159 0 0 0 0 0 807 319 214 0
tx-queue1-packet: 0 0 0 0 0 0 0 11 374 0 0
tx-queue2-packet: 0 0 0 0 0 0 0 0 0 0
tx-queue3-packet: 0 0 0 0 0 0 0 0 0 0
tx-queue4-packet: 0 0 0 0 0 0 0 0 0 0
tx-queue5-packet: 0 0 0 0 0 0 0 0 0 0
tx-queue6-packet: 0 0 0 0 0 0 0 0 0 0
tx-queue7-packet: 0 0 0 0 0 0 0 0 0 0
i was tracking that for a while, now we know this is realI noticed the CRS309 has 8 hardware TX queues (tx-queue0-packet) but I didn't see how to classify traffic to use each queue.
The current implementation is for QoS Phase 1 - QoS Marking (introduced in RouterOS v7.10).
Greetings, fellow community members!
We are glad to announce the beginning of a new project - Quality of Service Hardware Offloading (QoS-HW), introduced in RouterOS v7.10. The goal of the project is to perform QoS packet marking (VLAN PCP, IP DSCP, and in the future - MPLS EXP), traffic shaping, congestion avoidance/resolution, lossless forwarding, etc. - on the hardware level, which, in turn, means near-to-wire-speed performance.
Documentation: https://help.mikrotik.com/docs/pages/vi ... =189497483
The target devices are those based on Marvell Prestera® DX switch chips: MikroTik CRS3xx, CRS5xx series, CCR2116, and CCR2216. In other words, the devices that support L3HW will eventually support QoS-HW.
We are currently at the beginning of the project: RouterOS v7.10 can perform QoS packet marking on the hardware level. Other QoS features are still in development. The documentation will be available shortly. I'll put the link here once ready.
Your feedback is more than welcome! Please share your vision of QoS enforcement in RouterOS, use-cases, and setups. While the project is in the Beta phase, it is very flexible to adjust to community demand. Also, our QA engineers would like to perform QoS testing based on real setups rather than artificial test cases.
This topic will be updated with recent info regarding QoS HW.
/interface ethernet switch qos map
add name=classify
/interface ethernet switch qos profile
add dscp=8 name=scavanger
add name=best-effort priority=1
add name=class1 priority=1
add name=class2 priority=2
add name=class3 priority=3
add name=class4 priority=4
add name=class5 priority=5
add name=class6 priority=6
add name=class7 priority=7
/interface ethernet switch qos map vlan
add qos-map=classify qos-profile=scavanger
add priority=1 qos-map=classify qos-profile=class1
add priority=2 qos-map=classify qos-profile=class2
add priority=3 qos-map=classify qos-profile=class3
add priority=4 qos-map=classify qos-profile=class4
add priority=5 qos-map=classify qos-profile=class5
add priority=6 qos-map=classify qos-profile=class6
add priority=7 qos-map=classify qos-profile=class7
/interface ethernet switch qos map ip
add dscp=0 qos-map=classify qos-profile=best-effort
add dscp=2 qos-map=classify qos-profile=class1
add dscp=4 qos-map=classify qos-profile=class1
add dscp=6 qos-map=classify qos-profile=class1
add dscp=8 qos-map=classify qos-profile=scavanger
add dscp=10 qos-map=classify qos-profile=scavanger
add dscp=12 qos-map=classify qos-profile=class1
add dscp=14 qos-map=classify qos-profile=class1
add dscp=16 qos-map=classify qos-profile=class1
add dscp=18 qos-map=classify qos-profile=class2
add dscp=20 qos-map=classify qos-profile=class2
add dscp=22 qos-map=classify qos-profile=class2
add dscp=24 qos-map=classify qos-profile=class2
add dscp=26 qos-map=classify qos-profile=class3
add dscp=28 qos-map=classify qos-profile=class3
add dscp=30 qos-map=classify qos-profile=class3
add dscp=32 qos-map=classify qos-profile=class3
add dscp=34 qos-map=classify qos-profile=class3
add dscp=36 qos-map=classify qos-profile=class4
add dscp=38 qos-map=classify qos-profile=class4
add dscp=40 qos-map=classify qos-profile=class4
add dscp=42 qos-map=classify qos-profile=class4
add dscp=44 qos-map=classify qos-profile=class4
add dscp=46 qos-map=classify qos-profile=class5
add dscp=48 qos-map=classify qos-profile=class5
add dscp=50 qos-map=classify qos-profile=class5
add dscp=52 qos-map=classify qos-profile=class5
add dscp=54 qos-map=classify qos-profile=class5
add dscp=56 qos-map=classify qos-profile=class6
add dscp=58 qos-map=classify qos-profile=class7
add dscp=60 qos-map=classify qos-profile=class7
add dscp=62 qos-map=classify qos-profile=class7
/interface/ethernet/switch
port/set sfp-sfpplus1 qos-map=classify qos-trust-l2=keep qos-trust-l3=keep
port/set sfp-sfpplus2 qos-map=classify qos-trust-l2=keep qos-trust-l3=keep
...
Hello, this is interesting news. Are there plans to use the new feature for dynamic queues, e.g. with a PPPoE server on a CCR2216?
Thanks
Hello,Hello, this is interesting news. Are there plans to use the new feature for dynamic queues, e.g. with a PPPoE server on a CCR2216?
Thanks
Maybe not this hardware, but actually some of the SoC do implement PPPoE hardware offloading, as it is a common use case for consumer routers.aditionally i am not sure PPPoE Server can benefit of L3 Hardware Offload at all
If only MikroTik would do that themselves. I.e. finish the unfinished features in v7 before starting a new one.P.S. Please stay on the topic!
that's great news. Thanks for the information.Using hardware QoS for bandwidth limitation is a natural next step for the project, so the feature will likely be implemented in the future. However, the current goals must be met first. The main goal of QoS HW is to provide lossless audio/video switching and (together with L3HW) routing at near-to-wire-speed rates. However, we want to think "out of the box" and make QoS HW as flexible as possible to cover a wider range of possible usage scenarios.
don't know if this could be supported but it would be great if we could prioritize traffic based on TCP/UDP port.
# NOT IMPLEMENTED YET! IT MAY BE A SUBJECT TO CHANGE.
/interface/ethernet/switch/rule add protocol=tcp dst-port=1337 qos-profile=my-prioritized-traffic
Is this for thePort settings
...
By default, ports are untrusted and receive the lowest (0, best-effort) priority, where priority fields are cleared from the egress packets.
dscp
priority
dscp=8
refer to the PCP value or the priority (as unlike higher values in the case of the first two PCP values of 0 and 1 these don't match)?QoS Profile
...
priority (integer: 0..7; Default: 0) - VLAN priority value (IEEE 802.1q PCP - Priority Code Point). ...
First of all thanks for the documentation @raimondsp . Upon checking it I have come across a thing that would be great if clarified:
inIs this for thePort settings
...
By default, ports are untrusted and receive the lowest (0, best-effort) priority, where priority fields are cleared from the egress packets.or theCode: Select alldscp
parameter? As in neither case marks 0 the lowest priority since in case of RFC4594 DiffServ Service Classes (DSCP)Code: Select allpriority
should mark the lowest priority (CS1 Low-Priority Data which is below DF (CS0) Standard in the pecking order). In case of Priority Code Point (PCP) governed by 802.1Q-2022 (IEEE Standard for Local and Metropolitan Area Networks--Bridges and Bridged Networks) currently the lowest priority 0 (for background traffic) has PCP value 1 and the default PCP value 0 is for the one notch higher (priority 1) best effort traffic. So is the above quoted part of the documentation refers to PCP or DSCP?Code: Select alldscp=8
If the above refers to PCP, than PCP value or PCP defined priority as it does make difference since PCP value 0 has priority 1, while PCP value 1 has priority 0.
If the above refers to DSCP, than the same question rises: does it refer to the value, in which case 0 has higher priority (DF (CS0)) than 8 (CS1)?
While we are at it in the same documentation regarding the PCP values therefer to the PCP value or the priority (as unlike higher values in the case of the first two PCP values of 0 and 1 these don't match)?QoS Profile
...
priority (integer: 0..7; Default: 0) - VLAN priority value (IEEE 802.1q PCP - Priority Code Point). ...
Thanks in advance for the explanation (and for clearing this up in the documentation).
/interface/ethernet/switch/qos/profile add name=lowest-priority priority=1 dscp=8
/interface/ethernet/switch/port set ether1 qos-profile=lowest-priority
/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 no no
[admin@router1] > /interface/ethernet/switch/print detail
Flags: I - invalid
0 name="switch1" type=Marvell-98DX3255 mirror-source=none mirror-target=none mirror-egress-target=none l3-hw-offloading=no qos-hw-offloading=no
[admin@router1] > /interface/ethernet/switch/port print detail
Flags: I - invalid
0 name="sfp1.lan" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
1 name="sfp2.wan1" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
2 name="sfp-sfpplus3" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
3 name="sfp-sfpplus4" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
4 name="ether1.wan2" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
5 name="ether2" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
6 name="ether3" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
7 name="ether4" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
8 name="ether5" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
9 name="ether6" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
10 name="ether7" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
11 name="ether8" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
12 name="ether9" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
13 name="ether10" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
14 name="ether11" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
15 name="ether12" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes l3-hw-offloading=yes qos-profile=default qos-map=default qos-trust-l2=ignore qos-trust-l3=ignore
16 name="switch1-cpu" switch=switch1 storm-rate=100 limit-unknown-unicasts=no limit-unknown-multicasts=no limit-broadcasts=yes
/interface/ethernet/switch/rule/print detail
Flags: X - disabled, I - invalid; D - dynamic
0 X ;;; orange dhcp4 COS6
switch=switch1 ports=sfp2.wan1 mac-protocol=ip vlan-id=832 protocol=udp dst-port=67 copy-to-cpu=no redirect-to-cpu=no mirror=no new-vlan-priority=6
1 X ;;; orange dhcp6 COS6
switch=switch1 ports=sfp2.wan1 mac-protocol=ipv6 vlan-id=832 protocol=udp dst-port=547 copy-to-cpu=no redirect-to-cpu=no mirror=no new-vlan-priority=6
2 X ;;; orange icmp6 COS6 (fe00::/7 = fe80::/10 + ff02::/16)
switch=switch1 ports=sfp2.wan1 mac-protocol=ipv6 vlan-id=832 protocol=icmp dst-address6=fe00::/7 copy-to-cpu=no redirect-to-cpu=no mirror=no new-vlan-priority=6
3 X ;;; orange arp COS6
switch=switch1 ports=sfp2.wan1 mac-protocol=arp vlan-id=832 copy-to-cpu=no redirect-to-cpu=no mirror=no new-vlan-priority=6
Thanks.
Do i need to enable on the switch ?
/interface/ethernet/switch/set l3-hw-offloading=yes
Does my current switch rules will work or do i need to rewrite them ?
thanks
I am interested to know this too.is a little off topic but i have the following question:
is MikroTik considering in the long term to have some Eggress ACL (switch rules) support on CRS Switches ?
NoI'm wondering as well, does this QoS-HW mean fq-codel traffic shaping in hardware as opposed to a CPU only thing?
Cheers
Paul
In general I prefer bql + cake split evenly between all hardware tx queues vs QoS & diffserv applied this way because it leverages the scarcest resource, CPU. diffserv is a fiddly distraction compared to aqm and fq in the first place. A little diffserv on top of that can help, but first you gotta keep the queues short and the packets well mixed.QoS-HW is compatible with L3HW. You can use both features together.
Every supported device has 8 TX queues per port, and users will be able to assign QoS profiles to TX queues: either grant a QoS profile exclusive access to a queue or share a queue (or group of queues) between multiple profiles. The feature is still in development and not available yet. Meanwhile, all QoS profiles share all TX queues, i.e., there is no QoS enforcement yet.
It never worked.Hello,
I don't know if it related or not. Sorry if i made a mistake to post here.
I am currently using switch rules on a CRS305 in front of CCR2116 tp change COS on DHCP (ipv6 ipv4) requests. These DHCP requests with COS 6 are a requirement to authenticate to my ISP.
I decided to remove the CRS305 and use only the CCR2116. Of course i moved the switch rules from the CRS305 to the CCR.
But the rules do not work at all. Switch rules to change COS are never applied.
I am not sure, but i think i have understand that the switch are applied to ingress traffic, not egress. I my case, the DHCP client requests are of course egress from the CCR to my ISP.
Am i right or i make a mistake ?
Is there a workaround to change COS for DHCP egress requests ?
thanks.
Hello,
Where Can I find manual exactly for the feature of hw-qos Per-queue traffic shaping, which was introduced in 7.15?
Could not find this topic in official manual about HW-qos at help.mikrotik.com
Hello,
how I can offload the simple-queues, configured on my ccr2116
Hi,
Can you tell me shortly, If in Ros 7.15 on ccr2116, it is possible to have per ip down/up shaper in hardware?
for example
1000 subscribers on 10mb/s down/up
800 subscribers on 20mb/s
2000 subscribers on 30mb/s?
Hi,
Can you tell me shortly, If in Ros 7.15 on ccr2116, it is possible to have per ip down/up shaper in hardware?
for example
1000 subscribers on 10mb/s down/up
800 subscribers on 20mb/s
2000 subscribers on 30mb/s?
Hi, the short answer is - yes, it is possible. But I guess there will be a follow-up question "how?" - that I'll answer a bit later.
/interface/ethernet/switch/qos/profile
add comment="20M subs" name=tc2 traffic-class=2
add comment="30M subs" name=tc3 traffic-class=3
/interface/ethernet/switch/qos/tx-manager/queue
set [find where traffic-class=1] schedule=low-priority-group weight=1
set [find where traffic-class=2] schedule=low-priority-group weight=2
set [find where traffic-class=3] schedule=low-priority-group weight=3
/interface/ethernet/switch/qos/port
set sfp-sfpplus1,sfp-sfpplus2 egress-rate-queue1=10M
set sfp-sfpplus1,sfp-sfpplus2 egress-rate-queue2=20M
set sfp-sfpplus1,sfp-sfpplus2 egress-rate-queue3=30M
/interface/ethernet/switch/rule
add new-qos-profile=tc2 ports=sfp-sfpplus1 src-address=192.168.24.0/21 switch=switch1
add new-qos-profile=tc2 ports=sfp-sfpplus2 dst-address=192.168.24.0/21 switch=switch1
add new-qos-profile=tc3 ports=sfp-sfpplus1 src-address=192.168.32.0/21 switch=switch1
add new-qos-profile=tc3 ports=sfp-sfpplus2 dst-address=192.168.32.0/21 switch=switch1
[admin@MikroTik] /interface/ethernet/switch/qos/profile> print
Flags: H - HW-OFFLOADED
Columns: NAME, PCP, DSCP, TRAFFIC-CLASS, COLOR
# NAME PCP DSCP TRAFFIC-CLASS COLOR
;;; default QoS profile
0 H default 0 0 1 green
;;; 20M subs
1 H tc2 0 0 2 green
;;; 30M subs
2 H tc3 0 0 3 green
[admin@MikroTik] /interface/ethernet/switch/qos/tx-manager/queue> print where hw-offloaded
Flags: H - HW-OFFLOADED
Columns: TX-MANAGER, TRAFFIC-CLASS, SCHEDULE, WEIGHT, QUEUE-BUFFERS, USE-SHARED-BUFFERS, SHARED-POOL-INDEX
# TX-MANAGER TRAFFIC-CLASS SCHEDULE WEIGHT QUEUE-BUFFERS USE-SHARED-BUFFERS SHARED-POOL-INDEX
1 H default 1 low-priority-group 1 auto yes 0
2 H default 2 low-priority-group 2 auto yes 0
3 H default 3 low-priority-group 3 auto yes 0
[admin@MikroTik] /interface/ethernet/switch/qos/port> print proplist=name,egress-rate-queue1,egress-rate-queue2,egress-rate-queue3 where name=sfp-sfpplus1 or name=sfp-sfpplus2
Columns: NAME, EGRESS-RATE-QUEUE1, EGRESS-RATE-QUEUE2, EGRESS-RATE-QUEUE3
# NAME EGRESS-RATE-QUEUE1 EGRESS-RATE-QUEUE2 EGRESS-RATE-QUEUE3
0 sfp-sfpplus1 10.0Mbps 20.0Mbps 30.0Mbps
1 sfp-sfpplus2 10.0Mbps 20.0Mbps 30.0Mbps
[admin@MikroTik] /interface/ethernet/switch/rule> print
Flags: X - disabled, I - invalid; D - dynamic
0 switch=switch1 ports=sfp-sfpplus1 src-address=192.168.2.0/24 copy-to-cpu=no redirect-to-cpu=no mirror=no
new-qos-profile=tc2 keep-qos-fields=no
1 switch=switch1 ports=sfp-sfpplus2 dst-address=192.168.2.0/24 copy-to-cpu=no redirect-to-cpu=no mirror=no
new-qos-profile=tc2 keep-qos-fields=no
2 switch=switch1 ports=sfp-sfpplus1 src-address=192.168.3.0/24 copy-to-cpu=no redirect-to-cpu=no mirror=no
new-qos-profile=tc3 keep-qos-fields=no
3 switch=switch1 ports=sfp-sfpplus2 dst-address=192.168.3.0/24 copy-to-cpu=no redirect-to-cpu=no mirror=no
new-qos-profile=tc3 keep-qos-fields=no
Hi,
My ISP (Orange France) require that ICMP and DHCP (clients) requests marked COS 6 and DSCP 6.
Currently, I am using another switch (CRS310) with the GPON SFP and some switch rules on it, because switch rules only work with input requests (not output).
Today (with 7.15), is it possible to use switch rules for outgoing ?
In this case, I could use switch rules directly on my CCR2116 (with the GPON SFP inside) and avoid using another switch.
Thanks.
Hi, the short answer is - yes, it is possible. But I guess there will be a follow-up question "how?" - that I'll answer a bit later.
Starting from v7.15, RouterOS allows setting per-queue shaper. One option to assign traffic to a queue is by setting a QoS Profile via a Switch Rule.
For simplicity, let's imagine that all clients are connected to sfp-sfpplus1, forwarding all traffic to sfp-sfpplus2. Feel free to expand the example based on your needs.
- Create QoS profiles. We can leave the default profile for 10M subscribers, but redirect 20M and 30M subscribers to queue2 and queue3, respectively.
Code: Select all/interface/ethernet/switch/qos/profile add comment="20M subs" name=tc2 traffic-class=2 add comment="30M subs" name=tc3 traffic-class=3
- I guess we don't want 30M traffic to completely block 20M and 10M subscribers, so let's schedule all three traffic classes under the same priority group, adjusting the weight based on speed:
Code: Select all/interface/ethernet/switch/qos/tx-manager/queue set [find where traffic-class=1] schedule=low-priority-group weight=1 set [find where traffic-class=2] schedule=low-priority-group weight=2 set [find where traffic-class=3] schedule=low-priority-group weight=3
- Limit egress rate of the respective queues:
Code: Select all/interface/ethernet/switch/qos/port set sfp-sfpplus1,sfp-sfpplus2 egress-rate-queue1=10M set sfp-sfpplus1,sfp-sfpplus2 egress-rate-queue2=20M set sfp-sfpplus1,sfp-sfpplus2 egress-rate-queue3=30M
- Define ACL rules to match traffic by IP. For example, if all 20M subs are in 192.168.24.0/21subnet, and 30M - 192.168.32.0/21:
Code: Select all/interface/ethernet/switch/rule add new-qos-profile=tc2 ports=sfp-sfpplus1 src-address=192.168.24.0/21 switch=switch1 add new-qos-profile=tc2 ports=sfp-sfpplus2 dst-address=192.168.24.0/21 switch=switch1 add new-qos-profile=tc3 ports=sfp-sfpplus1 src-address=192.168.32.0/21 switch=switch1 add new-qos-profile=tc3 ports=sfp-sfpplus2 dst-address=192.168.32.0/21 switch=switch1
Here is the print output for reference:Code: Select all[admin@MikroTik] /interface/ethernet/switch/qos/profile> print Flags: H - HW-OFFLOADED Columns: NAME, PCP, DSCP, TRAFFIC-CLASS, COLOR # NAME PCP DSCP TRAFFIC-CLASS COLOR ;;; default QoS profile 0 H default 0 0 1 green ;;; 20M subs 1 H tc2 0 0 2 green ;;; 30M subs 2 H tc3 0 0 3 green [admin@MikroTik] /interface/ethernet/switch/qos/tx-manager/queue> print where hw-offloaded Flags: H - HW-OFFLOADED Columns: TX-MANAGER, TRAFFIC-CLASS, SCHEDULE, WEIGHT, QUEUE-BUFFERS, USE-SHARED-BUFFERS, SHARED-POOL-INDEX # TX-MANAGER TRAFFIC-CLASS SCHEDULE WEIGHT QUEUE-BUFFERS USE-SHARED-BUFFERS SHARED-POOL-INDEX 1 H default 1 low-priority-group 1 auto yes 0 2 H default 2 low-priority-group 2 auto yes 0 3 H default 3 low-priority-group 3 auto yes 0 [admin@MikroTik] /interface/ethernet/switch/qos/port> print proplist=name,egress-rate-queue1,egress-rate-queue2,egress-rate-queue3 where name=sfp-sfpplus1 or name=sfp-sfpplus2 Columns: NAME, EGRESS-RATE-QUEUE1, EGRESS-RATE-QUEUE2, EGRESS-RATE-QUEUE3 # NAME EGRESS-RATE-QUEUE1 EGRESS-RATE-QUEUE2 EGRESS-RATE-QUEUE3 0 sfp-sfpplus1 10.0Mbps 20.0Mbps 30.0Mbps 1 sfp-sfpplus2 10.0Mbps 20.0Mbps 30.0Mbps [admin@MikroTik] /interface/ethernet/switch/rule> print Flags: X - disabled, I - invalid; D - dynamic 0 switch=switch1 ports=sfp-sfpplus1 src-address=192.168.2.0/24 copy-to-cpu=no redirect-to-cpu=no mirror=no new-qos-profile=tc2 keep-qos-fields=no 1 switch=switch1 ports=sfp-sfpplus2 dst-address=192.168.2.0/24 copy-to-cpu=no redirect-to-cpu=no mirror=no new-qos-profile=tc2 keep-qos-fields=no 2 switch=switch1 ports=sfp-sfpplus1 src-address=192.168.3.0/24 copy-to-cpu=no redirect-to-cpu=no mirror=no new-qos-profile=tc3 keep-qos-fields=no 3 switch=switch1 ports=sfp-sfpplus2 dst-address=192.168.3.0/24 copy-to-cpu=no redirect-to-cpu=no mirror=no new-qos-profile=tc3 keep-qos-fields=no
P.S. We'll add "/in/eth/sw/qos/port print rates" for more convenient output in RouterOS v7.16.
Hello,
THanks for your answer, I tested it and it works
1. I have 2 following questions: can I make more then 8 internet packages? ( as I noticed it is bound with traffic classes )
2. what if subscribers in the same ip subnet have different internet packages?
/interface/ethernet/switch/rule
add new-qos-profile=tc3 ports=sfp-sfpplus1 src-address=192.168.10.15/32 switch=switch1
add new-qos-profile=tc2 ports=sfp-sfpplus1 src-address=192.168.10.0/24 switch=switch1
This shaper will limit on per IP basis as lashguti requested? Or its one common 20 mbps pool for all IPs in 192.168.24.0/21?Starting from v7.15, RouterOS allows setting per-queue shaper. One option to assign traffic to a queue is by setting a QoS Profile via a Switch Rule.Hi,
Can you tell me shortly, If in Ros 7.15 on ccr2116, it is possible to have per ip down/up shaper in hardware?
for example
1000 subscribers on 10mb/s down/up
800 subscribers on 20mb/s
2000 subscribers on 30mb/s?
For simplicity, let's imagine that all clients are connected to sfp-sfpplus1, forwarding all traffic to sfp-sfpplus2. Feel free to expand the example based on your needs.
...
/interface/ethernet/switch/rule
add new-qos-profile=tc2 ports=sfp-sfpplus1 src-address=192.168.24.0/21 switch=switch1
add new-qos-profile=tc2 ports=sfp-sfpplus2 dst-address=192.168.24.0/21 switch=switch1
It is actually a per-port, per-queue shaper. Connecting each client to an individual physical port will give you per-client shaping while connecting an entire subnet to one router port will give per-subnet shaping. Using QoS HW enforcement for IP traffic shaping is a temporary workaround rather than a solution. Top-end switch chips provide metering and policing features for per-flow QoS, which we will eventually implement.This shaper will limit on per IP basis as lashguti requested? Or its one common 20 mbps pool for all IPs in 192.168.24.0/21?
If its per-IP shaper, how can I configure one common shaper for entire subnet? Thanks.
I need to achieve two main goals with my QoS setup on a CCR2116 and would like to use L3HW if possible:
1. De-prioritize all traffic on TCP port 21 (FTP).
2. Prioritize all VoIP traffic by matching DSCP values.
Is this possible with QoS-HW? What would the configuration look like, as an example?
/interface/ethernet/switch/qos/profile add name=lowest-priority traffic-class=0
/interface/ethernet/switch/rule add switch=switch1 ports=ether1 protocol=tcp src-port=21 new-qos-profile=lowest-priority
/interface/ethernet/switch/rule add switch=switch1 ports=ether2,ether3,ether4 protocol=tcp dst-port=21 new-qos-profile=lowest-priority
Thank you very helpful. But what if the uplink port has a 10G link but ISP bandwidth is only 5G? How can I make sure the buffer is not saturated at the ISP and thereby nullifying the priority queues? For example, should I set the sfp1 interface to 95% of 5Gbps so that the switch QoS takes effect? How would that look with WRED and ECN. Thank you
/interface/ethernet/switch/port set sfp1 egress-rate=5G
For some reason when I do this, max bandwidth gets capped around 800Mbps not 5GYou can limit the egress rate of the port (or even a particular queue):Code: Select all/interface/ethernet/switch/port set sfp1 egress-rate=5G
# 2024-06-17 06:50:40 by RouterOS 7.16beta2
# software id = L70L-YK87
#
# model = CCR2116-12G-4S+
/interface bridge
add name=bridge1 protocol-mode=none
add name=containers
/interface ethernet
set [ find default-name=sfp-sfpplus1 ] name=sfp-sfpplus1-Hotwire
set [ find default-name=sfp-sfpplus4 ] name=sfp-sfpplus4-LAN
/interface ethernet switch
set 0 l3-hw-offloading=yes qos-hw-offloading=yes
/interface ethernet switch port
set 0 l3-hw-offloading=no
/interface ethernet switch qos port
set sfp-sfpplus1-Hotwire trust-l3=keep
set sfp-sfpplus2 trust-l3=keep
set sfp-sfpplus3 trust-l3=keep
set sfp-sfpplus4-LAN trust-l3=keep
set ether1 trust-l3=keep
set ether2 trust-l3=keep
set ether3 trust-l3=keep
set ether4 trust-l3=keep
set ether5 trust-l3=keep
set ether6 trust-l3=keep
set ether7 trust-l3=keep
set ether8 trust-l3=keep
set ether9 trust-l3=keep
set ether10 trust-l3=keep
set ether11 trust-l3=keep
set ether12 trust-l3=keep
set switch1-cpu trust-l3=keep
/interface ethernet switch qos profile
add dscp=56 name=dante-ptp pcp=7 traffic-class=7
add dscp=46 name=dante-audio pcp=5 traffic-class=5
add dscp=8 name=dante-low pcp=1 traffic-class=0
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/interface bridge port
add bridge=bridge1 fast-leave=yes interface=ether13
add bridge=bridge1 fast-leave=yes interface=ether1
add bridge=bridge1 fast-leave=yes interface=ether2
add bridge=bridge1 fast-leave=yes interface=ether3
add bridge=bridge1 fast-leave=yes interface=ether4
add bridge=bridge1 fast-leave=yes interface=ether5
add bridge=bridge1 fast-leave=yes interface=ether6
add bridge=bridge1 fast-leave=yes interface=ether7
add bridge=bridge1 fast-leave=yes interface=ether8
add bridge=bridge1 fast-leave=yes interface=ether9
add bridge=bridge1 fast-leave=yes interface=ether10
add bridge=bridge1 fast-leave=yes interface=ether11
add bridge=bridge1 fast-leave=yes interface=ether12
add bridge=bridge1 fast-leave=yes interface=sfp-sfpplus2
add bridge=bridge1 fast-leave=yes interface=sfp-sfpplus3
add bridge=bridge1 fast-leave=yes interface=sfp-sfpplus4-LAN
add bridge=containers fast-leave=yes interface=veth1-kuma
/interface ethernet switch l3hw-settings
set ipv6-hw=yes
/interface ethernet switch qos map ip
add dscp=56 profile=dante-ptp
add dscp=46 profile=dante-audio
add dscp=8 profile=dante-low
/interface ethernet switch qos tx-manager queue
set 1 weight=1
set 2 schedule=strict-priority
set 3 schedule=strict-priority
set 4 schedule=strict-priority
set 5 schedule=strict-priority
/interface ethernet switch rule
add dst-port=563 new-qos-profile=dante-low ports=sfp-sfpplus1-Hotwire protocol=tcp switch=switch1
/interface list member
add interface=sfp-sfpplus1-Hotwire list=WAN
add interface=bridge1 list=LAN
The config looks file. Please check if bridge1 has the H flag in "/interface/bridge print". The switch chip supports only one hardware bridge, let's double-check if the system picked the right one.For some reason when I do this, max bandwidth gets capped around 800Mbps not 5GYou can limit the egress rate of the port (or even a particular queue):Code: Select all/interface/ethernet/switch/port set sfp1 egress-rate=5G
Also, I followed the Dante instructions but it does not seem like the below configuration has any effect. Additionally, traffic on port 563 does not appear to be deprioritized. Am I missing something? Suggestions? Thanks in advance
/interface/ethernet/switch/qos/port print stats where running
The config looks file. Please check if bridge1 has the H flag in "/interface/bridge print". The switch chip supports only one hardware bridge, let's double-check if the system picked the right one.
[adam@gw01] /interface/bridge> /interface/bridge print
Flags: X - disabled, R - running
0 R name="bridge1" mtu=auto actual-mtu=1500 l2mtu=1584 arp=enabled arp-timeout=auto mac-address=D4:01:C3:0E:BC:7E protocol-mode=none
fast-forward=yes igmp-snooping=no auto-mac=yes ageing-time=5m vlan-filtering=no dhcp-snooping=no port-cost-mode=long mvrp=no
forward-reserved-addresses=no max-learned-entries=auto
1 R name="containers" mtu=auto actual-mtu=1500 l2mtu=65535 arp=enabled arp-timeout=auto mac-address=FE:45:01:62:6A:6B protocol-mode=rstp
fast-forward=yes igmp-snooping=no auto-mac=yes ageing-time=5m priority=0x8000 max-message-age=20s forward-delay=15s transmit-hold-count=6
vlan-filtering=no dhcp-snooping=no port-cost-mode=long mvrp=no max-learned-entries=auto
Use the following command to print per-queue port stats and see if there any traffic on queue0 and queue5. The default traffic goes through queue1.Code: Select all/interface/ethernet/switch/qos/port print stats where running
[adam@gw01] /interface/bridge> /interface/ethernet/switch/qos/port print stats where running
name: sfp-sfpplus1-Hotwire sfp-sfpplus4-LAN
tx-packet: 166 504 678 725 159 119
tx-byte: 81 999 221 054 970 145 466 206
drop-packet: 6
drop-byte: 8 724
tx-queue0-packet: 22 922 49 774 095
tx-queue1-packet: 166 460 861 675 338 235
tx-queue5-packet: 20 884 43 230
tx-queue7-packet: 11 3 559
tx-queue0-byte: 3 921 218 62 196 321 974
tx-queue1-byte: 81 991 322 136 907 936 713 946
tx-queue5-byte: 3 976 820 11 259 634
tx-queue7-byte: 880 1 170 652
drop-queue0-packet: 6
drop-queue0-byte: 8 724
/in/bridge/port print
[adam@gw01] /interface/bridge> /interface/bridge print
Flags: X - disabled, R - running
0 R name="bridge1" mtu=auto actual-mtu=1500 l2mtu=1584 arp=enabled arp-timeout=auto mac-address=D4:01:C3:0E:BC:7E protocol-mode=none
fast-forward=yes igmp-snooping=no auto-mac=yes ageing-time=5m vlan-filtering=no dhcp-snooping=no port-cost-mode=long mvrp=no
forward-reserved-addresses=no max-learned-entries=auto
interface ethernet switch
set 0 qos-hw-offloading=yes
/interface ethernet switch qos port
set Router trust-l2=keep trust-l3=keep
set ONT trust-l2=keep trust-l3=keep
/interface ethernet switch qos profile
add comment="Orange BNC reqs - PCP=6, DSCP=48 (CS6)" dscp=48 name=orange-prio-bng pcp=6 \
traffic-class=6
/interface ethernet switch rule
add comment="Modify QoS profile for Orange ISP - ARP traffic" mac-protocol=arp new-qos-profile=\
orange-prio-bng ports=Router switch=switch1 vlan-id=832
add comment="Modify QoS profile for Orange ISP - DHCPv4" dst-port=67 mac-protocol=ip \
new-qos-profile=orange-prio-bng ports=Router protocol=udp switch=switch1 vlan-id=832
add comment="Modify QoS profile for Orange ISP - DHCPv6" dst-port=547 mac-protocol=ipv6 \
new-qos-profile=orange-prio-bng ports=Router protocol=udp switch=switch1 vlan-id=832
Hi @Larsa, Thank you for your reply. My intention is to ask the product owner at Mikrotik about the coverage level of these new QoS features regarding RoCE, specifically the RoCEv1 Layer 2 / QoS features. I'm also interested in whether they think these features are mature enough or need more time. While I understand that PFC and ETS are crucial, I'm aware there might be additional L2 features involved, hence the 'etc.' in your response. Leveraging the switch chips' hardware RoCE features would be fantastic.Maybe you should study how RoCE and its different versions work. V1 operates at L2 with various helpers according to DCB (e.g., PFC, ETS, etc.) which sometime is called lossless Ethernet. But you can also manage without it by using other means like standard switches and handling the flow controll in the device driver endpoints. V2 operates at L3 (UDP).
/interface ethernet switch port set ether1 ingress-rate=1G egress-rate=1G
queue simples does not have any relationship with QoS done on switches by hardware
have you tried routeros 7.16.2 ? since 7.16 winbox include QoS in GUIHello!
While going over the QoS Examples here: https://help.mikrotik.com/docs/spaces/R ... vice-Dante
I struggle understanding the syntax.
Example: WHY do I have to setup a QOS MAPPING if there is already a QOS PROFILE??
Doesn't the PROFILE already define everything the switch needs to know, like which incoming DSCP is put into which queue?
Thanks for some fundamental help with the syntax or the concept.