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: Anand Gupta <xen.mails@xxxxxxxxx>
Subject: Re: [Xen-users] Linux Traffic Shaping concept for Xen
From: Timo Benk <timo.benk@xxxxxx>
Date: Sat, 28 Apr 2007 13:21:14 +0200
Cc: Xen Users <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 28 Apr 2007 04:20:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <acb757c00704280312l23ce8b9ev40dd27f07abaef86@xxxxxxxxxxxxxx>
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>
Openpgp: id=67E2E5E9; url=http://m28s01.vlinux.de/timo_benk_gpg_key.asc
References: <20061007192115.28680@xxxxxxx> <20070107065619.GA14295@xxxxxxxxxx> <20070107070620.GA14526@xxxxxxxxxx> <45A0BBFA.5000707@xxxxxx> <1168163494.15109.107.camel@tower> <45A0C4D8.50601@xxxxxx> <acb757c00704280312l23ce8b9ev40dd27f07abaef86@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.0 (X11/20070326)
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


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>