[LARTC] CBQ's weird behavior

2002-06-09 Thread Bruno

Hi there, 

I'm using Linux (Debian), kernel version 2.4.17 on Pentium III
based PC and have a NIC 3com EtherLink 10/100 PCI (3c905b) on eth0
interface.
I've done some tests on CBQ. The class hierarchy was pretty simple
- I've created only one class (100kbit/s) except root class and it was
bounded isolated. (Commands are shown at the end of this message.) I'
ve used an UDP traffic generator, which has been generating (in this
example) UDP packets with interpacket time of 20 miliseconds and sending
them from  host A to host B. 
For all tests I did the number of generated packets was 5000. For 
different packet sizes I got these results:

p_size (bytes)  10   50   100  200  300   400   
g (kbit/s)  20,8 36,8 56,8 96,8 136,8 176,8 
m (kbit/s)  20,7997  36,7995  56,7993  96,7987  105,2356  104,0127  
num_of_rec_p5000 5000 5000 5000 3947  3043  


p_size (bytes)  500   800   1000
g (kbit/s)  216,8 336,8 416,8
m (kbit/s)  105,7655  103,6437  102,9431
num_of_rec_p5000  5000  5000



p_size ... generated packet size

g ... bit-rate at which packets are sent to the interface (host A),
calculated from the following formula:
 g=p_size+UDP header (bit)/generated_interpacket_time (s)
(generated_interpacket_time in shown example was 20 ms)

m ... packets are received at this rate (host B), calculated from the
following formula:
 m=p_size+UDP header (bit)/measured_interpacket_time (s)
(measured_interpacket_time is average value of all received packets'
interpacket time)

num_of_rec_p ... number of received packets (on host B) 



- My first problem is that I can't figure out why (for the packet size
greater than a 400 bytes) the packets that should be dropped go overlimit
and don't get dropped by qdisc or class?
For the packets smaller (or equal) than a 400 bytes this works normal.
- The second one is: Why the class isn't limited exactly as I defined
(100 kbit/s)?



Hardware configuration was as follows:

[host A eth0]--[ switch ]-[eth0 host B]
192.168.19.203  192.168.19.204



CBQ definition in my example was: (the commands were started on host A)


tc qdisc add dev eth0 root handle 1: cbq bandwidth 100Mbit avpkt 1000

tc class add dev eth0 parent 1:0 classid 1:10 cbq bandwidth 100Mbit rate 
100kbit allot 1514 avpkt 1000 prio 5 bounded isolated

tc filter add dev eth0 parent 1: protocol ip prio 5 u32 match ip src 
192.168.19.203/24 classid 1:10



Have I done anything wrong? Anyone has an idea? Please HELP ME.
I will be really greatful if anyone can solve this.

Thank You in advance!

Bruno

-
Bruno Jurcic,

Faculty of Electrical Engineering and Computing, University of Zagreb
Department of Telecommunications

e-mail:[EMAIL PROTECTED] ([EMAIL PROTECTED])

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



Re: [LARTC] Ethloop again and 4 level tree ???

2002-06-09 Thread King Yung Tong

Dear Martin,

Hello again, Thank you for you help last time.
I think I understand the solution form you and Stef, but when come to
ethloop, the result is not like this. I repost the question, I am pleased
if you can give me a quick fix of the problem? Sorry to bother you.

I try to create final checkfor htb, and still found the same problem. 
 
1:1 (ceil 1500kbps)
  / \
   (ceil 800kbps)   1:2 1:8 (ceil 700kbps)
  /\  \
1:4   1:121:14
   /  \
(prio 0) 1:10  1:11 (prio 1)
 
The tree under 1:2 is almost the same as you example and is working.
And I try to build a larger tree (4 levels) and I would like to do
following:
class 1:14 is completed isolated even no traffic, the BW will not borow.
class 1:12 is empty all the time.
class 1:10 is prio 0 and class 1:11 is prio 1
 
1. My understanding is 1:8 and 1:2 are isolated because of ceil and will
not borrow?
2. Since 1:12 is always empty, it can borrow the excess to tree 1:4 and
   1:10 will get all the BW wiht prio 0.
 
