Tweaking tcp buffer settings - Barnes & Noble Nook Tablet

I'd like to tweak the tcp.rmem settings that come stock. The maximum buffer size (110208 bytes) is quite low for a high speed connection.
I've tried build.prop, init.rc, and init.local.rc. I checked the results with "sysctl -a | grep tcp".
/system/build.prop - no effect (is everybody around the web enjoying placebo?)
net.tcp.buffersize.default=4096,87380,524288,4096,16384,110208
net.tcp.buffersize.wifi=4096,87380,524288,4096,16384,110208
/system/etc/init.local.rc - doesn't seem to be used by the OS?
setprop net.tcp.buffersize.default 4096,87380,524288,4096,16384,110208;
setprop net.tcp.buffersize.wifi 4096,87380,524288,4096,16384,110208;
/init.rc - is seemingly recreated on each boot with some predefined numbers
setprop net.tcp.buffersize.default 4096,87380,524288,4096,16384,110208;
setprop net.tcp.buffersize.wifi 4096,87380,524288,4096,16384,110208;
[in these values the first three #s are receive (min,start,max), second three are send (min,start,max)]. TCP auto adjusts between min and max.
issuing the setprop commands by terminal works but that isn't really ideal.

Are these the default values? What optimized values should we set from the terminal?
You could try smanager to run a script that changes the values.
Sent from my BNTV250 using XDA

defaults are (init.rc):
setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208
the first 110208 in these is the max allowed tcp receive buffer size and it really isn't ideal for say a 10+ mbps connection. A value of 262144 would be more appropriate. Even 524288 perhaps for 20-30 mbps though a 63mbps wifi connection is probably too slow for this to be beneficial.
good idea on just using a custom script.....

I have successfully set up V6 Supercharger Script on CM9 so I would assume it should work on CM7 if that's what you are running. If you want to go that route. May be placebo effect but it seemed to make an improvement in many areas.
Sent from my CM9 Nook Tablet using Tapatalk

swaaye said:
defaults are (init.rc):
setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208
the first 110208 in these is the max allowed tcp receive buffer size and it really isn't ideal for say a 10+ mbps connection. A value of 262144 would be more appropriate. Even 524288 perhaps for 20-30 mbps though a 63mbps wifi connection is probably too slow for this to be beneficial.
good idea on just using a custom script.....
Click to expand...
Click to collapse
I believe (and this is not a 100% sure guarantee) that the stock values are set in the source, in the driver code for the linux networking stack. If that's the case, the easiest way is to run the aforementioned script to just set it to different values on boot.
Can you get values through, say,
Code:
cat /proc/sys/net/ipv4/tcp_mem
?
The default allocated memory is based on system ram. But, if you're on a ~10mbps connection, you're not going to notice much of a pickup over stock with 26kb of tcp buffer. I mean, on a 10MBPS connection you should have low latency (well under 100ms), increasing the buffer won't 'speed it up'.
However, this site recommends setting it to 12MB (12582912), to increase performance on higher-latency connections (essentially, not local connections). Try that?

Related

iwmulticall binary.. (or some way to interace with the BCM4329 PM)

So far, I have not found a way to turn off power management.. Usually it goes like this -
iwconfig eth0 power off
I did notice wmiconfig and thus tried wmiconfig --getpower which gave me:
eth1
Power mode is rec
Power mode can be rec or maxperf..
If any of you have used the broadcom drivers in Linux, you'll know that they slow down big time when power management is set to 'All Packets Received'. On my laptop with a 300mb/sec 5ghz 802.11n connection, I get 2MB/sec with PM on.. 19MB/sec with PM off. It matters..
I haven't been able to find much on wmiconfig due to MS having an identical name for one of its utilities. I'm going to try the iwmulticall binary from my g2 now.... ok.. got errors. it listed lo, tunl0, and gre0.. then it died.. heh.
Has anyone turned off the PM or been able to interface with the bcm wifi chip? It'd be even cooler if we could turn up the tx-power a little.
Nothing? Do you guys think the bottleneck for wifi transfer speed is the emmc?!
Any progress?
I have an Adam, which uses same wmiconfig and BCM4329 wifi.
wmiconfig have options like --power maxperf , but when I use it and try --getpower it reports back rec mode and not maxperf
Also there is option --txoptbursting 1 but not sure if it worked or at lease I don't know how to check if it has changed.
Yes. I can get 4-5MB/second (receive via ubuntu ncftp as client, gtab server) with power management turned off. CIFS has slightly lower speeds - but that's normal. SFTP is also decent (allows me to access / in its entirety as if it were mounted locally).
Anyways... put this in /system/xbin/
http://home.comcast.net/~ibladesi/iwmulticall
and start symlinking to it... like so
# cd /system/xbin/
/system/xbin # ln -s /system/xbin/iwmulticall iwconfig
Here are the symlinks you can create in addition to iwconfig:
iwgetid iwlist iwpriv iwspy
My normal use for it is-
iwconfig wlan0 power off
So I made a script and named it fstwan so its quick to type.
Don't try to set the txpower, that seems to be broken with all android devices.
And yeah, wmiconfig seems to be complete horse****.. that's even worse than bs. I don't think that this will change the tame nature of the wifi radio's power output.. I think it has more to do with system utilization.. its such strange default behavior. For example, using a ssh client to connect to the device is brutal in terms of responsiveness, turn pm off and viola, its like you're using adb.

[Q] How can I change the mtu setting?

I need to change it to 1400, but after endless searches I have no clue. Is there any way to change the mtu settings and what is the default mtu setting for the vibrant (is it 1500?).
I found this thread, but it deals with windows mobile phones.
I need to do this because many downloads time out and need to reconnect.
Not sure you I understand the need but here is a basic description:
If things are working correctly MTU is "discovered" when the session is initiated.
MTU can change anyplace in the path. There is so much equipment there is no way to know for sure.
The one place that MTU size has a large impact is when the do not fragment flag is set. Normally a device that cannot pass it will return a messages via ICMP that says fragmentation required but the flag is set and drop the packet. The client then resends it with a smaller MTU. When a firewall blocks this message (some people do not know ICMP is not always ping) you get very strange and hard to debug issues.
Packet fragmentation used to be a much larger issue. Depends what device is doing the reassembly of the packet. PCs now days have plenty of power and so do most routers and firewalls.
There is also the issue of extra overhead for the tcp header on the fragments but bandwidth is huge so that also makes little difference.
The only MTU settings that make a large performance difference is when you can run jumbo frames but this is limited to equipment that can support this.
I think the timeouts may be a result of tower traffic kick off and slow transfer rate, and changing the MTU probably won't make a difference unless you are trying to connect to a specific site.
Hope that helps...
when I tether my phone to my pc, I had trouble d/l files because they would time out and the tether connection would be dropped as a result
After changing the mtu for this connection on my pc from the default of 1500 down to a lower value, the files downloaded properly and there was no dropping of connection.
Now when I download directly from my phone (no tethering), the same thing happens where the downloads time out. I'm wondering if there is a similar process where I could change the mtu settings on my phone like I did on my pc so that it only accepts a certain size of packets plus header instead of the default which I think is 1500.

removing wifi scan ro. lines from build.prop & using setprop "on demand" wifi call?

removing wifi scan ro. lines from build.prop & using setprop "on demand" wifi call?
If I understand correctly, many people add certain lines to their build prop to allow settings on the device as read only i.e ro.
However for many people having this as set could mean in such cases where wifi scan interval is set to hi (or more frequent i.e 20)to enable maintained wifi connection during calls....that they will suffer with some amounts of battery drain.
Other people who are not interested in wifi calling could (could and usually do) set the scanning to a much high (or infrequent scan value of like 180) this is fine in most cases where battery consumption is considerably less and more desirable and even better when coupled with a modem to suit their region, provider and band.
But lets say someone uses wifi calling, but they don't want to permanently "set" i.e. an ro line within the build prop to constantly scan 20 when they are not on a wifi call. This is mostly true for most wifi callers around, unless the phone they are using is a dedicated inhouse wifi device (and yes I have considered a nice lil cheaper to do this with my self) anyway I hope you guys can see where I am headed with this?
Could say a script be generated where when a process is enabled that it calls the script to ramp up wifi scanning to a smaller more frequent value 20 when "ON A WIFI CALL" (that being the process) and then revert to a lower value (set otherwise so to speak) and conserve batter when "NOT ON A WIFI CALL" ?
If so can someone direct me with how to go about doing this?
I am in the process of setting up an installation package for T-mobile users on ICS using Galaxy S & variants of....and would like to include in my installation package a way of detecting and removing the wifi scan intival from the build.prop ro line and then paste the my scripting within system.
I already know how to make a install script that does the detect and CHANGE or detect and REMOVE in the build prop for ALL types of ICS Galaxys.....however I am not sure about how to generate and then intitate an "on-demand" scripting for wifi calls? I assume that this is a setprop type function if so long as the ro function is gone (which is a read only and set at a higher precedent than any other functions if I believe right?)
Any help or pointed would be greatly appreciated.
James

Use ONLY Iperf to test Wifi !!!

Just a reminder to get it on top of the list again
It is becoming rather difficult to compare all the different statements about Wifi performance and the speed results determined with Speedtest.Net
Don't use the bars at the bottom of the screen.
These are just a graphical image representing that something is going on with Wifi. If the parameters in the firmware are changed you can get as much bars as you want.
Furthermore the bars don't say anything about the quality of the Wifi connection.
Don't use Speedtest.Net
Speedtest.Net doesn't measure Wifi speed but the speed of the connection you are having with a remote Speedtest.Net server on the internet. The speed it indicates is the speed of the weakest link in the routing. So congestion on the internet (not your Wifi) is represented in a slower speed.
When your family or housemates are streaming Youtube the speed it indicates is the speed for the remainder of the bandwith that is left over for you.
Use only Iperf!!! (it's free)
With Iperf you set up a server and a client in your home network . By executing Iperf with different parameters you can get a lot of different info about your Wifi like bandwith, lost packets, jitter, sent and recieved data, etcetera.
For the noob it seems complicated but it isn't. There is a good tutorial on http://openmaniak.com/iperf.php
Please do me, the community and yourself a favor.
Use Iperf.
That way we can get data we can compare.
And maybe someday it will get us somewhere
Thank you very much in advance
PS: Don't just do one test. Do multiple tests. This is something you can automate with Iperf. Set it to do 20 (or more) tests and get some coffee.
using -c<ip> -d I get the following in the same room of my 300mbps wireless n router:
Client connecting to 192.168.1.100, TCP port 5001
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[256] local 192.168.1.102 port 49792 connected with 192.168.1.100 port 5001
[ ID] Interval Transfer Bandwidth
[256] 0.0-10.0 sec 8.52 MBytes 7.13 Mbits/sec
[280] 0.0-10.1 sec 36.1 MBytes 30.1 Mbits/sec
[288] local 192.168.1.102 port 5001 connected with 192.168.1.100 port 58706
i'm going to assume that this is bad...
Edit: Another test doing -t 25 -i 1:
I get an average transfer of about 4.4 MBytes and Bandwidth of an average of about 38MBits/sec
dingdonggggg said:
Just a reminder to get it on top of the list again
It is becoming rather difficult to compare all the different statements about Wifi performance and the speed results determined with Speedtest.Net
Don't use the bars at the bottom of the screen.
These are just a graphical image representing that something is going on with Wifi. If the parameters in the firmware are changed you can get as much bars as you want.
Furthermore the bars don't say anything about the quality of the Wifi connection.
Don't use Speedtest.Net
Speedtest.Net doesn't measure Wifi speed but the speed of the connection you are having with a remote Speedtest.Net server on the internet. The speed it indicates is the speed of the weakest link in the routing. So congestion on the internet (not your Wifi) is represented in a slower speed.
When your family or housemates are streaming Youtube the speed it indicates is the speed for the remainder of the bandwith that is left over for you.
Use only Iperf!!! (it's free)
With Iperf you set up a server and a client in your home network . By executing Iperf with different parameters you can get a lot of different info about your Wifi like bandwith, lost packets, jitter, sent and recieved data, etcetera.
For the noob it seems complicated but it isn't. There is a good tutorial on http://openmaniak.com/iperf.php
Please do me, the community and yourself a favor.
Use Iperf.
That way we can get data we can compare.
And maybe someday it will get us somewhere
Thank you very much in advance
PS: Don't just do one test. Do multiple tests. This is something you can automate with Iperf. Set it to do 20 (or more) tests and get some coffee.
Click to expand...
Click to collapse
Just a reminder to get the thread a liitle bit higher on the list again.
Lot's of people asking the same question

[Q] Why does't ICS supports IPv6 on WIFI?

I mean this is stupid... you can have IPv6 APN and everything, but on WIFI you cant get IPv6 address... I have dualstack LAN at home, every client should get local IPv4 address and public IPv6. But for some silly reason Google decided to not include this in to ICS, but since there is support for UMTS IPv6 APNs it should WORK technically... This works flawlessly on iPhone4S and other clients (read computers) that supports IPv6 on my LAN...
From what I can see, ICS manages to configure a IPv6 global address on its wlan0 interface via autoconfiguration.
Looking at results from tcpdump and other command line tools, there seem to be two other problems:
1) Even though there is a router on the LAN sending router advertisements and the device configures its address, it does not seem to install or use the the default gateway. I am able to ping the phone via IPv6 on the same local /64 global, and its link local, and am able to ping those devices back from the device (ping6 via busybox). I cannot however ping past the local IPv6 global network.
2) None of the web browsers on the phone I have tried seem to be doing AAAA lookups. Confirmed tcpdump, even when trying to resolve names that only have AAAA records, the request only ever goes out for an A record and never a AAAA.
I was able to run a web server on the same local /64 the phone was configured on, and was able to browse to it by its IPv6 address directly through the browser. So it does work, just missing the default route and AAAA DNS functionality it seems.
As an FYI this was tested on a rooted Galaxy S3 SGH-I747M running 4.0.4. I'm assuming the IPv6 functionality wouldn't be any different between this and the SII, but maybe I'm wrong.
themikea said:
1) Even though there is a router on the LAN sending router advertisements and the device configures its address, it does not seem to install or use the the default gateway. I am able to ping the phone via IPv6 on the same local /64 global, and its link local, and am able to ping those devices back from the device (ping6 via busybox). I cannot however ping past the local IPv6 global network.
Click to expand...
Click to collapse
I have a Galaxy S3 SPH-L710 running Android 4.0.4, and I had the same problem with it not configuring the default IPv6 route. There is a sysctl variable that controls whether the Linux kernel automatically adds the default route advertised in the IPv6 Router Advertisement messages, and it defaults to 0 (off) on the phone. Look at /proc/sys/net/ipv6/conf/default/accept_ra_defrtr.
themikea said:
2) None of the web browsers on the phone I have tried seem to be doing AAAA lookups. Confirmed tcpdump, even when trying to resolve names that only have AAAA records, the request only ever goes out for an A record and never a AAAA.
Click to expand...
Click to collapse
When I set accept_ra_defrtr to 1 and cycled my Wi-Fi connection, it came back up and added the default IPv6 route. Now test-ipv6.com on my phone gives me a 10/10 on both IPv4 and IPv6, meaning the DNS resolver is asking for AAAA records too and even preferring them when a host has both A and AAAA, which is the recommended and desired behavior. Loading comcast6.net on my phone shows my IP address as an IPv6 address.
Trouble is, setting sysctl variables in /proc/sys will not survive through a reboot, and there is no /etc/sysctl.conf on Android, so I don't know where to stash this setting so it gets applied on every boot. There is no file anywhere in /system that contains "accept_ra_defrtr" except for the vpnclient.ko kernel module, and that's not loaded, so I'd guess the kernel has been modified to disable IPv6 default routes by default.
Any idea if there's an Android equivalent of inittab or sysctl.conf or how might I go about setting that sysctl variable automatically on boot?
whitslack said:
I have a Galaxy S3 SPH-L710 running Android 4.0.4, and I had the same problem with it not configuring the default IPv6 route. There is a sysctl variable that controls whether the Linux kernel automatically adds the default route advertised in the IPv6 Router Advertisement messages, and it defaults to 0 (off) on the phone. Look at /proc/sys/net/ipv6/conf/default/accept_ra_defrtr.
When I set accept_ra_defrtr to 1 and cycled my Wi-Fi connection, it came back up and added the default IPv6 route. Now test-ipv6.com on my phone gives me a 10/10 on both IPv4 and IPv6, meaning the DNS resolver is asking for AAAA records too and even preferring them when a host has both A and AAAA, which is the recommended and desired behavior. Loading comcast6.net on my phone shows my IP address as an IPv6 address.
Trouble is, setting sysctl variables in /proc/sys will not survive through a reboot, and there is no /etc/sysctl.conf on Android, so I don't know where to stash this setting so it gets applied on every boot. There is no file anywhere in /system that contains "accept_ra_defrtr" except for the vpnclient.ko kernel module, and that's not loaded, so I'd guess the kernel has been modified to disable IPv6 default routes by default.
Any idea if there's an Android equivalent of inittab or sysctl.conf or how might I go about setting that sysctl variable automatically on boot?
Click to expand...
Click to collapse
bro look at your /system/etc/init.d. if it exists, you can add a new script as
#!/system/bin/sh
echo 1>/sys/XXXXXXX
in init.d and name it 89enipv6 or sth.
if it don't work, check your /system/bin/sysinit. if it doesn't exist, google and copy one.
Does anyone know how I can disable IPV6 on my S3 ?
ahoslc said:
Does anyone know how I can disable IPV6 on my S3 ?
Click to expand...
Click to collapse
Why do you want to disable IPv6? It's new better version of IP protocol and should be used whenever it possible.
runapp said:
bro look at your /system/etc/init.d. if it exists, you can add a new script as
#!/system/bin/sh
echo 1>/sys/XXXXXXX
in init.d and name it 89enipv6 or sth.
if it don't work, check your /system/bin/sysinit. if it doesn't exist, google and copy one.
Click to expand...
Click to collapse
In my case of 4.1.3 the value of 0 rewrited in /proc/sys/net/ipv6/conf/wlan0/accept_ra_deftrt on every wifi interface restart, even independently on "all"/"default" values.

Categories

Resources