[LARTC] fragment in CBQ?

2002-12-18 Thread James Ma



Hi, All,

Does any body know ifCBQ could do packet 
fragment? Or may be there is other tool in linux could do it? 

The reason I need to do it is that, I want to set 
up QoS using CBQ for voice packet, but too big TCP packet in the low priority 
queuewill cause intolerable jitter for the 
voice traffic since the outbound rate is only 64kbps.

Regards,

James


[LARTC] VoIP and CBQ

2002-12-18 Thread James Ma



Hi, All,

I did some work on QoS with CBQ. Basically, I 
wanted to separate VoIP traffic from other traffics and give it guarantied 
bandwidth. I used the following scripts to do the work,



#!/bin/sh


OPTION="allot 1514 maxburst 20 avpkt 1000"
tc qdisc del dev eth0 root 
tc qdisc add dev eth0 root handle 10: cbq bandwidth 10mbit avpkt 1000
tc class add dev eth0 parent 10: classid 10:2 cbq bandwidth 10mbit rate 
34kbit $OPTION prio 3 bounded
tc class add dev eth0 parent 10:2 classid 10:10 cbq bandwidth 10mbit rate 
30kbit $OPTION prio 3 
tc class add dev eth0 parent 10:2 classid 10:20 cbq bandwidth 10mbit rate 
4kbit $OPTION prio3tc filter add dev eth0 parent 10: protocol ip prio 3 
u32 match ip tos 0x20 0xf0 flowid 10:2
tc filter add dev eth0 parent 10: protocol ip prio 3 u32 match ip dst 0/0 
flowid 10:2
tc filter add dev eth0 parent 10:2 protocol ip prio 3 u32 match ip tos 0x20 
0xf0 flowid 10:10
tc filter add dev eth0 parent 10:2 protocol ip prio 3 u32 match ip dst 0/0 
flowid 10:20
It 
seemed working -- when therewas no VoIP traffic, a ftp link was using all 
34kbit rate. When there was VoIP traffic, the ftp ratedropped to 17kbit 
(which was correct because the voice traffic was using 17kbit). Unfortunately, 
the voice quality was not good. Even if without ftp traffic, there were packets 
loss for voice traffic (ifyou count from 1 to 20 with one handset, you 
miss certain figures on the other end, they are 4, 5, 8, 9, 12, 13 
etc).







Any one had the same problem before? Any one 
can explain it? Any parameter I should adjust to better suit this 
application?

Another thing I noticed was, when I changed 
the parameters for "allot" (ex 300) and "avpkt" (ex 500) in order to 
seekbetter setting for this application, the CBQstopped doing 
anything, so theratewas the NIC rate instead of 34kbit.I could 
change "maxburst" but it didn't improve the voice quality. Could any one tell me 
how to use these parameters?

Thanks,

James


[LARTC] my qos-cbq didn't work

2002-12-12 Thread James Ma





Hi, All,
I implemented the following qos scripts in my Linux gateway (redhat7.3, 
kernel 2.4.18),put ftp server (10.10.3.49) on one side (eth0 nic) and ftp 
client (10.10.5.3) on the other side (eth1 nic). I tried to up load a file 
(211kbytes) from client to ftp server. I wanted to see a 22kbps transmission 
rate. Quite surprise, the ftp client showed transmission rate as 6.8e+02 
kbytes/s (211k transmitted in 0.3 seconds). It was the same as it without qos 
implementation. So the conclusion is the QoS was not working at all.
Could anybody tell me what's wrong with the setting?
Thanks,

James


#!/bin/sh


OPTION="allot 1514 maxburst 20 avpkt 500"
tc qdisc del dev eth0 root 
tc qdisc add dev eth0 root handle 10: cbq bandwidth 10mbit avpkt 500
tc class add dev eth0 parent 10:0 classid 10:2 cbq bandwidth 10mbit 
rate22kbps $OPTION prio 3 bounded
tc qdisc add dev eth0 parent 10:2 handle 20: cbq bandwidth 10mbit allot 1514 
avpkt 500
tc class add dev eth0 parent 20: classid 20:10 cbq bandwidth 10mbit rate 
11kbps $OPTION prio 3 bounded
tc class add dev eth0 parent 20: classid 20:20 cbq bandwidth 10mbit 
rate11kbps $OPTION prio3 bounded
tc filter add dev eth0 parent 10: protocol ip prio 3 u32 match ip tos 
0xa0 0xff flowid 10:2
tc filter add dev eth0 parent 10: protocol ip prio 3 u32 match ip 
src10.10.5.3/24 flowid 10:2
tc filter add dev eth0 parent 20: protocol ip prio 3 u32 match ip tos 0xa0 
0xff flowid 20:10
tc filter add dev eth0 parent 20: protocol ip prio 3 u32 match ip 
src10.10.5.3/24 flowid 20:20



[LARTC] questions on CBQ

2002-12-09 Thread James Ma



Hi, All,

When I use CBQ, what should I put for "avpkt"? I 
saw all the examples using 1000, but if I have a lot of voice packets 
whichare very small,will "avpkt 1000" cause any problem? Another 
thing is, does CBQ support "default" as HTB does (ex: tc qdisc add dev eth0 root 
handle 1: htb default 12)? How can I put "all other traffic" into certain 
class?

Thanks,

James


[LARTC] redhat ready for htb?

2002-12-06 Thread James Ma



Hi, All,

I want to use linux (redhat) to do some bandwidth 
shaping work. I did know something on HTB and IPtables but I have very limited 
knowledge on Linux itself. I was told it's hard for non linux expert 
topatchthe kernel or even ptach HTB into IPROUTE2. So I would like 
to know if there is Redhat version with IPROUTE2 and HTB ready,then I 
don't need to do any patch work? Or if it's not available now,I 
knowkernel 2.4.20 hasHTB support, but how to patch HTB into 
IProute2?

