summaryrefslogtreecommitdiff
path: root/usr/src/man/man1m/flowadm.1m
blob: a64a7036126a9b24d7dd444b53528d27af81dd41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH FLOWADM 1M "Feb 14, 2009"
.SH NAME
flowadm \- administer bandwidth resource control and priority for protocols,
services, containers, and virtual machines
.SH SYNOPSIS
.LP
.nf
\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-S\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-l\fR \fIlink\fR]
     [\fB-o\fR \fIfield\fR[,...]] [\fB-z\fR \fIzonename\fR] [\fIflow\fR]
.fi

.LP
.nf
\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR \fIlink\fR
     \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] {\fB-l\fR \fIlink\fR | \fIflow\fR}
.fi

.LP
.nf
\fBflowadm set-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
\fBflowadm reset-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-p\fR \fIprop\fR[,...]] \fIflow\fR
\fBflowadm show-flowprop\fR [\fB-cP\fR] [\fB-l\fR \fIlink\fR] [\fB-o\fR \fIfield\fR[,...]]
     [\fB-p\fR \fIprop\fR[,...]] [\fIflow\fR]
.fi

.LP
.nf
\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]
     [\fB-e\fR \fItime\fR] \fB-f\fR \fIfilename\fR [\fIflow\fR]
.fi

.SH DESCRIPTION
.sp
.LP
The \fBflowadm\fR command is used to create, modify, remove, and show
networking bandwidth and associated resources for a type of traffic on a
particular link.
.sp
.LP
The \fBflowadm\fR command allows users to manage networking bandwidth resources
for a transport, service, or a subnet. The service is specified as a
combination of transport and local port. The subnet is specified by its IP
address and subnet mask. The command can be used on any type of data link,
including physical links, virtual NICs, and link aggregations.
.sp
.LP
A flow is defined as a set of attributes based on Layer 3 and Layer 4 headers,
which can be used to identify a protocol, service, or a virtual machine. When a
flow is identified based on flow attributes, separate kernel resources
including layer 2, 3, and 4 queues, their processing threads, and other
resources are uniquely created for it, such that other traffic has minimal or
zero impact on it.
.sp
.LP
Inbound and outbound packet are matched to flows in a very fast and scalable
way, so that limits can be enforced with minimal performance impact.
.sp
.LP
The \fBflowadm\fR command can be used to identify a flow without imposing any
bandwidth resource control. This would result in the traffic type getting its
own resources and queues so that it is isolated from rest of the networking
traffic for more observable and deterministic behavior.
.sp
.LP
\fBflowadm\fR is implemented as a set of subcommands with corresponding
options. Options are described in the context of each subcommand.
.SH SUB-COMMANDS
.sp
.LP
The following subcommands are supported:
.sp
.ne 2
.na
\fB\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fB-z\fR \fIzonename\fR] [\fIflow\fR]\fR
.ad
.sp .6
.RS 4n
Show flow configuration information (the default) or statistics, either for all
flows, all flows on a link, or for the specified \fIflow\fR.
.sp
.ne 2
.na
\fB\fB-o\fR \fIfield\fR[,...]\fR
.ad
.sp .6
.RS 4n
A case-insensitive, comma-separated list of output fields to display. The field
name must be one of the fields listed below, or a special value \fBall\fR, to
display all fields. For each flow found, the following fields can be displayed:
.sp
.ne 2
.na
\fB\fBflow\fR\fR
.ad
.sp .6
.RS 4n
The name of the flow.
.RE

.sp
.ne 2
.na
\fB\fBlink\fR\fR
.ad
.sp .6
.RS 4n
The name of the link the flow is on.
.RE

.sp
.ne 2
.na
\fB\fBipaddr\fR\fR
.ad
.sp .6
.RS 4n
IP address of the flow. This can be either local or remote depending on how the
flow was defined.
.RE

.sp
.ne 2
.na
\fB\fBtransport\fR\fR
.ad
.sp .6
.RS 4n
The name of the layer for protocol to be used.
.RE

.sp
.ne 2
.na
\fB\fBport\fR\fR
.ad
.sp .6
.RS 4n
Local port of service for flow.
.RE

