Upgrade ncurses. 1/2
[dragonfly.git] / share / examples / pf / ackpri
1 # $OpenBSD: ackpri,v 1.2 2003/03/10 14:24:33 henning Exp $
2 # $DragonFly: src/share/examples/pf/ackpri,v 1.1 2005/12/13 01:58:27 corecode Exp $
3
4 # Use a simple priority queue to prioritize empty (no payload) TCP ACKs,
5 # which dramatically improves throughput on (asymmetric) links when the
6 # reverse direction is saturated. The empty ACKs use an insignificant
7 # part of the bandwidth, but if they get delayed, downloads suffer
8 # badly, so prioritize them.
9
10 # Example: 512/128 kbps ADSL. Download is 50 kB/s. When a concurrent
11 # upload saturates the uplink, download drops to 7 kB/s. With the
12 # priority queue below, download drops only to 48 kB/s.
13
14 # Replace lo0 with your real external interface
15
16 ext_if="lo0"
17
18 # For a 512/128 kbps ADSL with PPPoE link, using "bandwidth 100Kb"
19 # is optimal. Some experimentation might be needed to find the best
20 # value. If it's set too high, the priority queue is not effective, and
21 # if it's set too low, the available bandwidth is not fully used.
22 # A good starting point would be real_uplink_bandwidth * 90 / 100.
23
24 altq on $ext_if priq bandwidth 100Kb queue { q_pri, q_def }
25 queue q_pri priority 7
26 queue q_def priority 1 priq(default)
27
28 pass out on $ext_if proto tcp from $ext_if to any flags S/SA \
29         keep state queue (q_def, q_pri)
30
31 pass in  on $ext_if proto tcp from any to $ext_if flags S/SA \
32         keep state queue (q_def, q_pri)
33