LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-23-2013, 02:56 PM   #1
parthelion
LQ Newbie
 
Registered: Jul 2013
Posts: 3

Rep: Reputation: Disabled
Should a TCP connection be able to survive a short (Few second) interruption?


I have a few machines configured in the following layout:

BOX1----[LAN]----BOX2----BOX3

Box3 can't be connected directly to the LAN, so all its traffic is routed via Box2. I have instances of a legacy application running on box1 and box3 that communicate with TCP sockets and, normally, this works just fine. The problem is that, every few hours, there is a chance that the physical connection between Box2 and Box3 will become disconnected for a couple seconds but quickly reconnected.

Until recently, the application recovered fine when this happened. Nothing happened at the application level to facilitate the reconnect. All each instance of the application saw was a few seconds of no data received, followed by a second of more data than normal, and then everything was back to normal. I'm no expert, but I thought this was due to the TCP's robustness.

My problems started when we tried to install this setup on a new set of machines. The physical configuration is exactly the same and the software hasn't changed. We did upgrade operating systems (From RHEL5 to RHEL6) and Box3 is actually running a much older network card for reasons beyond my control. Everything works fine, except that when the Box2-Box3 connection is interrupted, the TCP connection doesn't recover. Watching with netstat, we can see each port's send-queue climbing forever. We have to manually restart the application on Box1 and Box3 (the legacy application didn't have any provision for resetting sockets.)

So my question is: does anyone have any idea what could be causing the difference in behaviour? Was I wrong about the older network card not possibly having any effect on a TCP socket? Is there a Red Hat configuration option I might be missing that could cause this? I'm hoping to eventually be able to put an application-level heartbeat mechanism in to reconnect when this happens, but for now I'm hoping to figure out what's going on.

Thanks for the help.
 
Old 09-23-2013, 04:15 PM   #2
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
The answer is yes, TCP should be able to recover from a few seconds outage. The dip and burst in response to a brief outage is classic behavour. Having said that, some IP stacks are a bit dodgy and don't recover from a segment timout when they should. I've seen Windows servers sulk for several minutes before closing a connection after a retransmission. Also it depends on what the application layer running over TCP is doing. If it has its own timeout mechanism then it might fail in those two seconds and then instruct the TCP layer to reset the connection.

Last edited by baldy3105; 09-23-2013 at 04:17 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP connect timeout in so short time. just around 5s to 10s. feiyinzilgd Programming 1 12-28-2011 12:41 AM
TCP tuning for a server with very short HTTP connections jampy Linux - Networking 1 12-24-2009 10:15 AM
Replay tcp connection Tex-Twil Linux - Networking 2 06-24-2009 08:12 AM
log for TCP/IP (TCP) connection? fireball003 Linux - Server 4 12-04-2008 02:58 PM
SUSE9.2 I-net connection lost after short time - DSL behind a router... Zzorrkk SUSE / openSUSE 8 02-01-2005 09:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration