Skip to contentSkip to conversation

Unshapeable traffic

LARTC Tomasz Wrona 1 participant 4 messages May 4, 2005 – May 5, 2005

lore
Share & tools
lore
#0 lore raw

AK> Every new connection will try to push out as
AK> much data as possible, so HTB is busy beating the little bugger down AK> right from the beginning. Some people use iptables to generally drop AK> a few packets of any newly established connection to avoid this sort AK> of problem.

To avoid congestion I attached RED queue to p2p class but without any visible effect. I doesn't respond on any kind of shaping :/

Signature · 6 lines
tw

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
#1 lore raw

AF> Maybe you could try further seperating the P2P traffic into bulk and AF> network udp/syns/acks etc.

In fact it's done. UDP and ACKs goes extra prio queue. Also statistics say that dropped packets are the same size as other packets.

AF> Depends on what type of P2P clients are,to
AF> some extent what tcp there OS is running and number of connections. AF> Maybe PRIO would be better with bulk going to SFQ and small packets AF> getting priority.

AF> You could also play around with queue lengths and see AF> if that helps.

OK, I will try.

AF> Does it actually matter anyway - as it's egress you are shaping and I AF> assume the 2Mbit extra doesn't really hurt LAN speeds.

I doesn't play a role for LAN speed but it shouldn't occur anyway. It means that something doesn't work as expected. If it happens on download all your shaping is useless at all. You have to leave ie. spare 2Mbit [30% !!!] from your leased line not to overload it.

BTW. I though if it could be caused ie. by hacked TCP stack of some hosts or turned off windows_scaling feature of tcp... ?

Signature · 6 lines
tw

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
#2 lore raw
In reply to Tomasz Wrona

AF> Do you know roughly how many active connections you have?

Up to 30K.

AF> I think SFQ should be better than HTB default FIFO.

None works... [read ahead]

Quoted 2 lines
Quoted 2 lines

BTW. I though if it could be caused ie. by hacked TCP stack of some hosts or turned off windows_scaling feature of tcp... ?

AF> I think the fact it's on by default in Linux now hurts - It's off by AF> default in Windows AFAIK. Are the senders on your LAN using Linux or AF> Windows?

99% windows users.

However I just found propably reason of issue...

As p2p is both direction transfer most of it sends large ACK packets. After short investigation there are some facts:

1) 40% of p2p ACK packets have payload larger than 1KB, other are regular ACKs

2) 15% of all other traffic ACKs are longer than 1KB, 85% are regular ACKs.

I have priority class only for regular short ACKs, so other goes to custom p2p class.
Cause ACKs have to be send after receiving some data propably that's why I can't slow down traffic to defined value. Every time customer receive p2p data, sends LARGE ACK. Outcome is that shaping p2p upload have impact on p2p download and vice versa or in other words, to shape upload, shape download also.
Giving extra prio for large ACKs would be suicide. I suppose the only way to shape p2p is to dominate it by hard limits [up/down].

Please correct me if it's fake [and give an advise ;)].

Signature · 7 lines
Regards
 Tomasz Wrona

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
#3 lore raw
In reply to Tomasz Wrona
Quoted 2 lines
Quoted 2 lines

AF> Do you know roughly how many active connections you have? Up to 30K.

AF> I think this could be the problem - If 30k connections all tried to send AF> through 4mbit then a quick prod at xcalc tells me that each would get to AF> send 1 1500 byte packet every 90 seconds.

Not all of them are active. It's total upstream and downstream conntrack entries.

AF> Maybe limiting the number of connections per user would be best - if you AF> can.

All is done. I tested today p2p traffic with limited p2p allowed
users, no more then few dozens sessions [few hundred total conntrack].
When shaped upload to 3Mbit, iptables counted up to 3,5Mbit traffic.
You are right, more sessions active [and more bandwidth allocated], this difference grows.

However, I am not still sure if it's only reason of this upload case.

Regards
Tomasz Wrona

PS. Andy, thank's a lot for your time :)

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc