6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / man / man1m / ipqosconf.1m
blob9766afceecd519d07cc25339ad269ebf7b3057ce
1 '\" te
2 .\" Copyright (C) 2004, 2009 Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH IPQOSCONF 1M "Dec 18, 2008"
7 .SH NAME
8 ipqosconf \- configure the IPQoS facility
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/sbin/ipqosconf\fR
13 .fi
15 .LP
16 .nf
17 \fB/usr/sbin/ipqosconf\fR \fB-a\fR \fIconf_file\fR [\fB-vs\fR]
18 .fi
20 .LP
21 .nf
22 \fB/usr/sbin/ipqosconf\fR \fB-c\fR
23 .fi
25 .LP
26 .nf
27 \fB/usr/sbin/ipqosconf\fR \fB-f\fR
28 .fi
30 .LP
31 .nf
32 \fB/usr/sbin/ipqosconf\fR \fB-l\fR
33 .fi
35 .LP
36 .nf
37 \fB/usr/sbin/ipqosconf\fR \fB-L\fR
38 .fi
40 .SH DESCRIPTION
41 .sp
42 .LP
43 The \fBipqosconf\fR utility configures the Quality of Service facility of the
44 Internet Protocol (\fBIP\fR). Only superusers can use this command.
45 .sp
46 .LP
47 Without arguments, \fBipqosconf\fR displays the actual \fBIPQoS\fR
48 configuration.
49 .sp
50 .LP
51 Configuration is not preserved across reboot. You must apply the configuration
52 every time that the machine reboots. To apply the configuration early in the
53 boot phase, you can populate the \fB/etc/inet/ipqosinit.conf\fR file, which is
54 then read from the \fBsvc:/network/initial:default\fR service.
55 .SH OPTIONS
56 .sp
57 .LP
58 The following options are supported:
59 .sp
60 .ne 2
61 .na
62 \fB\fB-a\fR \fIconf_file\fR\fR
63 .ad
64 .RS 16n
65 Apply the configuration in \fIconf_file\fR. If the \fIconf_file\fR is
66 \fB\(mi\fR, \fBipqosconf\fR reads from standard input.
67 .RE
69 .sp
70 .ne 2
71 .na
72 \fB\fB-c\fR\fR
73 .ad
74 .RS 16n
75 Populate the boot file with the current configuration.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fB-f\fR\fR
82 .ad
83 .RS 16n
84 Flush the configuration.
85 .RE
87 .sp
88 .ne 2
89 .na
90 \fB\fB-l\fR\fR
91 .ad
92 .RS 16n
93 List the current applied configuration.
94 .RE
96 .sp
97 .ne 2
98 .na
99 \fB\fB-L\fR\fR
101 .RS 16n
102 List the current configuration in verbose mode.
104 In addition to the information that the \fB-l\fR option provides, the \fB-L\fR
105 option provides filters and classes configured through other means than the
106 \fBiqposconf\fR command. This option also provides the full set of filters that
107 were created by \fBipqosconf\fR by representing a multi-homed host in a
108 configuration file
112 .ne 2
114 \fB\fB-s\fR\fR
116 .RS 16n
117 Log messages to \fBsyslog\fR during an \fB-a\fR operation.
121 .ne 2
123 \fB\fB-v\fR\fR
125 .RS 16n
126 Toggle verbose mode during an \fB-a\fR operation.
128 The \fB-v\fR option causes all messages to go to the console in addition to
129 their normal destination. Messages intended to go to \fBsyslog\fR, because the
130 \fB-s\fR flag is set or because it is a log message, still go to \fBsyslog\fR
131 as well as the console.
134 .SH CONFIGURATION FILE
137 The configuration file is composed of a format version and a succession of
138 configuration (action) blocks. There are different configuration blocks for
139 each type of action that is being configured.
140 .SS "Format Version"
143 The first line of the configuration file specifies the format version contained
144 in the configuration file.
147 The following entry specifies the format version:
149 .in +2
151 fmt_version \fIx\fR.\fIx\fR
153 .in -2
157 where \fIx\fR.\fIx\fR is the format version. \fB1.0\fR is the only supported
158 version.
159 .SS "Configuration Blocks"
162 Following the format version, are a succession of configuration (action) blocks
163 that are different for each type of action being configured. A configuration
164 block always has the following structure:
166 .in +2
168 action {
169       name action_name
170       module module_name
171       params_clause | ""
172       cf_clauses
175 action_name      ::= string
176 module_name      ::= ipgpc | dlcosmk | dscpmk | flowacct | tswtclmt |
177                      tokenmt
179 params_clause    ::= params {
180                         parameters
181                         params_stats | ""
182                      }
184 parameters       ::= prm_name_value parameters | ""
186 prm_name_value   ::= \fIparam_name\fR \fIparam_value\fR
188 .in -2
191 .SS "Modules"
194 The \fIparam_name\fR and the types of \fIparam_value\fR are specific to a given
195 module.
197 .in +2
199 params_stats     ::= global_stats boolean
201 cf_clauses       ::= class_clause cf_clauses |
202                      filter_clause cf_clauses | ""
204 class_clause     ::= class {
205                          name class_name
206                          next_action next_action_name
207                          class_stats | ""
208                      }
210 class_name       ::= string
211 next_action_name ::= string
212 class_stats      ::= enable_stats boolean
213 boolean          ::= TRUE | FALSE
215 filter_clause    ::= filter {
216                         name filter_name
217                         class class_name
218                         parameters
219                      }
221 filter_name      ::= string
223 .in -2
228 There must be exactly one configuration block belonging to module \fBipgpc\fR.
229 The action must be named \fBipgpc.classify\fR. All other actions should be
230 reachable from \fBipgpc\fR by way of parameters of type action or the
231 next_action of a class.
234 The set of types that are used for parameters of the different modules are:
236 .in +2
238 action        ::=     string
239 protocol      ::=     1..255
240 port          ::=     1..65535
241 uint8         ::=     0..255
242 uint32        ::=     0..4294967296
243 int32         ::=     -2147483648..2147483648
244 address       ::=    <see the description section>
245 ifname        ::=    <interface name recognized by SIOGLIFINDEX ioctl>
246 enum          ::=     string | { string_list }
247 boolean       ::=     TRUE | FALSE
248 integer_array ::=     { range_value_list }
249 map_index     ::=     uint32
250 address       ::=     ip_address | ip_node_name
251 user          ::=     uid | username
252 uid           ::=     0..65535
253 username      ::=     string
254 string_list          ::=   string sl_entrys
255 sl_entrys            ::=   ',' string sl_entrys | ""
256 range_value_list     ::=   range_value_entry range_value_entrys
257 range_value_entry    ::=   range ':' integer_array_value
258 range                ::=   uint32 '-' uint32
259 integer_array_value  ::=   string | integer_array_number
260 integer_array_number ::=   uint8 | uint32
261 range_value_entrys   ::=   ';' range_value_entry range_value_entrys | ""
262 ip_node_name         ::=   string
263 ip_address           ::=   v4_address | v6_address
264 v4_address           ::=   v4_ip_address / v4_cidr_mask |
265 v4_ip_address
266 v4_cidr_mask         ::=   1-32
267 v6_address           ::=   v6_ip_address / v6_cidr_mask |
268 v6_ip_address
269 v6_cidr_mask         ::=   1-128
271 .in -2
276 METER module tokenmt configuration syntax:
278 .in +2
280 red_action_name         action
281 yellow_action_name      action
282 green_action_name       action
283 committed_rate          uint32
284 committed_burst         uint32
285 peak_rate               uint32
286 <if present this signifies that this will be a two rate meter, not
287    a single rate meter>
288 peak_burst              uint32
289 <this is the 'peak' burst size for a two rate meter, but
290    the 'excess' burst size for a single rate meter>
291 color_aware             boolean
292 color_map               integer_array
293 global_stats            boolean
295 .in -2
300 METER module tswtclmt configuration syntax:
302 .in +2
304 red_action_name         action
305 yellow_action_name      action
306 green_action_name       action
307 committed_rate          uint32
308 peak_rate               uint32
309 window                  uint32
310 global_stats            boolean
312 .in -2
317 MARKER module dscpmk configuration syntax:
319 .in +2
321 next_action         action
322 dscp_map            int_array
323 dscp_detailed_stats boolean
324 global_stats       boolean
326 .in -2
331 MARKER module dlcosmk configuration syntax:
333 .in +2
335 next_action         action
336 cos                 map_index
337 global_stats        boolean
339 .in -2
343 CLASSIFIER module ipgpc configuration syntax:
345 .in +2
347 user               user
348 projid             int32
349 if_name            ifname
350 direction          enum {
351                    LOCAL_IN,
352                    LOCAL_OUT,
353                    FWD_IN,
354                    FWD_OUT}
355 protocol           protocol
356 dsfield            uint8
357 dsfield_mask       uint8
358 saddr              address
359 daddr              address
360 sport              port
361 dport              port
362 priority           uint32
363 precedence         uint32
364 ip_version         enum {
365                    V4,
366                    V6 }
367 global_stats       boolean
369 .in -2
374 ACCOUNTING module flowacct configuration syntax:
376 .in +2
378 next_action      action
379 timer            uint32
380 timeout          uint32
381 max_limit        uint32
383 .in -2
386 .SS "Types"
388 .ne 2
390 \fB\fIaction\fR\fR
392 .RS 17n
393 A string of characters with a matching action definition. The character string
394 can be up to twenty three characters in length. To allow for spaces the string
395 needs to be enclosed in quotes and cannot span lines. Two special actions are
396 pre-defined and can not have an explicit action definition. The two pre-defined
397 actions are \fBcontinue\fR and \fBdrop\fR. continue causes the packet that is
398 passed to it to continue normal processing. \fBdrop\fR causes the packet that
399 is passed to it to be dropped.
403 .ne 2
405 \fB\fIaddress\fR\fR
407 .RS 17n
408 A machine name or address recognized by \fBgetipnodebyname\fR(3SOCKET). If a
409 machine name is specified, and \fBip_version\fR has been defined, the query is
410 done using that address family. If a machine name is not specified and
411 \fBip_version\fR has not been defined, the query is done using the
412 \fBAI_DEFAULT\fR flag to \fBgetipnodebyname()\fR(\fB\&..AF_INET6..\fR).
413 \fBCIDR\fR address masks following an IP address are allowed. Specify the
414 \fBCIDR\fR address masks as \fB1\fR-\fB32\fR (for \fBv4\fR) or
415 \fB1\fR-\fB128\fR (for \fBv6\fR). \fBCIDR\fR addresses are disallowed for node
416 names.
420 .ne 2
422 \fB\fIenum\fR\fR
424 .RS 17n
425 Either one of the supported values or comma delimited list of support values,
426 enclosed in curly braces.
430 .ne 2
432 \fB\fIifname\fR\fR
434 .RS 17n
435 A non-\fINULL\fR, existing interface name recognized by the \fBSIOGLIFINDEX\fR
436 socket ioctl.
440 .ne 2
442 \fB\fIinteger_array\fR\fR
444 .RS 17n
445 A comma delimited set of \fIrange\fR/\fIvalue\fR pairs, enclosed in curly
446 braces.
448 Specify \fIrange\fR in the format \fIx\fR-\fIy\fR, where \fIx\fR and \fIy\fR
449 are integers that denote the range of array indexes to which the value applies.
450 The minimum value for both \fIx\fR and \fIy\fR is \fB0\fR. The maximum value
451 for \fIx\fR is particular to the parameter. Any array indexes not referred to
452 in the set of ranges are left at their previous value.
456 .ne 2
458 \fB\fImap_index\fR\fR
460 .RS 17n
461 A non-negative integer used as an index into any maps associated with a
462 parameter of this type.
464 The maximum value of this type is dictated by the number of entries in the
465 associated maps. The index starts at \fB0\fR.
469 .ne 2
471 \fB\fIport\fR\fR
473 .RS 17n
474 Either a service name recognized by \fBgetservbyname\fR(3SOCKET) or an integer
475 \fB1\fR-\fB65535\fR.
479 .ne 2
481 \fB\fIprotocol\fR\fR
483 .RS 17n
484 Either a protocol name recognized by \fBgetprotobyname\fR(3SOCKET) or an
485 integer \fB1\fR-\fB255\fR.
489 .ne 2
491 \fB\fIstring\fR\fR
493 .RS 17n
494 A character string. Enclose \fIstring\fR in quotes. \fIstring\fR cannot span
495 multiple lines.
499 .ne 2
501 \fB\fIuser\fR\fR
503 .RS 17n
504 Either a valid user ID or username for the system that is being configured.
507 .SS "Parameters"
510 The configuration file can contain the following parameters
512 .ne 2
514 \fBcolor_aware\fR
516 .RS 23n
517 A value of \fBTRUE\fR or \fBFALSE\fR, indicating whether or not the configured
518 action takes account of the previous packet coloring when classifying.
522 .ne 2
524 \fBcolor_map\fR
526 .RS 23n
527 An integer array that defines which values of the \fBdscp\fR field correspond
528 with which colors for when the \fBcolor_aware\fR parameter is set to
529 \fBTRUE\fR.
533 .ne 2
535 \fBcommitted_burst\fR
537 .RS 23n
538 The committed burst size in bits.
542 .ne 2
544 \fBcommitted_rate\fR
546 .RS 23n
547 The committed rate in bits per second.
551 .ne 2
553 \fBcos\fR
555 .RS 23n
556 The value used to determine the underlying driver level priority applied to the
557 packet which is defined in \fB802.1D\fR.
561 .ne 2
563 \fBdaddr\fR
565 .RS 23n
566 The destination address of the datagram.
570 .ne 2
572 \fBdirection\fR
574 .RS 23n
575 The value used to build a filter matching only part of the traffic.
577 This parameter is of type \fBenum\fR with valid values of \fBLOCAL_IN\fR (local
578 bound traffic), \fBLOCAL_OUT\fR (local sourced traffic), \fBFWD_IN\fR
579 (forwarded traffic entering the system), and \fBFWD_OUT\fR (forwarded traffic
580 exiting the system).
584 .ne 2
586 \fBdport\fR
588 .RS 23n
589 The destination port of the datagram.
593 .ne 2
595 \fBdscp_detailed_stats\fR
597 .RS 23n
598 A value of \fBTRUE\fR or \fBFALSE\fR that determines whether detailed
599 statistics are switched on for this \fBdscp\fR action.
601 Specify \fBTRUE\fR to switch on or \fBFALSE\fR to switch off.
605 .ne 2
607 \fBdscp_map\fR
609 .RS 23n
610 The \fIinteger_array\fR that supplies the values that IP packets with a given
611 \fBdscp\fR value have their dscp re-marked with.
613 The existing value is used to index into the array where the new value is taken
614 from. The array is of size \fB64\fR, meaning valid indexes are \fB0\fR-\fB63\fR
615 and valid values are also \fB0\fR-\fB63\fR.
619 .ne 2
621 \fBdsfield\fR
623 .RS 23n
624 The \fBDS\fR field of the \fBIP\fR datagram header. This is an 8-bit value,
625 with each bit position corresponding with the same one in the header; this
626 enables matches to be done on the CU bits. If you specify this parameter, you
627 must also specify the \fBdsfield_mask\fR parameter.
631 .ne 2
633 \fB\fBdsfield_mask\fR\fR
635 .RS 23n
636 The mask applied to the \fBdsfield\fR parameter to determine the bits against
637 which to match. This is an 8-bit value, with each bit position corresponding
638 with the same one in the \fBdsfield\fR parameter.
642 .ne 2
644 \fBglobal_stats\fR
646 .RS 23n
647 A value of \fBTRUE\fR or \fBFALSE\fR to enable or disable the statistic
648 collection for this action.
652 .ne 2
654 \fBgreen_action_name\fR
656 .RS 23n
657 The action to be executed for packets that are deemed to be green.
661 .ne 2
663 \fBif_name\fR
665 .RS 23n
666 The name of an interface recognized by the \fBSIOGLIFINDEX\fR ioctl. This
667 parameter is of type \fBifname\fR.
671 .ne 2
673 \fBip_version\fR
675 .RS 23n
676 This parameter is of type \fBenum\fR and has valid values of \fBV4\fR and
677 \fBV6\fR.
679 If it is set to \fBV4\fR only then only \fBipv4\fRaddresses are requested for a
680 specified hostname. If it is set to \fBV6\fR, only \fBipv6\fR addresses are
681 returned if there are any, otherwise \fBv4\fR mapped \fBv6\fR addresses are
682 returned. If both \fBV4\fR and \fBV6\fR are specified, or if \fBip_version\fR
683 is not specified, then both \fBipv4\fR and \fBipv6\fR addresses are requested
684 for a specified hostname.
688 .ne 2
690 \fBmax_limit\fR
692 .RS 23n
693 The maximum number of flow entries present at one time in the \fBflowacct\fR
694 actions in the memory resident table.
698 .ne 2
700 \fBnext_action\fR
702 .RS 23n
703 The action to be executed when the current action is complete.
705 This value can be either the name of an action defined in the configuration
706 file, or one of the two special action types: \fBdrop\fR and \fBcontinue\fR.
710 .ne 2
712 \fBpeak_burst\fR
714 .RS 23n
715 The peak burst size, for a two rate meter, or excess burst size, for a single
716 rate meter, in bits.
720 .ne 2
722 \fBpeak_rate\fR
724 .RS 23n
725 The peak rate in bits per second.
729 .ne 2
731 \fBprecedence\fR
733 .RS 23n
734 An integer that is used to order filters. If there are two matching filters
735 that have the same priority value, the one with the lower precedence value is
736 the one matched. This parameter should be used because the order of the filters
737 in a configuration file has no influence on their relative precedence.
741 .ne 2
743 \fBpriority\fR
745 .RS 23n
746 An integer that represents the relative priority of a filter. If there are two
747 matching filters, the one with the higher priority value is the one matched.
748 Multiple filters can have the same priority.
752 .ne 2
754 \fBprojid\fR
756 .RS 23n
757 The project ID of the process sending the data. This value is always \fB-1\fR
758 for received traffic.
762 .ne 2
764 \fBprotocol\fR
766 .RS 23n
767 The Upper Layer Protocol against which this entry is matched.
771 .ne 2
773 \fBred_action_name\fR
775 .RS 23n
776 The action to be executed for packets that are determined to be red.
780 .ne 2
782 \fBsaddr\fR
784 .RS 23n
785 The source address of the datagram.
789 .ne 2
791 \fBsport\fR
793 .RS 23n
794 The source port of the datagram.
798 .ne 2
800 \fBtimeout\fR
802 .RS 23n
803 The timeout in milliseconds after which flows are written to the accounting
804 file.
808 .ne 2
810 \fBtimer\fR
812 .RS 23n
813 The period in milliseconds at which timed-out flows are checked for.
817 .ne 2
819 \fBuser\fR
821 .RS 23n
822 The user ID or username of the process sending the data. This value is always
823 \fB-1\fR for received traffic.
827 .ne 2
829 \fBwindow\fR
831 .RS 23n
832 The window size in ms.
836 .ne 2
838 \fByellow_action_name\fR
840 .RS 23n
841 The action to be executed for packets that are determined to be yellow.
844 .SH SECURITY
847 None.
848 .SH EXAMPLES
850 \fBExample 1 \fRSending All Traffic From eng to the AF 1 Class of Service
853 This example sends all traffic from \fBeng\fR to the \fBAF 1\fR class of
854 service. It is documented in four separate steps:
858 The following step creates a \fBtokenmt\fR action with three outcomes:
861 .in +2
863 #meter for class 1.
864 action {
865         name AF_CL1
866         module tokenmt
867         params{
868                 committed_rate 64
869                 committed_burst 75
870                 peak_burst 150
871                 global_stats TRUE
872                 red_action_name drop
873                 yellow_action_name markAF12
874                 green_action_name markAF11
875         }
878 .in -2
883 The following step creates two \fBdscpmk\fR actions:
886 .in +2
888 #class 1, low drop precedence.
889 action {
890         name markAF11
891         module dscpmk
892         params{
893              dscp_map {0-63:28}
894              dscp_detailed_stats TRUE
895                 global_stats TRUE
896                 next_action acct1
897         }
899 #class 1, medium drop precedence.
900 action {
901         name markAF12
902         module dscpmk
903         params {
904                 dscp_map {0-63:30}
905              dscp_detailed_stats TRUE
906                 global_stats TRUE
907                 next_action acct1
908         }
911 .in -2
916 The following step creates an accounting action:
919 .in +2
921 #billing for transmitted class 1 traffic.
922 action {
923         name acct1
924         module flowacct
925         params {
926                 timer 10
927                 timeout 30
928                 global_stats TRUE
929 max_limit 1024
930 next_action continue
931         }
934 .in -2
939 The following step creates an \fBipgpc\fR action:
942 .in +2
944 #traffic from eng sent, traffic from ebay dropped.
945 action {
946         name ipgpc.classify
947         module ipgpc
948         class {
949                 name from_eng
950                 enable_stats TRUE
951                 next_action AF_CL1
952         }
953         class {
954                 name from_ebay
955                 enable_stats TRUE
956                 next_action drop
957         }
959         filter {
960                 name from_eng
961                 saddr eng-subnet
962                 class from_eng
963         }
964         filter {
965                 name from_ebay
966                 saddr ebay-subnet
967                 class from_ebay
968         }
971 .in -2
974 .SH FILES
976 .ne 2
978 \fB\fB/etc/inet/ipqosinit.conf\fR\fR
980 .sp .6
981 .RS 4n
982 Contains the \fBIPQoS\fR configuration loaded at boot time. If this file
983 exists, it is read from the \fBnetwork/initial:default\fR service.
987 .ne 2
989 \fB\fB/etc/inet/ipqosconf.1.sample\fR\fR
991 .sp .6
992 .RS 4n
993 Sample configuration file for an application server
997 .ne 2
999 \fB\fB/etc/inet/ipqosconf.2.sample\fR\fR
1001 .sp .6
1002 .RS 4n
1003 Sample configuration file that meters the traffic for a specified application
1007 .ne 2
1009 \fB\fB/etc/inet/ipqosconf.3.sample\fR\fR
1011 .sp .6
1012 .RS 4n
1013 Sample configuration file that marks the ethernet headers of web traffic with a
1014 given user priority
1017 .SH ATTRIBUTES
1020 See \fBattributes\fR(5) for descriptions of the following attributes:
1025 box;
1026 c | c
1027 l | l .
1028 ATTRIBUTE TYPE  ATTRIBUTE VALUE
1030 Interface Stability     Evolving
1033 .SH SEE ALSO
1036 \fBsyslog\fR(3C), \fBgetipnodebyname\fR(3SOCKET),
1037 \fBgetprotobyname\fR(3SOCKET), \fBgetservbyname\fR(3SOCKET),
1038 \fBattributes\fR(5), \fBdlcosmk\fR(7IPP), \fBdscpmk\fR(7IPP),
1039 \fBflowacct\fR(7IPP), \fBipgpc\fR(7IPP), \fBipqos\fR(7IPP),
1040 \fBtokenmt\fR(7IPP), \fBtswtclmt\fR(7IPP)
1041 .SH DIAGNOSTICS
1044 \fBipqosconf\fR sends messages to \fBsyslog\fR of facility user, severity
1045 notice when any changes are made to the \fBIPQoS\fR configuration.
1048 Errors that occur during an \fBipqosconf\fR operation send an error message to
1049 the console by default. For the application of a new configuration if the
1050 \fB-s\fR option is set then these messages are sent to \fBsyslog\fR as facility
1051 user, severity error instead. If the \fB-v\fR option is present during an
1052 application then all error and change notificationmessages are sent to the
1053 console as well as their default destination.