Router Slowdown

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 13:17, 15 May 2007 (edit)
1179210963 (Talk | contribs)

← Previous diff
Revision as of 01:56, 16 May 2007 (edit) (undo)
Hal (Talk | contribs)
(Revert spam)
Next diff →
Line 140: Line 140:
---3/23/07-- ---3/23/07--
[[Category:English documentation]] [[Category:English documentation]]
-<div style="display:none"> 
-[ there it go the whistle Song Juelz Santana] 
-[ Rascal Flatts Me and My Gang] 
-[ Neil Sedaka The Best Of] 
-[ Alison Krauss A Hundred Miles or More A Collection] 
-[ Nickelback All The Right Reasons] 
-[ Martina McBride Waking Up Laughing] 
-[ Fergie Featuring Ludacris Glamorous] 
-[ Miguel Bose Papito CD1] 
-[ Beyonce B Day Delux Edition] 
-[ Kou Shibasaki Kiki]  
-[ Christophe Willem Inventaire] 
-[ Elton John Rocket Man - the Definitive Hits] 
-[ Carrie Underwood Some Hearts] 
-[ The Cranberries Fee Fi Fo] 
-[ Joe Ain t Nothing Like Me EP] 
-[ REM Sad professor] 
-[ KAT-TUN Cartoon KAT-TUN II You CD1] 
-[ DJ Tiesto Elements Of Life] 
-[ Robin Thicke The Evolution of Robin Thicke] 
-<div style="display:none"> 
-[ Neil Young Live at Massey Hall] 
-[ Billy Currington Doing Something Right] 
-[ Rodney Atkins If You are Going Through Hell]  
-[ Brad Paisley Time Well Wasted]  
-[ Stevie Nicks Crystal Visions The Very Best of Stevie Nicks]  
-[ Dixie Chicks Taking the Long Way]  
-[ Jennifer Lopez Como Ama una Mujer]  
-[ Dierks Bentley Long Trip Alone]  
-[ Elliott Yamin Elliott Yamin]  
-[ Gym Class Heroes As Cruel as School Children]  
-[ Buckcherry 15]  
-[ Vicente Fernandez La Historia de un Idolo]  
-[ Ciara The Evolution]  
-[ Donny Osmond Love Songs of the 70s]  
-[ The Fall Of Troy Manipulator]  
-[ Killers Sams Town]  
-[ Keith Urban Love, Pain and the Whole Crazy Thing]  
-[ Young Jeezy The Inspiration Thug Motivation 102]  
-[ Lily Allen Alright Still]  
-[ Chevelle Vena Sera]  
-[ 30 seconds to Mars A Beautiful Lie]  
-[ Aaron Shust Anything Worth Saying]  
-[ The Red Jumpsuit Apparatus Dont You Fake It]  
-[ Angelique Kidjo Djin Djin]  
-[ MIMS Music Is My Savior]  
-[ Bright Eyes Cassadaga]  
-[ Soundtrack Disney Mania 5]  
-[ Breaking Benjamin Phobia]  
-[ Josh Groban Awake]  
-[ Sugarland Enjoy the Ride]  
-[ Larry The Cable Guy The Right to Bare Arms]  
-[ John Mayer Continuum]  
-[ Il Divo Siempre]  
-[ Hilary Duff Dignity]  
-[ Miranda Lambert Crazy Ex Girlfriend]  
-[ Blake Shelton Pure BS]  
-[ Robin Thicke The Evolution of Robin Thicke] 

Revision as of 01:56, 16 May 2007



A lot of people have issues with their router, some symptoms can be

  • Slow web-interface
  • Slow transfer of data, e.g. browsing
  • Not responding to ping
  • Crash or even rebooting

Usually these people are running P2P software like Emule, Bittorrent, Shareaza or something else. These programs require a lot of connections which could cause the ip_conntrack-table to get full. Especially BitTorrent DHT feature sends thousands of UDP packets that quickly overflow this table.

Routers affected with this issue are Linksys WRT54G, Linksys WRT54GL, Linksys WRT54GS or just any other machine running DD-WRT.


Even if this occurs and the router doesn't respond to pings nor HTTP, you still can check what's going on:

  • Close all your P2P/network applications and wait a few minutes for connections to be freed.
  • Try to telnet or SSH into your router. If that's not possible, reboot.
  • Check to see if your problem is caused by TCP or UDP connections:
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max
4096                                       # your max space
grep -c ^udp /proc/net/ip_conntrack
3693                                       # here UDP uses 3693 entries
grep -c ^tcp /proc/net/ip_conntrack
115                                        # and TCP uses only 115 entries
  • You may also view syslog messages