.sp
.ne 2
.na
\fB\fBdsfield\fR\fR
.ad
.sp .6
.RS 4n
Differentiated services value for flow and mask used with \fBDSFIELD\fR value
to state the bits of interest in the differentiated services field of the IP
header.
.RE

.RE

.sp
.ne 2
.na
\fB\fB-p\fR, \fB--parseable\fR\fR
.ad
.sp .6
.RS 4n
Display using a stable machine-parseable format.
.RE

.sp
.ne 2
.na
\fB\fB-P\fR, \fB--persistent\fR\fR
.ad
.sp .6
.RS 4n
Display persistent flow property information.
.RE

.sp
.ne 2
.na
\fB\fB-S\fR, \fB--continuous\fR\fR
.ad
.sp .6
.RS 4n
Continuously display network utilization by flow in a manner similar to the way
that \fBprstat\fR(1M) displays CPU utilization by process.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR, \fB--statistics\fR\fR
.ad
.sp .6
.RS 4n
Displays flow statistics.
.RE

.sp
.ne 2
.na
\fB\fB-i\fR \fIinterval\fR, \fB--interval\fR=\fIinterval\fR\fR
.ad
.sp .6
.RS 4n
Used with the \fB-s\fR option to specify an interval, in seconds, at which
statistics should be displayed. If this option is not specified, statistics are
displayed once.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
.ad
.sp .6
.RS 4n
Display information for all flows on the named link or information for the
named flow.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-z\fR \fIzonename\fR
.ad
.sp .6
.RS 4n
Operate on a link that has been delegated to the specified zone.
.RE

.RE

.sp
.ne 2
.na
\fB\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
.ad
.sp .6
.RS 4n
Adds a flow to the system. The flow is identified by its flow attributes and
properties.
.sp
As part of identifying a particular flow, its bandwidth resource can be limited
and its relative priority to other traffic can be specified. If no bandwidth
limit or priority is specified, the traffic still gets its unique layer 2, 3,
and 4 queues and processing threads, including NIC hardware resources (when
supported), so that the selected traffic can be separated from others and can
flow with minimal impact from other traffic.
.sp
.ne 2
.na
\fB\fB-t\fR, \fB--temporary\fR\fR
.ad
.sp .6
.RS 4n
The changes are temporary and will not persist across reboots. Persistence is
the default.
.RE

.sp
.ne 2
.na
\fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
.ad
.sp .6
.RS 4n
Specifies an alternate root directory where \fBflowadm\fR should apply
persistent creation.
.RE

.sp
.ne 2
.na
\fB\fB-z\fR \fIzonename\fR
.ad
.sp .6
.RS 4n
Operate on a link that has been delegated to the specified zone.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR\fR
.ad
.sp .6
.RS 4n
Specify the link to which the flow will be added.
.RE

.sp
.ne 2
.na
\fB\fB-a\fR \fIattr\fR=\fIvalue\fR[,...], \fB--attr\fR=\fIvalue\fR\fR
.ad
.sp .6
.RS 4n
A comma-separated list of attributes to be set to the specified values.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
.ad
.sp .6
.RS 4n
A comma-separated list of properties to be set to the specified values.
.RE

.RE

.sp
.ne 2
.na
\fB\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR {\fIlink\fR | \fIflow\fR}\fR
.ad
.sp .6
.RS 4n
Remove an existing flow identified by its link or name.
.sp
.ne 2
.na
\fB\fB-t\fR, \fB--temporary\fR\fR
.ad
.sp .6
.RS 4n
The changes are temporary and will not persist across reboots. Persistence is
the default.
.RE

.sp
.ne 2
.na
\fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
.ad
.sp .6
.RS 4n
Specifies an alternate root directory where \fBflowadm\fR should apply
persistent removal.
.RE

.sp
.ne 2
.na
\fB\fB-z\fR \fIzonename\fR
.ad
.sp .6
.RS 4n
Operate on a link that has been delegated to the specified zone.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-l\fR \fIlink\fR | \fIflow\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
.ad
.sp .6
.RS 4n
If a link is specified, remove all flows from that link. If a single flow is
specified, remove only that flow.
.RE

.RE

