I need to create an ssh connection between two Linux machines running Centos v5 but the latency could be as high as 25 seconds. I find that if I test something approaching this configuration artificially by simulating 7 seconds or more round trip latency using:
tc qdisc add dev eth0 root netem delay 7s
When I try:
ssh -n -o ConnectTimeout=0 WilliamKF@centos5Machine whoami
It fails after about 1 min 23 sec with:
Connection closed by 10.35.50.114
Note that ConnectTimeout=0 means never timeout. Also, simulating a round trip latency of 6 seconds results in a successful ssh after about 1 min 32 sec.
Is there anything I can do to get ssh to work in the face of extremely high latency on Linux? Why does ssh fail at this threshold? When I run tcpdump, I see nothing obviously wrong, there are about 51 packets, which packets of tcpdump are helpful here? Success took only around 41 packets.