Re: Bidirectional queueing in post-ALTQ era

Charleroi Vogt <[email protected]> Wed, 03 Feb 2016 07:54:29 -0500
Newsgroups gmane.os.openbsd.pf
Message-ID <[email protected]>
------=_Part_934_1776457359.1454504069946
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Thank you for the reply!  A question related to the last part...



---- On Wed, 03 Feb 2016 05:36:31 -0500 Stuart Henderson &lt;[email protected]&gt;wrote ---- 




On 2016/02/03 00:26, Charleroi Vogt wrote: 



&gt; 2) If the desired inbound queue classification doesn't line up 1-to-1 

&gt; with the outbound classification, then can making the state policy 

&gt; if-bound be used? E.g., 

&gt; 

&gt; # queue and macro definitions not shown 

&gt; # trivial illustrative example only, no real filtering/classification 

&gt; shown 

&gt; set state-policy if-bound 

&gt; pass in on $int_if no state 

&gt; pass out on $ext_if keep state set queue some_outbound_queue 

&gt; pass out on $int_if keep state set queue an_inbound_queue 

&gt; 

&gt; If this makes sense, I presume once the state entry on $int_if is 

&gt; created by the session return packets flowing in the direction of the 

&gt; internal network(s), that subsequent outbound packets belonging to the 

&gt; same session will match the state entry as they cross $int_if despite 

&gt; the first rule indicating "no state"? 

 

PF normally does TCP sequence number tracking. With non-ancient 

clients this can only be done if a state was created with knowledge 

of wscale from the SYN which I think will be lost with your if-bound 

states; if you run into problems with connections stalling then 

consider whether using "sloppy" might be acceptable. 




If this is a typical NAT gateway type setup without general traffic being allowed inbound unless it's part of a TCP connection initiated from the inbound side, since the ext_if makes its state entry based on the connection initiation, then only the last line would need the sloppy state tracking, correct?  I.e.,



pass out on $int_if keep state sloppy set queue an_inbound_queue



The pass out on $ext_if should work, for that use-case as is, shouldn't it?





------=_Part_934_1776457359.1454504069946
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'><div>Thank you for the reply!&nbsp; A question related to the last part...<br></div><div><br></div><div class="zmail_extra"><div id="1"><div>---- On Wed, 03 Feb 2016 05:36:31 -0500 <b>Stuart Henderson &lt;[email protected]&gt;</b>wrote ---- <br></div></div><div><br></div><blockquote style="border-left: 1px solid #cccccc; padding-left: 6px; margin:0 0 0 5px"><div>On 2016/02/03 00:26, Charleroi Vogt wrote:
<br></div><div><br></div><div>&gt; 2) If the desired inbound queue classification doesn't line up 1-to-1
<br></div><div>&gt; with the outbound classification, then can making the state policy
<br></div><div>&gt; if-bound be used?  E.g.,
<br></div><div>&gt; 
<br></div><div>&gt; # queue and macro definitions not shown
<br></div><div>&gt; # trivial illustrative example only, no real filtering/classification
<br></div><div>&gt; shown
<br></div><div>&gt; set state-policy if-bound
<br></div><div>&gt; pass in on $int_if no state
<br></div><div>&gt; pass out on $ext_if keep state set queue some_outbound_queue
<br></div><div>&gt; pass out on $int_if keep state set queue an_inbound_queue
<br></div><div>&gt; 
<br></div><div>&gt; If this makes sense, I presume once the state entry on $int_if is
<br></div><div>&gt; created by the session return packets flowing in the direction of the
<br></div><div>&gt; internal network(s), that subsequent outbound packets belonging to the
<br></div><div>&gt; same session will match the state entry as they cross $int_if despite
<br></div><div>&gt; the first rule indicating "no state"?
<br></div><div>
<br></div><div>PF normally does TCP sequence number tracking. With non-ancient
<br></div><div>clients this can only be done if a state was created with knowledge
<br></div><div>of wscale from the SYN which I think will be lost with your if-bound
<br></div><div>states; if you run into problems with connections stalling then
<br></div><div>consider whether using "sloppy" might be acceptable.
<br></div></blockquote></div><div><br></div><div>If this is a typical NAT gateway type setup without general traffic being allowed inbound unless it's part of a TCP connection initiated from the inbound side, since the ext_if makes its state entry based on the connection initiation, then only the last line would need the sloppy state tracking, correct?&nbsp; I.e.,<br></div><div><br></div><div>pass out on $int_if keep state sloppy set queue an_inbound_queue<br></div><div><br></div><div>The pass out on $ext_if should work, for that use-case as is, shouldn't it?<br></div><div><br></div></div></body></html>
------=_Part_934_1776457359.1454504069946--