nat-spec-surge-client.rcS revision 1645:4efe65fb0bce
1#!/bin/sh
2#
3# /etc/init.d/rcS
4#
5CLIENT=10.0.0.2
6SERVER=192.168.0.1
7
8echo -n "mounting swap..."
9/sbin/swapon /dev/hdc
10echo "done."
11
12echo -n "setting up network..."
13/sbin/ifconfig eth0 $CLIENT txqueuelen 1000
14/sbin/ifconfig lo 127.0.0.1
15
16echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
17echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
18echo "1" > /proc/sys/net/ipv4/tcp_window_scaling
19echo "0" > /proc/sys/net/ipv4/tcp_timestamps
20echo "0" > /proc/sys/net/ipv4/tcp_sack
21echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout
22echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog
23echo "1" > /proc/sys/net/ipv4/tcp_vegas_cong_avoid
24
25echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range
26echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem
27echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem
28echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem
29
30echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
31
32echo "524287" > /proc/sys/net/core/rmem_max
33echo "524287" > /proc/sys/net/core/wmem_max
34echo "524287" > /proc/sys/net/core/optmem_max
35echo "300000" > /proc/sys/net/core/netdev_max_backlog
36
37echo "131072" > /proc/sys/fs/file-max
38echo "done."
39
40echo "changing route table..."
41route add default gw 10.0.0.1 
42
43echo "waiting for server..."
44/usr/bin/netcat -c -l -p 8000
45
46echo -n "running surge client..."
47/bin/bash -c "cd /benchmarks/surge && ./spec-m5 1 20 1 $SERVER 5 40000 1000000000 1000"
48echo "done."
49
50echo -n "halting machine"
51m5 exit
52
53echo -n "starting bash shell..."
54/bin/bash
55