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

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


  • To: Anand Gupta <xen.mails@xxxxxxxxx>
  • 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
  • List-id: Xen user discussion <xen-users.lists.xensource.com>
  • Openpgp: id=67E2E5E9; url=http://m28s01.vlinux.de/timo_benk_gpg_key.asc

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


 


Rackspace

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