kiranghag
Posts: 8
Joined: Thu May 31, 2012 3:58 am

performance - using p3b+ as wlan router

Sun Jun 24, 2018 5:04 am

I followed the various pages/tutorials to setup Pi3B+ as a wireless router

ISP Ethernet <--> ppp0/eth0 -----PI----- wlan0 <--> laptop

PI has been setup as WiFi access point using hostapd
eth0 is set for DHCP (it receives no IP from ISP)
PPPoE has been successfully configured to dial at boot
dhcp is setup on wlan0 and laptop is able to get DHCP IP.

following iptables rules are used to NAT the laptop to internet

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
sudo iptables -A FORWARD -i ppp0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o ppp0 -j ACCEPT

-----------------------------------------------------------------------------------------------------------------------------------------------------

The laptop is able to connect to internet but speed test shows only 13-15Mbps. Also the pi either locks up or reboots when speed test is done.

The Pi on its own is able to download at full 50Mbps bandwidth.

Has someone done similar setup and got more throughput?

ejolson
Posts: 2041
Joined: Tue Mar 18, 2014 11:47 am

Re: performance - using p3b+ as wlan router

Tue Jun 26, 2018 9:27 pm

kiranghag wrote:
Sun Jun 24, 2018 5:04 am
Also the pi either locks up or reboots when speed test is done.
The lock up or reboot sounds like a serious problem. There are some idea how to fix lockups on this thread. From my experience, you definitely want to turn off transmission TCP segmentation offload. I'm not sure if the problem lies with the Ethernet driver, the Ethernet circuitry or the built-in USB hub, but the configuration setting

# ethtool -K eth0 tx-tcp-segmentation off

seems necessary for reliable wired networking.

If the outright system crashes and reboots persist, I would recommend under clocking your Pi 3B+ as described earlier in the same thread.

I have a setup that is essentially the opposite of what you have: Cable modem with built-in WiFi Router connected to Pi through WiFi which then servers as a masquerade firewall for a wired local area network. No crashing had been observed so far. What speed test are you using?

drgeoff
Posts: 8633
Joined: Wed Jan 25, 2012 6:39 pm

Re: performance - using p3b+ as wlan router

Tue Jun 26, 2018 10:08 pm

ejolson wrote:
Tue Jun 26, 2018 9:27 pm
From my experience, you definitely want to turn off transmission TCP segmentation offload. I'm not sure if the problem lies with the Ethernet driver, the Ethernet circuitry or the built-in USB hub, but the configuration setting

# ethtool -K eth0 tx-tcp-segmentation off

seems necessary for reliable wired networking.
The TCP segmentation offload is referred to in viewtopic.php?f=28&t=171122&p=1332782#p1332782. But it is not 100% clear to me what the "fixed in latest update" means. I would hope it means that the offload is now behaving properly.

gkid19
Posts: 3
Joined: Mon Oct 15, 2012 3:12 am

Re: performance - using p3b+ as wlan router

Wed Jun 27, 2018 1:22 am

Have you tried changing your SD card? I had this old Transcend 8gb class 6 card on my Pi 1 model B for a long time and tried so many things to try to get it working. It would lock up after a heavy load or even just 4 hours on no load. Recently I got back into it and had a smart plug power cycling it whenever it crashed. I figured I broke something on it in the beginning but this last week it started working flawlessly after changing cards!! I now have a 16 GB Transcend SDHC I class 10 which works perfectly.

ejolson
Posts: 2041
Joined: Tue Mar 18, 2014 11:47 am

Re: performance - using p3b+ as wlan router

Wed Jun 27, 2018 5:58 am

drgeoff wrote:
Tue Jun 26, 2018 10:08 pm
But it is not 100% clear to me what the "fixed in latest update" means. I would hope it means that the offload is now behaving properly.
Since transmission offload seems to break only when transferring files stored on a USB drive, my suspicion is that something is going wrong at the USB transport level. Maybe an entire offload request is lost and since USB is supposed to be lossless, the TCP stack doesn't think to resend it. I should emphasize that this is all conjecture. It would be interesting to hear from the Raspberry Pi engineers what the real problem is and how it was solved.

kiranghag
Posts: 8
Joined: Thu May 31, 2012 3:58 am

Re: performance - using p3b+ as wlan router

Fri Jun 29, 2018 3:55 am

gkid19 wrote:
Wed Jun 27, 2018 1:22 am
Have you tried changing your SD card? I had this old Transcend 8gb class 6 card on my Pi 1 model B for a long time and tried so many things to try to get it working. It would lock up after a heavy load or even just 4 hours on no load. Recently I got back into it and had a smart plug power cycling it whenever it crashed. I figured I broke something on it in the beginning but this last week it started working flawlessly after changing cards!! I now have a 16 GB Transcend SDHC I class 10 which works perfectly.
I have class 10 16GB

kiranghag
Posts: 8
Joined: Thu May 31, 2012 3:58 am

Re: performance - using p3b+ as wlan router

Fri Jun 29, 2018 3:57 am

ejolson wrote:
Tue Jun 26, 2018 9:27 pm
kiranghag wrote:
Sun Jun 24, 2018 5:04 am
Also the pi either locks up or reboots when speed test is done.
The lock up or reboot sounds like a serious problem. There are some idea how to fix lockups on this thread. From my experience, you definitely want to turn off transmission TCP segmentation offload. I'm not sure if the problem lies with the Ethernet driver, the Ethernet circuitry or the built-in USB hub, but the configuration setting

# ethtool -K eth0 tx-tcp-segmentation off

seems necessary for reliable wired networking.

If the outright system crashes and reboots persist, I would recommend under clocking your Pi 3B+ as described earlier in the same thread.

I have a setup that is essentially the opposite of what you have: Cable modem with built-in WiFi Router connected to Pi through WiFi which then servers as a masquerade firewall for a wired local area network. No crashing had been observed so far. What speed test are you using?
atm I formatted the pi and need to build it again for this purpose.

will check with the segmentation option. thanks for the tip.

I am using speedtest.net or simply try to download a large file from laptop client.

what speeds do you see if you do a speed test?

btw, my setup is reverse of your setup. internet is on ethernet and local clients on wifi

BBUK
Posts: 134
Joined: Tue Dec 18, 2012 10:34 am

Re: performance - using p3b+ as wlan router

Fri Jul 06, 2018 2:21 pm

This may sound a little strange given the comments above but I had a similar problem.

I found it was caused by the DHCP server on the Pi attempting to give IP addresses over all interfaces rather than just wlan0.

Try configuring whichever DCHP server you are using to only apply IP addresses over wlan0.

Have fun

BBUK

ejolson
Posts: 2041
Joined: Tue Mar 18, 2014 11:47 am

Re: performance - using p3b+ as wlan router

Sun Jul 08, 2018 4:59 pm

ejolson wrote:
Wed Jun 27, 2018 5:58 am
drgeoff wrote:
Tue Jun 26, 2018 10:08 pm
But it is not 100% clear to me what the "fixed in latest update" means. I would hope it means that the offload is now behaving properly.
It would be interesting to hear from the Raspberry Pi engineers what the real problem is and how it was solved.
Apparently the official solution is just to disable TCP segmentation transmit offload, though it is not clear whether this causes a performance regression in other cases.

kiranghag
Posts: 8
Joined: Thu May 31, 2012 3:58 am

Re: performance - using p3b+ as wlan router

Mon Jul 09, 2018 7:54 am

ejolson wrote:
Sun Jul 08, 2018 4:59 pm
ejolson wrote:
Wed Jun 27, 2018 5:58 am
drgeoff wrote:
Tue Jun 26, 2018 10:08 pm
But it is not 100% clear to me what the "fixed in latest update" means. I would hope it means that the offload is now behaving properly.
It would be interesting to hear from the Raspberry Pi engineers what the real problem is and how it was solved.
Apparently the official solution is just to disable TCP segmentation transmit offload, though it is not clear whether this causes a performance regression in other cases.
I tried with ethtool but current release has a bug that rejects the change :(

will wait for update

ejolson
Posts: 2041
Joined: Tue Mar 18, 2014 11:47 am

Re: performance - using p3b+ as wlan router

Sun Jul 15, 2018 12:36 am

ejolson wrote:
Sun Jul 08, 2018 4:59 pm
ejolson wrote:
Wed Jun 27, 2018 5:58 am
drgeoff wrote:
Tue Jun 26, 2018 10:08 pm
But it is not 100% clear to me what the "fixed in latest update" means. I would hope it means that the offload is now behaving properly.
It would be interesting to hear from the Raspberry Pi engineers what the real problem is and how it was solved.
Apparently the official solution is just to disable TCP segmentation transmit offload, though it is not clear whether this causes a performance regression in other cases.
This is a quick post to note that today after an

# apt-get update
# apt-get upgrade

the wired networking works fine for me without having to manually disable TCP segmentation offload.

Return to “Advanced users”