Miniupnpd: update to 2.0
[tomato.git] / release / src / router / iproute2 / examples / cbqinit.eth1
blob226ec1c54072541797b7caf33de435d4c1333207
1 #! /bin/sh
3 TC=/home/root/tc
4 IP=/home/root/ip
5 DEVICE=eth1
6 BANDWIDTH="bandwidth 10Mbit"
8 # Attach CBQ on $DEVICE. It will have handle 1:.
9 # $BANDWIDTH is real $DEVICE bandwidth (10Mbit).
10 # avpkt is average packet size.
11 # mpu is minimal packet size.
13 $TC qdisc add dev $DEVICE root handle 1: cbq \
14 $BANDWIDTH avpkt 1000 mpu 64
16 # Create root class with classid 1:1. This step is not necessary.
17 # bandwidth is the same as on CBQ itself.
18 # rate == all the bandwidth
19 # allot is MTU + MAC header
20 # maxburst measure allowed class burstiness (please,read S.Floyd and VJ papers)
21 # est 1sec 8sec means, that kernel will evaluate average rate
22 # on this class with period 1sec and time constant 8sec.
23 # This rate is viewed with "tc -s class ls dev $DEVICE"
25 $TC class add dev $DEVICE parent 1:0 classid :1 est 1sec 8sec cbq \
26 $BANDWIDTH rate 10Mbit allot 1514 maxburst 50 avpkt 1000
28 # Bulk.
29 # New parameters are:
30 # weight, which is set to be proportional to
31 # "rate". It is not necessary, weight=1 will work as well.
32 # defmap and split say that best effort ttraffic, not classfied
33 # by another means will fall to this class.
35 $TC class add dev $DEVICE parent 1:1 classid :2 est 1sec 8sec cbq \
36 $BANDWIDTH rate 4Mbit allot 1514 weight 500Kbit \
37 prio 6 maxburst 50 avpkt 1000 split 1:0 defmap ff3d
39 # OPTIONAL.
40 # Attach "sfq" qdisc to this class, quantum is MTU, perturb
41 # gives period of hash function perturbation in seconds.
43 $TC qdisc add dev $DEVICE parent 1:2 sfq quantum 1514b perturb 15
45 # Interactive-burst class
47 $TC class add dev $DEVICE parent 1:1 classid :3 est 2sec 16sec cbq \
48 $BANDWIDTH rate 1Mbit allot 1514 weight 100Kbit \
49 prio 2 maxburst 100 avpkt 1000 split 1:0 defmap c0
51 $TC qdisc add dev $DEVICE parent 1:3 sfq quantum 1514b perturb 15
53 # Background.
55 $TC class add dev $DEVICE parent 1:1 classid :4 est 1sec 8sec cbq \
56 $BANDWIDTH rate 100Kbit allot 1514 weight 10Mbit \
57 prio 7 maxburst 10 avpkt 1000 split 1:0 defmap 2
59 $TC qdisc add dev $DEVICE parent 1:4 sfq quantum 1514b perturb 15
61 # Realtime class for RSVP
63 $TC class add dev $DEVICE parent 1:1 classid 1:7FFE cbq \
64 rate 5Mbit $BANDWIDTH allot 1514b avpkt 1000 \
65 maxburst 20
67 # Reclassified realtime traffic
69 # New element: split is not 1:0, but 1:7FFE. It means,
70 # that only real-time packets, which violated policing filters
71 # or exceeded reshaping buffers will fall to it.
73 $TC class add dev $DEVICE parent 1:7FFE classid 1:7FFF est 4sec 32sec cbq \
74 rate 1Mbit $BANDWIDTH allot 1514b avpkt 1000 weight 10Kbit \
75 prio 6 maxburst 10 split 1:7FFE defmap ffff