[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: "Timo Benk" <timo.benk@xxxxxx>
  • 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
  • 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=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.