1.\" 2.\" Copyright (c) 2004 Max Laier <mlaier@FreeBSD.org> 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.Dd January 21, 2024 27.Dt ALTQ 4 28.Os 29.Sh NAME 30.Nm ALTQ 31.Nd "alternate queuing of network packets" 32.Sh SYNOPSIS 33.Cd options ALTQ 34.Pp 35.Cd options ALTQ_CBQ 36.Cd options ALTQ_CODEL 37.Cd options ALTQ_RED 38.Cd options ALTQ_RIO 39.Cd options ALTQ_HFSC 40.Cd options ALTQ_CDNR 41.Cd options ALTQ_PRIQ 42.Cd options ALTQ_FAIRQ 43.Sh DESCRIPTION 44The 45.Nm 46system is a framework which provides several disciplines for queuing outgoing 47network packets. 48This is done by modifications to the interface packet queues. 49See 50.Xr altq 9 51for details. 52.Pp 53The user interface for 54.Nm 55is implemented by the 56.Xr pfctl 8 57utility, so please refer to the 58.Xr pfctl 8 59and the 60.Xr pf.conf 5 61man pages for a complete description of the 62.Nm 63capabilities and how to use it. 64.Ss Kernel Options 65The following options in the kernel configuration file are related to 66.Nm 67operation: 68.Pp 69.Bl -tag -width ".Dv ALTQ_DEBUG" -compact 70.It Dv ALTQ 71Enable 72.Nm . 73.It Dv ALTQ_CBQ 74Build the 75.Dq "Class Based Queuing" 76discipline. 77.It Dv ALTQ_CODEL 78Build the 79.Dq "Controlled Delay" 80discipline. 81.It Dv ALTQ_RED 82Build the 83.Dq "Random Early Detection" 84extension. 85.It Dv ALTQ_RIO 86Build 87.Dq "Random Early Drop" 88for input and output. 89.It Dv ALTQ_HFSC 90Build the 91.Dq "Hierarchical Packet Scheduler" 92discipline. 93.It Dv ALTQ_CDNR 94Build the traffic conditioner. 95This option is meaningless at the moment as the conditioner is not used by 96any of the available disciplines or consumers. 97.It Dv ALTQ_PRIQ 98Build the 99.Dq "Priority Queuing" 100discipline. 101.It Dv ALTQ_FAIRQ 102Build the 103.Dq "Fair Queuing" 104discipline. 105.It Dv ALTQ_NOPCC 106Required if the TSC is unusable. 107.It Dv ALTQ_DEBUG 108Enable additional debugging facilities. 109.El 110.Pp 111Note that 112.Nm Ns -disciplines 113cannot be loaded as kernel modules. 114In order to use a certain discipline you have to build it into a custom 115kernel. 116The 117.Xr pf 4 118interface, that is required for the configuration process of 119.Nm 120can be loaded as a module. 121.Sh SUPPORTED DEVICES 122The driver modifications described in 123.Xr altq 9 124are required to use a certain network card with 125.Nm . 126They have been applied to the following hardware drivers: 127.Xr ae 4 , 128.Xr age 4 , 129.Xr alc 4 , 130.Xr ale 4 , 131.Xr aue 4 , 132.Xr axe 4 , 133.Xr bce 4 , 134.Xr bfe 4 , 135.Xr bge 4 , 136.Xr bxe 4 , 137.Xr cas 4 , 138.Xr dc 4 , 139.Xr em 4 , 140.Xr epair 4 , 141.Xr et 4 , 142.Xr fxp 4 , 143.Xr gem 4 , 144.Xr igb 4 , 145.Xr ix 4 , 146.Xr jme 4 , 147.Xr le 4 , 148.Xr liquidio 4 , 149.Xr msk 4 , 150.Xr mxge 4 , 151.Xr my 4 , 152.Xr nfe 4 , 153.Xr nge 4 , 154.Xr qlxgb 4 , 155.Xr re 4 , 156.Xr rl 4 , 157.Xr sge 4 , 158.Xr sis 4 , 159.Xr sk 4 , 160.Xr ste 4 , 161.Xr stge 4 , 162.Xr ti 4 , 163.Xr udav 4 , 164.Xr vge 4 , 165.Xr vr 4 , 166.Xr vte 4 , 167and 168.Xr xl 4 . 169.Pp 170The 171.Xr tun 4 , 172.Xr if_bridge 4 , 173.Xr if_vlan 4 , 174and 175.Xr ng_iface 4 176pseudo drivers also do support 177.Nm . 178.Pp 179An example: 180.Bd -literal -offset indent 181altq on igb0 cbq queue { def aq } 182queue def bandwidth 90% cbq (default borrow) 183queue aq bandwidth 10Mb cbq 184 185pass in on igb0.10 proto udp all queue aq keep state 186.Ed 187.Sh SEE ALSO 188.Xr pf 4 , 189.Xr pf.conf 5 , 190.Xr ipfw 8 , 191.Xr pfctl 8 , 192.Xr altq 9 193.Sh HISTORY 194The 195.Nm 196system first appeared in March 1997 and found home in the KAME project 197(https://www.kame.net). 198It was imported to 199.Fx 200in 5.3 . 201