More Control over PCC Load Balancing?

Hello, I was wondering if there was as way to have more control over what connection gets used when you are doing PCC Load Balancing.

the reason why Im asking this, is that it seems that everything is gong over only 1 connection, with the lights on the other 3 connections blink once every 5-15min. we have about 50 clients and I dont think they should all be going over the 1.

TIA


Drew

http://wiki.mikrotik.com/wiki/How_PCC_works_(beginner)

Yea, I looked at that one the last time you showed it to me. I’m using both-addresses-and-ports this time. the more I read in to PCC the more I am not sure it is going to do what I need it to do. ( here’s a link to the last time i asked about PCC http://forum.mikrotik.com/t/pppoe-w-dynamic-ip-from-isp-pcc-problem/38151/1

i can post the cfg i used if that will help.

Does “/ip firewall mangle print stats” show that both markers fire as they should?

Please do post your configuration.

What are you expecting PCC to do for you?

i get this w/ that command.
Flags: X - disabled, I - invalid, D - dynamic

CHAIN ACTION BYTES PACKETS

0 input mark-connection 4099510 35336
1 input mark-connection 1499460 17234
2 input mark-connection 355148 4053
3 input mark-connection 299644 3387
4 output mark-routing 4769132 33479
5 output mark-routing 2505350 15322
6 output mark-routing 506762 3950
7 output mark-routing 480190 3185


so it looks like its working as its supposed to.. i think..


Here is my config i used to make the PCC.

/ ip firewall mangle
add chain=input in-interface=pppoe-out1 action=mark-connection new-connection-mark=wan1_conn
add chain=input in-interface=pppoe-out2 action=mark-connection new-connection-mark=wan2_conn
add chain=input in-interface=pppoe-out3 action=mark-connection new-connection-mark=wan3_conn
add chain=input in-interface=pppoe-out4 action=mark-connection new-connection-mark=wan4_conn


add chain=output connection-mark=wan1_conn action=mark-routing new-routing-mark=to_wan1 
add chain=output connection-mark=wan2_conn action=mark-routing new-routing-mark=to_wan2
add chain=output connection-mark=wan3_conn action=mark-routing new-routing-mark=to_wan3
add chain=output connection-mark=wan4_conn action=mark-routing new-routing-mark=to_wan4



add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/0 \
action=mark-connection new-connection-mark=wan1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/1 \
action=mark-connection new-connection-mark=wan2_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/2 \
action=mark-connection new-connection-mark=wan3_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/3 \
action=mark-connection new-connection-mark=wan4_conn passthrough=yes

add chain=prerouting connection-mark=wan1_conn in-interface=Local action=mark-routing new-routing-mark=to_wan1
add chain=prerouting connection-mark=wan2_conn in-interface=Local action=mark-routing new-routing-mark=to_wan2
add chain=prerouting connection-mark=wan3_conn in-interface=Local action=mark-routing new-routing-mark=to_wan3
add chain=prerouting connection-mark=wan4_conn in-interface=Local action=mark-routing new-routing-mark=to_wan4

/ ip route
add dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_wan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_wan2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_wan3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out4 routing-mark=to_wan4 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out2 distance=2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out3 distance=3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out4 distance=3 check-gateway=ping

/ ip firewall nat 
add chain=srcnat out-interface=pppoe-out1 action=masquerade
add chain=srcnat out-interface=pppoe-out2 action=masquerade
add chain=srcnat out-interface=pppoe-out3 action=masquerade
add chain=srcnat out-interface=pppoe-out4 action=masquerade

as for what I want it to do, (which after reading alot about it, i dont think it will) is take my 4 DSL connectoins/circuits and place them in a pool of bandwith that everyone one pulls from, IE instead of 46mb connections, it appears as 124mb connection. We where able to do this with 2 lines using a Linksys RV082. But we needed more bandwith and can’t afford the $15,700 soultion they want to sell us, or the $4,800/mo 48mb Fiber.

I would be happy if I could get it to when people connect, the RB493AH balences the load over the 4 DSL connections/circuits, trying to keep the useage spread over the lines as much as it can. IE say we have 15mb of traffic needing to go in/out from/to the net over the RB439AH, take that 15mb and spread it over the 4 lines, leaving all 4 connections w/ 3.75mb of traffic. or something like that. w/ PCC it reads like its more randomly picking out of a hat then i’d like.

If that can’t be done, can the RB439AH be setup to use 1 dsl/circuit to a percentage of use (say 60%) before it starts to offload on to the 2nd dsl/circuit and so on and so fourth.

i get this w/ that command.
Flags: X - disabled, I - invalid, D - dynamic

CHAIN ACTION BYTES PACKETS

0 input mark-connection 4099510 35336
1 input mark-connection 1499460 17234
2 input mark-connection 355148 4053
3 input mark-connection 299644 3387
4 output mark-routing 4769132 33479
5 output mark-routing 2505350 15322
6 output mark-routing 506762 3950
7 output mark-routing 480190 3185


so it looks like its working as its supposed to.. i think..


Here is my config i used to make the PCC.

/ ip firewall mangle
add chain=input in-interface=pppoe-out1 action=mark-connection new-connection-mark=wan1_conn
add chain=input in-interface=pppoe-out2 action=mark-connection new-connection-mark=wan2_conn
add chain=input in-interface=pppoe-out3 action=mark-connection new-connection-mark=wan3_conn
add chain=input in-interface=pppoe-out4 action=mark-connection new-connection-mark=wan4_conn


add chain=output connection-mark=wan1_conn action=mark-routing new-routing-mark=to_wan1 
add chain=output connection-mark=wan2_conn action=mark-routing new-routing-mark=to_wan2
add chain=output connection-mark=wan3_conn action=mark-routing new-routing-mark=to_wan3
add chain=output connection-mark=wan4_conn action=mark-routing new-routing-mark=to_wan4



add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/0 \
action=mark-connection new-connection-mark=wan1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/1 \
action=mark-connection new-connection-mark=wan2_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/2 \
action=mark-connection new-connection-mark=wan3_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/3 \
action=mark-connection new-connection-mark=wan4_conn passthrough=yes

add chain=prerouting connection-mark=wan1_conn in-interface=Local action=mark-routing new-routing-mark=to_wan1
add chain=prerouting connection-mark=wan2_conn in-interface=Local action=mark-routing new-routing-mark=to_wan2
add chain=prerouting connection-mark=wan3_conn in-interface=Local action=mark-routing new-routing-mark=to_wan3
add chain=prerouting connection-mark=wan4_conn in-interface=Local action=mark-routing new-routing-mark=to_wan4

/ ip route
add dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_wan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_wan2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_wan3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out4 routing-mark=to_wan4 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out2 distance=2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out3 distance=3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out4 distance=3 check-gateway=ping

/ ip firewall nat 
add chain=srcnat out-interface=pppoe-out1 action=masquerade
add chain=srcnat out-interface=pppoe-out2 action=masquerade
add chain=srcnat out-interface=pppoe-out3 action=masquerade
add chain=srcnat out-interface=pppoe-out4 action=masquerade

as for what I want it to do, (which after reading alot about it, i dont think it will) is take my 4 DSL connectoins/circuits and place them in a pool of bandwith that everyone one pulls from, IE instead of 46mb connections, it appears as 124mb connection. We where able to do this with 2 lines using a Linksys RV082. But we needed more bandwith and can’t afford the $15,700 soultion they want to sell us, or the $4,800/mo 48mb Fiber.

I would be happy if I could get it to when people connect, the RB493AH balences the load over the 4 DSL connections/circuits, trying to keep the useage spread over the lines as much as it can. IE say we have 15mb of traffic needing to go in/out from/to the net over the RB439AH, take that 15mb and spread it over the 4 lines, leaving all 4 connections w/ 3.75mb of traffic. or something like that. w/ PCC it reads like its more randomly picking out of a hat then i’d like.

If that can’t be done, can the RB439AH be setup to use 1 dsl/circuit to a percentage of use (say 60%) before it starts to offload on to the 2nd dsl/circuit and so on and so fourth.

That does look right, and the mangle shows that connections are being spread. How do the interface counters look? Do all four interfaces show approximate spreading of load?

as for what I want it to do, (which after reading alot about it, i dont think it will) is take my 4 DSL connectoins/circuits and place them in a pool of bandwith that everyone one pulls from, IE instead of 46mb connections, it appears as 124mb connection. We where able to do this with 2 lines using a Linksys RV082. But we needed more bandwith and can’t afford the $15,700 soultion they want to sell us, or the $4,800/mo 48mb Fiber.

I would be happy if I could get it to when people connect, the RB493AH balences the load over the 4 DSL connections/circuits, trying to keep the useage spread over the lines as much as it can. IE say we have 15mb of traffic needing to go in/out from/to the net over the RB439AH, take that 15mb and spread it over the 4 lines, leaving all 4 connections w/ 3.75mb of traffic. or something like that.

PCC does not simply multiply the bandwidth of the circuits by the number of circuits. For that you need bonding, which requires the ISP to set things up on their end. PCC simply marks connections based on whatever criteria you give it. You then, for the purpose of balancing circuit load, use those connection marks to enforce the connection being routed out a specific interface and across a specific circuit. Because this is done by connection this will only approximate being equally spread over many connections. If you only have four connections going through the router and one is using 5mbps and the other three are 10kbps then you’re not going to see equal spreading of loads. both-addresses-and-ports should, however, equalize load fairly nicely and quickly.

w/ PCC it reads like its more randomly picking out of a hat then i’d like.

It’s actually the very opposite of random. It’s 100% deterministic.

If that can’t be done, can the RB439AH be setup to use 1 dsl/circuit to a percentage of use (say 60%) before it starts to offload on to the 2nd dsl/circuit and so on and so fourth.

To the best of my knowledge that is not possible.

nope. I see activity only on the first port. (assuming im looking at the right area, Winbox>Interfaces

I’ve attached the firewall menu from the winbox..
Firewall.jpg
this does not look right to me. for one 10-15 show nothing. and the values seem low. (concidering i’ve been downloading misc window service packs today)

PCC does not simply multiply the bandwidth of the circuits by the number of circuits. For that you need bonding, which requires the ISP to set things up on their end.

Hums, it didn’t require bonding on the Linksys RV082, and the RV042, as they both are able to do it ((dont ask me how, as i dont know)) I just know that going to speedtest.net, i was able to retunly get 10mbs down and 1.3mbps up (with 2 6mb/768k dsl lines) and it seemed to work on downloads as well.

You then, for the purpose of balancing circuit load, use those connection marks to enforce the connection being routed out a specific interface and across a specific circuit. Because this is done by connection this will only approximate being equally spread over many connections. If you only have four connections going through the router and one is using 5mbps and the other three are 10kbps then you’re not going to see equal spreading of loads. both-addresses-and-ports should, however, equalize load fairly nicely and quickly.

That’s what i was thinking it would do, but looking at it, it doens’t seem to be doing that. we have all our clients throttled between 384 and 1m (at the radio) so we should (i thought) be seeing a very resonable spread over the 4 connections.

That screenshot isn’t showing these rules:

add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/0 \
action=mark-connection new-connection-mark=wan1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/1 \
action=mark-connection new-connection-mark=wan2_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/2 \
action=mark-connection new-connection-mark=wan3_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/3 \
action=mark-connection new-connection-mark=wan4_conn passthrough=yes
add chain=prerouting connection-mark=wan1_conn in-interface=Local action=mark-routing new-routing-mark=to_wan1
add chain=prerouting connection-mark=wan2_conn in-interface=Local action=mark-routing new-routing-mark=to_wan2
add chain=prerouting connection-mark=wan3_conn in-interface=Local action=mark-routing new-routing-mark=to_wan3
add chain=prerouting connection-mark=wan4_conn in-interface=Local action=mark-routing new-routing-mark=to_wan4

Why not?

I do not know. Was those lines not in the cfg i posted earlier? could that be my problem?
putty ip firewall mangle.jpg
here is what it says when i connect via ssh and do a ip firewall mangle print so they are there, just not showing up?

They don’t show in that either. The rules I said weren’t there are in the pre-routing chain, not in input or output (which is all that I can see in your CLI and GUI screenshots).

It looks like those lines aren’t in your configuration. Paste them in. Those lines are the ones that do the actual load balancing.

where do i put those in at?
/ip firewall mangle ?

and another newbish question.. paste those in “as is” or do i need to change the !local in-interface to match my local interface? (in my case ether1)

Yes, they go into the firewall mangle section. And yes, you must edit them so that the in-interface name matches the name of the LAN interface on your router.

If it helps at all, i got my PCC rules wrong two days ago.

I understand it very very well, but i still made a mistake.

Amazingly nobody complained until today.

Ahh! i see now why my config didn’t work all the way… the post where i got it for 3 lines wasn’t documented very well so I dind’t know I had to change the =local…


Thanks!!

dboillot, Can you post your final and working configuration?
I’ve been gathering some information lately to do the same thing as you by load balancing 4 Cable Internet connections on an RB800.

Any help would be great, Thanks.

My LAN connection is called ether1, with the pppoe connections the default they come up with (pppoe-out1, pppoe-out2, pppoe-out3, pppoe-out4)

/ ip firewall mangle
add chain=input in-interface=pppoe-out1 action=mark-connection new-connection-mark=wan1_conn
add chain=input in-interface=pppoe-out2 action=mark-connection new-connection-mark=wan2_conn
add chain=input in-interface=pppoe-out3 action=mark-connection new-connection-mark=wan3_conn
add chain=input in-interface=pppoe-out4 action=mark-connection new-connection-mark=wan4_conn


add chain=output connection-mark=wan1_conn action=mark-routing new-routing-mark=to_wan1 
add chain=output connection-mark=wan2_conn action=mark-routing new-routing-mark=to_wan2
add chain=output connection-mark=wan3_conn action=mark-routing new-routing-mark=to_wan3
add chain=output connection-mark=wan4_conn action=mark-routing new-routing-mark=to_wan4



add chain=prerouting dst-address-type=!local in-interface=ether1 per-connection-classifier=both-addresses-and-ports:4/0 \
action=mark-connection new-connection-mark=wan1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=ether1 per-connection-classifier=both-addresses-and-ports:4/1 \
action=mark-connection new-connection-mark=wan2_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=ether1 per-connection-classifier=both-addresses-and-ports:4/2 \
action=mark-connection new-connection-mark=wan3_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=ether1 per-connection-classifier=both-addresses-and-ports:4/3 \
action=mark-connection new-connection-mark=wan4_conn passthrough=yes

add chain=prerouting connection-mark=wan1_conn in-interface=ether1 action=mark-routing new-routing-mark=to_wan1
add chain=prerouting connection-mark=wan2_conn in-interface=ether1 action=mark-routing new-routing-mark=to_wan2
add chain=prerouting connection-mark=wan3_conn in-interface=ether1 action=mark-routing new-routing-mark=to_wan3
add chain=prerouting connection-mark=wan4_conn in-interface=ether1 action=mark-routing new-routing-mark=to_wan4

/ ip route
add dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_wan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_wan2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_wan3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out4 routing-mark=to_wan4 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out2 distance=2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out3 distance=3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out4 distance=3 check-gateway=ping

/ ip firewall nat 
add chain=srcnat out-interface=pppoe-out1 action=masquerade
add chain=srcnat out-interface=pppoe-out2 action=masquerade
add chain=srcnat out-interface=pppoe-out3 action=masquerade
add chain=srcnat out-interface=pppoe-out4 action=masquerade