Community discussions

MikroTik App
 
jfdumont
just joined
Topic Author
Posts: 13
Joined: Sat Apr 20, 2013 5:42 pm

PCC Rules and Multi wan

Mon Apr 22, 2013 6:09 pm

From what I understood PCC is that it is a modulo of some fields (source IP, source port ...) of the packet header. And based on the result for the connection will be tagged to see a different routing on WAN
Consider that we have 4 WAN
to a load balancing rules there will be 4 CPC for example
per-connection-classifier = src-address-and-Ports: 4/0 new-connection-mark = W01
per-connection-classifier = src-address-and port 4/1 new-connection-mark = W02
per-connection-classifier = src-address-and port 4/2 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 4/3 new-connection-mark = W04


We can say with great traffic connections will be divided into equal shares between 4 wans

But if we have ADSL that does not have the same rate
by exemple
WAN 1 = 1000kbs
WAN 2 = 1000kbs
WAN 3 = 1000kbs
WAN 4 = 2000kbs

I read a lot of script they proposed a fair type marking
per-connection-classifier = src-address-and-Ports: 4/0 new-connection-mark = W01
per-connection-classifier = src-address-and port 4/1 new-connection-mark = W02
per-connection-classifier = src-address-and port 4/2 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 4/3 new-connection-mark = W04
per-connection-classifier = src-address-and-Port: 4/4 new-connection-mark = W04

but tell me if I'm wrong but a number modulo 4 is never equal to 4 ?
a number modulo 4 may result 0 or 1 or 2 or 3

if you want to make a correct balacing, I have to do ?:
per-connection-classifier = src-address-and-Port: 5/0 new-connection-mark = W01
per-connection-classifier = src-address-and port 5/1 new-connection-mark = W02
per-connection-classifier = src-address-and port 5/2 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 5/3 new-connection-mark = W04
per-connection-classifier = src-address-and-Port: 5/4 new-connection-mark = W04


Now if I have the following rates
WAN 1 = 1000kbs
WAN 2 = 1000kbs
WAN 3 = 2000kbs
WAN 4 = 2000kbs

I must:

per-connection-classifier = src-address-and-ports: 6/0 new-connection-mark = W01
per-connection-classifier = src-address-and port : 6/1 new-connection-mark = W02
per-connection-classifier = src-address-and port : 6/2 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/3 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04

is that correct?

Now if I want to make fairly accurate setting with different completions WAN speeds I should create a lot of PCC rules.

I want to know what can cause a lot of PCC rules on the performance of the router.
I wonder if the modulo is recalculated for each PCC rule


Or is there a better solution to make load balancing depends of WAN Rate

Thank you for your answers.
 
User avatar
Egate
Long time Member
Long time Member
Posts: 554
Joined: Thu May 15, 2008 10:43 am
Location: South Africa

Re: PCC Rules and Multi wan

Wed Apr 24, 2013 8:59 am

per-connection-classifier = src-address-and-ports: 6/0 new-connection-mark = W01
per-connection-classifier = src-address-and port : 6/1 new-connection-mark = W02
per-connection-classifier = src-address-and port : 6/2 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/3 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04
No, would be
per-connection-classifier = src-address-and-ports: 6/0 new-connection-mark = W01
per-connection-classifier = src-address-and port : 6/1 new-connection-mark = W02
per-connection-classifier = src-address-and port : 6/2 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/3 new-connection-mark = W04
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W05
per-connection-classifier = src-address-and-Port: 6/5 new-connection-mark = W06
The deferens will be in the routing rule where u use the connection mark W03 and W04 twice for WAN 3 and W04 and W05 twice for WAN 4.
 
jfdumont
just joined
Topic Author
Posts: 13
Joined: Sat Apr 20, 2013 5:42 pm

Re: PCC Rules and Multi wan

Wed Apr 24, 2013 11:29 am

Hello

thank you for your answer
You tell me that it is in the mark-routing i have to rebalance the rates.

But in this case there will be more rules that if i use new-connection-mark.

