FORUMS
Remove All Ads from XDA
Google Home

Boost Net_speed by Network Tuning on nexus 5

155 posts
Thanks Meter: 121
 
By rawe_etc, Senior Member on 31st January 2018, 04:02 AM
Post Reply Email Thread


Another method to Network Tuning and Performance by touch some value on linux tcp/IP tuning to give us some significant result on test speed and download process more faster than usual.

Tweak are made for boosting the interneet without any app so you must be Rooted, TWRP , Busybox inside and some rom or kernel to supported for init.d on system/etc or do a little search on xda how to put the init .d insde yours and for busybox download from palystore

this tweak cannot be combine with some other tweak for net_tweak because i dont know what kind of tweak inside your rom it will be give you some crash or the tweak not running as well
how to test or running my tweak :

backup up first so if there's and problem you can restore everything
and do manualy by deleting the init.d stuff ( note . if u have one ) and just get rid all the build prop for tweaking especilay mention about tcp buffer size .. u can grab it from the original rom and push it to your device



tweak as desired, depending on your internet connection and maximum bandwidth/latency on your country so this tweak not guarantee will give u same result




how to flash :
1. reboot to twrp
2. flash the file
3. wipe cache and dalvik
4. reboot .

For uninstal my tweak you can do it manualy :
extract my zip file and take alook at it
open app like rootexplorer . and delete all the stuff then reboot
done


Choose and Please .. comment and give me full report this tweak is running or not .. so i can do more

