Upload speed problem due to mtu?

1,481 views
Skip to first unread message

Ali Farajpahlou

unread,
Apr 9, 2016, 5:46:56 AM4/9/16
to Grase Hotspot
hey there.

I've Noticed a problem with uploading files though the hotspot (client side) and after searching in the group and internet, and running some tests with MTU and ping testing with different MTU's (ping packet size), i found out that the problem is with mtu size.
all interfaces were set to MTU:1500 by default. changing them didn't fix the issue, and after checking and adding header size i still get that the MTU that is being applied to packets is 576.

if anyone has any idea about this problem, i would appreciate any suggestions. if u want more details about anything... I'm here :)

many thanx in advance and if my writing has problems, sry for my bad english :)

David Wilson

unread,
Apr 9, 2016, 5:03:55 PM4/9/16
to grase-...@grasehotspot.org
Hi Ali


MTU issues are normally related to additional overhead created by using protocols on top of Ethernet. 

So If you have a pppoe connection to the internet, for example, then that pppoe protocol will increase the packet size and possibly cause it to fail to traverse the Internet. 

You should test to see what the maximum packet size is that you can send through your internet connection from your Grase server 
You can find this by trial and error 

The best value for MTU is that value just before your packets get fragmented. How do you find that out? By using Ping at the command prompt.

Windows users:
Go to Start/ Programs/ Accessories/ Command Prompt and type the following:
ping -f -l 1472 www.dslreports.com
(That is a dash lower case "L"  Also note the spaces in between the sections.)

Linux users:
ping -s 1472 www.dslreports.com

OS X users:
ping -D -s 1472 www.dslreports.com

Press Enter. Then reduce 1472 by 10 until you no longer get the "packet needs to be fragmented" error message. Then increase by 1 until you are 1 less away from getting the "packet need to be fragmented" message again.  Add 28 more to this (since you specified ping packet size, not including IP/ICMP header of 28 bytes), and this is your MaxMTU.


Then you need to use iptables to implement the mss clamp unless you have another router between your Grase server and the internet in which case you may be able to do the MSS clamping on that router. 
(I always setup this way so I have never used Grase to do the Clamping) 
There are two options below - The first one is automatic and “may not work” as some people have had issues with this.
The second option is based on you finding the correct value above and then adding it to the command in place of the 1500 - Don’t forget to add the 28 to the successful test result above.

In order for this to work you need at least iptables-1.2.1a and Linux 2.4.3 or higher. The basic command line is:

	# iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS  --clamp-mss-to-pmtu
This calculates the proper MSS for your link. If you are feeling brave, or think that you know best, you can also do something like this:

# iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1500




Dave 


--
This mailing list is for the Grase Hotspot Project http://grasehotspot.org
---
You received this message because you are subscribed to the Google Groups "Grase Hotspot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grase-hotspo...@grasehotspot.org.
To post to this group, send email to grase-...@grasehotspot.org.
Visit this group at https://groups.google.com/a/grasehotspot.org/group/grase-hotspot/.
To view this discussion on the web visit https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/4be26113-f8ef-4517-9241-3d55ccfb8a8f%40grasehotspot.org.

Ali Farajpahlou

unread,
Apr 10, 2016, 6:46:53 AM4/10/16
to Grase Hotspot
thank you for your reply suggestions. i already tried pinging with different sizes, the problem is the hotspot device i think. the device is connected to the internet through a firewall (firewall is the dhcp server assigning ip to the wan side of the hotspot device). i tried connecting directly to the firewall and there was no issue with uploading and packet fragmentation. i have determined an mtu of 576 behind the hotspot device (pinging the hotspot device), and i think the probelm is that the device needs to fragment the packets, but they contain a DF header i think. so it drops them. i cant find where this mtu is set on the device, checking the interfaces mtu didnt solve the issue (they were already set at 1500 on every interface (yes even the tunnels xD )). havn't checked mss clampings but i'm assuming that it's not causing the problem.

the first iptables command didnt output anyresponse. gonna search some more myself and see what more info i can find about this.

btw i forgot to mention that im working on the latest Debian release with the latest version of grase (stable version not nightly)


again, thanx for your help and suggestions.

David Wilson

unread,
Apr 10, 2016, 8:41:11 AM4/10/16
to grase-...@grasehotspot.org
MTU will normally always be 1500 for ethernet devices. 

MSS Clamping is different to the MTU.
Getting an MTU of 576 from the client to the hotspot device is not that important, you need to know what size ping you can get out to somewhere on the internet (www.yahoo.com) without fragmentation. 

What was the result of running the pings (commands below) from a client on the LAN side of the hotspot?
You can run the same from the firewall lan if you like, but if your issue is with Grase clients then best to do it from the client. 

Then you set the command in IPTables to Clamp all packets to that size. 

The first command probably won’t give you an output but will create a new firewall rule. 
Just make sure you runt that command without the initial # (The # is just a comment delimiter from where those commands came from 


Dave 


Timothy White

unread,
Apr 10, 2016, 1:48:43 PM4/10/16
to Grase Hotspot
It may also be worth running https://grasehotspot.org/support/collecting-support-information/ to show your setup to us. It's possible that you are missing something obvious that is causing your MTU issues.

I just did some tests on my devices, and pings of size 1472 all go through my hotspots fine. What hardware are you using? Maybe it's a network card driver bug?

Regards

Tim

Reza Dadman

unread,
Apr 20, 2016, 3:37:55 AM4/20/16
to Grase Hotspot
I have the same problem and I a getting confused. I can Upload a file in https websites like GMail but when it comes to a http website I cant upload files!!! 

Timothy White

unread,
Apr 20, 2016, 3:46:03 AM4/20/16
to Grase Hotspot
Hi Reza

This is useful information. That suggests it might be an issue with the Squid proxy. I'll try and have a poke to see what might be causing this.

Tim

On Wed, Apr 20, 2016 at 5:37 PM, Reza Dadman <online...@gmail.com> wrote:
I have the same problem and I a getting confused. I can Upload a file in https websites like GMail but when it comes to a http website I cant upload files!!! 

--
This mailing list is for the Grase Hotspot Project http://grasehotspot.org
---
You received this message because you are subscribed to the Google Groups "Grase Hotspot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grase-hotspo...@grasehotspot.org.
To post to this group, send email to grase-...@grasehotspot.org.
Visit this group at https://groups.google.com/a/grasehotspot.org/group/grase-hotspot/.

José Borges

unread,
May 12, 2016, 5:22:12 AM5/12/16
to Grase Hotspot
Tim, I had this problem also, until recently, but thank god, I fixed it... Before i had 0.75kb upload... now it's 48MB upload

First test your network upload speed, then run the following line in your command line, replacing NETWORK_CARD_ID with the id of your UPLOAD card, and then run the test again... You will have better upload speeds.

   ethtool -K NETWORK_CARD gro off

For the eth0 network card you would write: ethtool -k eth0 gro off


To make it permanent, on each reboot of the machine, edit your /etc/rc.local and add that line for each of your in use network cards, with the path prefix, like so:

/sbin/ethtool -K eth0 gro off

KIRA Ynet

unread,
May 12, 2016, 8:54:40 AM5/12/16
to Grase Hotspot
Mr. Jose,

The network card id that you mean is on the wan side or lan side of the card? i'm using bonding method though.

José Borges

unread,
May 12, 2016, 10:09:55 AM5/12/16
to Grase Hotspot
I did it for both my OUTGOING and INCOMING network card... in my case (eth0 and p32p1)

José Borges

unread,
May 12, 2016, 10:10:35 AM5/12/16
to Grase Hotspot
do it for both cards... the wan side and the lan side... and check speeds to see if they get better.


quinta-feira, 12 de Maio de 2016 às 13:54:40 UTC+1, KIRA Ynet escreveu:
Reply all
Reply to author
Forward
0 new messages