We (very) successfully shape traffic on Linux systems using HTB and are unable to achieve the same control when using MikroTik routers. The most important rule (to us), which we are currently unable to implement, is the ability to prioritise TCP ACK (acknowledgement) packets to ensure the remote system is more quickly able to adjust the transmission rate.
Method we’re using on Linux to prioritise TCP ACK packets:
tc filter add dev $1 parent 1: protocol ip prio 12 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u16 0x0000 0xffc0 at 2 \
match u8 0x10 0xff at 33 \
flowid 1:10;
This works perfectly! Many thanks for the quick tip.
Would anyone have any reference material to substantiate that the 0-123 packet size? I would like to make it as specific as possible but the following is currently working:
The criteria are matched via the logical AND. This means the more criteria that you specify the more restrictive the match will be. I am bewildered as to on how you can be more restrictive and match more. I tried this rule on one of my routers without the size and it it regularly matches traffic.
Are you seeing any traffic being matched when excluding the size limitation?
Attached is a set of rules that simply count matches because the action is passthrough. They were enabled at the exact same time… as you can see the I have a lot more ACK packets then I have ACK packets under 124 bits.
Yeah Josh you are right , it will match a lot more traffic .
bbs , I ran into the EXACT same problem you had as we migrate a lot of netfilter+tc boxes to mtk . At the time I was trying to get it working properly via tcp flags but just could not get it working properly (call it time constraints or rush troubleshooting at 4am) . I’m certain someone smarter than I has a one liner tcp flags to match it perfect
BBS , the secret is in here in the packet details . Do the following on a linux lab / test box and have a look at the size
tcpdump -v -i ethX ‘tcp[13] & 16 != 0’ and src srciporhostnamewhereconnectionisoriginating and less 124 (remember)