Skip to content

Proposal: waterfall-by-priority load balancing algorithm #82

@stapelberg

Description

@stapelberg

Hey,

currently, MLVPN supports a weighted round robin load balancing algorithm. This is fine if the cost of all the links is roughly the same, and all links will be used equally (or proportionally to their configured bandwidth).

However, I’m in a situation where it is desirable to use a minimum number of links first and then gradually use more links as needed. Think about a setup with the following links:

  • link1: residential ADSL
  • link2: shared ADSL via a WiFi beam radio
  • link3: mobile broadband with strict traffic limits

Whenever the needed bandwidth can be satisified by using link1, only link1 should be used. If necessary, link2 can be utilized, and if absolutely need be, link3 can be utilized as well.

My proposed algorithm for this situation works as follows:

  1. Introduce a (statically configured) priority field for each link.
  2. On each link, set a counter to 0.
  3. When a packet needs to be sent, grab the first link by priority.
  4. Check whether the counter exceeds the configured bandwidth. If yes, grab the next link by priority and check again.
  5. If no, send the packet and increment the counter with the number of bytes.
  6. Each second, reset all link counters to 0.

I have implemented this in a proof-of-concept implementation (outside of MLVPN) and it works fine.

I’m willing to put in the work to implement this within MLVPN.

Would you accept such a contribution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions