Service quality on MikroTik ensures reliable performance and consistent delivery.
Service quality on MikroTik ensures reliable performance and consistent delivery.
Hello! First, I want to note that I’ve already explored the Mikrotik Wiki, looked at various configuration samples, and read numerous forum discussions about QoS settings similar to what I’m trying to set up. Since I’m relatively new to networking, there’s a chance I might have overlooked some key details. My current arrangement is:
- Mikrotik operates in "ap bridge" mode, using its single LAN port to link to a Linux desktop. It’s set to the 2.4GHz B channel so bandwidth is capped at about 10Mbit/s (I actually see around 6Mbit/s). All ports are bridged.
- A Linux laptop connects to the same 2.4GHz channel. I’ve written a simple TCP client-server program to test ping-like messages over TCP, sending and receiving them reliably.
My goal now is to ensure at least 200kbit/s reaches the ping-like connection while I run iperf3 to saturate the link. The laptop acts as the client, sending a “double” signal via WiFi to the desktop, which then forwards it. I aim to prioritize this traffic using Queue Trees.
To achieve this, I configured the tree with specific limits and priorities:
- Set max-limit=10M for high-priority traffic.
- Assign priority levels and mark packets accordingly.
- Use bridge rules to direct flows correctly.
In theory, this should secure 200kbit/s for my ping traffic and 2Mbit/s for iperf3, with the rest routed based on priorities. In practice, since the ping connection already uses ~150kbit/s, the rest should go to iperf.
To make the Queue Tree function properly, I marked packets with appropriate flags. I checked the logs and counters, and they seem to reflect the changes correctly.
However, when I run iperf3 and start my ping client, it doesn’t consistently hit the 2Mbit/s target—it lags significantly (RTT around 500ms). The ping connection itself appears to be working fine, but the traffic isn’t being prioritized as expected.
Could there be something missing in my setup? I’m still learning, so your advice might be more insightful than I realize. Please let me know if you have any suggestions or adjustments!
P.S. Here’s the full router configuration: https://pastebin.com/yXix5fwb
Traffic shaping performs poorly on wireless connections since it depends on a fixed bandwidth. Restricting data to 10 Mbps and the link dropping to 6 Mbps breaks QoS effectiveness, causing packets to accumulate in the WiFi driver. WMM addresses this issue by operating at the MAC layer, prioritizing high-traffic flows over low-priority ones. A script exists for MikroTik RouterOS to activate WMM on both wireless interfaces and set firewall rules using DSCP. You can also configure IP_TOS socket options to mark pings appropriately. Another option is using adapters with ath9k support, which employs FQ-CoDel to implicitly prioritize sparse traffic like pings, ensuring uniform low latency without classification.