.sp
.ne 2
.na
\fB\fBflowadm set-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
\fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
.ad
.sp .6
.RS 4n
Set values of one or more properties on the flow specified by name. The
complete list of properties can be retrieved using the \fBshow-flow\fR
subcommand.
.sp
.ne 2
.na
\fB\fB-t\fR, \fB--temporary\fR\fR
.ad
.sp .6
.RS 4n
The changes are temporary and will not persist across reboots. Persistence is
the default.
.RE

.sp
.ne 2
.na
\fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
.ad
.sp .6
.RS 4n
Specifies an alternate root directory where \fBflowadm\fR should apply
persistent setting of properties.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
.ad
.sp .6
.RS 4n
A comma-separated list of properties to be set to the specified values.
.RE

.RE

.sp
.ne 2
.na
\fB\fBflowadm reset-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
[\fIprop\fR=\fIvalue\fR[,...]] \fIflow\fR\fR
.ad
.sp .6
.RS 4n
Resets one or more properties to their default values on the specified flow. If
no properties are specified, all properties are reset. See the
\fBshow-flowprop\fR subcommand for a description of properties, which includes
their default values.
.sp
.ne 2
.na
\fB\fB-t\fR, \fB--temporary\fR\fR
.ad
.sp .6
.RS 4n
Specifies that the resets are temporary. Temporary resets last until the next
reboot.
.RE

.sp
.ne 2
.na
\fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
.ad
.sp .6
.RS 4n
Specifies an alternate root directory where \fBflowadm\fR should apply
persistent setting of properties.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
.ad
.sp .6
.RS 4n
A comma-separated list of properties to be reset.
.RE

.RE

.sp
.ne 2
.na
\fB\fBflowadm show-flowprop\fR [\fB-cP\fR] [\fB-l\fR \fIlink\fR] [\fB-p\fR
\fIprop\fR[,...]] [\fIflow\fR]\fR
.ad
.sp .6
.RS 4n
Show the current or persistent values of one or more properties, either for all
flows, flows on a specified link, or for the specified flow.
.sp
By default, current values are shown. If no properties are specified, all
available flow properties are displayed. For each property, the following
fields are displayed:
.sp
.ne 2
.na
\fB\fBFLOW\fR\fR
.ad
.sp .6
.RS 4n
The name of the flow.
.RE

.sp
.ne 2
.na
\fB\fBPROPERTY\fR\fR
.ad
.sp .6
.RS 4n
The name of the property.
.RE

.sp
.ne 2
.na
\fB\fBVALUE\fR\fR
.ad
.sp .6
.RS 4n
The current (or persistent) property value. The value is shown as \fB--\fR
(double hyphen), if it is not set, and \fB?\fR (question mark), if the value is
unknown. Persistent values that are not set or have been reset will be shown as
\fB--\fR and will use the system \fBDEFAULT\fR value (if any).
.RE

.sp
.ne 2
.na
\fB\fBDEFAULT\fR\fR
.ad
.sp .6
.RS 4n
The default value of the property. If the property has no default value,
\fB--\fR (double hyphen), is shown.
.RE

.sp
.ne 2
.na
\fB\fBPOSSIBLE\fR\fR
.ad
.sp .6
.RS 4n
A comma-separated list of the values the property can have. If the values span
a numeric range, the minimum and maximum values might be shown as shorthand. If
the possible values are unknown or unbounded, \fB--\fR (double hyphen), is
shown.
.RE

Flow properties are documented in the "Flow Properties" section, below.
.sp
.ne 2
.na
\fB\fB-c\fR, \fB--parseable\fR\fR
.ad
.sp .6
.RS 4n
Display using a stable machine-parseable format.
.RE

.sp
.ne 2
.na
\fB\fB-P\fR, \fB--persistent\fR\fR
.ad
.sp .6
.RS 4n
Display persistent flow property information.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIprop\fR[,...], \fB--prop\fR=\fIprop\fR[,...]\fR
.ad
.sp .6
.RS 4n
A comma-separated list of properties to show.
.RE

.RE

