Ultimate SQM settings: Layer_cake + DSCP marks

Connbyte with avgpkt has already taken packet length into account. Specifically, upload and download traffic need to be separately considered.

Take LOL for example.
ipv4 2 udp 17 179 src= dst= sport=8786 dport=7080 packets=55483 bytes=4841699 src= dst= sport=7080 dport=8786 packets=65694 bytes=12491560 [ASSURED] mark=80 zone=0 use=2

Average upload packet length: 4841699/55483≈87
Average download packet length: 12491560 / 65694≈190
Games like DNF will have larger download packet length around 300-400.

I am using connmark to avoid those connections whose rates are bouncing back and forth. The following two rules are used to save CPU cycles by only checking connections with no connmark and remove connmark with a probability of 0.5% in order to let some connections checked again later.

$ipt -A PREROUTING -m conntrack --ctstate RELATED,ESTABLISHED -m connmark ! --mark 0xf0/0xf0 -m connmark ! --mark 0x60/0xf0 -m connmark ! --mark 0x70/0xf0 -m statistic --mode random --probability 0.005 -j CONNMARK --and-mark 0xff0f
$ipt -A PREROUTING -i br-lan -m connmark --mark 0x0/0xf0 -j mark_DSCP_ul