Simple socket-based TCP repeater. Code attached. Note that the StreamRepeater class has a rather large copy buffer (32KB). Reducing this to 4KB results in throughput reducing to ~210 Mbit/s. ================================================================================= Test setup: Host A (iperf client) <-> Host B (Simple tunnel) <-> A (iperf server) Host A: CentOS 5.5, iperf 2.0.5, gigabit NIC. 192.168.254.40 Host B: Windows 7 x64, JDK 6u29, running in Eclipse, gigabit NIC. 192.168.254.122 ================================================================================= Changes made to Tunnel sample: public static final String HOST = "192.168.254.122"; public static final int PORT = 5001; public static final String REDIRECT_HOST = "192.168.254.40"; public static final int REDIRECT_PORT = 5001; ================================================================================= HOST A - IPERF CLIENT LOG: [root@lnbackup1 grizzly]# iperf -t 10 -i 1 -c 192.168.254.122 ------------------------------------------------------------ Client connecting to 192.168.254.122, TCP port 5001 TCP window size: 16.0 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.254.40 port 37096 connected with 192.168.254.122 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0- 1.0 sec 81.0 MBytes 679 Mbits/sec [ 3] 1.0- 2.0 sec 81.8 MBytes 686 Mbits/sec [ 3] 2.0- 3.0 sec 82.0 MBytes 688 Mbits/sec [ 3] 3.0- 4.0 sec 82.0 MBytes 688 Mbits/sec [ 3] 4.0- 5.0 sec 82.4 MBytes 691 Mbits/sec [ 3] 5.0- 6.0 sec 82.2 MBytes 690 Mbits/sec [ 3] 6.0- 7.0 sec 82.1 MBytes 689 Mbits/sec [ 3] 7.0- 8.0 sec 82.0 MBytes 688 Mbits/sec [ 3] 8.0- 9.0 sec 82.5 MBytes 692 Mbits/sec [ 3] 9.0-10.0 sec 81.9 MBytes 687 Mbits/sec [ 3] 0.0-10.0 sec 820 MBytes 688 Mbits/sec ================================================================================= HOST A - IPERF SERVER (CONSUMER) LOG: [root@lnbackup1 ~]# iperf -i 1 -s ------------------------------------------------------------ Server listening on TCP port 5001 TCP window size: 85.3 KByte (default) ------------------------------------------------------------ [ 4] local 192.168.254.40 port 5001 connected with 192.168.254.122 port 49567 [ ID] Interval Transfer Bandwidth [ 4] 0.0- 1.0 sec 81.7 MBytes 686 Mbits/sec [ 4] 1.0- 2.0 sec 81.7 MBytes 685 Mbits/sec [ 4] 2.0- 3.0 sec 82.0 MBytes 688 Mbits/sec [ 4] 3.0- 4.0 sec 82.2 MBytes 689 Mbits/sec [ 4] 4.0- 5.0 sec 82.1 MBytes 689 Mbits/sec [ 4] 5.0- 6.0 sec 82.3 MBytes 691 Mbits/sec [ 4] 6.0- 7.0 sec 82.2 MBytes 689 Mbits/sec [ 4] 7.0- 8.0 sec 82.1 MBytes 689 Mbits/sec [ 4] 8.0- 9.0 sec 82.3 MBytes 690 Mbits/sec [ 4] 9.0-10.0 sec 81.4 MBytes 683 Mbits/sec [ 4] 0.0-10.0 sec 820 MBytes 688 Mbits/sec