Thanks,

James




[LARTC] questions with Stef's scripts

2002-12-05 Thread James Ma



Hi, Stef,

I have some questions withyour following 
scripts on www.docum.org,

BW1=$1'kbps'
BW2=`expr 100 - $1`
BW2=$BW2'kbps'

tc qdisc del dev eth0 root handle 1:

tc qdisc add dev eth0 root handle 1: htb default 12
tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil 100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate $BW1 ceil 100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:11 htb rate $BW2 ceil 100kbps burst 2k

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 1 fw classid 10:10
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid 10:11

iptables -F
iptables -X
iptables -N acc_0
iptables -N acc_1
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1
iptables -A OUTPUT -t mangle -p tcp --dport 2001 -j MARK --set-mark 2
iptables -A OUTPUT -p tcp --dport 2000 -j acc_0
iptables -A OUTPUT -p tcp --dport 2001 -j acc_1
	My questions are as follow,1.Why the classid in tc filter are "10:10 and 10:11" instead of "1:10 and 1:11"? How can you associate the filters with the classes you defined before?2.What does "fw" before "classid" in tc filter mean? Does it refer to forward chain?3.I guess the "handle 1" in tc filter refer to "mark1" in iptables, am I right? But is there any sequence problem to define handle 1 first and mark1 later in the scripts?4.Where can I find procedure on how to install HTB and compile kernel to use it?Your answer will be much appreciated,Regards,James


[LARTC] flowid and classid

2002-12-05 Thread James Ma



Hi, All,

Ihave aclass 1:10,it seems if 
Iusenetfilter mark as classifier, then the class will be refered as 
classid 1:10, however, if I use u32 as classifer, then the class should be 
refered as flowid 1:10, is it right?

Thanks in advance,

James


[LARTC] u32 and netfilter

2002-12-04 Thread James Ma



Hi, All,

My understanding is u32 filter is very powerful 
filter and could do anything aboutIP header filtering, then why do we 
sometimes use netfilering in IPtables? One advantege I guess is in netfilering, 
there is usage counter? Are there other advantges using netfilter (such as 
delay, flexibility)? What is the disadvantages to us Netfilter?

In summary, what are the considerations to select 
u32 or netfilter as classifier for QoS?


Thanks,

James


[LARTC] HTB and IP tables

2002-12-02 Thread James Ma



Hi, All,

Does anyone have working scripts using HTB for QoS 
but IPtables for filtering? I want to learn how to put them together. Do the 
scripts working on Redhat?


Thanks in advance,

James


[LARTC] dynamic bandwidth in stef's scripts

2002-11-29 Thread James Ma



Hi, All,

I went through the HTB test section on www.docum.org. One thing I am very interested in 
is the scripts Stef was using:

BW1=$1'kbps'
BW2=`expr 100 - $1`
BW2=$BW2'kbps'

tc qdisc del dev eth0 root handle 1:

tc qdisc add dev eth0 root handle 1: htb default 12
tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil 100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate $BW1 ceil 100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:11 htb rate $BW2 ceil 100kbps burst 2k

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 1 fw classid 10:10
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid 10:11

iptables -F
iptables -X
iptables -N acc_0
iptables -N acc_1
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1
iptables -A OUTPUT -t mangle -p tcp --dport 2001 -j MARK --set-mark 2
iptables -A OUTPUT -p tcp --dport 2000 -j acc_0
iptables -A OUTPUT -p tcp --dport 2001 -j acc_1
	It seems we could dynamically change the bandwidth allocation between children. But can we use dynamic bandwidth for the parent? I mean can I use a variable to replace 100kbps in the parentqueue defination and change it whenever this script file is called? This way, the scripts will work with dynamic bandwidth environment, I can monitor the bandwidth I have currently, and give it to the scripts dynamically by calling the script file with the bandwidth parameter.Is this practical? Has anybody tried it before?James


[LARTC] A TOS QUESTION

2002-11-28 Thread James Ma



Can anybody tell me what is "TOS=3D5"? I saw it 
several times in previous email. I would assume "3D" was added by the mail 
system automaticaly and means nothing here (so it should be "TOS=5"), am I 
right?

Thanks,

James


[LARTC] variable rate on wan connection

2002-11-06 Thread James Ma



Dear all,

I want to use IP route2 to do the QoS (VoIP, FTP, 
HTTP and Email). But the WAN connection rate is changing every 300ms, and it 
could be anywhere from 16kbps to 2mbps. Could IP route2 support it (I mean the 
total output of the queues will be updated every 300ms)? What is the requirement 
on the computer hardware? What issues I should consider?

Thanks in advance,

James


[LARTC] HTB with dynamic bandwidth

2002-10-01 Thread James Ma



Hi, All,

We want toimplement QoS in Linux gateway for 
different traffic,there are three types of trafficas 
below;

1.VoIP, total 34k, highest 
priority
2. HTTP, total 66k, medium priority
3. FTP, total 20k, low priority

However, the bandwidth on the WAN side is dynamic, 
it could be any where from 34k to 120k. Can we use IPROUTE2to do it? How 
todo it, HTB? It there similar work has been down before?

Thanks in advance,

James


[LARTC] iptable for multiple ip address

2002-09-12 Thread James Ma



Hi, All,

So far, all the applications I have seen for 
Iptables are focusing on connecting aWAN with one IP address to a LAN and 
using NAT. My question is if the iptables support multiple IP address on WAN 
side? If so, how it works (you only have one NIC on WAN side)? Is static NAT (it 
might not be the right term, I mean a static and permanent connection between 
WAN IP address and LAN IP address) supported?


Thanks in advance,

James