[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TC Help for Newbie



Hi, I'm running the 2.2.5 kernel with iproute2-2.3.4-now-ss000305
over ppp 2.3.8.

I'm trying to set up some flow control so that
any data that is sent through ppp0 on UDP port
5004 has priority over other data.  I also have
to limit the total bandwidth used to 384Kbps.
(Connecting Ethernet to a DSL)  Starving normal
data is not a concern in this case.  Below is
the script that I used for this purpose.  However,
the script doesn't seem to do anything.  Am I
using the proper methods/parameters?

Albert Liu

=======================================================================
#! /bin/sh

echo "Add the CBQ queueing discipline to ppp0"
tc qdisc add dev ppp0 root handle 1: cbq bandwidth 384Kbit allot 1514 \
cell 8 avpkt 10000 mpu 64

echo "Add the root class for ppp0"
tc class add dev ppp0 parent 1:0 classid 1:1 cbq bandwidth 384Kbit rate \
384Kbit allot 1514 cell 8 weight 38Kbit prio 8 maxburst 20 avpkt 10000

echo "Add class for High-Importance data"
tc class add dev ppp0 parent 1:1 classid 1:10 cbq bandwidth 300Kbit rate \
300Kbit prio 3 allot 1514 cell 8 maxburst 20 avpkt 10000

echo "Add class for other data"
tc class add dev ppp0 parent 1:1 classid 1:20 cbq bandwidth 84Kbit rate \
84Kbit prio 7 allot 1514 cell 8 maxburst 20 avpkt 1000

echo "Add FIFO Pipeline for High-Importance data"
tc qdisc add dev ppp0 parent 1:10 pfifo

echo "Add FIFO Pipeline for normal data"
tc qdisc add dev ppp0 parent 1:20 pfifo

echo "Add Filter for High-Importance data"
tc filter add dev ppp0 parent 1:0 priority 10 protocol ip u32 match ip \
dst 10.1.1.77 flowid 1:10

echo "Add Filter for normal data"
tc filter add dev ppp0 parent 1:0 protocol ip priority 60 u32 match ip \
dst 0.0.0.0/0 flowid 1:20

tc filter add dev ppp0 parent 1:0 protocol ip priority 60 u32 match ip \ 
src 0.0.0.0/0 flowid 1:20
========================================================