PF Do priority levels scale in PF?

Wasn't sure how to phrase the topic question. What I'm wondering is if the priority flag is used for rules, is it just a matter of which packets have the higher priority, or does it get *more* prioritized at higher priority levels?

Like for instance, if I have some traffic at the default priority 3, but I want some other sort of traffic to be higher priority. Relative to the priority 3 traffic, is the prioritization exactly the same whether it is priority 4 or priority 7? Or would it get more and more prioritized the higher the number I set?
 
from man pf https://man.freebsd.org/cgi/man.cgi?pf.conf :
set-tos <string> | <number>
Enforces a TOS for matching IP packets. TOS may be given as one
of critical, inetcontrol, lowdelay, netcontrol, throughput,
reliability, or one of the DiffServ Code Points: ef, va, af11 ...
af43, cs0 ... cs7; or as either hex or decimal.
and
tos <string> | <number>
This rule applies to packets with the specified TOS bits set.
TOS may be given as one of critical, inetcontrol, lowdelay,
netcontrol, throughput, reliability, or one of the DiffServ Code
Points: ef, va, af11 ... af43, cs0 ... cs7; or as either hex or
decimal.

For example, the following rules are identical:

pass all tos lowdelay
pass all tos 0x10
pass all tos 16
So, we can mark a packets. For example,
pass in proto tcp to port 22 set-tos critical
or place a rule towards priority
pass in quick inet proto udp from $vlan77 tos 0xB8

PS. You should understand, that all other network equipment may not follow a priority for packets towards their flags. It can works only within a router with priority rules.
 
It can works only within a router with priority rules.
This is important. These bits can be set in a packet, but are often ignored. At best I think they are advisory: "this bit means route along a low latency path, so do the best you can"
 
Back
Top