]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/examples/pf/ackpri
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / examples / pf / ackpri
1 # $FreeBSD$
2 # $OpenBSD: ackpri,v 1.3 2006/10/07 04:48:01 mcbride 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 queue (q_def, q_pri)
29
30 pass in  on $ext_if proto tcp from any to $ext_if queue (q_def, q_pri)
31