Community discussions

MikroTik App
 
msatter
Forum Guru
Forum Guru
Topic Author
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Using PCC more efficient

Wed Aug 30, 2023 10:12 pm

I see often PCC being defined for every part that should be separated. I see the following lines for example 25% for one gateway and 75% for the second gateway.

Then I see these kind of PCC rules:

PCC line 1: pcc 4/0 ==> connection mark gateway-25 if not already connection marked
PCC line 2: pcc 4/1 ==> connection mark gateway-75 if not already connection marked
PCC line 3: pcc 4/2 ==> connection mark gateway-75 if not already connection marked
PCC line 4: pcc 4/3 ==> connection mark gateway-75 if not already connection marked

Connections now gets split in one part for gateway-25 and three parts for gateway-75 making in total 100%

In fact splitting the connections in two parts. One of 25% and one of 75%. If you want to have a 75% part then you can subtract 25% from 100% and you are left with 75%.

Why not apply that that also to PCC? The lines will be then like this and the strike-trough lines can be omitted in the final version of course.

PCC line 1: pcc 4/0 ==> connection mark gateway-25 if not already connection marked
PCC line 2: pcc 4/1 ==> connection mark gateway-75 if not already connection marked
PCC line 3: pcc 4/2 ==> connection mark gateway-75 if not already connection marked
PCC line 3: pcc 4/3 ==> connection mark gateway-75 if not already connection marked
Traffic not already connection marked ==> gateway-75

You are now having the same result by replacing three lines by one line. That line marks the traffic not yet marked by the pcc 4/0 line which is the remainder of 75%.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19409
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Using PCC more efficient

Wed Aug 30, 2023 10:50 pm

I will bite, so where will that 75% of traffic get routed then?? If not assigned to specific WAN, (lets say there are three) ?????
Even if there are two gateways, you haven't funnelled that traffic to gateway75, it still may go to gateway 25.
It will depend, I think, what you have setup on the main table, (aka distance for example).......

Edit: After the post below, clued-in, the non-marked traffic does get routed............ So yes very nice!
Last edited by anav on Thu Aug 31, 2023 6:05 pm, edited 1 time in total.
 
User avatar
arnaldo
newbie
Posts: 45
Joined: Wed Sep 21, 2016 2:38 am
Location: localhost.localdomain

Re: Using PCC more efficient

Thu Aug 31, 2023 5:02 pm

The concept is great!
But there is an error in the post (probably resulting from cut-paste) is that the second example still has PCC lines 2 to 4.

so the correct rules would be (assumes that all packets start as not conn-marked):

PCC 4/0 ===> connection mark gateway-25
if not marked ==> connection mark to gateway-75

This is very interesting, specially with ratios that require several rules, like 3:7. Instead of 10 rules, one can use just 4, a 60% improvement. Nice!
 
msatter
Forum Guru
Forum Guru
Topic Author
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: Using PCC more efficient

Thu Aug 31, 2023 10:32 pm

The concept is great!
But there is an error in the post (probably resulting from cut-paste) is that the second example still has PCC lines 2 to 4.

so the correct rules would be (assumes that all packets start as not conn-marked):

PCC 4/0 ===> connection mark gateway-25
if not marked ==> connection mark to gateway-75

This is very interesting, specially with ratios that require several rules, like 3:7. Instead of 10 rules, one can use just 4, a 60% improvement. Nice!
Those lines are left there on purpose to show what can be made obsolete. I did write that also in my post.

"The lines will be then like this and the strike-trough lines can be omitted in the final version of course."
 
kashifmax
newbie
Posts: 37
Joined: Mon Feb 22, 2016 9:53 pm

Re: Using PCC more efficient

Sun Sep 10, 2023 1:42 pm

The concept is great!
But there is an error in the post (probably resulting from cut-paste) is that the second example still has PCC lines 2 to 4.

so the correct rules would be (assumes that all packets start as not conn-marked):

PCC 4/0 ===> connection mark gateway-25
if not marked ==> connection mark to gateway-75

This is very interesting, specially with ratios that require several rules, like 3:7. Instead of 10 rules, one can use just 4, a 60% improvement. Nice!
Those lines are left there on purpose to show what can be made obsolete. I did write that also in my post.

"The lines will be then like this and the strike-trough lines can be omitted in the final version of course."
Hi,
Thanks for the tip so how to convert this as per yours
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=ether5_lan new-connection-mark=wan1_conn passthrough=yes per-connection-classifier=both-addresses-port:3/0

add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=ether5_lan new-connection-mark=wan2_conn passthrough=yes per-connection-classifier=both-addresses-port:3/1

add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=ether5_lan new-connection-mark=wan3_conn passthrough=yes per-connection-classifier=both-addresses-port:3/2
And I think no need if 2 WAN lines.

Thank you

Who is online

Users browsing this forum: No registered users and 36 guests