All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] TC (HTB) doesn't work well when network is congested?
@ 2007-10-25 16:38 William Xu
  2007-10-25 17:22 ` Peter Rabbitson
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: William Xu @ 2007-10-25 16:38 UTC (permalink / raw)
  To: lartc

Hi,

I have a server and ten clients in a Gigabit network. The server has 
125mbps network bandwidth.
I want that the server has 40Mbps bandwidth reserved for client 1 (IP 
192.168.5.141), and the
rest bandwidth is for all other clients.

My script looks like this (I use IFB for incoming traffic):

#!/bin/bash

export TC="/sbin/tc"

$TC qdisc add dev ifb0 root handle 1: htb default 30 r2q 100

$TC class add dev ifb0 parent 1:0 classid 1:1 htb rate 125mbps mtu 9000
$TC class add dev ifb0 parent 1:1 classid 1:10 htb rate 40mbps ceil 
125mbps mtu 9000 prio 0
$TC class add dev ifb0 parent 1:1 classid 1:30 htb rate 85mbps ceil 
125mbps mtu 9000 prio 1

$TC filter add dev ifb0 parent 1: protocol ip prio 1 u32 match ip src 
192.168.5.141/32 flowid 1:10

$TC qdisc add dev eth2 ingress
$TC filter add dev eth2 parent ffff: protocol ip prio 1 u32 \
        match u32 0 0 flowid 1:1 \
        action mirred egress redirect dev ifb0

$TC qdisc add dev eth2 root handle 1: htb default 30 r2q 100

$TC class add dev eth2 parent 1: classid 1:1 htb rate 125mbps mtu 9000
$TC class add dev eth2 parent 1:1 classid 1:10 htb rate 40mbps ceil 
125mbps mtu 9000 prio 0
$TC class add dev eth2 parent 1:1 classid 1:30 htb rate 85mbps ceil 
125mbps mtu 9000 prio 1

$TC filter add dev eth2 parent 1: protocol ip prio 1 u32 match ip dst 
192.168.5.141/32 classid 1:10

I ran a test in which all 10 clients send/receive packets to/from the 
server simultaneously. But
Client 1 only got 20mbps bandwidth for sending, and 38mpbs for 
receiving. If I limit the rate of
both classes 1:1 to 60mbps instead of 125mbps, Client 1 got 39mbps for 
sending, and 40mbps for
receiving.

I am not sure what might cause this. Is it because TC doesn't work well 
when network is congested?
Or my script is not right?

Thanks a lot,
william



_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-11-01 12:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-25 16:38 [LARTC] TC (HTB) doesn't work well when network is congested? William Xu
2007-10-25 17:22 ` Peter Rabbitson
2007-10-25 18:20 ` William Xu
2007-10-25 21:13 ` Peter Rabbitson
2007-10-26 13:44 ` William Xu
2007-10-26 22:39 ` Peter Rabbitson
2007-10-31 19:39 ` William Xu
2007-11-01 12:08 ` Georgi Alexandrov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.