On Saturday 23 November 2002 06:58, ajay@movingdelhi.org wrote:
> Thanx, I managed it to get the basic script working but the result IS N=
OT
> satisfactory. What is happening is this:-
>
> When any user (ex 192.168.0.4 in my script) starts to download a file
> (Download1) after a while it settles down to the alloted bandwidth 32kb=
ps.
> If he puts another download (Download 2) after a while it occupies
> approximately half of the total bandwidht alloted to 192.168.0.4. So f=
ar
> so good.....
> NOW, when the user(192.168.0.4) cancels any one of the downloads (Say
> download 1) the other download (download 2) takes a very long time to g=
row
> up to the total alloted bandwidth i.e 32kbps.
>
> Why is that happening?
I'm not sure, but when the scond download is started, both ends of the=20
connection are using as much bandwidth as possible untill packets are=20
dropped. If the connection has suddenly more bandwidth because the other=
=20
download is stopped, it takes some time before both ends of the connectio=
n=20
realize this. And when they do so, they are trying to push again as much=
as=20
possible untill they are throttled to 64kbps. I think that's the way how=
tcp=20
is handle the bandwidth limitaion.
> I can't figure it out. Could SFQ Help?
Not really. SFQ give each data stream the same opportunity to send somet=
hing. =20
If one of the streams is gone, the other can send all of the time. But y=
ou=20
can try to add one to see what happens.
> ___________________________________________________________
> /sbin/tc qdisc add root dev eth1 handle 1:0 cbq bandwidth 10Mbit avpkt =
1000
> /sbin/tc class add dev eth1 parent 1:0 classid 1:1 cbq bandwidth 10Mbit
> rate 256Kbit allot 1514 bounded
> /sbin/tc class add dev eth1 parent 1:1 classid 1:2 cbq bandwidth 256Kbi=
t
> rate 32Kbit allot 1514 bounded
> /sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip=
src
> 192.168.0.4 flowid 1:2
> /sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip=
dst
> 192.168.0.4 flowid 1:2
> ________________________________________________________________
bandwidth is always the nic bandwidth so 10Mbit.
And shaping on eth1 is shaping all the packets that are leaving eth2. So=
the=20
usung src and dst in 2 filters is useless. The src filter will never mat=
ch.
Stef
--=20
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net