.sp
.ne 2
.na
\fB\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] [\fB-e\fR \fItime\fR]
[\fIflow\fR]\fR
.ad
.sp .6
.RS 4n
Show the historical network flow usage from a stored extended accounting file.
Configuration and enabling of network accounting through \fBacctadm\fR(1M) is
required. The default output will be the summary of flow usage for the entire
period of time in which extended accounting was enabled.
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.sp .6
.RS 4n
Display all historical network usage for the specified period of time during
which extended accounting is enabled. This includes the usage information for
the flows that have already been deleted.
.RE

.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.sp .6
.RS 4n
Display the dates for which there is logging information. The date is in the
format \fIDD\fR/\fIMM\fR/\fIYYYY\fR.
.RE

.sp
.ne 2
.na
\fB\fB-F\fR \fIformat\fR\fR
.ad
.sp .6
.RS 4n
Specifies the format of \fIplotfile\fR that is specified by the \fB-p\fR
option. As of this release, \fBgnuplot\fR is the only supported format.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIplotfile\fR\fR
.ad
.sp .6
.RS 4n
When specified with \fB-s\fR or \fB-e\fR (or both), outputs flow usage data to
a file of the format specified by the \fB-F\fR option, which is required.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR \fItime\fR, \fB-e\fR \fItime\fR\fR
.ad
.sp .6
.RS 4n
Start and stop times for data display. Time is in the format
\fIYYYY\fR.\fIMM\fR.\fIDD\fR,\fIhh\fR:\fImm\fR:\fIss\fR.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR \fIfilename\fR\fR
.ad
.sp .6
.RS 4n
Read extended accounting records of network flow usage from \fIfilename\fR.
.RE

.sp
.ne 2
.na
\fB\fIflow\fR\fR
.ad
.sp .6
.RS 4n
If specified, display the network flow usage only from the named flow.
Otherwise, display network usage from all flows.
.RE

.RE

.SS "Flow Attributes"
.sp
.LP
The flow operand that identify a flow in a \fBflowadm\fR command is a
comma-separated list of one or more keyword, value pairs from the list below.
.sp
.ne 2
.na
\fB\fBlocal_ip\fR[\fB/\fR\fIprefix_len\fR]\fR
.ad
.sp .6
.RS 4n
Identifies a network flow by the local IP address. \fIvalue\fR must be a IPv4
address in dotted-decimal notation or an IPv6 address in colon-separated
notation. \fIprefix_len\fR is optional.
.sp
If \fIprefix_len\fR is specified, it describes the netmask for a subnet
address, following the same notation convention of \fBifconfig\fR(1M) and
\fBroute\fR(1M) addresses. If unspecified, the given IP address will be
considered as a host address for which the default prefix length for a IPv4
address is \fB/32\fR and for IPv6 is \fB/128\fR.
.RE

.sp
.ne 2
.na
\fB\fBremote_ip\fR[\fB/\fR\fIprefix_len\fR]\fR
.ad
.sp .6
.RS 4n
Identifies a network flow by the remote IP address. The syntax is the same as
\fBlocal_ip\fR attributes
.RE

.sp
.ne 2
.na
\fB\fBtransport\fR={\fBtcp\fR|\fBudp\fR|\fBsctp\fR|\fBicmp\fR|\fBicmpv6\fR}\fR
.ad
.sp .6
.RS 4n
Identifies a layer 4 protocol to be used. It is typically used in combination
with local_port to identify the service that needs special attention.
.RE

.sp
.ne 2
.na
\fB\fBlocal_port\fR\fR
.ad
.sp .6
.RS 4n
Identifies a service specified by the local port.
.RE

.sp
.ne 2
.na
\fB\fBdsfield\fR[\fB:\fR\fIdsfield_mask\fR]\fR
.ad
.sp .6
.RS 4n
Identifies the 8-bit differentiated services field (as defined in RFC 2474).
.sp
The optional \fIdsfield_mask\fR is used to state the bits of interest in the
differentiated services field when comparing with the \fBdsfield\fR value. A
\fB0\fR in a bit position indicates that the bit value needs to be ignored and
a \fB1\fR indicates otherwise. The mask can range from \fB0x01\fR to
\fB0xff\fR. If \fIdsfield_mask\fR is not specified, the default mask \fB0xff\fR
is used. Both the \fBdsfield\fR value and mask must be in hexadecimal.
.RE

