Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > comp.unix.bsd.openbsd.misc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-02-2008, 05:03 AM
boisvert.ian@gmail.com
 
Posts: n/a
Default Question about TCP ACK queuing in PF

I have a newbie question about the PF packet queueing example in the
OpenBSD PF FAQ.

The example shows that if you want to queue TCP ACK packets you should
use a rule like:
pass in on fxp0 proto tcp from any to any port 22 flags S/SA keep
state queue ssh

I'm a little confused by this, though, because according to the packet
filtering section of the FAQ, this will match SYN packets and not ACK
packets.

Could someone clear this up for me?

Thanks.
Ian.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-02-2008, 05:04 AM
Joachim Schipper
 
Posts: n/a
Default Re: Question about TCP ACK queuing in PF

boisvert.ian@gmail.com wrote:
> I have a newbie question about the PF packet queueing example in the
> OpenBSD PF FAQ.
>
> The example shows that if you want to queue TCP ACK packets you should
> use a rule like:
> pass in on fxp0 proto tcp from any to any port 22 flags S/SA keep
> state queue ssh
>
> I'm a little confused by this, though, because according to the packet
> filtering section of the FAQ, this will match SYN packets and not ACK
> packets.
>
> Could someone clear this up for me?


I can see why you'd think that, but I don't think the FAQ intends to say
that. Prioritizing ACK is somewhat useful, and assigning traffic to
queues using states is the way to go, but that particular command isn't
really related to ACK.

In short, you're completely right.

Joachim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-05-2008, 05:50 AM
boisvert.ian@gmail.com
 
Posts: n/a
Default Re: Question about TCP ACK queuing in PF

Joachim, thanks very much for your reply.

I reread the section in the FAQ, and I think you are right--it doesn't
intend to say what I had thought it said...

If one wanted to prioritize ACK packets, though, would the following
be on the right track?

pass out on fxp0 proto tcp from any to any flags A/SA keep state queue
higher_priority

Thanks.
Ian.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-05-2008, 05:50 AM
Joachim Schipper
 
Posts: n/a
Default Re: Question about TCP ACK queuing in PF

boisvert.ian@gmail.com wrote:
> If one wanted to prioritize ACK packets, though, would the following
> be on the right track?
>
> pass out on fxp0 proto tcp from any to any flags A/SA keep state queue
> higher_priority


That should work. (Should - I haven't tried this recently.)

Joachim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-07-2008, 10:14 AM
Stefan Zill
 
Posts: n/a
Default Re: Question about TCP ACK queuing in PF

<boisvert.ian@gmail.com> wrote:
> The example shows that if you want to queue TCP ACK packets you should
> use a rule like:
> pass in on fxp0 proto tcp from any to any port 22 flags S/SA keep
> state queue ssh
>
> I'm a little confused by this, though, because according to the packet
> filtering section of the FAQ, this will match SYN packets and not ACK
> packets.


This rule creates a state due to "keep state" and matches the following
ACK-packets to the state, not to a rule. The state "knows" which queue its
packets belong to. There can be two different queues a state assigns its
packets to. The first queue is used for bulk traffic, the other for packets
with TOS bit for low delay set and empty ACK packets.

pass in on fxp0 proto tcp from any to any port 22 flags S/SA keep state
queue (bulk, lowdelay)

This rule would assign traffic to two different queues, empty ACKs and low
delay packets to "lowdelay" and the rest to "bulk". Yet, interactive ssh
connections usually have the low delay bit set, so all traffic would be
assigned to the "lowdelay" queue. sftp-connections would be distributed on
the two queues, since low delay is not set there.

Your next question regarding "flags A/SA": I'd advise against creating a
state for a tcp-connection in the middle of that connection. Several
parameters are negotiated during the S/SA SA/SA phase. It should simply not
work reliably. Furthermore if you already have a "flags S/SA keep state"
rule, no valid packets could arrive at your A/SA rule.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:04 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62