But in my case, the prio parameter seems to be not working well. It will
give BW to both 1:10 and 1:11.The result I got using Ethloop is not like that.

I try to start 1:10 at 300k, 1:11 at 100k, since 1:4 parent ceil is 800bps
remind will be 400k.

At time 10s, I put 1:10 at 900k and 1:11 at 900k, and I think the 400kbs
excess will all go to 1:10 and make the flow 1:10 be 700kbs (  1:4 ceil ).

From the ethloop result, 1:10 from 30 go to 50.  (equal sharing)
 1:11 form 10 go to 30.  (eqaul sharing)

Do you think the problem is on HTB script or ethloop script or both

My HTB:
 
echo sim7 can do the priority BW
 
echo Clean all the tc setup
./tc qdisc del dev lo root
 
./tc qdisc add dev lo root handle 1: htb default 12
 
./tc class add dev lo parent 1: classid 1:1 htb rate 1500kbps ceil
1500kbps
 
echo AF and BE
./tc class add dev lo parent 1:1 classid 1:2 htb rate 100kbps ceil 800kbps
./tc class add dev lo parent 1:2 classid 1:4 htb rate 100nbps ceil 800kbps
./tc class add dev lo parent 1:2 classid 1:10 htb rate 300kbps ceil 800kbps prio 0
./tc class add dev lo parent 1:2 classid 1:11 htb rate 100kbps ceil 800kbps prio 1
./tc class add dev lo parent 1:1 classid 1:12 htb rate 100kbps ceil 800kbps
 
echo EF
./tc class add dev lo parent 1:1 classid 1:8 htb rate 100kbps ceil 700kbps
./tc class add dev lo parent 1:8 classid 1:14 htb rate 100kbps ceil 700kbps
 
echo qdisc for AF and BE
./tc qdisc add dev lo parent 1:10 handle 20: pfifo limit 5
./tc qdisc add dev lo parent 1:11 handle 30: pfifo limit 5
./tc qdisc add dev lo parent 1:12 handle 40: sfq perturb 10
echo qdisc EF
./tc qdisc add dev lo parent 1:14 handle 50: sfq perturb 10
 
 
My testcase:
 
# set simulation packet size to 1k
0   S   0   1k
0   S   1   1k
0   S   2   1k
0   S   3   1k
# flow 0 AF, flow 1  BE, flow 2 excess, flow 3 EF
0   P   0   0x10010
0   P   1   0x10011
0   P   2   0x10012
0   P   3   0x10014
# start all flow at defined rate
0   R   0   300k
0   R   1   100k
0   R   2   0
0   R   3   700k
# AE/BE independent of EF
 
# AE and BE flow higher than normal excess ---Both will get BW 
1R  0   900k
1R  1   900k
 
# AE and BE back to normal excess -- Go back to original case and try again
15000R  0   300k
15000R  1   100k
 
# BE flow higher than normal excess ---no prio flow, allow lower prio to get BW
2R  1   900k
 
# AF flow higher than normal ---flow for low prio, both will get BW 
25000R  0   900k
 
# EF flow higher than normal
3   R   3   900k
 
35000X  00
 
 
Result:
 
0.5 231444 231444 0 0 77383 77383 0 0 0 0 0 0 540271 478572 40 0   
1.0 278479 278479 0 0 92882 92882 0 0 0 0 0 0 609124 583719 61 0   
1.5 298901 298901 0 0 100509 100509 0 0 0 0 0 0 615354 611911 62 0
2.0 302205 302205 0 0 101279 101279 0 0 0 0 0 0 617530 617379 63 0 
2.5 305878 305878 0 0 102361 102361 0 0 0 0 0 0 616506 616471 63 0 
3.0 304599 304599 0 0 102921 102921 0 0 0 0 0 0 618702 618073 63 0 
3.5 307264 307264 0 0 102751 102751 0 0 0 0 0 0 618239 617715 63 0 
4.0 309582 309582 0 0 103272 103272 0 0 0 0 0 0 620044 619920 63 0 
4.5 309559 309559 0 0 103205 103205 0 0 0 0 0 0 619327 619298 63 0 
5.0 304899 304899 0 0 102930 102930 0 0 0 0 0 0 621407 619538 63 0 
5.5 307757 307757 0 0 102893 102893 0 0 0 0 0 0 618269 617825 63 0 
6.0 307659 307659 0 0 102626 102626 0 0 0 0 0 0 615972 615867 63 0 
6.5 308994 308994 0 0 103015 103015 0 0 0 0 0 0 618143 618118 63 0 
7.0 304329 304329 0 0 102740 102740 0 0 0 0 0 0 620014 617526 61 0   
7.5 307540 307540 0 0 102821 102821 0 0 0 0 0 0 617775 617184 63 0 
8.0 308544 308544 0 0 102921 102921 0 0 0 0 0 0 617728 617588 63 0 
8.5 308877 308877 0 0 102976 

