Connection issues
From Tapestries MUCK
(Fixed some slight mistakes, added slightly better explanations and added win9x information.) |
m (Changed the instructions slightly so periods were not at the end of values that can be copy/pasted -- to prevent confusion/mistakes.) |
||
Line 16: | Line 16: | ||
'''Warning: Do not set this value lower than 60 seconds or you may suffer a lot of connectivity issues.''' | '''Warning: Do not set this value lower than 60 seconds or you may suffer a lot of connectivity issues.''' | ||
+ | |||
===Under Linux=== | ===Under Linux=== | ||
Line 22: | Line 23: | ||
'''echo 180 > /proc/sys/net/ipv4/tcp_keepalive_time''' | '''echo 180 > /proc/sys/net/ipv4/tcp_keepalive_time''' | ||
- | However, if you wish to set this permanently (applied when you start the system), you will need to change/add '''net.ipv4.tcp_keepalive_time=''' in '''/etc/sysctl.conf''' to say something like '''net.ipv4.tcp_keepalive_time=180''' | + | However, if you wish to set this permanently (applied when you start the system), you will need to change/add '''net.ipv4.tcp_keepalive_time=''' in '''/etc/sysctl.conf''' to say something like: |
+ | |||
+ | '''net.ipv4.tcp_keepalive_time=180''' | ||
+ | |||
===Under Windows NT systems=== | ===Under Windows NT systems=== | ||
This can be set from a Administrator account: | This can be set from a Administrator account: | ||
- | Open regedit and browse to '''HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters''' | + | Open regedit and browse to: |
+ | |||
+ | '''HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters''' | ||
+ | |||
If there is a key called '''KeepAliveTime''' edit it. If it doesn't exist, create it as a new dword key. | If there is a key called '''KeepAliveTime''' edit it. If it doesn't exist, create it as a new dword key. | ||
Line 35: | Line 42: | ||
===Under Windows 95/98/ME systems=== | ===Under Windows 95/98/ME systems=== | ||
- | Open regedit and browse to '''HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VxD\MSTCP''' | + | Open regedit and browse to: |
+ | |||
+ | '''HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VxD\MSTCP''' | ||
Revision as of 12:17, 5 July 2007
Contents |
Home router silent disconnects
Probably one of the most common of issues encountered with home routers and idle connections.
Many home routers behave as NATs, the concept of a NAT is generally allow a network of computers share one IP address on another network, in this case the Internet. For address transversal to work, the router needs to keep routing information in memory of which connections are going where. Here is where in lies the problem.
The router's memory is finite, and generally home routers have very little memory. Many routers do not have the ability to check if a connection is still active if it's absolutely silent (no data passing through either side, quite a common case when you're in a quiet area on a MUCK and not communicating) the router will assume after a certain amount of time that the connection died and will remove the routing information from memory to free up memory to handle other/more connections.
Technical implementations for better checking mechanisms if a connection is still active do exist, but they require more memory and as such generally isn't found in home routers.
On many home routers which run on a embedded version of Linux (many of these use ipchains), this time limit is usually 900 seconds, although it can vary depending on what model and make of router you have. Generally this leads to silent disconnections after a bit of time.
Fortunately there is a workaround. You can increase the rate of 'TCP keep-alive' messages in the operating system (the computer you are using, not the router) to send messages periodically to the server to check if the connection is still alive. The default is value is 7200 seconds -- two hours under Linux and Windows. If the system sends these before the 'grace period' of dropping the connection, the router sees these messages and assumes the connection is still active and will not silently disconnect you.
Generally a value of 180 seconds is usually low enough to work around all the home routers I've encountered. --Ash-Fox
Warning: Do not set this value lower than 60 seconds or you may suffer a lot of connectivity issues.
Under Linux
This can be set on the fly by entering in the console as root:
echo 180 > /proc/sys/net/ipv4/tcp_keepalive_time
However, if you wish to set this permanently (applied when you start the system), you will need to change/add net.ipv4.tcp_keepalive_time= in /etc/sysctl.conf to say something like:
net.ipv4.tcp_keepalive_time=180
Under Windows NT systems
This can be set from a Administrator account:
Open regedit and browse to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
If there is a key called KeepAliveTime edit it. If it doesn't exist, create it as a new dword key.
Set the integer to 180000 (this is 180 seconds in mini-seconds), then restart Windows for the new changes to take effect.
Under Windows 95/98/ME systems
Open regedit and browse to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VxD\MSTCP
If there is a key called KeepAliveTime edit it. If it doesn't exist, create it as a new string value.
Set the string value to 180000 (this is 180 seconds in mini-seconds), then restart Windows for the new changes to take effect.