I've installed SQM and what I'm trying to do is classify manually the packets by marking them with DSCP marks. I want to priorize some ports with DSCP marking for an online game.
But something seems to be wrong in my config because the outbound packets are not marked as Wireshark shows:
I'm using basic firewall traffic rules to mark them, do I need other way to mark them properly?
My custom rules for these ports:
## This is the rule that doesn't work, I can't mark the packets
that outgoes from my IP LAN to the destination port of the game
server
config rule
option name 'Battlefield 3659'
option family 'ipv4'
list proto 'udp'
option src_port '3659'
option target 'DSCP'
option set_dscp 'CS7'
option dest 'wan'
option src 'lan'
list src_ip '192.168.1.3'
## This rule works, I can receive the packets from
the game server to my PC marked as CS7
config rule
option name 'Battlefield 25200'
list proto 'udp'
option src 'wan'
option src_port '25200'
option dest 'lan'
option dest_port '3659'
option target 'DSCP'
option set_dscp 'CS7'
list dest_ip '192.168.1.3'
You can capture on the WAN interface to confirm the outbound marks. But the other issue is your Inbound rule is ineffective because the firewall gets the inbound packet AFTER SQM has already classified and prioritized it. It looks good in a capture, but doesn’t influence SQM at all.
Note if your game runs on Windows you might be able to set DSCPs directly on windows, but that still only affects packets from your gaming computer to the servers.
Quick note, some ISPs will only re-mark packets but some will drop CS7/CS6 packets directly, so maybe do not let these marls escape into your ISP's network (using cake's wash option) or pick a less problematic DSCP, like EF (which still lands in cake's highest priority tin).
I have installed the script and it only works with the destination port of the game server. It only marks the packets of the game server port 25200 (inbound packets).
I still have the same problem, the 3659 client port (outbound packets) of my computer can't be marked with the specific DSCP value with this script, so I get CS0 DSCP with the 3659 source port to 25200 destination port.
I've read this:
By the way, with this approach you can set DSCPs in the router or in LAN clients (for upload), and then these will get automatically applied on download too.
The way this works is that any DSCP in an upload packet is stored to conntrack, and then that stored DSCP is also set on the download packet for the same connection (restored from conntrack).
For example this can be done in Windows like this:
Using the firewall rule, and run your tcpdump capture on the router wan port. Are you using tcpdump on the router to capture packets? You should be if you want to see the outbound marks. If you're only capturing with Wireshark on the game machine, you won't see what the router is marking for outbound.
So, yes, CAKE is washing the packets with CS0 after "tinning" them. You can be assured it's working on the outbound traffic if your inbound traffic is showing up as CS4. The script is saving the CS4 on the outbound packet, and applying it to the inbound reply packets. Magic.
If you want to be able to see it in tcpdump, update the script config file to add nowash to the cake_ul_options.
Likely you didn't stop and disable sqm before installing cake-qos-simple.
@thomas24 you can also inspect the tinning in respect of download and upload by running ‘service cake-qos-simple download’ and ‘service cake-qos-simple upload’.