[LARTC] HTB and Ethloop interesting result??

2002-06-09 Thread King Yung Tong

Hello Martin,

Thank you for you help last time, I got the previous working (HTB1 
Ethloop1) but when I increase the rate and ceil (HTB2  Ethloop2), the
outcome is quite different.

The different between cases is he rate and ceil are 10 times bigger 
than the other. Please take a look and I gusess this is the originl for
the problem I post in the previous mail.


HTB1: 

echo Clean all the tc setup
./tc qdisc del dev lo root
./tc qdisc add dev lo root handle 1: htb default 12

./tc class add dev lo parent 1: classid 1:1 htb rate 100kbps ceil 100kbps
./tc class add dev lo parent 1:1 classid 1:2 htb rate 40kbps ceil 100kbps
./tc class add dev lo parent 1:2 classid 1:10 htb rate 30kbps ceil 100kbps
prio 0
./tc class add dev lo parent 1:2 classid 1:11 htb rate 10kbps ceil 100kbps
prio 1
./tc class add dev lo parent 1:1 classid 1:12 htb rate 60kbps ceil 100kbps

echo qdisc
./tc qdisc add dev lo parent 1:10 handle 20: pfifo limit 5
./tc qdisc add dev lo parent 1:11 handle 30: pfifo limit 5
./tc qdisc add dev lo parent 1:12 handle 40: sfq perturb 10
   
Ethloop1:

# lo will be used to TX and RX
0   i   0   lo
0   i   1   lo
0   i   2   lo
# set simulation packet size to 1k
0   S   0   1k
0   S   1   1k
0   S   2   1k
# flow 0 AE, flow 1  BE, flow 2 excess
0   P   0   0x10010
0   P   1   0x10011
0   P   2   0x10012
# start all flow at defined rate
0   R   0   30k
0   R   1   10k
0   R   2   0
# Create extra at 1:12 and borrow this to 1:2 --?
5000R   0   100k
5000R   1   100k
5000R   2   0
# Back to normal
15000R   0   30k
15000R   1   10k
# Flow 1 can more first
2R   1  1000k
# Flow 2 can more
25000R   0  1000k

# finish at 8sec
3X  00

Result1:

0.5 23109 23109 0 0 7703 7703 0 0 0 0 0 0
1.0 29318 29318 0 0 9772 9772 0 0 0 0 0 0
1.5 29928 29928 0 0 9976 9976 0 0 0 0 0 0
2.0 30942 30942 0 0 10314 10314 0 0 0 0 0 0
2.5 31274 31274 0 0 10424 10424 0 0 0 0 0 0
3.0 31452 31452 0 0 10484 10484 0 0 0 0 0 0
3.5 30195 30195 0 0 10065 10065 0 0 0 0 0 0
4.0 30474 30474 0 0 10158 10158 0 0 0 0 0 0
4.5 31245 31245 0 0 10415 10415 0 0 0 0 0 0
5.0 31135 31135 0 0 10378 10378 0 0 0 0 0 0
5.5 84378 76533 45 0 82038 15606 216 0 0 0 0 0
6.0 98421 94852 12 0 97866 9825 459 0 0 0 0 0
6.5 101759 89512 39 0 101627 11952 560 0 0 0 0 0
7.0 102587 95447 24 0 102556 8875 572 0 0 0 0 0
7.5 102784 89635 39 0 102776 11755 576 0 0 0 0 0
8.0 102830 97338 14 0 102829 8828 582 0 0 0 0 0
8.5 102841 90084 39 0 102841 11744 578 0 0 0 0 0
9.0 102844 95583 24 0 102844 8826 581 0 0 0 0 0
9.5 102909 89635 39 0 102909 11795 579 0 0 0 0 0
10.0 102969 95553 25 0 102969 8859 578 0 0 0 0 0
10.5 102762 89504 39 0 102762 11768 578 0 0 0 0 0
11.0 102825 95445 24 0 102825 8831 578 0 0 0 0 0
11.5 102646 89422 39 0 100086 11745 581 0 0 0 0 0
12.0 103020 95627 30 0 102412 8847 580 0 0 0 0 0
12.5 102886 89678 39 0 102742 11748 576 0 0 0 0 0
13.0 103113 95771 24 0 103079 8827 574 0 0 0 0 0
13.5 102715 89499 39 0 102706 11744 577 0 0 0 0 0
14.0 103182 95805 29 0 103179 8847 578 0 0 0 0 0
14.5 102925 89720 39 0 102924 11748 578 0 0 0 0 0
15.0 102718 95337 24 0 102718 8827 578 0 0 0 0 0
15.5 47906 47791 0 0 32219 14847 120 0 0 0 0 0
16.0 34208 34180 0 0 15259 11136 28 0 0 0 0 0
16.5 31638 31632 0 0 11461 10483 6 0 0 0 0 0
17.0 31064 31063 0 0 10572 10339 1 0 0 0 0 0
17.5 30870 30869 0 0 10341 10286 0 0 0 0 0 0
18.0 30838 30838 0 0 10292 10279 0 0 0 0 0 0
18.5 30869 30869 0 0 10292 10289 0 0 0 0 0 0
19.0 30846 30846 0 0 10283 10282 0 0 0 0 0 0
19.5 30896 30896 0 0 10298 10298 0 0 0 0 0 0
20.0 30888 30888 0 0 10296 10296 0 0 0 0 0 0
20.5 30851 30851 0 0 786473 65094 62 0 0 0 0 0
21.0 30897 30897 0 0 971969 64881 57 0 0 0 0 0
21.5 30853 30853 0 0 1014683 75618 62 0 0 0 0 0
22.0 30897 30897 0 0 1026647 67378 64 0 0 0 0 0
22.5 30853 30853 0 0 1027658 76210 71 0 0 0 0 0
23.0 30897 30897 0 0 1029726 67519 59 0 0 0 0 0
23.5 30853 30853 0 0 1028389 76244 71 0 0 0 0 0 
24.0 30897 30897 0 0 1029900 67527 68 0 0 0 0 0  
24.5 30853 30853 0 0 1028430 76246 71 0 0 0 0 0 
25.0 30897 30897 0 0 1029910 67527 59 0 0 0 0 0  
25.5 810677 77647 58 0 1047748 25853 309 0 0 0 0 0
26.0 957323 93982 31 0 1013581 12135 496 0 0 0 0 0
26.5 1027877 89074 58 0 1041227 12529 565 0 0 0 0 0
27.0 1008953 95183 30 0 1012121 9012 575 0 0 0 0 0
27.5 1041875 89572 58 0 1042627 11787 579 0 0 0 0 0
28.0 1011451 95326 32 0 1011629 8797 581 0 0 0 0 0
28.5 1043566 89574 58 0 1043609 11788 580 0 0 0 0 0
29.0 1016203 95663 30 0 1016214 8858 582 0 0 0 0 0
29.5 1043614 89654 58 0 1044696 11803 580 0 0 0 0 0
30.0 1016324 95765 33 0 1016581 8839 580 0 0 0 0 0




HTB2:
echo Clean all the tc setup
./tc qdisc del dev lo root

./tc qdisc add dev lo root handle 1: htb default 12

./tc class add dev lo parent 1: classid 1:1 htb rate 1000kbps ceil
1000kbps
./tc class add