summaryrefslogtreecommitdiff
path: root/polux/application/iproute2/examples/sarft/dba10to20
blob: b5c7a6e6014554f37d639334cf6515830ceedfe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /bin/sh

#changes added to previous dba test:
#TBF qdisc as root for good limitation
#HBT qdisc kept for good shaping

#these two lines erase previous queueing disciplines and ebtables
tc qdisc del dev plc0 root handle 10:
ebtables --init-table

#root qdisc 
tc qdisc add dev plc0 root handle 10: tbf rate 30Mbit buffer 40k limit 40k

#htb added to root tbf discipline
tc qdisc add dev plc0 parent 10:0 handle 20: htb

#htb qdisc has one "root" class
tc class add dev plc0 parent 20:0 classid 20:1 htb rate 30Mbit ceil 30Mbit burst 30k 

#htb 20:1 class has to leafs 20:2 and 20:3 which cat borrow from eachother
#important is choice of burst for 20:2 class,it is chosen to keep low bandwidth rate
#class 20:2 is the one whose precise limitation is important
tc class add dev plc0 parent 20:1 classid 20:2 htb rate 10Mbit ceil 20Mbit burst 4.2k
tc class add dev plc0 parent 20:1 classid 20:3 htb rate 20Mbit ceil 30Mbit burst 30k


tc filter add dev plc0 parent 20: protocol all handle 1 fw flowid 20:2
tc filter add dev plc0 parent 20: protocol all handle 2 fw flowid 20:3

#Traffic of one slave is put in class 20:2, it is makred 1. It is connected to tc filter by 
# handle 1. Traffic of other two(or everybody else) is put in 20:3 and they are marked 2.
#Since test is made for testing with smartbit, mac address in next line is one of the
#smartbit ports
ebtables -A FORWARD -d 00:00:00:00:00:02 -j mark --set-mark 1 --mark-target ACCEPT
ebtables -A FORWARD -j mark --set-mark 2 --mark-target ACCEPT