Community discussions

MikroTik App
 
kabiraftab
just joined
Topic Author
Posts: 13
Joined: Fri Jan 25, 2013 5:20 pm

Issue with 4 wan PCC Unequal Load Balancing

Wed Mar 06, 2013 11:00 am

Dear All,

I have posted it some days ago, but didnt got any reply. And later on, I tried to change the code which i pasted in my post because i did some changing though. But then, i could not see my topic at all. So i have to start this topic ,,, sorry moderators :( (i'm new here)

I have 4 Wans, in which All are 4mbps except WAN2 which is 10mb. I tried to do load balancing with PCC un equal method,, and i am getting speed of around 16,, (almost 4mb from all,, Wan2(10mb link) is also giving not more than 4.3-4.5).

So Kindly see my code and correct me where i am wrong.
/interface ethernet
set 0 name=WAN4
set 1 name=WAN3
set 2 name=WAN2
set 3 name=Local
set 4 name=WAN1

/ip address
add address=192.168.1.1/24 interface=Local
add address=192.168.10.2/24 interface=WAN1
add address=192.168.20.2/24 interface=WAN2
add address=192.168.30.2/24 interface=WAN3
add address=192.168.40.2/24 interface=WAN4

/ip dns
set allow-remote-requests=yes cache-size=5000KiB max-udp-packet-size=512 servers=208.67.220.220,208.67.222.222

/ip firewall mangle
add action=mark-connection chain=input in-interface=WAN1 new-connection-mark=WAN1_conn
add action=mark-connection chain=input in-interface=WAN2 new-connection-mark=WAN2_conn
add action=mark-connection chain=input in-interface=WAN3 new-connection-mark=WAN3_conn
add action=mark-connection chain=input in-interface=WAN4 new-connection-mark=WAN4_conn

add action=mark-routing chain=output connection-mark=WAN1_conn new-routing-mark=to_WAN1
add action=mark-routing chain=output connection-mark=WAN2_conn new-routing-mark=to_WAN2
add action=mark-routing chain=output connection-mark=WAN3_conn new-routing-mark=to_WAN3
add action=mark-routing chain=output connection-mark=WAN4_conn new-routing-mark=to_WAN4

add chain=prerouting dst-address=192.168.10.0/24 in-interface=Local
add chain=prerouting dst-address=192.168.20.0/24 in-interface=Local
add chain=prerouting dst-address=192.168.30.0/24 in-interface=Local
add chain=prerouting dst-address=192.168.40.0/24 in-interface=Local

add action=mark-connection chain=prerouting dst-address-type=!local in-interface=Local new-connection-mark=WAN1_conn per-connection-classifier=\
    both-addresses-and-ports:4/0
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=Local new-connection-mark=WAN3_conn per-connection-classifier=\
    both-addresses-and-ports:4/2
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=Local new-connection-mark=WAN4_conn per-connection-classifier=\
    both-addresses-and-ports:4/1
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=Local new-connection-mark=WAN2_conn per-connection-classifier=\
    both-addresses-and-ports:4/3
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=Local new-connection-mark=WAN2_conn per-connection-classifier=\
    both-addresses-and-ports:4/4

add action=mark-routing chain=prerouting connection-mark=WAN1_conn in-interface=Local new-routing-mark=to_WAN1
add action=mark-routing chain=prerouting connection-mark=WAN2_conn in-interface=Local new-routing-mark=to_WAN2
add action=mark-routing chain=prerouting connection-mark=WAN3_conn in-interface=Local new-routing-mark=to_WAN3
add action=mark-routing chain=prerouting connection-mark=WAN4_conn in-interface=Local new-routing-mark=to_WAN4

/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
add action=masquerade chain=srcnat out-interface=WAN3
add action=masquerade chain=srcnat out-interface=WAN4 to-addresses=0.0.0.0

/ip route
add check-gateway=ping distance=1 gateway=192.168.10.1 routing-mark=to_WAN1
add check-gateway=ping distance=1 gateway=192.168.20.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.30.1 routing-mark=to_WAN3
add check-gateway=ping distance=1 gateway=192.168.40.1 routing-mark=to_WAN4

add check-gateway=ping distance=1 gateway=192.168.10.1
add check-gateway=ping distance=2 gateway=192.168.20.1
add check-gateway=ping distance=3 gateway=192.168.30.1
add check-gateway=ping distance=4 gateway=192.168.40.1

 
dboillot
Member Candidate
Member Candidate
Posts: 124
Joined: Thu May 06, 2010 12:04 am

Re: Issue with 4 wan PCC Unequal Load Balancing

Wed Mar 06, 2013 7:34 pm

PCC has no clue what speeds your line are. all it does is divvy up (randomly) your connections over the different lines, how random it is depends on what classifiers you are doing (source ip/destination ip/source port/destination port)

you may want to test to see if your 10mb line to see if you're actually getting your 10mb

I know when I was using it, I could max out 6 lines and 4 were 6mb and 2 were 18
 
kabiraftab
just joined
Topic Author
Posts: 13
Joined: Fri Jan 25, 2013 5:20 pm

Re: Issue with 4 wan PCC Unequal Load Balancing

Wed Mar 06, 2013 8:16 pm

I have checked and my 10mb link fully working at all. But it does not give me full speed with PCC Load balancing...!
 
kabiraftab
just joined
Topic Author
Posts: 13
Joined: Fri Jan 25, 2013 5:20 pm

Re: Issue with 4 wan PCC Unequal Load Balancing

Thu Mar 07, 2013 6:33 pm

No Reply yet???

Please guys,, help me out! I am waiting for your reply!
 
kabiraftab
just joined
Topic Author
Posts: 13
Joined: Fri Jan 25, 2013 5:20 pm

Re: Issue with 4 wan PCC Unequal Load Balancing

Sun Mar 10, 2013 9:40 am

Hellooo!!! still waiting for solution :(
 
kabiraftab
just joined
Topic Author
Posts: 13
Joined: Fri Jan 25, 2013 5:20 pm

Re: Issue with 4 wan PCC Unequal Load Balancing

Mon Mar 11, 2013 11:38 am

No Reply?? :( :( :(
 
abhsek
newbie
Posts: 25
Joined: Fri Sep 18, 2015 6:19 am
Contact:

Re: Issue with 4 wan PCC Unequal Load Balancing

Thu Jul 21, 2016 12:28 pm

Try This :-
http://www.itlearnweb.com/2016/01/unequ ... cc_87.html

U can add more wan to this.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7198
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Issue with 4 wan PCC Unequal Load Balancing

Thu Jul 21, 2016 12:44 pm

You must understand that PCC is not per packet balancer. PCC classifies traffic per stream and doesn't care about total bandwidth, so it is possible that one stream, for example, is running over WAN1 is using 5Mbps, but stream on WAN2 is using only 1Mbps and so on.
 
larryhao
just joined
Posts: 2
Joined: Mon Jul 04, 2016 11:58 pm
Location: China

Re: Issue with 4 wan PCC Unequal Load Balancing

Mon Jul 25, 2016 5:19 am

I Ithink you didn't get full band width because you didn't split the connections correctly. For your configuration, you need to split all connections into 11, and then assign 2 to each 4M connections, and 5 to 10M connection. Total will be around 20-22 M. However, according to the nature of PCC, it's not packet based, so it's very hard to get full 22M. Some lines are already full, but some lines are not so full.

Here is what you need to do:
11/0
11/1
11/2
11/3
...
11/10

You don't need to list 11/11 as it'll not happed. It's the same as 11/0. If you take 11/0, 11/11 will always be 0.
What you could do better is, when you mark a connection, you could route it immediately, this way the router doesn't need to calculate it again. That means you need to add to command to mark routing between the split, and don't check passthough after routing.
 
MATU
just joined
Posts: 13
Joined: Thu Apr 03, 2014 11:01 am

Re: Issue with 4 wan PCC Unequal Load Balancing

Wed Jun 07, 2017 2:33 am

I Ithink you didn't get full band width because you didn't split the connections correctly. For your configuration, you need to split all connections into 11, and then assign 2 to each 4M connections, and 5 to 10M connection. Total will be around 20-22 M. However, according to the nature of PCC, it's not packet based, so it's very hard to get full 22M. Some lines are already full, but some lines are not so full.

Here is what you need to do:
11/0
11/1
11/2
11/3
...
11/10

You don't need to list 11/11 as it'll not happed. It's the same as 11/0. If you take 11/0, 11/11 will always be 0.
What you could do better is, when you mark a connection, you could route it immediately, this way the router doesn't need to calculate it again. That means you need to add to command to mark routing between the split, and don't check passthough after routing.
This worked for me when I had a similar issue of 1 big WAN link among 3 that was being under-utilized.