[LARTC] New qdisc path, try it (what is the problem)

2002-06-08 Thread alouini khalif

hello,

this is my new qdisc patch, when i recompile the
kernel with this patch i dn'nt succeed please look at
it and if there are any mistakes plesease send me a
mail

thanks in advance


___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



[LARTC] New qdisc patch,(final code) please try it (what is the problem)

2002-06-08 Thread alouini khalif

 hello,
  
  this is my new qdisc patch, when i recompile the
  kernel with this patch i dn'nt succeed please look
  at it and if there are any mistakes plesease send
 me a  mail
  
  thanks in advance

--- linux-2.4.7-10orig/net/sched/Config.in
+++ linux-2.4.4-10/net/sched/Config.in
# Traffic control configuration.
 #
tristate '  CBQ packet scheduler' CONFIG_NET_SCH_CBQ
+tristate '  EPD packet scheduler' CONFIG_NET_SCH_EPD
tristate '  CSZ packet scheduler' CONFIG_NET_SCH_CSZ
--- linux-2.4.7-10orig/net/sched/Makefile
+++ linux-2.4.7-10/net/sched/Makefile
obj-$(CONFIG_NET_SCH_CSZ)   += sch_csz.o
obj-$(CONFIG_NET_SCH_HPFQ)  += sch_hpfq.o
obj-$(CONFIG_NET_SCH_HFSC)  += sch_hfsc.o
+obj-$(CONFIG_NET_SCH_EPD)  += sch_epd.o
obj-$(CONFIG_NET_SCH_SFQ)   += sch_sfq.o
obj-$(CONFIG_NET_SCH_RED)   += sch_red.o
obj-$(CONFIG_NET_SCH_TBF)   += sch_tbf.o
--- linux-2.4.7-10orig/include/linux/pkt_sched.h
+++ linux-2.4.7-10/include/linux/pkt_sched.h
__u8grio;
 };
+/* EPD section*/
+struct tc_epd_qopt
+{
+   __u32 limit;
+   __u32 threshold;
+};
--- linux-2.4.7-10orig/net/sched/sch_api.c
+++ linux-2.4.7-10/net/sched/sch_api.c
#ifdef CONFIG_NET_SCH_CBQ
INIT_QDISC(cbq);
 #endif
+#ifdef CONFIG_NET_SCH_EPD
+   INIT_QDISC(epd);
+#endif
 #ifdef CONFIG_NET_SCH_CSZ
INIT_QDISC(csz);
 #endif