.sp
.LP
The following five types of combinations of attributes are supported:
.sp
.in +2
.nf
local_ip[/\fIprefixlen\fR]=\fIaddress\fR
remote_ip[/\fIprefixlen\fR]=\fIaddress\fR
transport={tcp|udp|sctp|icmp|icmpv6}
transport={tcp|udp|sctp},local_port=\fIport\fR
dsfield=\fIval\fR[:\fIdsfield_mask\fR]
.fi
.in -2
.sp

.sp
.LP
On a given link, the combinations above are mutually exclusive. An attempt to
create flows of different combinations will fail.
.SS "Restrictions"
.sp
.LP
There are individual flow restrictions and flow restrictions per zone.
.SS "Individual Flow Restrictions"
.sp
.LP
Restrictions on individual flows do not require knowledge of other flows that
have been added to the link.
.sp
.LP
An attribute can be listed only once for each flow. For example, the following
command is not valid:
.sp
.in +2
.nf
# \fBflowadm add-flow -l vnic1 -a local_port=80,local_port=8080 httpflow\fR
.fi
.in -2
.sp

.sp
.LP
\fBtransport\fR and \fBlocal_port\fR:
.sp
.LP
TCP, UDP, or SCTP flows can be specified with a local port. An ICMP or ICMPv6
flow that specifies a port is not allowed. The following commands are valid:
.sp
.in +2
.nf
# \fBflowadm add-flow -l e1000g0 -a transport=udp udpflow\fR
# \fBflowadm add-flow -l e1000g0 -a transport=tcp,local_port=80 \e
udp80flow\fR
.fi
.in -2
.sp

.sp
.LP
The following commands are not valid:
.sp
.in +2
.nf
# \fBflowadm add-flow -l e1000g0 -a local_port=25 flow25\fR
# \fBflowadm add-flow -l e1000g0 -a transport=icmpv6,local_port=16 \e
flow16\fR
.fi
.in -2
.sp

.SS "Flow Restrictions Per Zone"
.sp
.LP
Within a zone, no two flows can have the same name. After adding a flow with
the link specified, the link will not be required for display, modification, or
deletion of the flow.
.SS "Flow Properties"
.sp
.LP
The following flow properties are supported. Note that the ability to set a
given property to a given value depends on the driver and hardware.
.sp
.ne 2
.na
\fB\fBmaxbw\fR\fR
.ad
.sp .6
.RS 4n
Sets the full duplex bandwidth for the flow. The bandwidth is specified as an
integer with one of the scale suffixes(\fBK\fR, \fBM\fR, or \fBG\fR for Kbps,
Mbps, and Gbps). If no units are specified, the input value will be read as
Mbps. The default is no bandwidth limit.
.RE

.sp
.ne 2
.na
\fB\fBpriority\fR\fR
.ad
.sp .6
.RS 4n
Sets the relative priority for the flow. The value can be given as one of the
tokens \fBhigh\fR, \fBmedium\fR, or \fBlow\fR. The default is \fBmedium\fR.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRCreating a Policy Around a Mission-Critical Port
.sp
.LP
The command below creates a policy around inbound HTTPS traffic on an HTTPS
server so that HTTPS obtains dedicated NIC hardware and kernel TCP/IP
resources. The name specified, \fBhttps-1\fR, can be used later to modify or
delete the policy.

.sp
.in +2
.nf
# \fBflowadm add-flow -l bge0 -a transport=TCP,local_port=443 https-1\fR
# \fBflowadm show-flow -l bge0\fR
FLOW         LINK         IP ADDR                PROTO  PORT    DSFLD
https1       bge0         --                     tcp    443     --
.fi
.in -2
.sp

.LP
\fBExample 2 \fRModifying an Existing Policy to Add Bandwidth Resource Control
.sp
.LP
The following command modifies the \fBhttps-1\fR policy from the preceding
example. The command adds bandwidth control and give the policy a high
priority.

.sp
.in +2
.nf
# \fBflowadm set-flowprop -p maxbw=500M,priority=high https-1\fR
# \fBflowadm show-flow https-1\fR
FLOW         LINK         IP ADDR                PROTO  PORT    DSFLD
https1       bge0         --                     tcp    443     --

