Friday, December 01, 2023

Re: pf queues

On Fri, 1 Dec 2023 04:56:40 +0300
4 <babut@yandex.ru> wrote:

> match proto icmp set prio(6 7) queue(6-fly 7-ack)
> how is this supposed to work at all? i.e. packets are placed both in
> prio's queues 6/7(in theory priorities and queues are the same
> thing), and in hsfc's queues 6-fly/7-ack at once?

I am not sure I understand what you don't understand here.

Straight from manpage:
https://man.openbsd.org/pf.conf#set~2

If two priorities are given, TCP ACKs with no data payload and packets
which have a TOS of lowdelay will be assigned to the second one.

https://man.openbsd.org/pf.conf#set~3

If two queues are given, packets which have a TOS of lowdelay and TCP
ACKs with no data payload will be assigned to the second one.

ICMP is not the best example, but syntax works. I guess the rule you
quoted results in behaviour where all the ICMP packets get priority of
6 and get assigned to queue 6-fly, even though the idea was to have
requests with priority of 6 assigned to queue 6-fly, and replies with
priority of 7 to queue 7-ack. But then again perhaps it works the
latter way, if icmp replies have TOS of lowdelay.

If this was TCP, payload would get priority of 6 and assigned to queue
6-fly, while ACKs would get priority of 7 and assigned to queue 7-ack.

Anyway, after years of usage, and lot of frustration in the beginning, I
find current approach more flexible, because in HFSC queue and priority
have to be the same, while in current pf we can set it to be exactly
like HFSC, but also to have different priorities within the same queue,
or different queue for same priority. At this point I only miss the
ability to see prio values somewhere in monitoring tools like systat.

The only way to get the answers is to test, write ruleset wisely, and
observe systat. If someone knows of some others please let me know, I
am by no means "an expert on pf queueing", just a guy who tries to tame
his employer's network for quite some time now.

Regards,

--
Before enlightenment - chop wood, draw water.
After enlightenment - chop wood, draw water.

Marko Cupać
https://www.mimar.rs/

No comments:

Post a Comment