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 November 10, 2022 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 an 4 , 132.Xr aue 4 , 133.Xr axe 4 , 134.Xr bce 4 , 135.Xr bfe 4 , 136.Xr bge 4 , 137.Xr bxe 4 , 138.Xr cas 4 , 139.Xr dc 4 , 140.Xr em 4 , 141.Xr epair 4 , 142.Xr et 4 , 143.Xr fxp 4 , 144.Xr gem 4 , 145.Xr igb 4 , 146.Xr ixgbe 4 , 147.Xr jme 4 , 148.Xr le 4 , 149.Xr liquidio 4 , 150.Xr msk 4 , 151.Xr mxge 4 , 152.Xr my 4 , 153.Xr nfe 4 , 154.Xr nge 4 , 155.Xr npe 4 , 156.Xr qlxgb 4 , 157.Xr re 4 , 158.Xr rl 4 , 159.Xr sge 4 , 160.Xr sis 4 , 161.Xr sk 4 , 162.Xr ste 4 , 163.Xr stge 4 , 164.Xr ti 4 , 165.Xr udav 4 , 166.Xr vge 4 , 167.Xr vr 4 , 168.Xr vte 4 , 169and 170.Xr xl 4 . 171.Pp 172The 173.Xr tun 4 , 174.Xr if_bridge 4 , 175.Xr if_vlan 4 , 176and 177.Xr ng_iface 4 178pseudo drivers also do support 179.Nm . 180.Pp 181An example: 182.Bd -literal -offset indent 183altq on igb0 cbq queue { def aq } 184queue def bandwidth 90% cbq (default borrow) 185queue aq bandwidth 10Mb cbq 186 187pass in on igb0.10 proto udp all queue aq keep state 188.Ed 189.Sh SEE ALSO 190.Xr pf 4 , 191.Xr pf.conf 5 , 192.Xr ipfw 8 , 193.Xr pfctl 8 , 194.Xr altq 9 195.Sh HISTORY 196The 197.Nm 198system first appeared in March 1997 and found home in the KAME project 199(https://www.kame.net). 200It was imported to 201.Fx 202in 5.3 . 203