in mangle, mark only new conections

Hi all.
In my mangle chain, I use a list of rule like this:

#I mark the connection
add action=mark-connection chain=forward new-connection-mark=P2P-CONN p2p=all-p2p passthrough=yes
#I mark packets for the connection
add action=mark-packet chain=forward connection-mark=P2P-CONN new-packet-mark=P2P passthrough=no

Is it better, in the first rule, mark only NEW connection (i.e. adding connection-state=new) ?

If is the same this is true also for udp connections ?

Thanks.

actually, in general ‘p2p’ matcher catches connections not from the first packet, so ‘connection-state=established’ may be caught too

by the way, you may split your rule into two rules (with connection-state=new and connection-state=established) and see, how many packets will be caught by each one

clear, thanks

i made this one and it could help a little limit for p2p user :smiley:
and you can adjust in pcq-rate
in mangle

/ip firewall mangle
add action=mark-connection chain=prerouting comment=P2P disabled=yes new-connection-mark=
small-connection p2p=all-p2p passthrough=yes
add action=mark-packet chain=prerouting comment=“” connection-mark=small-connection disabled=yes
new-packet-mark=small-packet passthrough=yes

in queue

add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s comment=“” direction=both disabled=no
dst-address=0.0.0.0/0 interface=all limit-at=0/0 max-limit=0/0 name=small-queue packet-marks=
small-packet parent=none priority=8 queue=small-type/small-type total-queue=default-small

in queue type

add kind=pcq name=small-type pcq-classifier=dst-address pcq-limit=50 pcq-rate=256k pcq-total-limit=
2000