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

Controlling rate with CBQ



Hi!

I am working on a script based on the scripts of the "Differentiated Services on Linux" by Werner Almesberger, Jamal Hadi Salim and Alexey Kuznetsov, and im trying to control traffic comming from machine number 1 to machine number 2.

Number 1 sends traffic ip with a DSCP 0 0x2e (EF) and machine number 2 is a core device controling the traffic with a CBQ, just like the example on the paper.
 

The script of te Core device is the following:

#! /bin/sh

TC=/usr/src/iproute2/tc/tc
 

$TC qdisc add dev eth0 handle 1:0 root dsmark indices 64 set_tc_index

$TC filter add dev eth0 parent 1:0 protocol ip prio 1 tcindex \
mask 0xfc shift 2

$TC qdisc add dev eth0 parent 1:0 handle 2:0 cbq bandwidth 10Mbit \
allot 1514 cell 8 avpkt 1000 mpu 64
 

# The traffic with a DSCP equal to 0x2e goes throught class 2:0

$TC class add dev eth0 parent 2:0 classid 2:1 cbq \
bandwidth 10Mbit rate 1500Kbit avpkt 1000 prio 1 bounded isolated \
allot 1514 weight 1 maxburst 10 defmap 1

$TC qdisc add dev eth0 parent 2:1 cbq bandwidth 1500Kbit allot 1514 cell 8 \
avpkt 1000 mpu 64

$TC filter add dev eth0 parent 2:0 protocol ip prio 1 handle 0x2e tcindex \
classid 2:1
 
echo "---->"
echo "FIM"

echo "---- qdisc parameters Ingress  ----------"
$TC qdisc ls dev eth0
echo ""
echo "---- Class parameters Ingress  ----------"
$TC class ls dev eth0
echo ""
echo "---- filter parameters Ingress ----------"
$TC filter ls dev eth0
 

And the script of the machine 1 is the folowing:
 

#! /bin/sh

TC=/usr/src/iproute2/tc/tc

$TC qdisc add dev eth0 handle 1:0 root dsmark indices 64
$TC class change dev eth0 classid 1:1 dsmark mask 0x3 value 0xb8
echo "2"
$TC filter add dev eth0 parent 1:0 protocol ip prio 5 handle 1: u32 divisor 1
echo "3"
$TC filter add dev eth0 parent 1:0 prio 5 u32 match ip dst 193.137.28.246 \
classid 1:1
echo "3"
Then to test this i make an ftp from the machine 193.137.28.246 (machine number 2)
to the machine number 1 to get data from it.


When the transfer is finished the results of the ftp are:
150 Opening BINARY mode data connection for 'so51_lnx_01.tar' (74072576 bytes).
226 Transfer complete.
74072576 bytes received in 79.83 secs (906.1 kB/s)


What i dont understand is how can we have a connection with a near 7 Mbit rate when i defined
to have just 1500Kbit.






One more thing....The examples from the "Differentiated Services on Linux" are for ingress, or
for egress.  I believe that example number 5.1 is for egress, and 5.2 is for ingress.
Am i right?
Do we need to configure something on the interface for it to work for ingress or egress traffic?


Thanks


P.S : Is there any tool that shows us the fields of ATM traffic (something like Ethereal, but
for ATM)?
-------------------------------------------------------
Joao Brandao Reis ,  email: ee94002@fe.up.pt
WWW: http://members.fortunecity.com/ee94002
Pagina Projecto: http://netlab.fe.up.pt/~ee94002