[Galaxy S II Android Development] voku1987:
take a look at this file -> https://github.com/voku/initramfs3/blob/master/sbin/ext/cortexbrain-tune.sh

[...]
# ==============================================================
# TCP-TWEAKS
# ==============================================================
TCP_TWEAKS()
{
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "1" > /proc/sys/net/ipv4/tcp_moderate_rcvbuf;
echo "1" > /proc/sys/net/ipv4/route/flush;
echo "2" > /proc/sys/net/ipv4/tcp_syn_retries;
echo "2" > /proc/sys/net/ipv4/tcp_synack_retries;
echo "10" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "0" > /proc/sys/net/ipv4/tcp_ecn;
echo "256960" > /proc/sys/net/core/wmem_max;
echo "563200" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "20480" > /proc/sys/net/core/optmem_max;
echo "4096 16384 110208" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096 87380 563200" > /proc/sys/net/ipv4/tcp_rmem;
echo "4096" > /proc/sys/net/ipv4/udp_rmem_min;
echo "4096" > /proc/sys/net/ipv4/udp_wmem_min;
setprop net.tcp.buffersize.default 4096,87380,563200,4096,16384,110208;
setprop net.tcp.buffersize.wifi 4095,87380,563200,4096,16384,110208;
setprop net.tcp.buffersize.umts 4094,87380,563200,4096,16384,110208;
setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040;
setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680;
setprop net.tcp.buffersize.evdo_b 4094,87380,262144,4096,16384,262144;
setprop net.tcp.buffersize.hspa 4092,87380,563200,4096,16384,110208;

log -p i -t $FILE_NAME "*** tcp tweaks ***: enabled";
}
if [ $cortexbrain_tcp == on ]; then
TCP_TWEAKS;
fi;

# ==============================================================
# FIREWALL-TWEAKS
# ==============================================================
FIREWALL_TWEAKS()
{
# ping/icmp protection
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts;
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all;
echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses;

if [ -e /proc/sys/net/ipv6/icmp_echo_ignore_broadcasts ]; then
echo "1" > /proc/sys/net/ipv6/icmp_echo_ignore_broadcasts;
fi;

if [ -e /proc/sys/net/ipv6/icmp_echo_ignore_all ]; then
echo "1" > /proc/sys/net/ipv6/icmp_echo_ignore_all;
fi;

if [ -e /proc/sys/net/ipv6/icmp_ignore_bogus_error_responses ]; then
echo "1" > /proc/sys/net/ipv6/icmp_ignore_bogus_error_responses;
fi;

# syn protection
if [ -e /proc/sys/net/ipv4/tcp_synack_retries ]; then
echo "10" > /proc/sys/net/ipv4/tcp_synack_retries;
fi;

if [ -e /proc/sys/net/ipv6/tcp_synack_retries ]; then
echo "10" > /proc/sys/net/ipv6/tcp_synack_retries;
fi;

if [ -e /proc/sys/net/ipv6/tcp_syncookies ]; then
echo "0" > /proc/sys/net/ipv6/tcp_syncookies;
fi;

if [ -e /proc/sys/net/ipv4/tcp_syncookies ]; then
echo "1" > /proc/sys/net/ipv4/tcp_syncookies;
fi;

if [ -e /proc/sys/net/ipv4/tcp_max_syn_backlog ]; then
echo "4096" > /proc/sys/net/ipv4/tcp_max_syn_backlog;
fi;

# IPv6 privacy tweak
echo "2" > /proc/sys/net/ipv6/conf/all/use_tempaddr;

# drop spoof, redirects, etc
echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter;
echo "1" > /proc/sys/net/ipv4/conf/default/rp_filter;
echo "0" > /proc/sys/net/ipv4/conf/all/send_redirects;
echo "0" > /proc/sys/net/ipv4/conf/default/send_redirects;
echo "0" > /proc/sys/net/ipv4/conf/default/accept_redirects;
echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route;
echo "0" > /proc/sys/net/ipv4/conf/default/accept_source_route;

if [ -e /proc/sys/net/ipv6/conf/all/rp_filter ]; then
echo "1" > /proc/sys/net/ipv6/conf/all/rp_filter;
fi;

if [ -e /proc/sys/net/ipv6/conf/default/rp_filter ]; then
echo "1" > /proc/sys/net/ipv6/conf/default/rp_filter;
fi;

if [ -e /proc/sys/net/ipv6/conf/all/send_redirects ]; then
echo "0" > /proc/sys/net/ipv6/conf/all/send_redirects;
fi;

if [ -e /proc/sys/net/ipv6/conf/default/send_redirects ]; then
echo "0" > /proc/sys/net/ipv6/conf/default/send_redirects;
fi;

if [ -e /proc/sys/net/ipv6/conf/default/accept_redirects ]; then
echo "0" > /proc/sys/net/ipv6/conf/default/accept_redirects;
fi;

if [ -e /proc/sys/net/ipv6/conf/all/accept_source_route ]; then
echo "0" > /proc/sys/net/ipv6/conf/all/accept_source_route;
fi;

if [ -e /proc/sys/net/ipv6/conf/default/accept_source_route ]; then
echo "0" > /proc/sys/net/ipv6/conf/default/accept_source_route;
fi;

log -p i -t $FILE_NAME "*** firewall-tweaks ***: enabled";
}
if [ $cortexbrain_firewall == on ]; then
FIREWALL_TWEAKS;
fi;
[...]