--- linux-2.4.7-10orig/net/sched/sch_htb.c
+++ linux-2.4.7-10/net/sched/sch_htb.c
+/*
+ * net/sched/sch_epd.c Early packet discart 
+ *(adaptation for multimedia stream.)
+ *
+ *This program is free software; you can redistribute
+* it and/or modify it
+ * Authors:Alouini khalifa [EMAIL PROTECTED] 
+ * [EMAIL PROTECTED]
+ */
+#include linux/config.h
+#include linux/module.h
+#include asm/uaccess.h
+#include asm/system.h
+#include asm/bitops.h
+#include linux/types.h
+#include linux/kernel.h
+#include linux/sched.h
+#include linux/string.h
+#include linux/mm.h
+#include linux/socket.h
+#include linux/sockios.h
+#include linux/in.h
+#include linux/errno.h
+#include linux/interrupt.h
+#include linux/if_ether.h
+#include linux/inet.h
+#include linux/netdevice.h
+#include linux/etherdevice.h
+#include linux/notifier.h
+#include net/ip.h
+#include net/route.h
+#include linux/skbuff.h
+#include net/sock.h
+#include net/pkt_sched.h
+#include net/inet_ecn.h
+
+
+/*Early packet discart (EPD) algorithm. Version 1.0
+   ===
+This discipline is taken from ATM world,this version
+ is the simplest mode of EPD
+In ATM, a packet is divided in many cells,if a new
+ packet arrive and we reach a  threshold then we have
+ to drop all new data unit (witch may be divided into
+many cells) for the reason that one packet has no
+ signification if some of its data(cells) are dropped
+ so if we have to reject one cell of a packet we have
+to reject all sells that belongs to this packet (a
+ packet=data unit)
+To adaptate this discipline for multimedia stream, we
+ market the IP packet into the IP-OPION field (or TOS
+ field) the number of data unit at which it belongs
+ then we only have to extract this information 
+from the IP_OPTION field (or from TOS fields)
+
+Short description.
+--
+
+When a new packet arrives we look at the  queue
+ length:
+
+
+if (length threshold) - packet passed.
+if (length threshold) -tow possibilitties
+1 if (it is a new data unit) - packet dropped
+2 if( it is an old data unit) -packet accepted
+if (length =limit) -packet dropped
+
+   Parameters, settable by user:
+   -
+
+   limit   - bytes
+   threshold   -bytes
+*/
+#define NET_XMIT_DROP 0
+#define NET_XMIT_SUCCESS 1
+struct epd_sched_data
+{
+/* Parameters */
+unsigned limit;/* HARD maximal queue length*/
+unsigned threshold;/* limit under witch, we drop a
new
+ data unit*/
+
+/* Variables */
+unsigned current_unit ;
+   /* the  last unit  passed into the queue
*/
+unsigned dropped_unit; 
+/*the unit that must be dropped because one
+ packet of this unit was dropped (it is the number of
+ the last dropped unit) */
+};
+
+
+static int
+epd_enqueue(struct sk_buff *skb, struct Qdisc* sch)
+{
+struct epd_sched_data *q = (struct epd_sched_data/
+*)sch-data;
+int test =verify_data_unit(skb,sch);
+/*verify if this packet belongs to data unit that is
+ marked dropped then we have to drop this packet*/
+   if (test==0)
+   goto drop;
+   if (sch-stats.backlog = q-threshold)
+   {
+   update_data_unit (skb,sch)
+/*if it is a new data unit we have to update the
+ current_unit value*/
+   goto enqueue;
+   }
+   else
+{
+   u8 unit=skb-nh.iph-tos;
+   if (unit ==/
+   q-current_unit)
+/*if it is a segment of a data unit that is already
+ 

[LARTC] The Ultimate Traffic Conditioner: downlink not working

2002-06-08 Thread Oliver Folini

hi all

i'm pretty new to tc and have not understand a lot of the whole stuff 
... but pleas help me!

i tried to use the 'The Ultimate Traffic Conditioner' - cbq version -  
as it is in 'Linux Advanced Routing  Traffic Control HOWTO' chapter 15.

the uplink part i think is working but the download is not working: the 
connection to the internet seems to be broken (i can't ping any 
computer). i changed the filter in the download part to only one 
ip-address (from 0.0.0.0/0 to 130.59.10.30) to test the filter on this 
ip-address. the download part of the script is now

--- form 'The Ultimate Traffic Conditioner:'
DOWNLINK=250
DEV=eth1

tc qdisc del dev $DEV ingress 2 /dev/null  /dev/null

# downlink #
# slow downloads down to somewhat less than the real speed to prevent
# queuing at our ISP. Tune to see how high you can set it.
# ISPs tend to have *huge* queues to make sure big downloads are fast
#

# attach ingress policer:
tc qdisc add dev $DEV handle : ingress

# filter *everything* to it (0.0.0.0/0), drop everything that's
# coming in too fast:
tc filter add dev $DEV parent : protocol ip prio 50 u32 match ip src \
130.59.10.30 police rete ${DOWNLINK}kbit burst 10k drop flowid :1
--

with this setup i can ping all ip-addresses without 130.59.10.30. from 
the tcpdum i get this information (altair is the computer where  tc is 
running):

-- output of tcpdump -i eth1
19:16:10.525629 altair.ethz.ch  130.59.10.30: icmp: echo request (DF)
19:16:10.561771 130.59.10.30  altair.ethz.ch: icmp: echo reply (DF)
19:16:11.525697 altair.ethz.ch  130.59.10.30: icmp: echo request (DF)
19:16:11.560400 130.59.10.30  altair.ethz.ch: icmp: echo reply (DF)
--

so i think the ping can't pass the above filter. if i comment the 'tc 
filter add...' out, everything is working fine (but the buffer at my ISP 
is growing and growing :( ).

so, do i do something wrong or is this a bug in this script  ore elsewhere?

thanks for your help

oliver

ps: some more information about my setup
- on altair there is also running NAT (but the tc-stuff is also not 
working without NAT)
- i use a adsl-modem attached to eth1
- altair:~# tc -V
  tc utility, iproute2-ss010824




___
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-08 Thread King Yung Tong

Hello again, Thank you for you help last time. I try to create final check
for htb, and found some problem. Can you give a quick fix for the 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 emppty, it can borrow the excess to tree 1:4 and
   1:10 will get all the BW.

But in my case, the prio parameter seems to be not very ok. It will give
BW to both 1:10 and 1:11. 

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
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 ---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 102976 0 0 0 0 0 0 619844 619811 63 0 
9.0 302607 302607 0 0 100873 100873 0 0 0 0 0 0 620449 617339 61 0 
9.5 306437 306437 0 0 102147 102147 0 0 0 0 0 0 616490 615752 63 0 
10.0 300719 300719 0 0 100240 100240 0 0 0 0 0 0 604882 617636 63 0
10.5 777898 471982 0 0 729513 264159 0 0 0 0 0 0 609705 618402 43 0
11.0 863025 505560 0 0 851542 297668 0 0 0 0 0 0 619129 616713 41 0
11.5 909551 512577 0 0 906826 306202 0 0 0 0 0 0 618050 617476 43 0
12.0 921768 513819 0 0 921121 307972 0 0 0 0 0 0 618739 618603 43 0
12.5 907931 513704 0 0 905857 308147 0 0 0 0 0 0 619284 616925 43 0
13.0 886514 523490 0 0 883462 304891 0 0 0 0 0 0 624941 617690 40 0
13.5 915565 515999 0 0 886622 307416 0 0 0 0 0 0 620989 619268 42 0
14.0 923631 514873 0 0 879157 308406 0 0 0 0 0 0 618273 617864 43 0
14.5 927437 

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

2002-06-08 Thread Stef Coene

On Saturday 08 June 2002 20:10, King Yung Tong wrote:
 Hello again, Thank you for you help last time. I try to create final check
 for htb, and found some problem. Can you give a quick fix for the 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 emppty, it can borrow the excess to tree 1:4 and
1:10 will get all the BW.

 But in my case, the prio parameter seems to be not very ok. It will give
 BW to both 1:10 and 1:11.
HTB will try to give each class it's rate as a minimum :
./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 

So class 1:10 gets 300kbps and class 1:11 gets 100kbps.  The other 400kbps 
will go to class 1:10 beacause his prio is lower.  So prio is for traffic 
that's left after each class gets his rate.

I hope I'm right, Devik ?  :)

Stef

-- 

[EMAIL PROTECTED]
 Using Linux as bandwidth manager
 http://www.docum.org/
 #lartc @ irc.openprojects.net
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



Re: [LARTC] SFQ buckets/extensions

2002-06-08 Thread Gregory Maxwell

On Fri, Jun 07, 2002 at 04:37:07PM +0200, Jan Coppens wrote:
 Why not implementing the sfb (stochastic fair Blue)? From the papers I read,
 the algorithm with the double buffered moving hash extension, seemed like a
 better alternative for the FRED, Stochastic fair RED and SFQ.

I'd like to toss in a request that anyone who impliments this please make
the bloom filter size adjustable and provide a mask to remove information
from the hash (i.e. sport/dport) to allow for per host fairness rather then
per flow.
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/