(tested on my nexus 5 (6.0.1)

All the credit belong to @zeppelinrox


I'm not responsible if there is any kind off damage !!!

Hits Thank Button if i Helped you and give you more !!!
The Following 2 Users Say Thank You to rawe_etc For This Useful Post: [ View ] Gift rawe_etc Ad-Free
 
 
1st February 2018, 02:11 AM |#2  
rawe_etc's Avatar
OP Senior Member
Flag bandung
Thanks Meter: 121
 
More
After couple of experiment and tested ..i remove all the link above .. because as i said in red line on #post 1 every each country has diffrent internet connection and maximum bandwidth/latency but i wont stop to figure out and find the best value to maximize the network speed and performance especialy on 6.0.1 up, may be some other people say why you so hassle create this this craft and useless well the answer came because i'm can't find any app/ or tweaking value to give me some satisfaction, like on kernel under 2.6 (2011- 2013 )

some explanation you can find in here

http://www.linux-admins.net/2010/09/...cp-tuning.html

and these are what @zeppelinrox do on kick as kernel tweak :

Quote:

echo " Applying Network Tweaks...";
echo \$line;
echo "";
$sleep;
#
# Queue size modifications
busybox sysctl -e -w net.core.wmem_max=1048576;
busybox sysctl -e -w net.core.rmem_max=1048576;
#busybox sysctl -e -w net.core.rmem_default=262144;
#busybox sysctl -e -w net.core.wmem_default=262144;
busybox sysctl -e -w net.core.optmem_max=20480;
busybox sysctl -e -w net.unix.max_dgram_qlen=50;
#
busybox sysctl -e -w net.ipv4.tcp_moderate_rcvbuf=1; # Be sure that autotuning is in effect
busybox sysctl -e -w net.ipv4.route.flush=1;
busybox sysctl -e -w net.ipv4.udp_rmem_min=6144;
busybox sysctl -e -w net.ipv4.udp_wmem_min=6144;
busybox sysctl -e -w net.ipv4.tcp_rfc1337=1;
busybox sysctl -e -w net.ipv4.ip_no_pmtu_disc=0;
busybox sysctl -e -w net.ipv4.tcp_ecn=0;
busybox sysctl -e -w net.ipv4.tcp_rmem='6144 87380 1048576';
busybox sysctl -e -w net.ipv4.tcp_wmem='6144 87380 1048576';
busybox sysctl -e -w net.ipv4.tcp_timestamps=0;
busybox sysctl -e -w net.ipv4.tcp_sack=1;
busybox sysctl -e -w net.ipv4.tcp_fack=1;
busybox sysctl -e -w net.ipv4.tcp_window_scaling=1;
#
# Re-use sockets in time-wait state
busybox sysctl -e -w net.ipv4.tcp_tw_recycle=1;
busybox sysctl -e -w net.ipv4.tcp_tw_reuse=1;
#
# KickAss UnderUtilized Networking Tweaks below initially suggested by avgjoemomma (from XDA)
# Refined and tweaked by zeppelinrox... duh.
#
busybox sysctl -e -w net.ipv4.tcp_congestion_control=cubic; # Change network congestion algorithm to CUBIC
#
# Hardening the TCP/IP stack to SYN attacks (That's what she said)
# http://www.cyberciti.biz/faq/linux-k...rity-hardening
# http://www.symantec.com/connect/arti...ck-syn-attacks
#
busybox sysctl -e -w net.ipv4.tcp_syncookies=1;
busybox sysctl -e -w net.ipv4.tcp_synack_retries=2;
busybox sysctl -e -w net.ipv4.tcp_syn_retries=2;
busybox sysctl -e -w net.ipv4.tcp_max_syn_backlog=1024;
#
busybox sysctl -e -w net.ipv4.tcp_max_tw_buckets=16384; # Bump up tw_buckets in case we get DoS'd
busybox sysctl -e -w net.ipv4.icmp_echo_ignore_all=1; # Ignore pings
busybox sysctl -e -w net.ipv4.icmp_echo_ignore_broadcasts=1; # Don't reply to broadcasts (prevents joining a smurf attack)
busybox sysctl -e -w net.ipv4.icmp_ignore_bogus_error_responses=1; # Enable bad error message protection (should be enabled by default)
busybox sysctl -e -w net.ipv4.tcp_no_metrics_save=1; # Don't cache connection metrics from previous connection
busybox sysctl -e -w net.ipv4.tcp_fin_timeout=15;
busybox sysctl -e -w net.ipv4.tcp_keepalive_intvl=30;
busybox sysctl -e -w net.ipv4.tcp_keepalive_probes=5;
busybox sysctl -e -w net.ipv4.tcp_keepalive_time=1800;
#
# Don't pass traffic between networks or act as a router
busybox sysctl -e -w net.ipv4.ip_forward=0; # Disable IP Packet forwarding (should be disabled already)
busybox sysctl -e -w net.ipv4.conf.all.send_redirects=0;
busybox sysctl -e -w net.ipv4.conf.default.send_redirects=0;
#
# Enable spoofing protection (turn on reverse packet filtering)
busybox sysctl -e -w net.ipv4.conf.all.rp_filter=1;
busybox sysctl -e -w net.ipv4.conf.default.rp_filter=1;
#
# Don't accept source routing
busybox sysctl -e -w net.ipv4.conf.all.accept_source_route=0;
busybox sysctl -e -w net.ipv4.conf.default.accept_source_route=0 ;
#
# Don't accept redirects
busybox sysctl -e -w net.ipv4.conf.all.accept_redirects=0;
busybox sysctl -e -w net.ipv4.conf.default.accept_redirects=0;
busybox sysctl -e -w net.ipv4.conf.all.secure_redirects=0;
busybox sysctl -e -w net.ipv4.conf.default.secure_redirects=0;

and the script running as well .. ( Under jelly bean )

i edited most of my post and get rid all the link .. i give you some link to test
just wait and see i'm working on it

meanwhile if you want to try, i made a simple script based on last kisk ass kernel
give me some report if u have aproblem or the script not running i do my best i could .. Thank for testing it .. Cheers
Attached Files
File Type: zip Boost_net_test_rc01.zip - [Click for QR Code] (1.02 MB, 40 views)
2nd February 2018, 05:04 AM |#3  
rawe_etc's Avatar
OP Senior Member
Flag bandung
Thanks Meter: 121
 
More
The short summary:

TCP performance tuning - how to tune linux

The default Linux tcp window sizing parameters before 2.6.17 sucks.
The short fix [wirespeed for gigE within 5 ms RTT and fastE within 50 ms RTT]:
in /etc/sysctl.conf
net/core/rmem_max = 8738000
net/core/wmem_max = 6553600
net/ipv4/tcp_rmem = 8192 873800 8738000
net/ipv4/tcp_wmem = 4096 655360 6553600

It might also be a good idea to increase vm/min_free_kbytes, especially
if you have e1000 with NAPI or similar. A sensible value is 16M or 64M:
vm/min_free_kbytes = 65536
If you run an ancient kernel, increase the txqueuelen to at least 1000:
ifconfig ethN txqueuelen 1000
If you are seeing "TCP: drop open request" for real load (not a DDoS),
you need to increase tcp_max_syn_backlog (8192 worked much better than
1024 on heavy webserver load).

The background:
TCP performance is limited by latency and window size (and overhead, which
reduces the effective window size) by window_size/RTT (this is how much data
that can be "in transit" over the link at any given moment).
To get the actual transfer speeds possible you have to divide the resulting
window by the latency (in seconds):
The overhead is: window/2^tcp_adv_win_scale (tcp_adv_win_scale default is 2)
So for linux default parameters for the recieve window (tcp_rmem):
87380 - (87380 / 2^2) = 65536.
Given a transatlantic link (150 ms RTT), the maximum performance ends up at:
65536/0.150 = 436906 bytes/s or about 400 kbyte/s, which is really slow today.
With the increased default size:
(873800 - 873800/2^2)/0.150 = 4369000 bytes/s, or about 4Mbytes/s, which
is resonable for a modern network. And note that this is the default, if
the sender is configured with a larger window size it will happily scale
up to 10 times this (8738000*0.75/0.150 = ~40Mbytes/s), pretty good for
a modern network.

2.6.17 and later have resonably good defaults values, and actually tune
the window size up to the max allowed, if the other side supports it. So
since then most of this guide is not needed. For good long-haul throughput
the maxiumum value might need to be increased though.
For the txqueuelen, this is mostly relevant for gigE, but should not hurt
anything else. Old kernels have shipped with a default txqueuelen of 100,
which is definately too low and hurts performance.
net/core/[rw]mem_max is in bytes, and the largest possible window size.
net/ipv4/tcp_[rw]mem is in bytes and is "min default max" for the tcp
windows, this is negotiated between both sender and reciever. "r" is for
when this machine is on the recieving end, "w" when the connection is
initiated from this machine.
There are more tuning parameters, for the Linux kernel they are documented
in Documentation/networking/ip-sysctl.txt, but in our experience only the
parameters above need tuning to get good tcp performance..
The Following 2 Users Say Thank You to rawe_etc For This Useful Post: [ View ] Gift rawe_etc Ad-Free
5th February 2018, 07:15 PM |#4  
omarblu's Avatar
Senior Member
Flag bradford, uk
Thanks Meter: 32
 
More
any devs checked out this? placebo or malware?
6th February 2018, 03:56 AM |#5  
rawe_etc's Avatar
OP Senior Member
Flag bandung
Thanks Meter: 121
 
More
I let this post persist
and edit later this one based on

http://www.linux-admins.net/2010/09/...cp-tuning.html




change log :
another experiment changing some value on TCP Buffer size
TCP buffer limits min, default, and max number of bytes to use set max to 16MB for 1GE, and 32M or 54M
Attached Files
File Type: zip Boost_net_v.4.0.zip - [Click for QR Code] (1.02 MB, 48 views)
7th February 2018, 04:20 AM |#6  
daedric's Avatar
Senior Member
Flag Porto
Thanks Meter: 443
 
More
My issues with this mod is not what the TCP tweaks to the kernel and build.prop.

It lies here:

00Cleaner:

Code:
if $cache; then
    echo "* RemoveCache Tweaks Starting At $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $raweLOG
    busybox find /data/data -type d -iname "*cache*" -maxdepth 2 -mindepth 2 -exec busybox rm -rf {} ';'
    busybox rm -f /data/anr/*.*
    busybox rm -f /data/cache/*.*
    busybox rm -f /data/log/*.*
    busybox rm -f /data/mlog/
    busybox rm -f /data/tombstones/*
    busybox rm -f /data/backup/pending/*
    busybox rm -r /data/local/tmp/*
    busybox rm -r /data/system/appusagestats/*
    busybox rm -r /data/system/dropbox/*
    busybox rm -f /data/system/usagestats/*
    echo "* RemoveCache Tweaks Finished At $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $raweLOG
fi
and

01killing
Code:
#System rw at boot
sysrw

#Clean-up
find /data/data/*/cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/*/cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/*/*/cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/Cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/Cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/*/Cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/*/*/Cache/ -depth -mindepth 1 -exec rm -Rf {} \;
rm -Rf /data/data/com.facebook.katana/files/video-cache/*

#Google service drain fix
su -c "pm enable com.google.android.gms/.update.SystemUpdateActivity"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$ActiveReceiver"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$Receiver"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$SecretCodeReceiver"
su -c "pm enable com.google.android.gsf/.update.SystemUpdateActivity"
su -c "pm enable com.google.android.gsf/.update.SystemUpdatePanoActivity"
su -c "pm enable com.google.android.gsf/.update.SystemUpdateService"
su -c "pm enable com.google.android.gsf/.update.SystemUpdateService$Receiver"
su -c "pm enable com.google.android.gsf/.update.SystemUpdateService$SecretCodeReceiver"
I'm not sure what this all does on boot...

moreover, a permanent non upgradable hosts file redirecting all ads to localhost will probably reflect in a somewhat better web performance, but you should announce that you're doing it.


Code:
# This hosts file has been generated by AdAway on:
# 2016-11-15 23:17:02
# Please do not modify it directly, it will be overwritten when AdAway is applied again.
# This file is generated from the following sources:
# http://winhelp2002.mvps.org/hosts.txt
# https://adaway.org/hosts.txt
# https://hosts-file.net/ad_servers.txt
# https://pgl.yoyo.org/adservers/serve...type=plaintext
127.0.0.1 localhost
::1 localhost

127.0.0.1 ad.doubleclick.net.18295.9086.302br.net
127.0.0.1 db6.net-filter.com
127.0.0.1 ads.doktoronline.no
127.0.0.1 logc189.xiti.com
127.0.0.1 spinbox.techtracker.com
...
...
...
...

BTW, and for the record, to give credit where it's due:

Code:
 ================ Copyright (C) 2014 rawe Project ================

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 =====================================================================
9th February 2018, 04:25 AM |#7  
rawe_etc's Avatar
OP Senior Member
Flag bandung
Thanks Meter: 121
 
More
Quote:
Originally Posted by daedric

My issues with this mod is not what the TCP tweaks to the kernel and build.prop.

It lies here:

00Cleaner:

Code:
if $cache; then
    echo "* RemoveCache Tweaks Starting At $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $raweLOG
    busybox find /data/data -type d -iname "*cache*" -maxdepth 2 -mindepth 2 -exec busybox rm -rf {} ';'
    busybox rm -f /data/anr/*.*
    busybox rm -f /data/cache/*.*
    busybox rm -f /data/log/*.*
    busybox rm -f /data/mlog/
    busybox rm -f /data/tombstones/*
    busybox rm -f /data/backup/pending/*
    busybox rm -r /data/local/tmp/*
    busybox rm -r /data/system/appusagestats/*
    busybox rm -r /data/system/dropbox/*
    busybox rm -f /data/system/usagestats/*
    echo "* RemoveCache Tweaks Finished At $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $raweLOG
fi
and

01killing
Code:
#System rw at boot
sysrw

#Clean-up
find /data/data/*/cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/*/cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/*/*/cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/Cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/Cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/*/Cache/ -depth -mindepth 1 -exec rm -Rf {} \;
find /data/data/*/*/*/*/Cache/ -depth -mindepth 1 -exec rm -Rf {} \;
rm -Rf /data/data/com.facebook.katana/files/video-cache/*

#Google service drain fix
su -c "pm enable com.google.android.gms/.update.SystemUpdateActivity"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$ActiveReceiver"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$Receiver"
su -c "pm enable com.google.android.gms/.update.SystemUpdateService$SecretCodeReceiver"
su -c "pm enable com.google.android.gsf/.update.SystemUpdateActivity"
su -c "pm enable com.google.android.gsf/.update.SystemUpdatePanoActivity"
su -c "pm enable com.google.android.gsf/.update.SystemUpdateService"
su -c "pm enable com.google.android.gsf/.update.SystemUpdateService$Receiver"
su -c "pm enable com.google.android.gsf/.update.SystemUpdateService$SecretCodeReceiver"
I'm not sure what this all does on boot...

moreover, a permanent non upgradable hosts file redirecting all ads to localhost will probably reflect in a somewhat better web performance, but you should announce that you're doing it.


Code:
# This hosts file has been generated by AdAway on:
# 2016-11-15 23:17:02
# Please do not modify it directly, it will be overwritten when AdAway is applied again.
# This file is generated from the following sources:
# http://winhelp2002.mvps.org/hosts.txt
# https://adaway.org/hosts.txt
# https://hosts-file.net/ad_servers.txt
# https://pgl.yoyo.org/adservers/serve...type=plaintext
127.0.0.1 localhost
::1 localhost

127.0.0.1 ad.doubleclick.net.18295.9086.302br.net
127.0.0.1 db6.net-filter.com
127.0.0.1 ads.doktoronline.no
127.0.0.1 logc189.xiti.com
127.0.0.1 spinbox.techtracker.com
...
...
...
...

BTW, and for the record, to give credit where it's due:

Code:
 ================ Copyright (C) 2014 rawe Project ================

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 =====================================================================

thanks in advance
sorry late for respond..i have a lot of work to do
i'll try to fix and run the script on boot and running flawless
i.m still working on it doing some test and else

wide open minded if there any sugestion and oppinion cheers
13th February 2018, 06:27 PM |#8  
rawe_etc's Avatar
OP Senior Member
Flag bandung
Thanks Meter: 121
 
More
Boost_net_test rc 02
Tested On Nougat ( Pure Nexus 7.1 ) Huge thank for they awesome rom and hardwork
i just make additional option for net connection and i think nougat better on net then mm

Change Log :

- change the other method with directly touch the tuning from buildprop
- busybox included

Note :
Backup your buildprop to your sdcard ! and if theres some wrong u can push it manualy
for check just take alook system/buildprop on your device and you will find my tweak on it
Attached Files
File Type: zip Boost_net_test_rc02.zip - [Click for QR Code] (732.6 KB, 18 views)
The Following User Says Thank You to rawe_etc For This Useful Post: [ View ] Gift rawe_etc Ad-Free
15th February 2018, 09:53 AM |#9  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by rawe_etc

Boost_net_test rc 02
Tested On Nougat ( Pure Nexus 7.1 ) Huge thank for they awesome rom and hardwork
i just make additional option for net connection and i think nougat better on net then mm

Change Log :

- change the other method with directly touch the tuning from buildprop
- busybox included

Note :
Backup your buildprop to your sdcard ! and if theres some wrong u can push it manualy
for check just take alook system/buildprop on your device and you will find my tweak on it

Canthis tweak work on 8.1.0 oreo.?.. Or can you share any significant information i should be researching to better acheive this tweak.?.. Thank you in advance. RUNNING. GZOSP
15th February 2018, 01:23 PM |#10  
rawe_etc's Avatar
OP Senior Member
Flag bandung
Thanks Meter: 121
 
More
Quote:
Originally Posted by alienblackpro

Canthis tweak work on 8.1.0 oreo.?.. Or can you share any significant information i should be researching to better acheive this tweak.?.. Thank you in advance. RUNNING. GZOSP

not testing yet on oreo . but i think this can be work on oreo cause it just tweak on build prop and the main goal of this tweak are pushing the kernel 3. above to the limit until we get the max result, my advice just try it ! not to worry .. but u should backup your rom first .. do some test by app on playstore .. before u flashin this tweak and after ,, if anything goes wrong u can restore your rom and everthing will be back .. cheers
The Following User Says Thank You to rawe_etc For This Useful Post: [ View ] Gift rawe_etc Ad-Free
15th February 2018, 01:39 PM |#11  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by rawe_etc

not testing yet on oreo . but i think this can be work on oreo cause it just tweak on build prop and the main goal of this tweak are pushing the kernel 3. above to the limit until we get the max result, my advice just try it ! not to worry .. but u should backup your rom first .. do some test by app on playstore .. before u flashin this tweak and after ,, if anything goes wrong u can restore your rom and everthing will be back .. cheers

Yes foe sure...just needed the boot of confidence.. Thanks again..and yes sir im no strangee to brinking devices back from the dead...FYI....OREO. Running great on tge old " hammerhead"...#NEVERSETTLE
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes