Let us consider a very simple scenario. Lets set up a CBQ for an ethernet device on testbed14 (220.127.116.11). Lets assume that the average packet size is 1000, a cell value of 8 bytes and a maximum burst size of 20 bytes. Lets have two types of classes, one for traffic to the machine 18.104.22.168 (testbed11) and for the traffic to machine 22.214.171.124 (testbed13). The traffic to testbed11 is given a higher priority over the traffic to testbed 13. However, testbed11 requires a bandwidth of only 3 Mbps while testbed13 requires a bandwidth of 7 Mbps.
This example explains classification based on the routing table. The environment set up is shown in Figure 9.
To set up this environment in testbed14.
# Attaching the Qdisc to the eth0 device. The maximum available bandwidth is # 10Mbit. tc qdisc add dev eth0 root handle 1: cbq bandwidth 10Mbit cell 8 avpkt 1000 \ mpu 64 # Adding the root class to the queuing discipline. The root has 10 Mbit # completely. tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 10Mbit rate 10Mbit \ allot 1514 cell 8 weight 1Mbit prio 8 maxburst 20 avpkt 1000 # Traffic to testbed11. The priority is 3 and the allocation is 3 Mbit. tc class add dev eth0 parent 1:1 classid 1:2 cbq bandwidth 10Mbit rate 3Mbit \ allot 1514 cell 8 weight 100Kbit prio 3 maxburst 20 avpkt 1000 split 1:0 # Traffic to testbed13. The priority is 7 and the allocation is 7 Mbit. tc class add dev eth0 parent 1:1 classid 1:3 cbq bandwidth 10Mbit rate 8Mbit \ allot 1514 cell 8 weight 800Kbit prio 7 maxburst 20 avpkt 1000 split 1:0 # Installing the route classifier on the root of the tree. tc filter add dev eth0 parent 1:0 protocol ip prio 100 route # Assigning the route and the rules for testbed11 ip route add 126.96.36.199 via 188.8.131.52 flow 1:2 # Assigning the route and the rules for testbed13 ip route add 184.108.40.206 via 220.127.116.11 flow 1:3
Note that none of the classes are specified as bounded which means that the classes can borrow bandwidth from the parent.