When the Remote end of a Telnet drops

Bryant Eadon bryant.eadon at gmail.com
Thu Jun 18 23:32:08 UTC 2009


Martin McCormick wrote:
> In the last two weeks, we have suddenly begun having a problem
> when telnetting to a telephone switch in order to manage it.
> This device does not have ssh or we would sure be using that.
> 
> 	We run an expect script to poll various registers on the
> switch and the process is fairly simple. We ask for various
> listings of registers. When done with a listing, the switch
> sends a prompt which we see and then either go to the next poll
> or end and log out.
> 
> Recently, output just stops at the end of a line with no
> corruption of the text. There is even a Return character. The
> telnet session just sits there for days if we don't stop it.
> 
> 	It is tempting to point fingers at the switch and the
> people closest to the switch say that it must be something with
> the network, all that fun sort of stuff that happens when you
> don't have undisputable proof and it doesn't happen every
> day.
> 
> 	Exactly a month ago, I upgraded the patch level on this
> system to
> FreeBSD 6.3-RELEASE-p10
> 
> 	Does anybody know if there are any recent issues with telnet?
> 
> 	As a test, I telnetted to a system and then literally
> pulled the Ethernet plug on the remote system. The system I was
> telnetting from sat for many minutes. I finally hit Enter and a
> few minutes later, it figured out there was nothing on the
> remote end. There was the usual "Connection closed by foreign
> host." message.
> 
> 	Is there a way to make telnet either more proactive
> about detecting a loss of connection or of logging oddities if
> the connection is flickering?
> 
> 	One such stall happened on a weekend and the connection
> appeared to be up for 4 days. A ps ax |grep telnet |grep -v grep
> showed a connection still up at least until I killed it. At that
> point, it logged "terminated" and ended.
> 
> 	I can certainly put a timeout in expect but we have been
> using this same script, etc, for around 6 years and never had
> this problem before so a timeout would just hide whatever has
> changed.
> 
> 	My own gut feeling is that the FreeBSD system is fine as
> we have no other problems with anything else.
> 

I suspect something is killing the idle TCP session between your hosts.  If 
you're crossing the internet, you might ask if your ISP has modified something 
along those lines.

Have you fiddled with sysctl settings, specifically net.inet.tcp.keepintvl yet ?
more info at src/sys/netinet/tcp_timer.c


-Bryant


More information about the freebsd-questions mailing list