Bad results for rate limiting with bidirectional traffic

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

 



(I tried to post this to the LARTC mailing list but the host for that list
is down.  Hopefully some of the people knowledgable about Linux traffic
control will be paying attention on linux-net.  Apologies for any
interference.)

I'm running some tests on a simple CBQ-based traffic rate limiter using
Linux 2.2.18, and although it works acceptably well for unidirectional TCP
traffic, if I send bidirectional traffic it gets hosed.

I have a simple network design with two endpoints and two routers, one of
which is has the rate limiting configured on it.

  [10.1.1.17]
       |
  10.1.1.0/24 network
       |
   [dot-one]
       |
  10.5.5.0/24 network
       |
   [dot-23]
       |
 10.10.10.0/24 network
       |
 [10.10.10.32]

On 'dot-one' (which is 10.1.1.1 and 10.5.5.1) I have the tc configuration
given below:

tc qdisc add dev eth0 root handle 1: cbq bandwidth 10Mbit avpkt 1000 cell
  8 mpu 4
tc class add dev eth0 parent 1: classid 1:10 cbq bandwidth 10Mbit rate
  1Mbit weight 100Kbit allot 1514 avpkt 1000 bounded isolated
tc filter add dev eth0 parent 1:0 proto ip prio 100 u32 match ip src
  10.10.10.0/24 flowid 1:10

and the same configuration for eth1 except with the filter being "ip dst
10.10.10.0/24", so it works in the opposite direction.  Thus I'm basically
trying to rate limit the link from 10.1.1.0/24 to 10.10.10.0/24 to 1Mbps
for both incoming and outgoing traffic.

I used ttcp on both endpoints to do throughput tests.  If I only test
unidirectional traffic with one host receiving and one host transmitting,
then the results look great: 1027.89 Kbps, 1031.35 Kbps, etc.  But if I'm
transmitting from both endpoints and receiving on both endpoints then the
results look terrible: 216.38 Kbps and 357.13 Kbps on one end, 495.10 Kbps
and 511.05 Kbps on the other.  I've played around with a lot of settings
trying to figure out what's wrong, but the relative lack of documentation
on tc's options (like, what exactly they do and how they affect each
other) has me lost.  I'd like to be seeing 1Mbps in both directions, but
I'm not.

I have a hard time believing that this might be a hardware problem (which
a friend mentioned to me) because the unidirectional test works perfectly
well from either endpoint.  And if I turn off traffic control on dot-one
then the bidirectional test works fine, with TCP throughput of over 5Mbps
(on a 10Mbps link).

Can anyone explain what is going on?  How I can configure this to get what
I want, which is a 1Mbps rate limit in both directions simultaneously?

'james

-- 
James A. Crippen <james@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.



-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux