All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Žilvinas Vaičkus" <zilvinas.v@kis.lt>
To: lartc@vger.kernel.org
Subject: Re: HTB performance, and debbuging
Date: Tue, 05 Mar 2013 14:15:56 +0000	[thread overview]
Message-ID: <5135FE1C.3090806@kis.lt> (raw)
In-Reply-To: <5135905D.7050005@kis.lt>

On 03/05/2013 01:56 PM, Benjamin Kiessling wrote:
> Hi,
>
> On 2013.03.05 08:27:41 +0200, Žilvinas Vaičkus wrote:
>> Hi list,
>>
>> I have two traffic shaping servers, on Linux Centos 5.5
>> (2.6.18-194.32.1.el5) with HTB. In these servers are 2 gigabit NIC's and
>> running script which generates two HTB class'es per ip, one for http and
>> icmp, and another class for other ports. These class'es have different
>> bandwidth rate. Each server serves about 5000 IP's, so each server have
>> about 10000 class'es and about 40000 filters (4 filters per class), and all
>> IP's are hashed with hashing tables.I am not sure that all my ip's are
>> shaped. When i look to default class with "tc -s class show dev" sometimes
>> default class traffic goes up, so there is asumtion that some of ip's are
>> not shaped.
>>
>> 1. First question ist there any way to check which ip's go trough default
>> HTB class ?
> It would be possible to mirror traffic reaching the default class to an
> ifb like this:
>
> tc filter add dev eth0 parent 1:defaultclass protocol ip priority 10 u32 \
> match u32 0 0 flowid 1: action mirred egress mirror dev ifb0
>
> Then just run a tcpdump on ifb0.
>
> Regards,
> Ben
Thank you for the reply Benhamin.

Ok so simple example i have these HTB rules:

eth2 - internet
eth0 - lan
default class for eth0 are 2:16 and if I add filter (last line) all 
traffic which arive in that class will be mirrored to ifb0 correct ?

-------------------------------------------------------------------------------------------------------------
qdisc replace dev eth2 root handle 1: htb default 12
qdisc replace dev eth0 root handle 2: htb default 16

class add dev eth2 parent 1:0 classid 1:12 htb rate 995Mbit ceil 995Mbit
class add dev eth0 parent 2:0 classid 2:16 htb rate 995Mbit ceil 995Mbit

class add dev eth2 parent 1:0 classid 1:64 htb rate 5024kbit
class add dev eth2 parent 1:0 classid 1:65 htb rate 124kbit

         filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match 
ip src 10.42.1.24 match ip icmp_type 0x08 0xff flowid 1:64
         filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match 
ip src 10.42.1.24 match ip dport 80 0xffff flowid 1:64
         filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match 
ip src 10.42.1.24 match ip dport 443 0xffff flowid 1:64
         filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match 
ip src 10.42.1.24 match ip dport 33434 0xff80 flowid 1:64
         filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match 
ip src 10.42.1.24 match ip dport 0 0x0000 flowid 1:65

class add dev eth0 parent 2:0 classid 2:64 htb rate 5024kbit
class add dev eth0 parent 2:0 classid 2:65 htb rate 124kbit

         filter add dev eth0 parent 2:0 protocol ip prio 100 u32 match 
ip dst 10.42.1.24 match ip icmp_type 0x00 0xff flowid 2:64
         filter add dev eth0 parent 2:0 protocol ip prio 100 u32 match 
ip dst 10.42.1.24 match ip sport 80 0xffff flowid 2:64
         filter add dev eth0 parent 2:0 protocol ip prio 100 u32 match 
ip dst 10.42.1.24 match ip sport 443 0xffff flowid 2:64
         filter add dev eth0 parent 2:0 protocol ip prio 100 u32 match 
ip dst 10.42.1.24 match ip sport 33434 0xff80 flowid 2:64
         filter add dev eth0 parent 2:0 protocol ip prio 100 u32 match 
ip dst 10.42.1.24 match ip sport 0 0x0000 flowid 2:65
----------------------------------------------------------------------------------------------------------------
filter add dev eth0 parent 2:16 protocol ip priority 10 u32 match u32 0 
0 flowid 1: action mirred egress mirror dev ifb0

      parent reply	other threads:[~2013-03-05 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05  6:27 HTB performance, and debbuging Žilvinas Vaičkus
2013-03-05 11:56 ` Benjamin Kiessling
2013-03-05 14:15 ` Žilvinas Vaičkus [this message]

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=5135FE1C.3090806@kis.lt \
    --to=zilvinas.v@kis.lt \
    --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 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.