tc qdisc - a prio problem
Hi, I need some help with TC and prio.
I got HTB to work, but since I have a wireless dynamic mesh network (the bandwidth can vary between 0.1 and 30 Mbit/s depending on setup and scenario) I never know the current rate and therefore need to use a dynamic prio queue instead.
Simple test network:
[CLIENT1 - eth0] -wired- [eth0 - PLATFORM1 - ath0/wifi0] ---wireless--- [ath0/wifi0 - PLATFORM2 - eth0] -wired- [eth0 - CLIENT2]
I have six video streams running simultaneously (using vlc and a constant bit rate video of 6 Mbit/s) from CLIENT1 to CLIENT2 on different ports. The bandwidth between CLIENT1 and CLIENT2 is ~30 Mbit/s, resulting in some what crappy quality on all six video streams.
My goal is to get one of the streams (port 1234, udp) to be prioritized, which I guess should result in this video stream getting the full 6Mbit/s.
tc rules (on PLATFORM1):
--------------------------------------------------
# Flush ath0
tc qdisc del dev ath0 root
# Root qdisc is prio with 3 bands
tc qdisc add dev ath0 root handle 1:0 prio bands 3
# Band 1 qdisc is sfq and filter is OLSR
tc qdisc add dev ath0 parent 1:1 sfq perturb 16
tc filter add dev ath0 protocol ip parent 1:0 prio 1 u32 match ip sport 698 0xffff flowid 1:1
tc filter add dev ath0 protocol ip parent 1:0 prio 1 u32 match ip dport 698 0xffff flowid 1:1
# Band 2 qdisc is sfq and filter is Video
tc qdisc add dev ath0 parent 1:2 sfq perturb 16
tc filter add dev ath0 protocol ip parent 1:0 prio 2 u32 match ip sport 1234 0xffff flowid 1:2
tc filter add dev ath0 protocol ip parent 1:0 prio 2 u32 match ip dport 1234 0xffff flowid 1:2
# Band 3 qdisc is sfq and filter is anything unfiltered
tc qdisc add dev ath0 parent 1:3 sfq perturb 16
tc filter add dev ath0 protocol ip parent 1:0 prio 3 u32 match u8 0 0 flowid 1:3
--------------------------------------------------
tc -s qdisc:
qdisc pfifo_fast 0: dev wifi0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 2429440795 bytes 1814437 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc pfifo_fast 0: dev wifi1 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 4758007 bytes 12438 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc pfifo_fast 0: dev eth0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 201697 bytes 1742 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc prio 1: dev ath0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 1629824254 bytes 1201825 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 8007: dev ath0 parent 1:1 limit 127p quantum 1590b perturb 16sec
Sent 84408 bytes 1240 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 8008: dev ath0 parent 1:2 limit 127p quantum 1590b perturb 16sec
Sent 272423018 bytes 200639 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 8009: dev ath0 parent 1:3 limit 127p quantum 1590b perturb 16sec
Sent 1356481658 bytes 999331 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
8008 has sent 272423018 bytes and 8009 1356481658 bytes. 1356481658 is five times 272423018, which is correct since I have one video stream on port 1234 and five streams on random ports.
PLATFORM info:
Linux kernel: 2.6.27.6
ARM - Big endian
Kernel config:
#
# Queueing/Scheduling
#
CONFIG_NET_SCH_CBQ=y
CONFIG_NET_SCH_HTB=y
# CONFIG_NET_SCH_HFSC is not set
CONFIG_NET_SCH_PRIO=y
# CONFIG_NET_SCH_RED is not set
CONFIG_NET_SCH_SFQ=y
# CONFIG_NET_SCH_ESFQ is not set
# CONFIG_NET_SCH_TEQL is not set
CONFIG_NET_SCH_TBF=y
# CONFIG_NET_SCH_GRED is not set
# CONFIG_NET_SCH_DSMARK is not set
# CONFIG_NET_SCH_NETEM is not set
#
# Classification
#
CONFIG_NET_CLS=y
# CONFIG_NET_CLS_BASIC is not set
# CONFIG_NET_CLS_TCINDEX is not set
# CONFIG_NET_CLS_ROUTE4 is not set
# CONFIG_NET_CLS_FW is not set
CONFIG_NET_CLS_U32=y
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
# CONFIG_NET_CLS_RSVP is not set
# CONFIG_NET_CLS_RSVP6 is not set
# CONFIG_NET_CLS_FLOW is not set
# CONFIG_NET_EMATCH is not set
# CONFIG_NET_CLS_ACT is not set
# CONFIG_NET_CLS_IND is not set
CONFIG_NET_SCH_FIFO=y
The packets are apparently placed in the correct queue, but not dequeued correctly, since there is no difference in video quality on CLIENT2.
What am I doing wrong? Do I need to set iptables rules or modify the priomap? Or am I just stupid?
UPDATE:
I tried connecting the two platforms with cable and it worked perfectly!
I'm running MadWifi... I guess I could try ATH5K instead.
Last edited by LinuxMatt; 09-17-2009 at 06:49 AM.
|