coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
518 stars 260 forks source link

On x86/x64 some client traffic goes over lan interface and not tun0 #224

Closed limitisbsc closed 8 years ago

limitisbsc commented 8 years ago

We are operating successfully a bunch of coova-chilli installations with OpenWrt on home routers(MIPS), mostly without xt_coova. Just as a side note, a drawback in xt_coova is the lack of limiting the upload.

Recently we were testing coova-chilli on some x86 and x64 hardware with Debian Wheezy/Jessie and OpenWrt 15.05 as OS. Unfortunately we are having issues when it comes to the upload. Some of the packets don't go through the tun0 interface, but go over the lan interface, where the packets are getting dropped by default. I see no reason why client traffic should be going halfway through tun0 and halfway over lan. This behaviour obviously causes a huge decrease in the upload speed. 36368 45M ACCEPT all -- any tun0 anywhere anywhere 45842 25M ACCEPT all -- tun0 any anywhere anywhere 0 0 DROP all -- any br-lan anywhere anywhere 46672 27M DROP all -- br-lan any anywhere anywhere

A tcpdump shows a lot of retransmissions, dup acks and out of order packets. Something wrong with the tun0 device? It makes no difference if the LAN is bridged or not. Removing the DROP increases the upload speed slightly but saturates the wan link with the double amount of packets from tun0 and lan interface.

We experience this problem only on x86/x64 hardware. Using xt_coova does solve the problem, but that's not an option since we need also to limit the bandwidth.

Anyone having the same issues? Hints, ideas and suggestions are welcome. Thanks.

nzamps commented 8 years ago

Try turning off generic receive offload (GRO) and TSO:

ethtool -K eth0 gro off ethtool -K eth0 tso off

Change eth0 to your wan port name.

Or you can setup fairly simple tc scripts to limit the bandwidth when using xt_coova.

brian

On 9/03/2016, at 2:13 AM, limbsc notifications@github.com wrote:

We are operating successfully a bunch of coova-chilli installations with OpenWrt on home routers(MIPS), mostly without xt_coova. Just as a side note, a drawback in xt_coova is the lack of limiting the upload.

Recently we were testing coova-chilli on some x86 and x64 hardware with Debian Wheezy/Jessie and OpenWrt 15.05 as OS. Unfortunately we are having issues when it comes to the upload. Some of the packets don't go through the tun0 interface, but go over the lan interface, where the packets are getting dropped by default. I see no reason why client traffic should be going halfway through tun0 and halfway over lan. This behaviour obviously causes a huge decrease in the upload speed. 36368 45M ACCEPT all -- any tun0 anywhere anywhere 45842 25M ACCEPT all -- tun0 any anywhere anywhere 0 0 DROP all -- any br-lan anywhere anywhere 46672 27M DROP all -- br-lan any anywhere anywhere

A tcpdump shows a lot of retransmissions, dup acks and out of order packets. Something wrong with the tun0 device? It makes no difference if the LAN is bridged or not. Removing the DROP increases the upload speed slightly but saturates the wan link with the double amount of packets from tun0 and lan interface.

We experience this problem only on x86/x64 hardware. Using xt_coova does solve the problem, but that's not an option since we need also to limit the bandwidth.

Anyone having the same issues? Hints, ideas and suggestions are welcome. Thanks.

— Reply to this email directly or view it on GitHub https://github.com/coova/coova-chilli/issues/224.

sjbeskur commented 8 years ago

This worked for me ethtool -K eth0 gso off gro off tso off

On Mar 8, 2016, at 6:13 AM, limbsc notifications@github.com wrote:

We are operating successfully a bunch of coova-chilli installations with OpenWrt on home routers(MIPS), mostly without xt_coova. Just as a side note, a drawback in xt_coova is the lack of limiting the upload.

Recently we were testing coova-chilli on some x86 and x64 hardware with Debian Wheezy/Jessie and OpenWrt 15.05 as OS. Unfortunately we are having issues when it comes to the upload. Some of the packets don't go through the tun0 interface, but go over the lan interface, where the packets are getting dropped by default. I see no reason why client traffic should be going halfway through tun0 and halfway over lan. This behaviour obviously causes a huge decrease in the upload speed. 36368 45M ACCEPT all -- any tun0 anywhere anywhere 45842 25M ACCEPT all -- tun0 any anywhere anywhere 0 0 DROP all -- any br-lan anywhere anywhere 46672 27M DROP all -- br-lan any anywhere anywhere

A tcpdump shows a lot of retransmissions, dup acks and out of order packets. Something wrong with the tun0 device? It makes no difference if the LAN is bridged or not. Removing the DROP increases the upload speed slightly but saturates the wan link with the double amount of packets from tun0 and lan interface.

We experience this problem only on x86/x64 hardware. Using xt_coova does solve the problem, but that's not an option since we need also to limit the bandwidth.

Anyone having the same issues? Hints, ideas and suggestions are welcome. Thanks.

— Reply to this email directly or view it on GitHub.

limitisbsc commented 8 years ago

Thanks a lot. Turning off TCP segmentation offload worked for me too. It has a small impact on CPU load, but that's just the way TSO works.

SPQmax commented 11 months ago

Hi ,

We are having very similar problem that half of the traffic going in to LAN instead of TUN interface. Due to this Upload speed suffers a lot. As mentioned the thread, I tried tried

ethtool -K wan gso off gro off tso off

But having issue to turn off Segmentation. Please see the below error message. Any help will be appreciated.

root@2300I000004:~# ethtool -K wan gso off gro off tso off
Actual changes:
tx-generic-segmentation: off
rx-gro: off
tx-tcp-segmentation: on [requested off]
tx-tcp-ecn-segmentation: on [requested off]
tx-tcp-mangleid-segmentation: on [requested off]
tx-tcp6-segmentation: on [requested off]

Note : we are on OpenWrt 23.05. Coova Chilli 1.6-9.1.

Rgds SP