IPFS daemon resets my Internet modem

Hi!

When I run the IPFS on a couple of systems on my network and peers start to connect my Internet modem seems to panic and reset.

The modem is a DOCSIS one, provided by my cable company (Ziggo Netherlands). I cannot purchase/connect a different/better modem.

The modem is configured as a bridge so it doesn’t do any routing (I have my own Linux based router for that).

IPFS seems to be a really good fit for the problem I’m trying to solve but crashing my modem and Internet connection is really annoying.

Is there a way to drastically lower the amount of peer connections? (I presume this is the problem).

I don’t want to completely disable the peer discovery/swarming as I think it’s quite convenient.

According to the documentation Swarm.ConnMgr.HighWater only disconnects peers (those will still try to connect to me).

Setting Swarm.AddrFilters only disables outgoing connections, not incoming connections (flooding my ISP/modem).

I hope someone can help me.

The typical problem people run into is the fact that low end consumer routers usually have a small state table, so they can’t handle the firehose of connections an IPFS node generates (they actually hang). But, you say it’s in bridge mode and not routing, so it really shouldn’t care how many connections are happening.

My first question has to be: is it really in bridge mode, or do you have a double NAT situation? With double NAT, you are still using the state table and the problem stands.

If not, is it doing any kind of intelligent work on the traffic, like SPI? This can lead to similar problems and should be turned off. You want the modem to be just that, and your Linux router to do the work. Turn off its firewall entirely, if you can.

If not, I’m really not sure what else it could be, other than not being able to handle the traffic rate, but that’s very unlikely. Basically, by this stage, you are dealing with a dumb modem (and a switch, if it has multiple ports), it should just work.

I’ve had this issue. Router would reset as soon as ipfs daemon is started. Even with low number of connections (not sure how the small state table theory applies). Mine was also in “bridge” mode.

  1. You can use only tcp or only quic/udp in your swarm settings and see if that helps.
  2. What I didn’t try, is to use the resource manager as an effective way of really limiting the number of connections: kubo/docs/libp2p-resource-management.md at master · ipfs/kubo · GitHub

Set MaxMemory to 50MiB and that should only allow 50 connections. Maybe that helps, maybe not.

One thing I meant to mention as a last resort, and then completely forgot about: launch your node in client mode, instead of server mode (that just means it won’t act as a DHT server, but it will still be a bitswap server). This will crater your number of connections to a ridiculously low number. See if that helps.

Thanks a lot for the replies!

I’ll try the client mode.

I do get an Internet IP address on my router (213.93.0.0/16 range) and ports aren’t mangled, but something might still be tracking connections for some stupid reason I cannot disable.

The routers of this ISP are bugged, other peoples had success LIBP2P_TCP_REUSEPORT=false ipfs daemon that should work without having to limit the numbers of connections.

Yes, that is my fear as well, not sure why my modem resets though.

Ziggo promised me to send me a new modem so I’ll check that first.

I doubt this will solve anything, this looks a lot like a software bug and unless the new modem has a newer firmware version I don’t see why a different unit would solve the issue.

It’s a new type of modem, my current modem has a “puma chipset” which is known to have issues at high load.

1 Like

Allright, I installed the new modem and did some tests and it looks like the problem is solved.

2 Likes