# \fBflowadm show-flowprop https-1\fR
FLOW        PROPERTY    VALUE     DEFAULT      POSSIBLE
https-1     maxbw       500       --           --
https-1     priority    HIGH      --          LOW,NORMAL,HIGH
.fi
.in -2
.sp

.LP
\fBExample 3 \fRLimiting the UDP Bandwidth Usage
.sp
.LP
The following command creates a policy for UDP protocol so that it cannot
consume more than 100Mbps of available bandwidth. The flow is named
\fBlimit-udp-1\fR.

.sp
.in +2
.nf
# \fBflowadm add-flow -l bge0 -a transport=UDP -p maxbw=100M, \e
priority=low limit-udp-1\fR
.fi
.in -2
.sp

.LP
\fBExample 4 \fRShowing Flow Usage
.sp
.LP
Flow usage statistics can be stored using the extended accounting facility,
\fBacctadm\fR(1M).

.sp
.in +2
.nf
# \fBacctadm -e extended -f /var/log/net.log net\fR

# \fBacctadm net\fR
Network accounting: active
Network accounting file: /var/log/net.log
Tracked Network resources: extended
Untracked Network resources: none
.fi
.in -2
.sp

.sp
.LP
The historical data that was saved can be retrieved in summary form using the
\fBshow-usage\fR subcommand of \fBflowadm\fR.

.LP
\fBExample 5 \fRSetting Policy, Making Use of \fBdsfield\fR Attribute
.sp
.LP
The following command sets a policy for EF PHB (DSCP value of 101110 from RFC
2598) with a bandwidth of 500 Mbps and a high priority. The \fBdsfield\fR value
for this flow will be \fB0x2e\fR (101110) with the \fBdsfield_mask\fR being
\fB0xfc\fR (because we want to ignore the 2 least significant bits).

.sp
.in +2
.nf
# \fBflowadm add-flow -l bge0 -a dsfield=0x2e:0xfc \e
-p maxbw=500M,priority=high efphb-flow\fR
.fi
.in -2
.sp

.sp
.LP
Display summary information:

.sp
.in +2
.nf
# \fBflowadm show-usage -f /var/log/net.log\fR
FLOW      DURATION  IPACKETS RBYTES      OPACKETS OBYTES     BANDWIDTH
flowtcp   100       1031     546908      0        0          43.76 Kbps
flowudp   0         0        0           0        0           0.00 Mbps
.fi
.in -2
.sp

.sp
.LP
Display dates for which logging information is available:

.sp
.in +2
.nf
# \fBflowadm show-usage -d -f /var/log/net.log\fR
02/19/2008
.fi
.in -2
.sp

.sp
.LP
Display logging information for \fBflowtcp\fR starting at 02/19/2008, 10:38:46
and ending at 02/19/2008, 10:40:06:

.sp
.in +2
.nf
# \fBflowadm show-usage -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \e
-f /var/log/net.log flowtcp\fR
FLOW      TIME       IPACKETS RBYTES      OPACKETS OBYTES     BANDWIDTH
flowtcp   10:39:06   1        1546         4       6539       3.23 Kbps
flowtcp   10:39:26   2        3586         5       9922       5.40 Kbps
flowtcp   10:39:46   1        240          1       216       182.40 bps
flowtcp   10:40:06   0        0            0       0           0.00 bps
.fi
.in -2
.sp

.sp
.LP
Output the same information as above as a plotfile:

.sp
.in +2
.nf
# \fBflowadm show-usage -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \e
-p /home/plot/myplot -F gnuplot -f /var/log/net.log flowtcp\fR
# \fBTime tcp-flow\fR
10:39:06 3.23
10:39:26 5.40
10:39:46 0.18
10:40:06 0.00
.fi
.in -2
.sp

.SH EXIT STATUS
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.sp .6
.RS 4n
All actions were performed successfully.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.sp .6
.RS 4n
An error occurred.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.sp
.LP
\fBacctadm\fR(1M), \fBdladm\fR(1M), \fBifconfig\fR(1M), \fBprstat\fR(1M),
\fBroute\fR(1M), \fBattributes\fR(5), \fBdlpi\fR(7P)