Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-users

Re: [Xen-users] Linux Traffic Shaping concept for Xen

To: "Timo Benk" <timo.benk@xxxxxx>
Subject: Re: [Xen-users] Linux Traffic Shaping concept for Xen
From: "Anand Gupta" <xen.mails@xxxxxxxxx>
Date: Sat, 28 Apr 2007 19:11:17 +0530
Cc: Xen Users <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 28 Apr 2007 06:39:54 -0700
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=nYBYcuDyOR6KhZQ4HLE3cG6l1sgBR7pPPjFtgaZk+JWUCLh4bac66IYLwRU3o9QPNeVxeCpz8I1dx5HGBT9HDuiLO0NKqdvXBJlJZDeNlQcQAMwvqQVNcYfiWTrSJypzJ/W0RgysB1jdso37UhGz0IEbCUKHVxWvehOnZymC5Vc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=VxSPR56soj4R0jZRArd7pXwDi9fsA3kS8anqZl3qewgdVohJC8zEv9ldnMtv/J6KKd7zM7M85S0/O4S8wY053gpg8JnM2SwLi+kmChBcKrIQ6yAYfxDJbWtasQ3P9YZCoiRsNmMI4Cyqp9wAgngaxGdS2Ma2LXqriCaLiMEXEj4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <46332E2A.9010607@xxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <20061007192115.28680@xxxxxxx> <20070107065619.GA14295@xxxxxxxxxx> <20070107070620.GA14526@xxxxxxxxxx> <45A0BBFA.5000707@xxxxxx> <1168163494.15109.107.camel@tower> <45A0C4D8.50601@xxxxxx> <acb757c00704280312l23ce8b9ev40dd27f07abaef86@xxxxxxxxxxxxxx> <46332E2A.9010607@xxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thanks for the rules and quick response.

On 4/28/07, Timo Benk <timo.benk@xxxxxx> wrote:
Anand Gupta wrote:
> Would you mind sharing your tc rules / scripts and how you have used
> them to
> shape traffic for domU's ? Will appreciate the help.
>
> On 1/7/07, Timo Benk < timo.benk@xxxxxx> wrote:
>>
>> why choppy? It works on my side. BTW, no ebtables is needed to achieve
>> traffic shaping. You can stick your tc rules inside Dom0 at the
>> vif-Interfaces of the gateway domain. It is nothing more than tc-magic;-)

You can use the IFB-Device for shaping of the incoming traffic:

(The following tc commands are not tested, but they should give you a
good starting point)

####
## IFB Rules

# modprobe ifb
# tc qdisc add dev eth0 ingress
# tc filter add dev eth0 parent ffff: \
    protocol ip prio 10 u32           \
    match ip dst 0/0 flowid 1:1       \
    action mirred egress redirect dev ifb0

####
## HTB QDiscs

# tc qdisc add dev ifb0 root handle 1:0 htb
# tc class add dev ifb0 parent 1:0 \
    classid 1:1 htb                \
    rate 1mbit mtu 16000 quantum 16000

# tc class add dev ifb0 parent 1:0 \
    classid 1:2 htb                \
    rate 10mbit mtu 16000 quantum 16000

####
## Filter Definitions

# tc filter add dev ifb0 parent 1:0            \
    protocol ip prio 1 u32                     \
    match ip dst 172.17.0.101/32 flowid 1:1

# tc filter add dev ifb0 parent 1:0            \
    protocol ip prio 1 u32                     \
    match ip dst 172.17.0.102/32 flowid 1:2

Greetings,
-timo
--
Timo Benk - Jabber ID: fry@xxxxxxxxxxxx - ICQ ID: #414944731
PGP Public Key: http://www.m28s01.vlinux.de/timo_benk_gpg_key.asc




--
regards,

Anand Gupta
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>