Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: William Xu <wxu@max-t.com>
To: lartc@vger.kernel.org
Subject: [LARTC] TC (HTB) doesn't work well when network is congested?
Date: Thu, 25 Oct 2007 16:38:11 +0000	[thread overview]
Message-ID: <4720C673.7040900@max-t.com> (raw)

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

             reply	other threads:[~2007-10-25 16:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-25 16:38 William Xu [this message]
2007-10-25 17:22 ` [LARTC] TC (HTB) doesn't work well when network is congested? 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4720C673.7040900@max-t.com \
    --to=wxu@max-t.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox