1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

P2P apps make Tomato sluggish, crashes cablemodem

Discussion in 'Tomato Firmware' started by sauce, Mar 4, 2007.

  1. sauce

    sauce Network Guru Member

    OK, I made two *short* threads before this that I deleted. I hope I'm not driving anyone crazy. Just that my situation keeps changing as I go along. First I thought it was just wireless, then I thought it was just Windows, but anyway... here's the real story:

    DD-WRT was causing me problems, and I wanted to try Tomato. I love it to death. However, when running P2P apps, funny things happen. The network grinds to a slow, browsing the web is very sluggish, VOIP sounds crappy, downloads start at 10KBps and don't go much higher. Upload seems capped at 100KBps.

    I have a 15/2mbit connection. Tomato is customized lightly, but I had the same issues right after clearing nvram. The only thing I put in QoS is my VOIP box and that seems to be working perfectly.

    Once I start a P2P app, the issues start. If I close it, the issues stop a few seconds later. If I leave it running for a while... (this is the funny part).. my cablemodem DIES, and I have to powercycle it to get it back up.

    If I had to guess, this has to do with the number of connections. It seems that 50-100 connections cause the router to start lagging, 150-200 REALLY lags, 300 connections and the modem dies a few minutes later :(

    WRT54G v2.2 w/ v1.04

    Systems tested:
    wireless Windows Vista laptop (uTorrent)
    wireless Windows Vista desktop (uTorrent and DC++)
    wired Slackware Linux desktop (Ktorrent)

    Cablemodems tested:
    Motorola SB4200
    Motorola SB3100 (spare, just to see if my SB4200 was causing problems)
    *** Both on Optimum Online NYC (15/2mbit)
     
  2. Toxic

    Toxic Administrator Staff Member

    Try adding some QoS for p2p apps since even though VOIP may have higher priority the p2p apps will choke your bandwidth without it. put them on a very lower priority and see if this helps. you could also try limiting the bandwidth on the p2p application as well.
     
  3. larsrya8

    larsrya8 LI Guru Member

    Maybe your cable modem needs a new firmware?
     
  4. sauce

    sauce Network Guru Member

    I'm not sure if this is a QoS issue. It's a "number of connections issue," and not the usual "number of connections after a long duration of time"... because the effects of starting up P2P apps are instant on the network.

    Even so, I don't see why adding P2P apps to QoS would help since I have "bulk traffic" port numbers adding as Lowest Priority. That's very clear to the router. Seems much better than manually adding P2P apps.

    The SB4200 is confirmed to have the latest firmware. The SB3100 isn't confirmed, but its so old.. I just assume it has the latest. Doesn't really matter anyway. Both modems can't be bad.
     
  5. GeeTek

    GeeTek Guest

    When your p2p is running and causing problems, how much upstream and downstream bandwidth does it consume ? There is a link in the sticky to a script that will limit the number of connections to any value you like. As Toxic said, limiting the speed of p2p bandwidth, especially the upstream is the majic bullet for taming unruly p2p.
     
  6. sauce

    sauce Network Guru Member

    P2P upload consumes a max of 100KBps, even though I easily upload 200KBps when the problem is not happening. P2P download is sporadic. From 500-1000KBps. Never the full 1500KBps. Making new connections, downloading FTP, HTTP, and browsing HTTP is ridiculously slow and lagged.

    I think the link you're talking about is this: http://www.linksysinfo.org/forums/showthread.php?t=49421. But I'm confused, how do I implement it to try and fix this? And do I really want to limit the number of connections? Because this seems to happen when the router has 150 connections open, which is a very very low amount.
     
  7. roadkill

    roadkill Super Moderator Staff Member Member

    I got the same problem on ADSL I think it's the modem and not the router
    because it only happens above certain level of connections..
    and Vista is known to cause problems with TCP/IP and certain devices
    Google for Vista broadcom problems
     
  8. sauce

    sauce Network Guru Member

    You *think* its the modem. How could 2 cablemodems and 1 ADSL modem have the same problem? Our common thread is that we both use Tomato.

    I have problems with Slackware Linux as well. I will check out what you are saying though. I'm not sure what my network chipset is right now but I'll check when I get home.
     
  9. Toxic

    Toxic Administrator Staff Member

    i'm not too upto date on WRT54G firmware but does tomato have a Conntrack setting that you could change?
     
  10. GeeTek

    GeeTek Guest

    You are forcing me to admit a bit of ignorance on the implimentation, since I put the script into all 4 script locations, saving one at a time. I think firewall and startup would suffice nicely. The script limits TCP connections per IP address, not globally in router. Here is what I just copied out of one of my tomatoes, and is for a limit of 105 connections. Typical web browsing uses 20 or 30 connections, so 105 is quite a few. Adjust the limit count and IP range to suite your system. I would verify what roadkill suggested by connecting directly to the modem and hammering it with traffic to see if the modem is indeed your culprit. It is pretty hard to swamp a tomato router, even with it's default values.

    iptables -I FORWARD -p tcp --syn -m iprange --src-range 192.168.22.10-192.168.22.250 -m connlimit --connlimit-above 105 -j DROP
     
  11. sauce

    sauce Network Guru Member

    Thanks for the help but I don't want to limit my PCs to 105, or any connections at all, if its not necessary...
     
  12. azeari

    azeari LI Guru Member

    i suspect its the modem's fault too cuz i don't get this issue with my tomato

    qn: is the tomato webui sluggish as well when the problem occurs?

    some things to check
    router cpu load (if its unusually high, like 1.00/1.00/1.00, overclocking might solve it
    router free memory (cut down on unused services like ssh and telnet if its too lil)
    router conntrack (advanced->conntrack) press the count thingy and see if its anywhere near the limit, try increasing it if it is

    if the webui's fine, and everything here is in order, the culprit should be the cable modem
     
  13. sauce

    sauce Network Guru Member

    WebUI is very fast
    Router CPU load never comes close to 1.0's
    Router free memory is usually ~4MB
    Router's conntrack is never, ever near the limit. I set it to 4096, but 100 connections seem to make it unstable

    With DD-WRT I was able to run P2P without a problem using the same cablemodem. I know its not a problem but just for fun... I'm gonna go get the cablemodem replaced today. There IS a newer model but I was asking on my ISP's forums and no one has this problem except me. The newer model just looks prettier (black modern case, rather than a boxy white one).
     
  14. pharma

    pharma Network Guru Member

    Well you need a starting point to troubleshoot your problems. Why don't you decrease the number of connections allowed in your P2P application to something like 60 inbound/job, 60 outbound/job. If your problems disappear then you have a starting point, if not then try something else. Also, if you've been changing Tomato' s default settings that might also be what's causing the problem.

    A while ago I had a similar issue where my web browsing became sticky ... reducing my P2P connections per job resolved it all and have noticed no difference in the P2P speeds I now get. I also increased my XP pagefile to a 4 gig minimum because I found it helped when I was downloading P2P and simultaneously multitasking other applications on my computer.

    Also if you are running Windows check your event viewer to see if it has reached it's connection limit. Normally to change this requires a manual change to the registry and has nothing to do with the Tomato firmware.

    If you want an app that can change this limit you can get it here: http://xp-antispy.org/component/option,com_remository/Itemid,26/

    If you only want to change this limit, open the app and navigate --> Special --> Connections. The author has a statement there about why Microsoft limited the number of connections -- make sure you understand.
     
  15. sauce

    sauce Network Guru Member

    You're right, I need to back track... I'm also going to clear nvram once more just so I can start with a clear config. This weekend I'm going to be taking a closer look into this.
     
  16. roadkill

    roadkill Super Moderator Staff Member Member

    I suggest you set the connection limit back to 2048.
    I got a 4 PC all downloading in P2P applications and I don't use more than a 1000
    concurrent connections.
    the allocation of 4096 max connections could be causing a strain on the router...
     
  17. whiteyonenh

    whiteyonenh Guest

    IIRC the Surfboard 4200 has an issue with high traffic rates causing modem instability at 100MBit WAN speeds.

    I used to run a 4200 with a 4/384 connection with a 10Mbit router, I then upgraded to a WRT54G with Sveasoft firmware for a while, then tried DD-WRT, and now have Tomato. By far Tomato is the most stable and reliable that I have ever used. The modem started locking up as soon as I got the WRT54G regardless of what firmware it was. IIRC I forced the WAN to 10Mbit with the Sveasoft firmware, I would assume that it's possible with other firmwares. Forcing to 10MBit seemed to fix the issue for me in that instance.

    I don't remember, nor do I know where to go in the router, but I believe you can somehow force the wan in the router to run at 10MBit, although this would also mean that you would no longer be able to get your full upload and download, but you could try it and see if it solves your problem.

    The only other option I can think of is to replace the cable modem with either a Surfboard 5100 or equivalent and see if the issue goes away. If your modem is leased, see if you can get the cable company to let you exchange your modem for a newer one.
     
  18. GeeTek

    GeeTek Guest

    I run several boxes with 9999 programmed and see no ill efects. Rock solid and snappy with 1200+ total connections going collectively from several clients. I choke inbound speed to 150 kb and upload speed to 30 kb on p2p. Can't really tell they are there when browsing internet. WHR-G54S, 3 x 768 cable.
     
  19. roadkill

    roadkill Super Moderator Staff Member Member

    I don't think that more than 2048 connections are required so whats the point of allocating them?
    and I also think that limiting the wan port to 10mb full duplex is a good idea
     
  20. der_Kief

    der_Kief Super Moderator Staff Member Member

    Hi,
    this can be done under Advanced->Miscellaneous->WAN Port Speed
    And as roadkill mentioned a 2048 connection limit is enough to run "fast" P2P

    der_Kief
     
  21. GeeTek

    GeeTek Guest

    The connections count is just a variable. It does not pre-allocate any resouces nor cause any ill efects if set to a high number. That was my only point. Since it doesn't hurt to have a high number, why stop half way ? At 9999 you can be damned sure that you will never run low, and will never need to look at that field again.
     
  22. pharma

    pharma Network Guru Member

    Geetek ... I'd have to agree with you since the number of connections will never get to 4096. I have mine set at 4096 with no ill effects. It's definitely not hurting anything by setting it that high!

    At the same time I also agree with the others that 2048 should be high enough ... the most connections I've ever seen was about 1,968.

    Pharma :)
     
  23. roadkill

    roadkill Super Moderator Staff Member Member

    the variable is preallocating the array to 4096 and maybe changing the timeout for various connection types - I am not sure of it but it makes sense that if it has a large connection number it will change the timeout to a larger value...
     
  24. azeari

    azeari LI Guru Member

    well my router has went past the imaginary 4096 limit b4 and the net never became sluggish(this is what you get when there're 3 ppl running bittorrent and p2p stuff behind the router)

    my limit's set at 9000 and all seems well, so i doubt there's that much of a strain at 4096 =)

    Also i believe the max connections doesn't change timeout values or stuff. it simply changes the conntrack table size to allow for more connections. Afterall, the tcp and udp settings below remain unaffected by the change in connection numbers
     
  25. sillydoh

    sillydoh LI Guru Member

    I would suspect it's the modem. If you're a heavy bandwidth usage guy, it will eventually bog down your modem to the point where you'd have to reset it. (it happens with my Motorola SBV 5120)
     

Share This Page