8980 BIOS clock is sometimes one hour fast
[unleashed.git] / usr / src / man / man1m / flowadm.1m
blob5eca18142669353dec91b43701d9e444bd744179
1 '\" te
2 .\" Copyright (c) 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 FLOWADM 1M "April 9, 2016"
7 .SH NAME
8 flowadm \- administer bandwidth resource control and priority for protocols,
9 services, containers, and virtual machines
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBflowadm show-flow\fR [\fB-pP\fR] [\fB-S\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-l\fR \fIlink\fR]
14      [\fB-o\fR \fIfield\fR[,...]] [\fIflow\fR]
15 .fi
17 .LP
18 .nf
19 \fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...]
20      \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
21 \fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] {\fB-l\fR \fIlink\fR | \fIflow\fR}
22 .fi
24 .LP
25 .nf
26 \fBflowadm set-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
27 \fBflowadm reset-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-p\fR \fIprop\fR[,...]] \fIflow\fR
28 \fBflowadm show-flowprop\fR [\fB-cP\fR] [\fB-l\fR \fIlink\fR] [\fB-o\fR \fIfield\fR[,...]]
29      [\fB-p\fR \fIprop\fR[,...]] [\fIflow\fR]
30 .fi
32 .LP
33 .nf
34 \fBflowadm show-usage\fR [\fB-a\fR] [\fB-d\fR | {\fB-p\fR \fIplotfile\fR \fB-F\fR \fIformat\fR}] [\fB-s\fR \fItime\fR]
35      [\fB-e\fR \fItime\fR] \fB-f\fR \fIfilename\fR [\fIflow\fR]
36 .fi
38 .SH DESCRIPTION
39 .LP
40 The \fBflowadm\fR command is used to create, modify, remove, and show
41 networking bandwidth and associated resources for a type of traffic on a
42 particular link.
43 .sp
44 .LP
45 The \fBflowadm\fR command allows users to manage networking bandwidth resources
46 for a transport, service, or a subnet. The service is specified as a
47 combination of transport and local port. The subnet is specified by its IP
48 address and subnet mask. The command can be used on any type of data link,
49 including physical links, virtual NICs, and link aggregations.
50 .sp
51 .LP
52 A flow is defined as a set of attributes based on Layer 3 and Layer 4 headers,
53 which can be used to identify a protocol, service, or a virtual machine. When a
54 flow is identified based on flow attributes, separate kernel resources
55 including layer 2, 3, and 4 queues, their processing threads, and other
56 resources are uniquely created for it, such that other traffic has minimal or
57 zero impact on it.
58 .sp
59 .LP
60 Inbound and outbound packet are matched to flows in a very fast and scalable
61 way, so that limits can be enforced with minimal performance impact.
62 .sp
63 .LP
64 The \fBflowadm\fR command can be used to identify a flow without imposing any
65 bandwidth resource control. This would result in the traffic type getting its
66 own resources and queues so that it is isolated from rest of the networking
67 traffic for more observable and deterministic behavior.
68 .sp
69 .LP
70 \fBflowadm\fR is implemented as a set of subcommands with corresponding
71 options. Options are described in the context of each subcommand.
72 .SH SUBCOMMANDS
73 .LP
74 The following subcommands are supported:
75 .sp
76 .ne 2
77 .na
78 \fB\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]]
79 [\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fIflow\fR]\fR
80 .ad
81 .sp .6
82 .RS 4n
83 Show flow configuration information (the default) or statistics, either for all
84 flows, all flows on a link, or for the specified \fIflow\fR.
85 .sp
86 .ne 2
87 .na
88 \fB\fB-o\fR \fIfield\fR[,...]\fR
89 .ad
90 .sp .6
91 .RS 4n
92 A case-insensitive, comma-separated list of output fields to display. The field
93 name must be one of the fields listed below, or a special value \fBall\fR, to
94 display all fields. For each flow found, the following fields can be displayed:
95 .sp
96 .ne 2
97 .na
98 \fB\fBflow\fR\fR
99 .ad
100 .sp .6
101 .RS 4n
102 The name of the flow.
106 .ne 2
108 \fB\fBlink\fR\fR
110 .sp .6
111 .RS 4n
112 The name of the link the flow is on.
116 .ne 2
118 \fB\fBipaddr\fR\fR
120 .sp .6
121 .RS 4n
122 IP address of the flow. This can be either local or remote depending on how the
123 flow was defined.
127 .ne 2
129 \fB\fBtransport\fR\fR
131 .sp .6
132 .RS 4n
133 The name of the layer for protocol to be used.
137 .ne 2
139 \fB\fBport\fR\fR
141 .sp .6
142 .RS 4n
143 Local port of service for flow.
147 .ne 2
149 \fB\fBdsfield\fR\fR
151 .sp .6
152 .RS 4n
153 Differentiated services value for flow and mask used with \fBDSFIELD\fR value
154 to state the bits of interest in the differentiated services field of the IP
155 header.
161 .ne 2
163 \fB\fB-p\fR, \fB--parsable\fR\fR
165 .sp .6
166 .RS 4n
167 Display using a stable machine-parsable format.
171 .ne 2
173 \fB\fB-P\fR, \fB--persistent\fR\fR
175 .sp .6
176 .RS 4n
177 Display persistent flow property information.
181 .ne 2
183 \fB\fB-S\fR, \fB--continuous\fR\fR
185 .sp .6
186 .RS 4n
187 Continuously display network utilization by flow in a manner similar to the way
188 that \fBprstat\fR(1M) displays CPU utilization by process.
192 .ne 2
194 \fB\fB-s\fR, \fB--statistics\fR\fR
196 .sp .6
197 .RS 4n
198 Displays flow statistics.
202 .ne 2
204 \fB\fB-i\fR \fIinterval\fR, \fB--interval\fR=\fIinterval\fR\fR
206 .sp .6
207 .RS 4n
208 Used with the \fB-s\fR option to specify an interval, in seconds, at which
209 statistics should be displayed. If this option is not specified, statistics are
210 displayed once.
214 .ne 2
216 \fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
218 .sp .6
219 .RS 4n
220 Display information for all flows on the named link or information for the
221 named flow.
227 .ne 2
229 \fB\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
230 \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR
231 \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
233 .sp .6
234 .RS 4n
235 Adds a flow to the system. The flow is identified by its flow attributes and
236 properties.
238 As part of identifying a particular flow, its bandwidth resource can be limited
239 and its relative priority to other traffic can be specified. If no bandwidth
240 limit or priority is specified, the traffic still gets its unique layer 2, 3,
241 and 4 queues and processing threads, including NIC hardware resources (when
242 supported), so that the selected traffic can be separated from others and can
243 flow with minimal impact from other traffic.
245 .ne 2
247 \fB\fB-t\fR, \fB--temporary\fR\fR
249 .sp .6
250 .RS 4n
251 The changes are temporary and will not persist across reboots. Persistence is
252 the default.
256 .ne 2
258 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
260 .sp .6
261 .RS 4n
262 Specifies an alternate root directory where \fBflowadm\fR should apply
263 persistent creation.
267 .ne 2
269 \fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR\fR
271 .sp .6
272 .RS 4n
273 Specify the link to which the flow will be added.
277 .ne 2
279 \fB\fB-a\fR \fIattr\fR=\fIvalue\fR[,...], \fB--attr\fR=\fIvalue\fR\fR
281 .sp .6
282 .RS 4n
283 A comma-separated list of attributes to be set to the specified values.
287 .ne 2
289 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
291 .sp .6
292 .RS 4n
293 A comma-separated list of properties to be set to the specified values.
299 .ne 2
301 \fB\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
302 {\fIlink\fR | \fIflow\fR}\fR
304 .sp .6
305 .RS 4n
306 Remove an existing flow identified by its link or name.
308 .ne 2
310 \fB\fB-t\fR, \fB--temporary\fR\fR
312 .sp .6
313 .RS 4n
314 The changes are temporary and will not persist across reboots. Persistence is
315 the default.
319 .ne 2
321 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
323 .sp .6
324 .RS 4n
325 Specifies an alternate root directory where \fBflowadm\fR should apply
326 persistent removal.
330 .ne 2
332 \fB\fB-l\fR \fIlink\fR | \fIflow\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
334 .sp .6
335 .RS 4n
336 If a link is specified, remove all flows from that link. If a single flow is
337 specified, remove only that flow.
343 .ne 2
345 \fB\fBflowadm set-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
346 \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
348 .sp .6
349 .RS 4n
350 Set values of one or more properties on the flow specified by name. The
351 complete list of properties can be retrieved using the \fBshow-flow\fR
352 subcommand.
354 .ne 2
356 \fB\fB-t\fR, \fB--temporary\fR\fR
358 .sp .6
359 .RS 4n
360 The changes are temporary and will not persist across reboots. Persistence is
361 the default.
365 .ne 2
367 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
369 .sp .6
370 .RS 4n
371 Specifies an alternate root directory where \fBflowadm\fR should apply
372 persistent setting of properties.
376 .ne 2
378 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
380 .sp .6
381 .RS 4n
382 A comma-separated list of properties to be set to the specified values.
388 .ne 2
390 \fB\fBflowadm reset-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
391 [\fIprop\fR=\fIvalue\fR[,...]] \fIflow\fR\fR
393 .sp .6
394 .RS 4n
395 Resets one or more properties to their default values on the specified flow. If
396 no properties are specified, all properties are reset. See the
397 \fBshow-flowprop\fR subcommand for a description of properties, which includes
398 their default values.
400 .ne 2
402 \fB\fB-t\fR, \fB--temporary\fR\fR
404 .sp .6
405 .RS 4n
406 Specifies that the resets are temporary. Temporary resets last until the next
407 reboot.
411 .ne 2
413 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
415 .sp .6
416 .RS 4n
417 Specifies an alternate root directory where \fBflowadm\fR should apply
418 persistent setting of properties.
422 .ne 2
424 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
426 .sp .6
427 .RS 4n
428 A comma-separated list of properties to be reset.
434 .ne 2
436 \fB\fBflowadm show-flowprop\fR [\fB-cP\fR] [\fB-l\fR \fIlink\fR] [\fB-p\fR
437 \fIprop\fR[,...]] [\fIflow\fR]\fR
439 .sp .6
440 .RS 4n
441 Show the current or persistent values of one or more properties, either for all
442 flows, flows on a specified link, or for the specified flow.
444 By default, current values are shown. If no properties are specified, all
445 available flow properties are displayed. For each property, the following
446 fields are displayed:
448 .ne 2
450 \fB\fBFLOW\fR\fR
452 .sp .6
453 .RS 4n
454 The name of the flow.
458 .ne 2
460 \fB\fBPROPERTY\fR\fR
462 .sp .6
463 .RS 4n
464 The name of the property.
468 .ne 2
470 \fB\fBVALUE\fR\fR
472 .sp .6
473 .RS 4n
474 The current (or persistent) property value. The value is shown as \fB--\fR
475 (double hyphen), if it is not set, and \fB?\fR (question mark), if the value is
476 unknown. Persistent values that are not set or have been reset will be shown as
477 \fB--\fR and will use the system \fBDEFAULT\fR value (if any).
481 .ne 2
483 \fB\fBDEFAULT\fR\fR
485 .sp .6
486 .RS 4n
487 The default value of the property. If the property has no default value,
488 \fB--\fR (double hyphen), is shown.
492 .ne 2
494 \fB\fBPOSSIBLE\fR\fR
496 .sp .6
497 .RS 4n
498 A comma-separated list of the values the property can have. If the values span
499 a numeric range, the minimum and maximum values might be shown as shorthand. If
500 the possible values are unknown or unbounded, \fB--\fR (double hyphen), is
501 shown.
504 Flow properties are documented in the "Flow Properties" section, below.
506 .ne 2
508 \fB\fB-c\fR
510 .sp .6
511 .RS 4n
512 Display using a stable machine-parsable format.
516 .ne 2
518 \fB\fB-P\fR, \fB--persistent\fR\fR
520 .sp .6
521 .RS 4n
522 Display persistent flow property information.
526 .ne 2
528 \fB\fB-p\fR \fIprop\fR[,...], \fB--prop\fR=\fIprop\fR[,...]\fR
530 .sp .6
531 .RS 4n
532 A comma-separated list of properties to show.
538 .ne 2
540 \fB\fBflowadm show-usage\fR [\fB-a\fR] [\fB-d\fR | {\fB-p\fR \fIplotfile\fR
541 \fB-F\fR \fIformat\fR}] [\fB-s\fR \fItime\fR] [\fB-e\fR \fItime\fR]
542 [\fIflow\fR]\fR
544 .sp .6
545 .RS 4n
546 Show the historical network flow usage from a stored extended accounting file.
547 Configuration and enabling of network accounting through \fBacctadm\fR(1M) is
548 required. The default output will be the summary of flow usage for the entire
549 period of time in which extended accounting was enabled.
551 .ne 2
553 \fB\fB-a\fR\fR
555 .sp .6
556 .RS 4n
557 Display all historical network usage for the specified period of time during
558 which extended accounting is enabled. This includes the usage information for
559 the flows that have already been deleted.
563 .ne 2
565 \fB\fB-d\fR\fR
567 .sp .6
568 .RS 4n
569 Display the dates for which there is logging information. The date is in the
570 format \fIDD\fR/\fIMM\fR/\fIYYYY\fR.
574 .ne 2
576 \fB\fB-F\fR \fIformat\fR\fR
578 .sp .6
579 .RS 4n
580 Specifies the format of \fIplotfile\fR that is specified by the \fB-p\fR
581 option. As of this release, \fBgnuplot\fR is the only supported format.
585 .ne 2
587 \fB\fB-p\fR \fIplotfile\fR\fR
589 .sp .6
590 .RS 4n
591 When specified with \fB-s\fR or \fB-e\fR (or both), outputs flow usage data to
592 a file of the format specified by the \fB-F\fR option, which is required.
596 .ne 2
598 \fB\fB-s\fR \fItime\fR, \fB-e\fR \fItime\fR\fR
600 .sp .6
601 .RS 4n
602 Start and stop times for data display. Time is in the format
603 \fIYYYY\fR.\fIMM\fR.\fIDD\fR,\fIhh\fR:\fImm\fR:\fIss\fR.
607 .ne 2
609 \fB\fB-f\fR \fIfilename\fR\fR
611 .sp .6
612 .RS 4n
613 Read extended accounting records of network flow usage from \fIfilename\fR.
617 .ne 2
619 \fB\fIflow\fR\fR
621 .sp .6
622 .RS 4n
623 If specified, display the network flow usage only from the named flow.
624 Otherwise, display network usage from all flows.
629 .SS "Flow Attributes"
631 The flow operand that identify a flow in a \fBflowadm\fR command is a
632 comma-separated list of one or more keyword, value pairs from the list below.
634 .ne 2
636 \fB\fBlocal_ip\fR[\fB/\fR\fIprefix_len\fR]\fR
638 .sp .6
639 .RS 4n
640 Identifies a network flow by the local IP address. \fIvalue\fR must be a IPv4
641 address in dotted-decimal notation or an IPv6 address in colon-separated
642 notation. \fIprefix_len\fR is optional.
644 If \fIprefix_len\fR is specified, it describes the netmask for a subnet
645 address, following the same notation convention of \fBifconfig\fR(1M) and
646 \fBroute\fR(1M) addresses. If unspecified, the given IP address will be
647 considered as a host address for which the default prefix length for a IPv4
648 address is \fB/32\fR and for IPv6 is \fB/128\fR.
652 .ne 2
654 \fB\fBremote_ip\fR[\fB/\fR\fIprefix_len\fR]\fR
656 .sp .6
657 .RS 4n
658 Identifies a network flow by the remote IP address. The syntax is the same as
659 \fBlocal_ip\fR attributes
663 .ne 2
665 \fB\fBtransport\fR={\fBtcp\fR|\fBudp\fR|\fBsctp\fR|\fBicmp\fR|\fBicmpv6\fR}\fR
667 .sp .6
668 .RS 4n
669 Identifies a layer 4 protocol to be used. It is typically used in combination
670 with local_port to identify the service that needs special attention.
674 .ne 2
676 \fB\fBlocal_port\fR\fR
678 .sp .6
679 .RS 4n
680 Identifies a service specified by the local port.
684 .ne 2
686 \fB\fBdsfield\fR[\fB:\fR\fIdsfield_mask\fR]\fR
688 .sp .6
689 .RS 4n
690 Identifies the 8-bit differentiated services field (as defined in RFC 2474).
692 The optional \fIdsfield_mask\fR is used to state the bits of interest in the
693 differentiated services field when comparing with the \fBdsfield\fR value. A
694 \fB0\fR in a bit position indicates that the bit value needs to be ignored and
695 a \fB1\fR indicates otherwise. The mask can range from \fB0x01\fR to
696 \fB0xff\fR. If \fIdsfield_mask\fR is not specified, the default mask \fB0xff\fR
697 is used. Both the \fBdsfield\fR value and mask must be in hexadecimal.
702 The following five types of combinations of attributes are supported:
704 .in +2
706 local_ip[/\fIprefixlen\fR]=\fIaddress\fR
707 remote_ip[/\fIprefixlen\fR]=\fIaddress\fR
708 transport={tcp|udp|sctp|icmp|icmpv6}
709 transport={tcp|udp|sctp},local_port=\fIport\fR
710 dsfield=\fIval\fR[:\fIdsfield_mask\fR]
712 .in -2
717 On a given link, the combinations above are mutually exclusive. An attempt to
718 create flows of different combinations will fail.
719 .SS "Restrictions"
721 There are individual flow restrictions and flow restrictions per zone.
722 .SS "Individual Flow Restrictions"
724 Restrictions on individual flows do not require knowledge of other flows that
725 have been added to the link.
728 An attribute can be listed only once for each flow. For example, the following
729 command is not valid:
731 .in +2
733 # \fBflowadm add-flow -l vnic1 -a local_port=80,local_port=8080 httpflow\fR
735 .in -2
740 \fBtransport\fR and \fBlocal_port\fR:
743 TCP, UDP, or SCTP flows can be specified with a local port. An ICMP or ICMPv6
744 flow that specifies a port is not allowed. The following commands are valid:
746 .in +2
748 # \fBflowadm add-flow -l e1000g0 -a transport=udp udpflow\fR
749 # \fBflowadm add-flow -l e1000g0 -a transport=tcp,local_port=80 \e
750 udp80flow\fR
752 .in -2
757 The following commands are not valid:
759 .in +2
761 # \fBflowadm add-flow -l e1000g0 -a local_port=25 flow25\fR
762 # \fBflowadm add-flow -l e1000g0 -a transport=icmpv6,local_port=16 \e
763 flow16\fR
765 .in -2
768 .SS "Flow Restrictions Per Zone"
770 Within a zone, no two flows can have the same name. After adding a flow with
771 the link specified, the link will not be required for display, modification, or
772 deletion of the flow.
773 .SS "Flow Properties"
775 The following flow properties are supported. Note that the ability to set a
776 given property to a given value depends on the driver and hardware.
778 .ne 2
780 \fB\fBmaxbw\fR\fR
782 .sp .6
783 .RS 4n
784 Sets the full duplex bandwidth for the flow. The bandwidth is specified as an
785 integer with one of the scale suffixes(\fBK\fR, \fBM\fR, or \fBG\fR for Kbps,
786 Mbps, and Gbps). If no units are specified, the input value will be read as
787 Mbps. The default is no bandwidth limit.
791 .ne 2
793 \fB\fBpriority\fR\fR
795 .sp .6
796 .RS 4n
797 Sets the relative priority for the flow. The value can be given as one of the
798 tokens \fBhigh\fR, \fBmedium\fR, or \fBlow\fR. The default is \fBmedium\fR.
801 .SH EXAMPLES
803 \fBExample 1 \fRCreating a Policy Around a Mission-Critical Port
806 The command below creates a policy around inbound HTTPS traffic on an HTTPS
807 server so that HTTPS obtains dedicated NIC hardware and kernel TCP/IP
808 resources. The name specified, \fBhttps-1\fR, can be used later to modify or
809 delete the policy.
812 .in +2
814 # \fBflowadm add-flow -l bge0 -a transport=TCP,local_port=443 https-1\fR
815 # \fBflowadm show-flow -l bge0\fR
816 FLOW         LINK         IP ADDR                PROTO  PORT    DSFLD
817 https1       bge0         --                     tcp    443     --
819 .in -2
823 \fBExample 2 \fRModifying an Existing Policy to Add Bandwidth Resource Control
826 The following command modifies the \fBhttps-1\fR policy from the preceding
827 example. The command adds bandwidth control and give the policy a high
828 priority.
831 .in +2
833 # \fBflowadm set-flowprop -p maxbw=500M,priority=high https-1\fR
834 # \fBflowadm show-flow https-1\fR
835 FLOW         LINK         IP ADDR                PROTO  PORT    DSFLD
836 https1       bge0         --                     tcp    443     --
838 # \fBflowadm show-flowprop https-1\fR
839 FLOW        PROPERTY    VALUE     DEFAULT      POSSIBLE
840 https-1     maxbw       500       --           --
841 https-1     priority    HIGH      --          LOW,NORMAL,HIGH
843 .in -2
847 \fBExample 3 \fRLimiting the UDP Bandwidth Usage
850 The following command creates a policy for UDP protocol so that it cannot
851 consume more than 100Mbps of available bandwidth. The flow is named
852 \fBlimit-udp-1\fR.
855 .in +2
857 # \fBflowadm add-flow -l bge0 -a transport=UDP -p maxbw=100M, \e
858 priority=low limit-udp-1\fR
860 .in -2
864 \fBExample 4 \fRShowing Flow Usage
867 Flow usage statistics can be stored using the extended accounting facility,
868 \fBacctadm\fR(1M).
871 .in +2
873 # \fBacctadm -e extended -f /var/log/net.log net\fR
875 # \fBacctadm net\fR
876 Network accounting: active
877 Network accounting file: /var/log/net.log
878 Tracked Network resources: extended
879 Untracked Network resources: none
881 .in -2
886 The historical data that was saved can be retrieved in summary form using the
887 \fBshow-usage\fR subcommand of \fBflowadm\fR.
890 \fBExample 5 \fRSetting Policy, Making Use of \fBdsfield\fR Attribute
893 The following command sets a policy for EF PHB (DSCP value of 101110 from RFC
894 2598) with a bandwidth of 500 Mbps and a high priority. The \fBdsfield\fR value
895 for this flow will be \fB0x2e\fR (101110) with the \fBdsfield_mask\fR being
896 \fB0xfc\fR (because we want to ignore the 2 least significant bits).
899 .in +2
901 # \fBflowadm add-flow -l bge0 -a dsfield=0x2e:0xfc \e
902 -p maxbw=500M,priority=high efphb-flow\fR
904 .in -2
909 Display summary information:
912 .in +2
914 # \fBflowadm show-usage -f /var/log/net.log\fR
915 FLOW      DURATION  IPACKETS RBYTES      OPACKETS OBYTES     BANDWIDTH
916 flowtcp   100       1031     546908      0        0          43.76 Kbps
917 flowudp   0         0        0           0        0           0.00 Mbps
919 .in -2
924 Display dates for which logging information is available:
927 .in +2
929 # \fBflowadm show-usage -d -f /var/log/net.log\fR
930 02/19/2008
932 .in -2
937 Display logging information for \fBflowtcp\fR starting at 02/19/2008, 10:38:46
938 and ending at 02/19/2008, 10:40:06:
941 .in +2
943 # \fBflowadm show-usage -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \e
944 -f /var/log/net.log flowtcp\fR
945 FLOW      TIME       IPACKETS RBYTES      OPACKETS OBYTES     BANDWIDTH
946 flowtcp   10:39:06   1        1546         4       6539       3.23 Kbps
947 flowtcp   10:39:26   2        3586         5       9922       5.40 Kbps
948 flowtcp   10:39:46   1        240          1       216       182.40 bps
949 flowtcp   10:40:06   0        0            0       0           0.00 bps
951 .in -2
956 Output the same information as above as a plotfile:
959 .in +2
961 # \fBflowadm show-usage -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \e
962 -p /home/plot/myplot -F gnuplot -f /var/log/net.log flowtcp\fR
963 # \fBTime tcp-flow\fR
964 10:39:06 3.23
965 10:39:26 5.40
966 10:39:46 0.18
967 10:40:06 0.00
969 .in -2
972 .SH EXIT STATUS
973 .ne 2
975 \fB\fB0\fR\fR
977 .sp .6
978 .RS 4n
979 All actions were performed successfully.
983 .ne 2
985 \fB\fB>0\fR\fR
987 .sp .6
988 .RS 4n
989 An error occurred.
992 .SH ATTRIBUTES
994 See \fBattributes\fR(5) for descriptions of the following attributes:
999 box;
1000 c | c
1001 l | l .
1002 ATTRIBUTE TYPE  ATTRIBUTE VALUE
1004 Interface Stability     Committed
1007 .SH SEE ALSO
1009 \fBacctadm\fR(1M), \fBdladm\fR(1M), \fBifconfig\fR(1M), \fBprstat\fR(1M),
1010 \fBroute\fR(1M), \fBattributes\fR(5), \fBdlpi\fR(7P)