Reply To: Is Netbalancer/QoS patch included in ZS 0.1b14

Home Page Forums Network Management ZeroShell Is Netbalancer/QoS patch included in ZS 0.1b14 Reply To: Is Netbalancer/QoS patch included in ZS 0.1b14

#51569

atheling
Member

@drmca wrote:

Hi Atheling,

Some news: Sometimes I have to add more than 1 segment for the D/L to increase in speed to 2x that of a single connection. Actually, in at least 50% cases. Can you check your patch again, it looks like if the d/ls are started less than a few seconds apart, they would not be load balanced.

Appreciate your help!

I think you might be running into the basic way that Linux routing works. What the patch does is setup iptables to tag packets for several purposes in a way that are compatible with one another:

1. For routing so that all packets in one connection use the same WAN interface.
2. For unsolicited packets received via a gateway to be responded to on the same gateway (allows you to run a server on your LAN).
3. For QoS so that packets going out of an interface are prioritised correctly.

(There is a bit more so that the pings used for detecting dead gateways don’t keep flushing the routing cache, but that should not be an issue for this discussion.)

Your concern appears to be the selection of which WAN gateway to use for a new connection. This is unchanged by my patch and is made by the Linux kernel network routing logic based on the relative weights you specify. Connections that do not have a gateway tagged already are handled by the main routing table.

I don’t have access to my home system from here (my employer’s firewall blocks OpenVPN) so I can’t show you a console capture. But if you issue the following from the command shell you can see the IP routing rules:

ip rule list

The rules that have a realm associated with them are used for existing connections. Untagged packets will be handled by the “main” routing table. You can view that with

ip route list table main

The “default” rule at the bottom of that table will list your various gateways and a weights to apply to them. This is the rule that is triggered for new connections. Be advised, however that even this rule is not triggered if there is already a route to the destination that has been cached. In short, from your description, I suspect that the issues you are bringing up are with respect to how Linux does routing more than how Zeroshell, with or without my patch, sets up the IP routing subsystem.

There is a wealth of information, often unclear or contradictory, on load balancing using Linux. If you wish to understand it better I suggest you start with the section on load balancing for multiple gateways on the Linux Advanced Routing and Traffic Control website: http://lartc.org/howto/lartc.rpdb.multiple-links.html