cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
519
Views
0
Helpful
5
Replies

Howcan I keep a special TCP connection for a long time?

davidliji
Level 1
Level 1

I must make a special TCP connection(like ftp, telnet ect.) between two equipment for a long time, for example, you can see follow information when you open you mail with netstat command:

c:\netstat

Active Connections

Proto Local Address Foreign Address State

TCP aaron:1147 218.5.72.48:pop3 ESTABLISHED

and, after you quit your mail box, you can see the information:

c:\netstat

Active Connections

Proto Local Address Foreign Address State

TCP aaron:1147 218.5.72.48:pop3 TIME_WAIT

then, after about 30 seconds, you'll lost the record.

I must keep the connection for all the time due to special application even there no data need to across, how can I do?

Thanks

5 Replies 5

wkumari
Level 1
Level 1

Ummm, you will need to provide more information as to why you are trying to do this, but the short answer is goning to be that it depends on the application. Some applications (Telnet, SSH, FTP, etc) keep the connection open for a long time, some applications (HTTP, etc) keep the connection open for a much shorter time. With well behaved applications on a well behaved network you shouldn't be seeing things stuck in TIME_WAIT for very long.

Post some details on why you want this info, there is probably a better way of accomplishing what you want. It kinda sounds like you are wanting to do this for logging / monitoring, in which case something like Netflow or *shudder* IP accounting might work better.

Unless there is something special going on like IPSEC or dynamic access-lists the network infrastructure has nothing to do with this, it is the application that opens and closes connections. You open the mail box and it opens a connection to the server. You close the mailbox and it closes the connection THAT IT OPENED. If you want to keep the connection open you have to keep the application running. Some apps will timeout after idling too long like telnet. In those cases you have to change the applications timeout if possible. Other apps have an option for persistant connections. That means they hold the connection open instead of closing and reopening with each transaction.

Intermediate devices, like Firewalls, also keep track of connection's lifetime and may disconnect you after some configed idle time, even if applications don't terminate the socket.

Thanks.

Everybody, thanks for your help, it very helpful to me.

I mean that whether there is a INDUSTRY STANDARD holding time between the TCP connection when the data transfers is completed, which factors controlled the holding time? by the TCP/IP industry standard? by the applications absolutely? or by application and TCP/IP protocol and computer all together?

Note, not noly well-konw ports, it also all other port.

Thanks again.

thisisshanky
Level 11
Level 11

You should be tweaking Windows registry keys inorder to achieve what you are looking for.

First of all back up your registry files, and then use regedit.exe to tweak your registry settings.

For Windows 98, ME and 95, the key is at,

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\

MSTCP\MaxDataRetries

And for Win 2000, Nt4.0 and XP the key is at,

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\

Parameters\TcpMaxDataRetransmissions

If you dont see these keys in there, you need to create one.

The type of data is DWORD. Set this value to something like 10.

Also one more thing to notice is that, its not just a problem with your PC, doing the timeout. If the session is going through a firewall or nat kind of device, and if connection is idle, the device drops the translation slot and your session drops.

Check your power management settings. If you are doing telnet from a laptop and the laptop is running on backup power, everytime you go idle on the machine, within a minute the laptop will shut down the display and possibly the lan cards which causes your telnet or ftp connection to drop. So turn off any power savings options on your PC or laptop.

Check out the above options, and see if you are able to rectify the problem.

HTH

Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: