lstein / Net-ISP-Balance

Set of scripts to load-balance your Internet connection across two or more ISPs with auto failover
Artistic License 2.0
206 stars 49 forks source link

Question about routes cache #8

Closed fredbcode closed 8 years ago

fredbcode commented 8 years ago

Hello,

Related to http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=89aef8921bfbac22f00e04f8450f6e447db13e42 there is no route cache with recent kernels, unfortunately http://lartc.org/howto/lartc.rpdb.multiple-links.html is based on route cache method

This will balance the routes over both providers. The weight parameters can be tweaked to favor one provider over the other.

Note that balancing will not be perfect, as it is route based, and routes are cached. This means that routes to often-used sites will always be over the same provider.

So my question is, there is an impact for Net-ISP-Balance ? There are broken TCP sessions, no ? Eg: I mean, a cnx to HTTPS website with ISP1 suddenly moved to ISP2

lstein commented 8 years ago

Sorry for the unconscionable delay in responding to this issue request (a lot of emails piled up during the holiday vacations and I simply missed this).

For connections that are outgoing or incoming to the router, the method described in the lartc article is used, and is potentially affected to the kernel change. However, as a practical matter, there doesn't seem to be a problem. I am running kernels later than 3.6 (where the change to the kernel route cache is supposed to have happened) and I don't see an excess of broken TCP connections. I'm not sure why there isn't a problem, but both interfaces are being used for load balancing on a per-connection (not per-route) basis, and overall throughput is exactly what you'd expect.

For machines on the LAN that are using the router as a gateway to the Internet, the lartc method was never used. Instead it uses the "firewall mark" method, which is independent of the change to the route cache. This method is also connection based, meaning that every time you request a connection to an external server it assigns an interface on a stochastic basis. A different interface may be used for different connections to the same server, but within a single TCP session the same interface is always used.