cat /var/log/messages
  1. First, you'll see 'full, dropping packet.' messages followed by 'messages suppressed.'
  2. Eventually, it will get verbose and you'll see logs similar to the following :
<4>kernel: ip_conntrack: table full, dropping packet.
<4>kernel: NET: 15 messages suppressed.
<4>kernel: ip_conntrack: table full, dropping packet.
<4>kernel: NET: 12 messages suppressed.

Solution 1

  • Go to the Web-Admin and log in
  • Go to 'Administration'
  • Go to 'Management'
  • Enter the following values at 'IP Filter Settings'
    • Maximum Ports: 4096
    • TCP Timeout (s): 3600 to 90 (decrease if you have many TCP connections)
    • UDP Timeout (s): 3600 to 90 (decrease if you have many UDP connections)

alt IP Filter Settings at DD-WRT v23

  • Save Settings and then Reboot Router
  • Check via command line if it worked:
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream
  • This causes your inactive connections to be dropped after 90 seconds.

Popular, but outdated solution

The following command is often recommended, but only applies to older versions of the DD-WRT firmware:

echo '600 1800 120 60 120 120 10 60 30 120' > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts

Note: This method for resolving slowdown issues does apply for DD-WRT v23 SP2 firmware and beyond. Furthermore, this command only applies to TCP traffic issues only, not for UDP issues.

The 2.4.23 kernel ignores this file. The correct file is located in /proc/sys/net/ipv4/netfilter/ as shown above.

How It Works

Few people know what this line actually does. It is a list for all possible TCP states and their timeouts in seconds. See the table below (they are in the correct order):

State		Timeout value

NONE		10 minutes
ESTABLISHED	30 minutes (default is 5 days)
SYN_SENT	2 minutes
SYN_RECV	60 seconds
FIN_WAIT	2 minutes
TIME_WAIT	2 minutes
CLOSE		10 seconds
CLOSE_WAIT	60 seconds (default is 12 hours)
LAST_ACK	30 seconds
LISTEN		2 minutes

AIM, ICQ and other IM programs

If you're using certain IM clients such as ICQ or AIM (or other applications which do not send frequent keep-alive packets), you should set TCP timeout to 300 or 600 to help them stay connected. As this may cause hangups when you're dealing with very heavy P2P traffic, you might want to experiment with these values.

Solution 2

DD-WRT has an inbuild proxy feature that allows rewriting of HTML content to filter ActiveX cookies, etc. As this is load-intensive, you may want to disable this feature. This should be done under Security->Firewall.

Unfortunately this function has 3 bugs:

  • Though all 4 checkboxes are unchecked the rewriting proxy is still running (you might have to reboot)
  • It drops connections if under heavy load
  • It probably runs haywire checking traffic on other ports than 80, hence the slowdown with P2P applications (unconfirmed)

The only solution is to totally disable the firewall (which I do not recommend) in Security->Firewall. This fixes all slowdowns.

This behavior has been seen in v22 and v23. Please report this to the maintainer and put it in the bug database.

Solution 3

Apparently there is a bug in the WRT54GS v2.2. The bug involves a fatal memory access error due to a difference in the CPU clock speed and the clock speed on the memory bus. This bug causes connections to be dropped when transferring large files. New versions of the Linksys firmware overclock the CPU to 216 MHz. This can be fixed by logging into the router via SSH or Telnet and executing the following commands:

nvram set clkfreq=216
nvram commit

When running DD-WRT micro v23sp2 on a WRT54G v5 the clock speed can be adjusted by logging into the router via SSH or Telnet and executing the following commands:

nvram set overclock=216
nvram commit

After rebooting the router you can confirm that the new clock speed has applied by checking the Status page of the DD-WRT GUI or by logging in via Telnet and executing the following:

nvram get clkfreq

Solution 4

For P2P applications, and especially Bittorrent, the problem can be an overwhelming number of incoming connections. Try setting a limit to the number of peers/incoming connections to around 100 or so. See Azureus page regarding this.

Known issues

  • When using Steam (of Valve) and when you refresh your server list it might cause your router to reboot since it opens many connections.