I noticed that there was a lot of interest in SQM and buffbloat, and I did a simple test of how SQM works.
The buffbloat problem was not obvious in my network environment, so I set up the following test environment.
- As shown in the figure, three routers are cascaded through the LAN→WAN connection
- Run the iperf3 server on Router A
- In order to simulate network congestion, we limit the speed of the MAC address of the Test device on Router B. The lower the rate limit value is, the more obvious the effect will be.
- The Test device can open two consoles. One console can ping the gateway address of Router A and observe the ping latency, other console runs the iperf3 command.
- As can be seen, when iperf3 is running, the ping latency will rise sharply, as shown in the red box below, which proves that buffbloat exists on the network.
Now we need to configure qos policies to improve buffbloat. Execute the following script. I am using XE300, the WAN port is eth1, and set the rate to about 70% of the bandwidth.
tc qdisc replace dev eth1 root cake docsis ack-filter bandwidth 40kbps ip link add name ifb4eth1 type ifb tc qdisc del dev eth1 ingress tc qdisc add dev eth1 handle ffff: ingress tc qdisc del dev ifb4eth1 root tc qdisc add dev ifb4eth1 root cake bandwidth 40kbps besteffort wash ip link set ifb4eth1 up # important tc filter add dev eth1 parent ffff: matchall action mirred egress redirect dev ifb4eth1
iperf3 -c 192.168.99.1 -p 3030 -t 10 -P 10 on the test device to measure the uplink data of the Test router.
There will still be latency, but this is much better than before, indicating that buffbloat has improved.
iperf3 -c 192.168.99.1 -p 3030 -t 10 -P 10 -R on the test device to measure the downlink data of the Test router.
Latency is almost the same as before the qos policy was set and has not improved
For the above test, I refer to the official buffbloat example.CakeRecipes - Bufferbloat.net
I tried to configure layer_cake.qos and piece_of_cake.qos scripts directly using sqm-script and got the same results.
SQM’s cake strategy improves upstream buffbloat from testing results, but if a device on your network is downloading a large file, your other devices may still encounter buffbloat.
Of course, my knowledge of qos configuration is very limited, and this is a very hasty conclusion. If you have any other test suggestions, please let me know