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 "Feb 14, 2009"
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
16
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
23
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
31
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
37
38 .SH DESCRIPTION
39 .sp
40 .LP
41 The \fBflowadm\fR command is used to create, modify, remove, and show
42 networking bandwidth and associated resources for a type of traffic on a
43 particular link.
44 .sp
45 .LP
46 The \fBflowadm\fR command allows users to manage networking bandwidth resources
47 for a transport, service, or a subnet. The service is specified as a
48 combination of transport and local port. The subnet is specified by its IP
49 address and subnet mask. The command can be used on any type of data link,
50 including physical links, virtual NICs, and link aggregations.
51 .sp
52 .LP
53 A flow is defined as a set of attributes based on Layer 3 and Layer 4 headers,
54 which can be used to identify a protocol, service, or a virtual machine. When a
55 flow is identified based on flow attributes, separate kernel resources
56 including layer 2, 3, and 4 queues, their processing threads, and other
57 resources are uniquely created for it, such that other traffic has minimal or
58 zero impact on it.
59 .sp
60 .LP
61 Inbound and outbound packet are matched to flows in a very fast and scalable
62 way, so that limits can be enforced with minimal performance impact.
63 .sp
64 .LP
65 The \fBflowadm\fR command can be used to identify a flow without imposing any
66 bandwidth resource control. This would result in the traffic type getting its
67 own resources and queues so that it is isolated from rest of the networking
68 traffic for more observable and deterministic behavior.
69 .sp
70 .LP
71 \fBflowadm\fR is implemented as a set of subcommands with corresponding
72 options. Options are described in the context of each subcommand.
73 .SH SUB-COMMANDS
74 .sp
75 .LP
76 The following subcommands are supported:
77 .sp
78 .ne 2
79 .na
80 \fB\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]]
81 [\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fIflow\fR]\fR
82 .ad
83 .sp .6
84 .RS 4n
85 Show flow configuration information (the default) or statistics, either for all
86 flows, all flows on a link, or for the specified \fIflow\fR.
87 .sp
88 .ne 2
89 .na
90 \fB\fB-o\fR \fIfield\fR[,...]\fR
91 .ad
92 .sp .6
93 .RS 4n
94 A case-insensitive, comma-separated list of output fields to display. The field
95 name must be one of the fields listed below, or a special value \fBall\fR, to
96 display all fields. For each flow found, the following fields can be displayed:
97 .sp
98 .ne 2
99 .na
100 \fB\fBflow\fR\fR
101 .ad
102 .sp .6
103 .RS 4n
104 The name of the flow.
105 .RE
106
107 .sp
108 .ne 2
109 .na
110 \fB\fBlink\fR\fR
111 .ad
112 .sp .6
113 .RS 4n
114 The name of the link the flow is on.
115 .RE
116
117 .sp
118 .ne 2
119 .na
120 \fB\fBipaddr\fR\fR
121 .ad
122 .sp .6
123 .RS 4n
124 IP address of the flow. This can be either local or remote depending on how the
125 flow was defined.
126 .RE
127
128 .sp
129 .ne 2
130 .na
131 \fB\fBtransport\fR\fR
132 .ad
133 .sp .6
134 .RS 4n
135 The name of the layer for protocol to be used.
136 .RE
137
138 .sp
139 .ne 2
140 .na
141 \fB\fBport\fR\fR
142 .ad
143 .sp .6
144 .RS 4n
145 Local port of service for flow.
146 .RE
147
148 .sp
149 .ne 2
150 .na
151 \fB\fBdsfield\fR\fR
152 .ad
153 .sp .6
154 .RS 4n
155 Differentiated services value for flow and mask used with \fBDSFIELD\fR value
156 to state the bits of interest in the differentiated services field of the IP
157 header.
158 .RE
159
160 .RE
161
162 .sp
163 .ne 2
164 .na
165 \fB\fB-p\fR, \fB--parseable\fR\fR
166 .ad
167 .sp .6
168 .RS 4n
169 Display using a stable machine-parseable format.
170 .RE
171
172 .sp
173 .ne 2
174 .na
175 \fB\fB-P\fR, \fB--persistent\fR\fR
176 .ad
177 .sp .6
178 .RS 4n
179 Display persistent flow property information.
180 .RE
181
182 .sp
183 .ne 2
184 .na
185 \fB\fB-S\fR, \fB--continuous\fR\fR
186 .ad
187 .sp .6
188 .RS 4n
189 Continuously display network utilization by flow in a manner similar to the way
190 that \fBprstat\fR(1M) displays CPU utilization by process.
191 .RE
192
193 .sp
194 .ne 2
195 .na
196 \fB\fB-s\fR, \fB--statistics\fR\fR
197 .ad
198 .sp .6
199 .RS 4n
200 Displays flow statistics.
201 .RE
202
203 .sp
204 .ne 2
205 .na
206 \fB\fB-i\fR \fIinterval\fR, \fB--interval\fR=\fIinterval\fR\fR
207 .ad
208 .sp .6
209 .RS 4n
210 Used with the \fB-s\fR option to specify an interval, in seconds, at which
211 statistics should be displayed. If this option is not specified, statistics are
212 displayed once.
213 .RE
214
215 .sp
216 .ne 2
217 .na
218 \fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
219 .ad
220 .sp .6
221 .RS 4n
222 Display information for all flows on the named link or information for the
223 named flow.
224 .RE
225
226 .RE
227
228 .sp
229 .ne 2
230 .na
231 \fB\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
232 \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR
233 \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
234 .ad
235 .sp .6
236 .RS 4n
237 Adds a flow to the system. The flow is identified by its flow attributes and
238 properties.
239 .sp
240 As part of identifying a particular flow, its bandwidth resource can be limited
241 and its relative priority to other traffic can be specified. If no bandwidth
242 limit or priority is specified, the traffic still gets its unique layer 2, 3,
243 and 4 queues and processing threads, including NIC hardware resources (when
244 supported), so that the selected traffic can be separated from others and can
245 flow with minimal impact from other traffic.
246 .sp
247 .ne 2
248 .na
249 \fB\fB-t\fR, \fB--temporary\fR\fR
250 .ad
251 .sp .6
252 .RS 4n
253 The changes are temporary and will not persist across reboots. Persistence is
254 the default.
255 .RE
256
257 .sp
258 .ne 2
259 .na
260 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
261 .ad
262 .sp .6
263 .RS 4n
264 Specifies an alternate root directory where \fBflowadm\fR should apply
265 persistent creation.
266 .RE
267
268 .sp
269 .ne 2
270 .na
271 \fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR\fR
272 .ad
273 .sp .6
274 .RS 4n
275 Specify the link to which the flow will be added.
276 .RE
277
278 .sp
279 .ne 2
280 .na
281 \fB\fB-a\fR \fIattr\fR=\fIvalue\fR[,...], \fB--attr\fR=\fIvalue\fR\fR
282 .ad
283 .sp .6
284 .RS 4n
285 A comma-separated list of attributes to be set to the specified values.
286 .RE
287
288 .sp
289 .ne 2
290 .na
291 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
292 .ad
293 .sp .6
294 .RS 4n
295 A comma-separated list of properties to be set to the specified values.
296 .RE
297
298 .RE
299
300 .sp
301 .ne 2
302 .na
303 \fB\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
304 {\fIlink\fR | \fIflow\fR}\fR
305 .ad
306 .sp .6
307 .RS 4n
308 Remove an existing flow identified by its link or name.
309 .sp
310 .ne 2
311 .na
312 \fB\fB-t\fR, \fB--temporary\fR\fR
313 .ad
314 .sp .6
315 .RS 4n
316 The changes are temporary and will not persist across reboots. Persistence is
317 the default.
318 .RE
319
320 .sp
321 .ne 2
322 .na
323 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
324 .ad
325 .sp .6
326 .RS 4n
327 Specifies an alternate root directory where \fBflowadm\fR should apply
328 persistent removal.
329 .RE
330
331 .sp
332 .ne 2
333 .na
334 \fB\fB-l\fR \fIlink\fR | \fIflow\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
335 .ad
336 .sp .6
337 .RS 4n
338 If a link is specified, remove all flows from that link. If a single flow is
339 specified, remove only that flow.
340 .RE
341
342 .RE
343
344 .sp
345 .ne 2
346 .na
347 \fB\fBflowadm set-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
348 \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
349 .ad
350 .sp .6
351 .RS 4n
352 Set values of one or more properties on the flow specified by name. The
353 complete list of properties can be retrieved using the \fBshow-flow\fR
354 subcommand.
355 .sp
356 .ne 2
357 .na
358 \fB\fB-t\fR, \fB--temporary\fR\fR
359 .ad
360 .sp .6
361 .RS 4n
362 The changes are temporary and will not persist across reboots. Persistence is
363 the default.
364 .RE
365
366 .sp
367 .ne 2
368 .na
369 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
370 .ad
371 .sp .6
372 .RS 4n
373 Specifies an alternate root directory where \fBflowadm\fR should apply
374 persistent setting of properties.
375 .RE
376
377 .sp
378 .ne 2
379 .na
380 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
381 .ad
382 .sp .6
383 .RS 4n
384 A comma-separated list of properties to be set to the specified values.
385 .RE
386
387 .RE
388
389 .sp
390 .ne 2
391 .na
392 \fB\fBflowadm reset-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
393 [\fIprop\fR=\fIvalue\fR[,...]] \fIflow\fR\fR
394 .ad
395 .sp .6
396 .RS 4n
397 Resets one or more properties to their default values on the specified flow. If
398 no properties are specified, all properties are reset. See the
399 \fBshow-flowprop\fR subcommand for a description of properties, which includes
400 their default values.
401 .sp
402 .ne 2
403 .na
404 \fB\fB-t\fR, \fB--temporary\fR\fR
405 .ad
406 .sp .6
407 .RS 4n
408 Specifies that the resets are temporary. Temporary resets last until the next
409 reboot.
410 .RE
411
412 .sp
413 .ne 2
414 .na
415 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
416 .ad
417 .sp .6
418 .RS 4n
419 Specifies an alternate root directory where \fBflowadm\fR should apply
420 persistent setting of properties.
421 .RE
422
423 .sp
424 .ne 2
425 .na
426 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
427 .ad
428 .sp .6
429 .RS 4n
430 A comma-separated list of properties to be reset.
431 .RE
432
433 .RE
434
435 .sp
436 .ne 2
437 .na
438 \fB\fBflowadm show-flowprop\fR [\fB-cP\fR] [\fB-l\fR \fIlink\fR] [\fB-p\fR
439 \fIprop\fR[,...]] [\fIflow\fR]\fR
440 .ad
441 .sp .6
442 .RS 4n
443 Show the current or persistent values of one or more properties, either for all
444 flows, flows on a specified link, or for the specified flow.
445 .sp
446 By default, current values are shown. If no properties are specified, all
447 available flow properties are displayed. For each property, the following
448 fields are displayed:
449 .sp
450 .ne 2
451 .na
452 \fB\fBFLOW\fR\fR
453 .ad
454 .sp .6
455 .RS 4n
456 The name of the flow.
457 .RE
458
459 .sp
460 .ne 2
461 .na
462 \fB\fBPROPERTY\fR\fR
463 .ad
464 .sp .6
465 .RS 4n
466 The name of the property.
467 .RE
468
469 .sp
470 .ne 2
471 .na
472 \fB\fBVALUE\fR\fR
473 .ad
474 .sp .6
475 .RS 4n
476 The current (or persistent) property value. The value is shown as \fB--\fR
477 (double hyphen), if it is not set, and \fB?\fR (question mark), if the value is
478 unknown. Persistent values that are not set or have been reset will be shown as
479 \fB--\fR and will use the system \fBDEFAULT\fR value (if any).
480 .RE
481
482 .sp
483 .ne 2
484 .na
485 \fB\fBDEFAULT\fR\fR
486 .ad
487 .sp .6
488 .RS 4n
489 The default value of the property. If the property has no default value,
490 \fB--\fR (double hyphen), is shown.
491 .RE
492
493 .sp
494 .ne 2
495 .na
496 \fB\fBPOSSIBLE\fR\fR
497 .ad
498 .sp .6
499 .RS 4n
500 A comma-separated list of the values the property can have. If the values span
501 a numeric range, the minimum and maximum values might be shown as shorthand. If
502 the possible values are unknown or unbounded, \fB--\fR (double hyphen), is
503 shown.
504 .RE
505
506 Flow properties are documented in the "Flow Properties" section, below.
507 .sp
508 .ne 2
509 .na
510 \fB\fB-c\fR, \fB--parseable\fR\fR
511 .ad
512 .sp .6
513 .RS 4n
514 Display using a stable machine-parseable format.
515 .RE
516
517 .sp
518 .ne 2
519 .na
520 \fB\fB-P\fR, \fB--persistent\fR\fR
521 .ad
522 .sp .6
523 .RS 4n
524 Display persistent flow property information.
525 .RE
526
527 .sp
528 .ne 2
529 .na
530 \fB\fB-p\fR \fIprop\fR[,...], \fB--prop\fR=\fIprop\fR[,...]\fR
531 .ad
532 .sp .6
533 .RS 4n
534 A comma-separated list of properties to show.
535 .RE
536
537 .RE
538
539 .sp
540 .ne 2
541 .na
542 \fB\fBflowadm show-usage\fR [\fB-a\fR] [\fB-d\fR | {\fB-p\fR \fIplotfile\fR
543 \fB-F\fR \fIformat\fR}] [\fB-s\fR \fItime\fR] [\fB-e\fR \fItime\fR]
544 [\fIflow\fR]\fR
545 .ad
546 .sp .6
547 .RS 4n
548 Show the historical network flow usage from a stored extended accounting file.
549 Configuration and enabling of network accounting through \fBacctadm\fR(1M) is
550 required. The default output will be the summary of flow usage for the entire
551 period of time in which extended accounting was enabled.
552 .sp
553 .ne 2
554 .na
555 \fB\fB-a\fR\fR
556 .ad
557 .sp .6
558 .RS 4n
559 Display all historical network usage for the specified period of time during
560 which extended accounting is enabled. This includes the usage information for
561 the flows that have already been deleted.
562 .RE
563
564 .sp
565 .ne 2
566 .na
567 \fB\fB-d\fR\fR
568 .ad
569 .sp .6
570 .RS 4n
571 Display the dates for which there is logging information. The date is in the
572 format \fIDD\fR/\fIMM\fR/\fIYYYY\fR.
573 .RE
574
575 .sp
576 .ne 2
577 .na
578 \fB\fB-F\fR \fIformat\fR\fR
579 .ad
580 .sp .6
581 .RS 4n
582 Specifies the format of \fIplotfile\fR that is specified by the \fB-p\fR
583 option. As of this release, \fBgnuplot\fR is the only supported format.
584 .RE
585
586 .sp
587 .ne 2
588 .na
589 \fB\fB-p\fR \fIplotfile\fR\fR
590 .ad
591 .sp .6
592 .RS 4n
593 When specified with \fB-s\fR or \fB-e\fR (or both), outputs flow usage data to
594 a file of the format specified by the \fB-F\fR option, which is required.
595 .RE
596
597 .sp
598 .ne 2
599 .na
600 \fB\fB-s\fR \fItime\fR, \fB-e\fR \fItime\fR\fR
601 .ad
602 .sp .6
603 .RS 4n
604 Start and stop times for data display. Time is in the format
605 \fIYYYY\fR.\fIMM\fR.\fIDD\fR,\fIhh\fR:\fImm\fR:\fIss\fR.
606 .RE
607
608 .sp
609 .ne 2
610 .na
611 \fB\fB-f\fR \fIfilename\fR\fR
612 .ad
613 .sp .6
614 .RS 4n
615 Read extended accounting records of network flow usage from \fIfilename\fR.
616 .RE
617
618 .sp
619 .ne 2
620 .na
621 \fB\fIflow\fR\fR
622 .ad
623 .sp .6
624 .RS 4n
625 If specified, display the network flow usage only from the named flow.
626 Otherwise, display network usage from all flows.
627 .RE
628
629 .RE
630
631 .SS "Flow Attributes"
632 .sp
633 .LP
634 The flow operand that identify a flow in a \fBflowadm\fR command is a
635 comma-separated list of one or more keyword, value pairs from the list below.
636 .sp
637 .ne 2
638 .na
639 \fB\fBlocal_ip\fR[\fB/\fR\fIprefix_len\fR]\fR
640 .ad
641 .sp .6
642 .RS 4n
643 Identifies a network flow by the local IP address. \fIvalue\fR must be a IPv4
644 address in dotted-decimal notation or an IPv6 address in colon-separated
645 notation. \fIprefix_len\fR is optional.
646 .sp
647 If \fIprefix_len\fR is specified, it describes the netmask for a subnet
648 address, following the same notation convention of \fBifconfig\fR(1M) and
649 \fBroute\fR(1M) addresses. If unspecified, the given IP address will be
650 considered as a host address for which the default prefix length for a IPv4
651 address is \fB/32\fR and for IPv6 is \fB/128\fR.
652 .RE
653
654 .sp
655 .ne 2
656 .na
657 \fB\fBremote_ip\fR[\fB/\fR\fIprefix_len\fR]\fR
658 .ad
659 .sp .6
660 .RS 4n
661 Identifies a network flow by the remote IP address. The syntax is the same as
662 \fBlocal_ip\fR attributes
663 .RE
664
665 .sp
666 .ne 2
667 .na
668 \fB\fBtransport\fR={\fBtcp\fR|\fBudp\fR|\fBsctp\fR|\fBicmp\fR|\fBicmpv6\fR}\fR
669 .ad
670 .sp .6
671 .RS 4n
672 Identifies a layer 4 protocol to be used. It is typically used in combination
673 with local_port to identify the service that needs special attention.
674 .RE
675
676 .sp
677 .ne 2
678 .na
679 \fB\fBlocal_port\fR\fR
680 .ad
681 .sp .6
682 .RS 4n
683 Identifies a service specified by the local port.
684 .RE
685
686 .sp
687 .ne 2
688 .na
689 \fB\fBdsfield\fR[\fB:\fR\fIdsfield_mask\fR]\fR
690 .ad
691 .sp .6
692 .RS 4n
693 Identifies the 8-bit differentiated services field (as defined in RFC 2474).
694 .sp
695 The optional \fIdsfield_mask\fR is used to state the bits of interest in the
696 differentiated services field when comparing with the \fBdsfield\fR value. A
697 \fB0\fR in a bit position indicates that the bit value needs to be ignored and
698 a \fB1\fR indicates otherwise. The mask can range from \fB0x01\fR to
699 \fB0xff\fR. If \fIdsfield_mask\fR is not specified, the default mask \fB0xff\fR
700 is used. Both the \fBdsfield\fR value and mask must be in hexadecimal.
701 .RE
702
703 .sp
704 .LP
705 The following five types of combinations of attributes are supported:
706 .sp
707 .in +2
708 .nf
709 local_ip[/\fIprefixlen\fR]=\fIaddress\fR
710 remote_ip[/\fIprefixlen\fR]=\fIaddress\fR
711 transport={tcp|udp|sctp|icmp|icmpv6}
712 transport={tcp|udp|sctp},local_port=\fIport\fR
713 dsfield=\fIval\fR[:\fIdsfield_mask\fR]
714 .fi
715 .in -2
716 .sp
717
718 .sp
719 .LP
720 On a given link, the combinations above are mutually exclusive. An attempt to
721 create flows of different combinations will fail.
722 .SS "Restrictions"
723 .sp
724 .LP
725 There are individual flow restrictions and flow restrictions per zone.
726 .SS "Individual Flow Restrictions"
727 .sp
728 .LP
729 Restrictions on individual flows do not require knowledge of other flows that
730 have been added to the link.
731 .sp
732 .LP
733 An attribute can be listed only once for each flow. For example, the following
734 command is not valid:
735 .sp
736 .in +2
737 .nf
738 # \fBflowadm add-flow -l vnic1 -a local_port=80,local_port=8080 httpflow\fR
739 .fi
740 .in -2
741 .sp
742
743 .sp
744 .LP
745 \fBtransport\fR and \fBlocal_port\fR:
746 .sp
747 .LP
748 TCP, UDP, or SCTP flows can be specified with a local port. An ICMP or ICMPv6
749 flow that specifies a port is not allowed. The following commands are valid:
750 .sp
751 .in +2
752 .nf
753 # \fBflowadm add-flow -l e1000g0 -a transport=udp udpflow\fR
754 # \fBflowadm add-flow -l e1000g0 -a transport=tcp,local_port=80 \e
755 udp80flow\fR
756 .fi
757 .in -2
758 .sp
759
760 .sp
761 .LP
762 The following commands are not valid:
763 .sp
764 .in +2
765 .nf
766 # \fBflowadm add-flow -l e1000g0 -a local_port=25 flow25\fR
767 # \fBflowadm add-flow -l e1000g0 -a transport=icmpv6,local_port=16 \e
768 flow16\fR
769 .fi
770 .in -2
771 .sp
772
773 .SS "Flow Restrictions Per Zone"
774 .sp
775 .LP
776 Within a zone, no two flows can have the same name. After adding a flow with
777 the link specified, the link will not be required for display, modification, or
778 deletion of the flow.
779 .SS "Flow Properties"
780 .sp
781 .LP
782 The following flow properties are supported. Note that the ability to set a
783 given property to a given value depends on the driver and hardware.
784 .sp
785 .ne 2
786 .na
787 \fB\fBmaxbw\fR\fR
788 .ad
789 .sp .6
790 .RS 4n
791 Sets the full duplex bandwidth for the flow. The bandwidth is specified as an
792 integer with one of the scale suffixes(\fBK\fR, \fBM\fR, or \fBG\fR for Kbps,
793 Mbps, and Gbps). If no units are specified, the input value will be read as
794 Mbps. The default is no bandwidth limit.
795 .RE
796
797 .sp
798 .ne 2
799 .na
800 \fB\fBpriority\fR\fR
801 .ad
802 .sp .6
803 .RS 4n
804 Sets the relative priority for the flow. The value can be given as one of the
805 tokens \fBhigh\fR, \fBmedium\fR, or \fBlow\fR. The default is \fBmedium\fR.
806 .RE
807
808 .SH EXAMPLES
809 .LP
810 \fBExample 1 \fRCreating a Policy Around a Mission-Critical Port
811 .sp
812 .LP
813 The command below creates a policy around inbound HTTPS traffic on an HTTPS
814 server so that HTTPS obtains dedicated NIC hardware and kernel TCP/IP
815 resources. The name specified, \fBhttps-1\fR, can be used later to modify or
816 delete the policy.
817
818 .sp
819 .in +2
820 .nf
821 # \fBflowadm add-flow -l bge0 -a transport=TCP,local_port=443 https-1\fR
822 # \fBflowadm show-flow -l bge0\fR
823 FLOW LINK IP ADDR PROTO PORT DSFLD
824 https1 bge0 -- tcp 443 --
825 .fi
826 .in -2
827 .sp
828
829 .LP
830 \fBExample 2 \fRModifying an Existing Policy to Add Bandwidth Resource Control
831 .sp
832 .LP
833 The following command modifies the \fBhttps-1\fR policy from the preceding
834 example. The command adds bandwidth control and give the policy a high
835 priority.
836
837 .sp
838 .in +2
839 .nf
840 # \fBflowadm set-flowprop -p maxbw=500M,priority=high https-1\fR
841 # \fBflowadm show-flow https-1\fR
842 FLOW LINK IP ADDR PROTO PORT DSFLD
843 https1 bge0 -- tcp 443 --
844
845 # \fBflowadm show-flowprop https-1\fR
846 FLOW PROPERTY VALUE DEFAULT POSSIBLE
847 https-1 maxbw 500 -- --
848 https-1 priority HIGH -- LOW,NORMAL,HIGH
849 .fi
850 .in -2
851 .sp
852
853 .LP
854 \fBExample 3 \fRLimiting the UDP Bandwidth Usage
855 .sp
856 .LP
857 The following command creates a policy for UDP protocol so that it cannot
858 consume more than 100Mbps of available bandwidth. The flow is named
859 \fBlimit-udp-1\fR.
860
861 .sp
862 .in +2
863 .nf
864 # \fBflowadm add-flow -l bge0 -a transport=UDP -p maxbw=100M, \e
865 priority=low limit-udp-1\fR
866 .fi
867 .in -2
868 .sp
869
870 .LP
871 \fBExample 4 \fRShowing Flow Usage
872 .sp
873 .LP
874 Flow usage statistics can be stored using the extended accounting facility,
875 \fBacctadm\fR(1M).
876
877 .sp
878 .in +2
879 .nf
880 # \fBacctadm -e extended -f /var/log/net.log net\fR
881
882 # \fBacctadm net\fR
883 Network accounting: active
884 Network accounting file: /var/log/net.log
885 Tracked Network resources: extended
886 Untracked Network resources: none
887 .fi
888 .in -2
889 .sp
890
891 .sp
892 .LP
893 The historical data that was saved can be retrieved in summary form using the
894 \fBshow-usage\fR subcommand of \fBflowadm\fR.
895
896 .LP
897 \fBExample 5 \fRSetting Policy, Making Use of \fBdsfield\fR Attribute
898 .sp
899 .LP
900 The following command sets a policy for EF PHB (DSCP value of 101110 from RFC
901 2598) with a bandwidth of 500 Mbps and a high priority. The \fBdsfield\fR value
902 for this flow will be \fB0x2e\fR (101110) with the \fBdsfield_mask\fR being
903 \fB0xfc\fR (because we want to ignore the 2 least significant bits).
904
905 .sp
906 .in +2
907 .nf
908 # \fBflowadm add-flow -l bge0 -a dsfield=0x2e:0xfc \e
909 -p maxbw=500M,priority=high efphb-flow\fR
910 .fi
911 .in -2
912 .sp
913
914 .sp
915 .LP
916 Display summary information:
917
918 .sp
919 .in +2
920 .nf
921 # \fBflowadm show-usage -f /var/log/net.log\fR
922 FLOW DURATION IPACKETS RBYTES OPACKETS OBYTES BANDWIDTH
923 flowtcp 100 1031 546908 0 0 43.76 Kbps
924 flowudp 0 0 0 0 0 0.00 Mbps
925 .fi
926 .in -2
927 .sp
928
929 .sp
930 .LP
931 Display dates for which logging information is available:
932
933 .sp
934 .in +2
935 .nf
936 # \fBflowadm show-usage -d -f /var/log/net.log\fR
937 02/19/2008
938 .fi
939 .in -2
940 .sp
941
942 .sp
943 .LP
944 Display logging information for \fBflowtcp\fR starting at 02/19/2008, 10:38:46
945 and ending at 02/19/2008, 10:40:06:
946
947 .sp
948 .in +2
949 .nf
950 # \fBflowadm show-usage -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \e
951 -f /var/log/net.log flowtcp\fR
952 FLOW TIME IPACKETS RBYTES OPACKETS OBYTES BANDWIDTH
953 flowtcp 10:39:06 1 1546 4 6539 3.23 Kbps
954 flowtcp 10:39:26 2 3586 5 9922 5.40 Kbps
955 flowtcp 10:39:46 1 240 1 216 182.40 bps
956 flowtcp 10:40:06 0 0 0 0 0.00 bps
957 .fi
958 .in -2
959 .sp
960
961 .sp
962 .LP
963 Output the same information as above as a plotfile:
964
965 .sp
966 .in +2
967 .nf
968 # \fBflowadm show-usage -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \e
969 -p /home/plot/myplot -F gnuplot -f /var/log/net.log flowtcp\fR
970 # \fBTime tcp-flow\fR
971 10:39:06 3.23
972 10:39:26 5.40
973 10:39:46 0.18
974 10:40:06 0.00
975 .fi
976 .in -2
977 .sp
978
979 .SH EXIT STATUS
980 .sp
981 .ne 2
982 .na
983 \fB\fB0\fR\fR
984 .ad
985 .sp .6
986 .RS 4n
987 All actions were performed successfully.
988 .RE
989
990 .sp
991 .ne 2
992 .na
993 \fB\fB>0\fR\fR
994 .ad
995 .sp .6
996 .RS 4n
997 An error occurred.
998 .RE
999
1000 .SH ATTRIBUTES
1001 .sp
1002 .LP
1003 See \fBattributes\fR(5) for descriptions of the following attributes:
1004 .sp
1005
1006 .sp
1007 .TS
1008 box;
1009 c | c
1010 l | l .
1011 ATTRIBUTE TYPE ATTRIBUTE VALUE
1012 _
1013 Interface Stability Committed
1014 .TE
1015
1016 .SH SEE ALSO
1017 .sp
1018 .LP
1019 \fBacctadm\fR(1M), \fBdladm\fR(1M), \fBifconfig\fR(1M), \fBprstat\fR(1M),
1020 \fBroute\fR(1M), \fBattributes\fR(5), \fBdlpi\fR(7P)