Round Robin in RouterOS

I have been busy with distribution traffic in the last time and I like to use a simple Round Robin for that and I found the following ways to archive that in RouterOS.

Bst known is using Round Robing for DNS resolving and in RouterOS you can use /ip dns static
Create the following domain and IP’s for testing. Domain example.com is used as example here:

/ip dns static
add address=1.1.1.1 name=example.com ttl=1m
add address=2.2.2.2 name=example.com ttl=1m
add address=3.3.3.3 name=example.com ttl=1m

In Terminal resolve example.com several times and you will see the outcome:

:put [resolve example.com]
1.1.1.1
:put [resolve example.com]
2.2.2.2
:put [resolve example.com]
3.3.3.3
:put [resolve example.com]
1.1.1.1
:put [resolve example.com]
2.2.2.2

Next it NTH as found in /ip firewall mangle. I looked in the Wiki and at the available examples and never got the correct impression how it worked if there were more than 2 lines to connect to. Written is line one 2,1 / 2,1 and that works in this case. However if you have three lines you should use 3,1 / 2,1 / 1,1 to spread the new connections.
Better is that the examples are changed in 2,1 / 1,1 so that is is easier understandable when using connections and not the packets.

The last one I use is PCC (Per Connection Classifier) which is more complicated and have more possibilities. PPC is not an exact Round Robin because there are variations in the results when using different clients and target servers addresses

PerConnectionClassifier ::= [!]ValuesToHash:Denominator/Remainder
  Remainder ::= 0..4294967295    (integer number)
  Denominator ::= 1..4294967295    (integer number)
  ValuesToHash ::=both-addresses  both-addresses-and-ports  both-ports  dst-address  dst-address-and-port  dst-port  src-address  src-address-and-port  src-port

To have the maximum variation you can use both-addresses-and-ports and still have a decent spread over the available connections.

PCC = 3/0 3/1 3/2 as you can see you start at zero and increase from that.

You can also weight the single connections bases on their combined bandwidth. Example for a 200 200 100Mbit/s connection adding up to 500Mbit/s:
That would normally take five PPC lines:
200 = 5/0 + 5/1 = 200
200 = 5/2 + 5/3 = 200
100 = 5/4 = 100

Reduced to three lines for a total bandwidth of 500:
200 line 5/2 = 200 (5 minus 2 makes 3 or graphical 5 4 | | | )
200 line 3/2 = 200 (3 minus 2 makes 1 or graphical 3 2 | )
100 line 2/1 = 100 (2 minus 1 makes 1 or graphical 1)

If Round Robin can be used in other places in RouterOS then don’t keep that to yourself and write about it preferable in this thread.

Hello,
Please how to make load balancing with this feature. I have WAN 200Mbps and WAN 50Mbps

You have the to divide 250 (200 plus 50).

So that is a PCC of 5/1 as first and the rest is for the 200 connection.

5/1 line one = one fifth
1/1 line two = all the rest

Disable pasthrough on both line and the second line catch is left so you don’t have to entrr a PPC gor that.