I copy-paste here an explanation from another topics:
The point is that the connection-tracker part of the firewall keeps note on packets in both directions which belong to the same communication flow between a client and a server - a connection. The recognized types of connections are a TCP session (where the connection is directly equivalent to the session), a UDP flow (where swapped source and destination addresses and ports identify packets belogning to the opposite direction), or an ICMP echo request/response flow (where the combination of source and destination addresses along with ICMP ID field discriminates one ICMP connection from another).
Now if you use an action=mark-connection rule to assign a connection-mark to one packet belonging to a connection, the connection tracker remembers that and all subsequent packets identified to belong to that connection, regardless their direction, get the same connection-mark automatically. So in other rules, you can match packet against that connection-mark and take specific action (like assignment of routing-mark which is, unlike the connection-mark, only valid for the actual packet to which it has been assigned).
So by assigning a connection-mark once, to a newly initiated connection, you note down for that connection which WAN its packets should use; to actually force them to a different path that the default routing table would choose for them, you must translate the connection-mark to a routing-mark for every single packet of such connection which you route out. For these connections, you must disable fasttracking because fasttracking skips mangle rules, so the routing-mark would be assigned only to the first packet of that connection but not to the subsequent ones.
So the rules in chain=input which assign a connection-mark depending on in-interface, together with the rules in chain=output which translate that connection-mark to a routing-mark which makes the routing route the response packets of that connection out via the same interface through which the requests come in, make sure that the local services of the 'Tik are available at both its WAN IP addresses.
The per-connection-classifier itself can be used anywhere, but it only makes sense to use it to choose the WAN interface for connections initiated by devices on Mikrotik’s LAN, because the amount of connections initiated by Mikrotik itself is negligible and because the choice of WAN for connections initiated from outside is done by the remote client so the PCC cannot override it - the response must come from the same IP to which the request has arrived, that’s how internet transport protocols work in most cases.
So the PCC doesn’t actually distribute bandwidth occupation between the WANs, but distributes the sessions initiated from LAN side. There is no way to determine in advance what will be the bandwidth occupied by these sessions and whether they will be used mostly for upload, mostly for download or symmetrically, so there is no load distribution mechanism which could distribute the sessions among the WANs to optimize bandwidth occupation on both. So we rely on statistics and expect that if there are enough sessions, the average bandwidth occupation will be distributed between the WANs in the same ratio like the sessions were distributed.
You’ve provided no details, but connection-mark=no-mark is used to prevent rewriting already assigned connection-marks. While the per-connection-classifier matches all packets of a given direction of a given connection (because all these packets have the same source and destination address and port), other match conditions may give a different result. Or you want to exclude some connections from the PCC handling, but as you have to set passthrough=yes so that the packets just assigned a connection-mark would get also the routing-mark, you must prevent the PCC rules from assigning another connection-mark to packets which have already been connection-marked by some previous rule.
Order of rules matters only within each chain. See this picture to understand which phase of packet processing each of the chains actually covers.
I didn’t get what you are talking about. What is ppoe section?
It’s like in “mix one share of the powder with four shares of water”. Regardless whether the share is a teaspoon, a cup or a barrel, the ratio (by volume in this case) of the components remains the same. So the 5 is the sum of the shares. It would even be possible but hardly practical to use 100 rules with values from 100/0 to 100/99 to express the distribution in percent, so if you use 8/0..8/5 for Shatel and 8/6..8/7 for systec, you may as well use just 4/0 to 4/2 for Shatel and 4/3 for systec and the result will be exactly the same: 3/4 of the sessions will go to Shatel and 1/4 to systec.