Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
* [LARTC] throttling outgoing bandwidth with IP aliasing
@ 2002-01-17  3:02 Shirley Wang
  0 siblings, 0 replies; only message in thread
From: Shirley Wang @ 2002-01-17  3:02 UTC (permalink / raw)
  To: lartc

Hello all,

I have an end host with just 1 physical network card whose address is
a.b.c.d, and I need to throttle the outgoing bandwidth from a set of aliased
IP address to a remote server e.f.g.h.  I'm running RedHat 7.1 with 2.4.2
kernel.

I have attached 192.168.10.1 to eth0:1 and 192.168.10.2 to eth0:2
I have set up NATting for these aliases addresses by:
	iptables -A POSTROUTING -t nat -s 192.168.10.1 -j SNAT --to a.b.c.d
	iptables -A POSTROUTING -t nat -s 192.168.10.2 -j SNAT --to a.b.c.d

I have also set up bandwidth limitation using tc:
	tc qdisc add dev eth0 root handle 10: cbq bandwidth 10Mbit avpkt
1000

	tc class add dev eth0 parent 10:0 classid 10:1 cbq bandwidth 10Mbit
\
		rate 10Mbit allot 1514 weight 1Mbit prio 8 maxburst 20 avpkt
1000

	tc class add dev eth0 parent 10:1 classid 10:100 cbq bandwidth
10Mbit \
		rate 56kbit allot 1514 weight 5Kbit prio 5 maxburst 20 avpkt
1000 \
		bounded

	tc qdisc add dev eth0 parent 10:100 sfq quantum 1514b perturb 15

	tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip
\
		dst e.f.g.h flowid 10:100

I have written a little program that could connect to e.f.g.h using the
aliases IPs, transfer a file, and measure the throughput (similar to ftp
except using private IP).  However, I was seeing throughput far greater than
the expected 56Kbps (around 1Mbps).  It doesn't seem like any packets are
being sent to handle 10:100, looking from the output for '/sbin/tc -s -d
class ls dev eth0':

-----------begin output-----------
class cbq 10: root rate 10Mbit cell 8b (bounded,isolated) prio no-transmit/8
weight 10Mbit allot 1514b 
level 2 ewma 5 avpkt 1000b maxidle 23us 
 Sent 4469982 bytes 4672 pkts (dropped 0, overlimits 0) 
  borrowed 0 overactions 0 avgidle 624 undertime 0
class cbq 10:100 parent 10:1 leaf 8021: rate 56Kbit cell 8b (bounded) prio
5/5 weight 5Mbit allot 1514b 
level 0 ewma 5 avpkt 1000b maxidle 123062us 
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 
  borrowed 0 overactions 0 avgidle 3.22605e+06 undertime 0
class cbq 10:1 parent 10: rate 10Mbit cell 8b prio no-transmit/8 weight
1Mbit allot 1514b 
level 1 ewma 5 avpkt 1000b maxidle 23us 
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 
  borrowed 0 overactions 0 avgidle 624 undertime 0
-----------end output-----------

Is what I'm trying to achieve possible?  What am I missing?  Is it because I
added the rules to eth0 but the aliased IPs are on eth0:1 and eth0:2?  

Any help would be greatly appreciated!

Shirley
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-17  3:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-17  3:02 [LARTC] throttling outgoing bandwidth with IP aliasing Shirley Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox