Hi! I want to know how to use tc command correctly on a access point's wireless interface.
I found ap's wireless interface ap1-wlan1 can not filter packets correctly!!!
Here are my commands for you to reproduce:
- sudo mn --wifi
- xterm ap1
- in ap1's xterm: sudo tc qdisc del dev ap1-wlan1 root (to delete queues already exist because I need prio qdisc)
- then create qdiscs and classes:
- sudo tc qdisc add dev ap1-wlan1 root handle 1: prio
- sudo tc qdisc add dev ap1-wlan1 parent 1:1 handle 10: sfq
- sudo tc qdisc add dev ap1-wlan1 parent 1:2 handle 20: tbf rate 20kbit buffer 1600 limit 3000
- sudo tc qdisc add dev ap1-wlan1 parent 1:3 handle 30: sfq
- then create filters:
- sudo tc filter add dev ap1-wlan1 parent 1:0 protocol ip prio 1 u32 match ip tos 0x28 0xff flowed 1:1
- sudo tc filter add dev ap1-wlan1 parent 1:0 protocol ip prio 1 u32 match ip tos 0x48 0xff flowed 1:2
- sudo tc filter add dev ap1-wlan1 parent 1:0 protocol ip prio 1 u32 match ip tos 0x68 0xff flowed 1:3
After input these commands, I use ping to test:(in Mininet-wifi CLI)
- sta1 ping sta2 -c 5 -Q 0x28
- sta1 ping sta2 -c 5 -Q 0x48
- sta1 ping sta2 -c 5 -Q 0x68
Then use "
sudo tc -s qdisc show dev ap1-wlan1" to see statistics. On my computer, all packets go to 1:2 qdisc which refers to tos 0x48, this confuses me!
I think there should be 3 packets in 1:1, and 3 packets in 1:2, and 3 packets in 1:3. Did I do something wrong?
Please tell me, thank you ver much!