In the case :
WAN 1 = 1000kbs
WAN 2 = 1000kbs
WAN 3 = 2000kbs
WAN 4 = 2000kbs

with using mark-routing as you say
I will have 6 rules with new-connection-mark

per-connection-classifier = src-address-and-Port: 6/0 new-connection-mark = W01
...
per-connection-classifier = src-address-and-Port: 6/5 new-connection-mark = W06

and then 6 rules with new-routing-mark
action=mark-routing chain=output connection-mark=W01 new-routing-mark=rout01-mark
action=mark-routing chain=output connection-mark=W02 new-routing-mark=rout02-mark
action=mark-routing chain=output connection-mark=W03 new-routing-mark=rout03-mark
action=mark-routing chain=output connection-mark=W04 new-routing-mark=rout03-mark
action=mark-routing chain=output connection-mark=W05 new-routing-mark=rout04-mark
action=mark-routing chain=output connection-mark=W06 new-routing-mark=rout04-mark


if i use only new-connection-mark.
i will have 6 rules with new-routing-mark
per-connection-classifier = src-address-and-ports: 6/0 new-connection-mark = W01
per-connection-classifier = src-address-and port : 6/1 new-connection-mark = W02
per-connection-classifier = src-address-and port : 6/2 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/3 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04

and 4 with routing-mark

action=mark-routing chain=output connection-mark=W01 new-routing-mark=rout01-mark
action=mark-routing chain=output connection-mark=W02 new-routing-mark=rout02-mark
action=mark-routing chain=output connection-mark=W03 new-routing-mark=rout03-mark
action=mark-routing chain=output connection-mark=W04 new-routing-mark=rout04-mark


Is my solution wrong ?


Another issue.

I thing it's better to mark dst-address-and-Port to make balancing.
But we know that it will break some https sessions

the only way to not break is to mark using src-address only.

Can we do first
per-connection-classifier = src-address
for https session

somthing like :
action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface=ether1-master protocol=tcp dst-port=443 new-connection-mark=\
W02 per-connection-classifier=src-address :2/1

and then

action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface=ether1-master new-connection-mark=W02 per-connection-classifier=dst-address-and-port :2/1


I always try to find out how impact performance lots of PCC rules
and if is there a better solution to make load balancing depends of WAN Rate

Regards
 
User avatar
Egate
Long time Member
Long time Member
Posts: 554
Joined: Thu May 15, 2008 10:43 am
Location: South Africa

Re: PCC Rules and Multi wan

Wed Apr 24, 2013 2:22 pm

if i use only new-connection-mark.
i will have 6 rules with new-routing-mark
per-connection-classifier = src-address-and-ports: 6/0 new-connection-mark = W01
per-connection-classifier = src-address-and port : 6/1 new-connection-mark = W02
per-connection-classifier = src-address-and port : 6/2 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/3 new-connection-mark = W03
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04

and 4 with routing-mark

action=mark-routing chain=output connection-mark=W01 new-routing-mark=rout01-mark
action=mark-routing chain=output connection-mark=W02 new-routing-mark=rout02-mark
action=mark-routing chain=output connection-mark=W03 new-routing-mark=rout03-mark
action=mark-routing chain=output connection-mark=W04 new-routing-mark=rout04-mark
Will function correct.
Last
per-connection-classifier = src-address-and-Port: 6/4 new-connection-mark = W04
should be
per-connection-classifier = src-address-and-Port: 6/5 new-connection-mark = W04
src-address Is the easy way to go, every thing function any other way and lots of sites and games break. Only other way is to first do src-address of connections that needs same src ip and then do rest of data with other methode. Lots of rules, but possible.
 
jfdumont
just joined
Topic Author
Posts: 13
Joined: Sat Apr 20, 2013 5:42 pm

Re: PCC Rules and Multi wan

Wed Apr 24, 2013 3:19 pm

Hello Egate


Yes I saw that there was an error with the 2 last line and its

6/4 to wan 4
6/5 to wan 4

thanks for your answers

regards

Who is online

Users browsing this forum: Ahrefs [Bot], DenisPDA, settecplus and 202 guests