1 '\" te
   2 .\" Copyright 2020 Peter Tribble
   3 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
   4 .\" 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.
   5 .\" 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.
   6 .\" 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]
   7 .TH FLOWADM 1M "February 26, 2020"
   8 .SH NAME
   9 flowadm \- administer bandwidth resource control and priority for protocols,
  10 services, containers, and virtual machines
  11 .SH SYNOPSIS
  12 .nf
  13 \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[,...]
  14      [\fB-p\fR \fIprop\fR=\fIvalue\fR[,...]] \fIflow\fR
  15 \fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] {\fB-l\fR \fIlink\fR | \fIflow\fR}
  16 \fBflowadm show-flow\fR [\fB-p\fR] [\fB-l\fR \fIlink\fR] [\fB-o\fR \fIfield\fR[,...]] [\fIflow\fR]
  17 .fi
  18 
  19 .LP
  20 .nf
  21 \fBflowadm set-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
  22 \fBflowadm reset-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-p\fR \fIprop\fR[,...]] \fIflow\fR
  23 \fBflowadm show-flowprop\fR [\fB-cP\fR] [\fB-l\fR \fIlink\fR] [\fB-o\fR \fIfield\fR[,...]]
  24      [\fB-p\fR \fIprop\fR[,...]] [\fIflow\fR]
  25 .fi
  26 
  27 .SH DESCRIPTION
  28 The \fBflowadm\fR command is used to create, modify, remove, and show
  29 networking bandwidth and associated resources for a type of traffic on a
  30 particular link.
  31 .sp
  32 .LP
  33 The \fBflowadm\fR command allows users to manage networking bandwidth resources
  34 for a transport, service, or a subnet. The service is specified as a
  35 combination of transport and local port. The subnet is specified by its IP
  36 address and subnet mask. The command can be used on any type of data link,
  37 including physical links, virtual NICs, and link aggregations.
  38 .sp
  39 .LP
  40 A flow is defined as a set of attributes based on Layer 3 and Layer 4 headers,
  41 which can be used to identify a protocol, service, or a virtual machine. When a
  42 flow is identified based on flow attributes, separate kernel resources
  43 including layer 2, 3, and 4 queues, their processing threads, and other
  44 resources are uniquely created for it, such that other traffic has minimal or
  45 zero impact on it.
  46 .sp
  47 .LP
  48 Inbound and outbound packet are matched to flows in a very fast and scalable
  49 way, so that limits can be enforced with minimal performance impact.
  50 .sp
  51 .LP
  52 The \fBflowadm\fR command can be used to define a flow without imposing any
  53 bandwidth resource control. This would result in the traffic type getting its
  54 own resources and queues so that it is isolated from rest of the networking
  55 traffic for more observable and deterministic behavior.
  56 .sp
  57 .LP
  58 \fBflowadm\fR is implemented as a set of subcommands with corresponding
  59 options. Options are described in the context of each subcommand.
  60 .SH SUBCOMMANDS
  61 The following subcommands are supported:
  62 .sp
  63 .ne 2
  64 .na
  65 \fB\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
  66 \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] [\fB-p\fR
  67 \fIprop\fR=\fIvalue\fR[,...]] \fIflow\fR\fR
  68 .ad
  69 .sp .6
  70 .RS 4n
  71 Adds a flow to the system. The flow is identified by its flow attributes and
  72 properties.
  73 .sp
  74 As part of identifying a particular flow, its bandwidth resource can be limited
  75 and its relative priority to other traffic can be specified. If no bandwidth
  76 limit or priority is specified, the traffic still gets its unique layer 2, 3,
  77 and 4 queues and processing threads, including NIC hardware resources (when
  78 supported), so that the selected traffic can be separated from others and can
  79 flow with minimal impact from other traffic.
  80 .sp
  81 .ne 2
  82 .na
  83 \fB\fB-t\fR, \fB--temporary\fR\fR
  84 .ad
  85 .sp .6
  86 .RS 4n
  87 The changes are temporary and will not persist across reboots. Persistence is
  88 the default.
  89 .RE
  90 
  91 .sp
  92 .ne 2
  93 .na
  94 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
  95 .ad
  96 .sp .6
  97 .RS 4n
  98 Specifies an alternate root directory where \fBflowadm\fR should apply
  99 persistent creation.
 100 .RE
 101 
 102 .sp
 103 .ne 2
 104 .na
 105 \fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR\fR
 106 .ad
 107 .sp .6
 108 .RS 4n
 109 Specify the link to which the flow will be added.
 110 .RE
 111 
 112 .sp
 113 .ne 2
 114 .na
 115 \fB\fB-a\fR \fIattr\fR=\fIvalue\fR[,...], \fB--attr\fR=\fIvalue\fR\fR
 116 .ad
 117 .sp .6
 118 .RS 4n
 119 A mandatory comma-separated list of attributes to be set to the specified
 120 values.
 121 .RE
 122 
 123 .sp
 124 .ne 2
 125 .na
 126 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
 127 .ad
 128 .sp .6
 129 .RS 4n
 130 An optional comma-separated list of properties to be set to the specified
 131 values. Flow properties are documented in the "Flow Properties" section, below.
 132 .RE
 133 
 134 .RE
 135 
 136 .sp
 137 .ne 2
 138 .na
 139 \fB\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
 140 {\fIlink\fR | \fIflow\fR}\fR
 141 .ad
 142 .sp .6
 143 .RS 4n
 144 Remove an existing flow identified by its link or name.
 145 .sp
 146 .ne 2
 147 .na
 148 \fB\fB-t\fR, \fB--temporary\fR\fR
 149 .ad
 150 .sp .6
 151 .RS 4n
 152 The changes are temporary and will not persist across reboots. Persistence is
 153 the default.
 154 .RE
 155 
 156 .sp
 157 .ne 2
 158 .na
 159 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
 160 .ad
 161 .sp .6
 162 .RS 4n
 163 Specifies an alternate root directory where \fBflowadm\fR should apply
 164 persistent removal.
 165 .RE
 166 
 167 .sp
 168 .ne 2
 169 .na
 170 \fB\fB-l\fR \fIlink\fR | \fIflow\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
 171 .ad
 172 .sp .6
 173 .RS 4n
 174 If a link is specified, remove all flows from that link. If a single flow is
 175 specified, remove only that flow.
 176 .RE
 177 
 178 .RE
 179 
 180 .sp
 181 .ne 2
 182 .na
 183 \fB\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]]
 184 [\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fIflow\fR]\fR
 185 .ad
 186 .sp .6
 187 .RS 4n
 188 Show flow configuration information, either for all
 189 flows, all flows on a link, or for the specified \fIflow\fR.
 190 .sp
 191 .ne 2
 192 .na
 193 \fB\fB-o\fR \fIfield\fR[,...]\fR
 194 .ad
 195 .sp .6
 196 .RS 4n
 197 A case-insensitive, comma-separated list of output fields to display. The field
 198 name must be one of the fields listed below, or a special value \fBall\fR, to
 199 display all fields. For each flow found, the following fields can be displayed:
 200 .sp
 201 .ne 2
 202 .na
 203 \fB\fBflow\fR\fR
 204 .ad
 205 .sp .6
 206 .RS 4n
 207 The name of the flow.
 208 .RE
 209 
 210 .sp
 211 .ne 2
 212 .na
 213 \fB\fBlink\fR\fR
 214 .ad
 215 .sp .6
 216 .RS 4n
 217 The name of the link the flow is on.
 218 .RE
 219 
 220 .sp
 221 .ne 2
 222 .na
 223 \fB\fBipaddr\fR\fR
 224 .ad
 225 .sp .6
 226 .RS 4n
 227 IP address of the flow. This can be either local or remote depending on how the
 228 flow was defined.
 229 .RE
 230 
 231 .sp
 232 .ne 2
 233 .na
 234 \fB\fBproto\fR\fR
 235 .ad
 236 .sp .6
 237 .RS 4n
 238 The name of the layer for protocol to be used.
 239 .RE
 240 
 241 .sp
 242 .ne 2
 243 .na
 244 \fB\fBlport\fR\fR
 245 .ad
 246 .sp .6
 247 .RS 4n
 248 Local port of service for flow.
 249 .RE
 250 
 251 .sp
 252 .ne 2
 253 .na
 254 \fB\fBrport\fR\fR
 255 .ad
 256 .sp .6
 257 .RS 4n
 258 Remote port of service for flow.
 259 .RE
 260 
 261 .sp
 262 .ne 2
 263 .na
 264 \fB\fBdsfld\fR\fR
 265 .ad
 266 .sp .6
 267 .RS 4n
 268 Differentiated services value for flow and mask used with \fBDSFIELD\fR value
 269 to state the bits of interest in the differentiated services field of the IP
 270 header.
 271 .RE
 272 
 273 .RE
 274 
 275 .sp
 276 .ne 2
 277 .na
 278 \fB\fB-p\fR, \fB--parsable\fR\fR
 279 .ad
 280 .sp .6
 281 .RS 4n
 282 Display using a stable machine-parsable format.
 283 .RE
 284 
 285 .sp
 286 .ne 2
 287 .na
 288 \fB\fB-P\fR, \fB--persistent\fR\fR
 289 .ad
 290 .sp .6
 291 .RS 4n
 292 Display persistent flow property information.
 293 .RE
 294 
 295 .sp
 296 .ne 2
 297 .na
 298 \fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
 299 .ad
 300 .sp .6
 301 .RS 4n
 302 Display information for all flows on the named link or information for the
 303 named flow.
 304 .RE
 305 
 306 .RE
 307 
 308 .sp
 309 .ne 2
 310 .na
 311 \fB\fBflowadm set-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
 312 \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
 313 .ad
 314 .sp .6
 315 .RS 4n
 316 Set values of one or more properties on the flow specified by name. The
 317 complete list of properties can be retrieved using the \fBshow-flowprop\fR
 318 subcommand.
 319 .sp
 320 .ne 2
 321 .na
 322 \fB\fB-t\fR, \fB--temporary\fR\fR
 323 .ad
 324 .sp .6
 325 .RS 4n
 326 The changes are temporary and will not persist across reboots. Persistence is
 327 the default.
 328 .RE
 329 
 330 .sp
 331 .ne 2
 332 .na
 333 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
 334 .ad
 335 .sp .6
 336 .RS 4n
 337 Specifies an alternate root directory where \fBflowadm\fR should apply
 338 persistent setting of properties.
 339 .RE
 340 
 341 .sp
 342 .ne 2
 343 .na
 344 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
 345 .ad
 346 .sp .6
 347 .RS 4n
 348 A comma-separated list of properties to be set to the specified values.
 349 .RE
 350 
 351 .RE
 352 
 353 .sp
 354 .ne 2
 355 .na
 356 \fB\fBflowadm reset-flowprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
 357 [\fIprop\fR=\fIvalue\fR[,...]] \fIflow\fR\fR
 358 .ad
 359 .sp .6
 360 .RS 4n
 361 Resets one or more properties to their default values on the specified flow. If
 362 no properties are specified, all properties are reset. See the
 363 \fBshow-flowprop\fR subcommand for a description of properties, which includes
 364 their default values.
 365 .sp
 366 .ne 2
 367 .na
 368 \fB\fB-t\fR, \fB--temporary\fR\fR
 369 .ad
 370 .sp .6
 371 .RS 4n
 372 Specifies that the resets are temporary. Temporary resets last until the next
 373 reboot.
 374 .RE
 375 
 376 .sp
 377 .ne 2
 378 .na
 379 \fB\fB-R\fR \fIroot-dir\fR, \fB--root-dir\fR=\fIroot-dir\fR\fR
 380 .ad
 381 .sp .6
 382 .RS 4n
 383 Specifies an alternate root directory where \fBflowadm\fR should apply
 384 persistent setting of properties.
 385 .RE
 386 
 387 .sp
 388 .ne 2
 389 .na
 390 \fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR=\fIvalue\fR[,...]\fR
 391 .ad
 392 .sp .6
 393 .RS 4n
 394 A comma-separated list of properties to be reset.
 395 .RE
 396 
 397 .RE
 398 
 399 .sp
 400 .ne 2
 401 .na
 402 \fB\fBflowadm show-flowprop\fR [\fB-cP\fR] [\fB-l\fR \fIlink\fR] [\fB-p\fR
 403 \fIprop\fR[,...]] [\fIflow\fR]\fR
 404 .ad
 405 .sp .6
 406 .RS 4n
 407 Show the current or persistent values of one or more properties, either for all
 408 flows, flows on a specified link, or for the specified flow.
 409 .sp
 410 By default, current values are shown. If no properties are specified, all
 411 available flow properties are displayed. For each property, the following
 412 fields are displayed:
 413 .sp
 414 .ne 2
 415 .na
 416 \fB\fBFLOW\fR\fR
 417 .ad
 418 .sp .6
 419 .RS 4n
 420 The name of the flow.
 421 .RE
 422 
 423 .sp
 424 .ne 2
 425 .na
 426 \fB\fBPROPERTY\fR\fR
 427 .ad
 428 .sp .6
 429 .RS 4n
 430 The name of the property.
 431 .RE
 432 
 433 .sp
 434 .ne 2
 435 .na
 436 \fB\fBVALUE\fR\fR
 437 .ad
 438 .sp .6
 439 .RS 4n
 440 The current (or persistent) property value. The value is shown as \fB--\fR
 441 (double hyphen), if it is not set, and \fB?\fR (question mark), if the value is
 442 unknown. Persistent values that are not set or have been reset will be shown as
 443 \fB--\fR and will use the system \fBDEFAULT\fR value (if any).
 444 .RE
 445 
 446 .sp
 447 .ne 2
 448 .na
 449 \fB\fBDEFAULT\fR\fR
 450 .ad
 451 .sp .6
 452 .RS 4n
 453 The default value of the property. If the property has no default value,
 454 \fB--\fR (double hyphen), is shown.
 455 .RE
 456 
 457 .sp
 458 .ne 2
 459 .na
 460 \fB\fBPOSSIBLE\fR\fR
 461 .ad
 462 .sp .6
 463 .RS 4n
 464 A comma-separated list of the values the property can have. If the values span
 465 a numeric range, the minimum and maximum values might be shown as shorthand. If
 466 the possible values are unknown or unbounded, \fB--\fR (double hyphen), is
 467 shown.
 468 .RE
 469 
 470 Flow properties are documented in the "Flow Properties" section, below.
 471 .sp
 472 .ne 2
 473 .na
 474 \fB\fB-c\fR
 475 .ad
 476 .sp .6
 477 .RS 4n
 478 Display using a stable machine-parsable format.
 479 .RE
 480 
 481 .sp
 482 .ne 2
 483 .na
 484 \fB\fB-P\fR, \fB--persistent\fR\fR
 485 .ad
 486 .sp .6
 487 .RS 4n
 488 Display persistent flow property information.
 489 .RE
 490 
 491 .sp
 492 .ne 2
 493 .na
 494 \fB\fB-p\fR \fIprop\fR[,...], \fB--prop\fR=\fIprop\fR[,...]\fR
 495 .ad
 496 .sp .6
 497 .RS 4n
 498 A comma-separated list of properties to show.
 499 .RE
 500 
 501 .RE
 502 
 503 .SS "Flow Attributes"
 504 The flow operand that identify a flow in a \fBflowadm\fR command is a
 505 comma-separated list of one or more keyword, value pairs from the list below.
 506 .sp
 507 .ne 2
 508 .na
 509 \fB\fBlocal_ip\fR[\fB/\fR\fIprefix_len\fR]\fR
 510 .ad
 511 .sp .6
 512 .RS 4n
 513 Identifies a network flow by the local IP address. \fIvalue\fR must be a IPv4
 514 address in dotted-decimal notation or an IPv6 address in colon-separated
 515 notation. \fIprefix_len\fR is optional.
 516 .sp
 517 If \fIprefix_len\fR is specified, it describes the netmask for a subnet
 518 address, following the same notation convention of \fBifconfig\fR(1M) and
 519 \fBroute\fR(1M) addresses. If unspecified, the given IP address will be
 520 considered as a host address for which the default prefix length for a IPv4
 521 address is \fB/32\fR and for IPv6 is \fB/128\fR.
 522 .RE
 523 
 524 .sp
 525 .ne 2
 526 .na
 527 \fB\fBremote_ip\fR[\fB/\fR\fIprefix_len\fR]\fR
 528 .ad
 529 .sp .6
 530 .RS 4n
 531 Identifies a network flow by the remote IP address. The syntax is the same as
 532 the \fBlocal_ip\fR attribute.
 533 .RE
 534 
 535 .sp
 536 .ne 2
 537 .na
 538 \fB\fBtransport\fR={\fBtcp\fR|\fBudp\fR|\fBsctp\fR|\fBicmp\fR|\fBicmpv6\fR}\fR
 539 .ad
 540 .sp .6
 541 .RS 4n
 542 Identifies a layer 4 protocol to be used. It is typically used in combination
 543 with local_port to identify the service that needs special attention.
 544 .RE
 545 
 546 .sp
 547 .ne 2
 548 .na
 549 \fB\fBlocal_port\fR\fR
 550 .ad
 551 .sp .6
 552 .RS 4n
 553 Identifies a service specified by the local port.
 554 .RE
 555 
 556 .sp
 557 .ne 2
 558 .na
 559 \fB\fBremote_port\fR\fR
 560 .ad
 561 .sp .6
 562 .RS 4n
 563 Identifies a service specified by the remote port.
 564 .RE
 565 
 566 .sp
 567 .ne 2
 568 .na
 569 \fB\fBdsfield\fR[\fB:\fR\fIdsfield_mask\fR]\fR
 570 .ad
 571 .sp .6
 572 .RS 4n
 573 Identifies the 8-bit differentiated services field (as defined in RFC 2474).
 574 .sp
 575 The optional \fIdsfield_mask\fR is used to state the bits of interest in the
 576 differentiated services field when comparing with the \fBdsfield\fR value. A
 577 \fB0\fR in a bit position indicates that the bit value needs to be ignored and
 578 a \fB1\fR indicates otherwise. The mask can range from \fB0x01\fR to
 579 \fB0xff\fR. If \fIdsfield_mask\fR is not specified, the default mask \fB0xff\fR
 580 is used. Both the \fBdsfield\fR value and mask must be in hexadecimal.
 581 .RE
 582 
 583 .sp
 584 .LP
 585 The following six types of combinations of attributes are supported:
 586 .sp
 587 .in +2
 588 .nf
 589 local_ip[/\fIprefixlen\fR]=\fIaddress\fR
 590 remote_ip[/\fIprefixlen\fR]=\fIaddress\fR
 591 transport={tcp|udp|sctp|icmp|icmpv6}
 592 transport={tcp|udp|sctp},local_port=\fIport\fR
 593 transport={tcp|udp|sctp},remote_port=\fIport\fR
 594 dsfield=\fIval\fR[:\fIdsfield_mask\fR]
 595 .fi
 596 .in -2
 597 .sp
 598 
 599 .sp
 600 .LP
 601 On a given link, the types of combinations above are mutually exclusive. An
 602 attempt to create flows of different types on a given link will fail.
 603 .SS "Restrictions"
 604 There are individual flow restrictions and flow restrictions per zone.
 605 .SS "Individual Flow Restrictions"
 606 Restrictions on individual flows do not require knowledge of other flows that
 607 have been added to the link.
 608 .sp
 609 .LP
 610 An attribute can be listed only once for each flow. For example, the following
 611 command is not valid:
 612 .sp
 613 .in +2
 614 .nf
 615 # \fBflowadm add-flow -l vnic1 -a local_port=80,local_port=8080 httpflow\fR
 616 .fi
 617 .in -2
 618 .sp
 619 
 620 .sp
 621 .LP
 622 \fBtransport\fR and \fBlocal_port\fR:
 623 .sp
 624 .LP
 625 TCP, UDP, or SCTP flows can be specified with a local port. An ICMP or ICMPv6
 626 flow that specifies a port is not allowed. The following commands are valid:
 627 .sp
 628 .in +2
 629 .nf
 630 # \fBflowadm add-flow -l e1000g0 -a transport=udp udpflow\fR
 631 # \fBflowadm add-flow -l e1000g0 -a transport=tcp,local_port=80 \e
 632 udp80flow\fR
 633 .fi
 634 .in -2
 635 .sp
 636 
 637 .sp
 638 .LP
 639 The following commands are not valid:
 640 .sp
 641 .in +2
 642 .nf
 643 # \fBflowadm add-flow -l e1000g0 -a local_port=25 flow25\fR
 644 # \fBflowadm add-flow -l e1000g0 -a transport=icmpv6,local_port=16 \e
 645 flow16\fR
 646 .fi
 647 .in -2
 648 .sp
 649 
 650 .SS "Flow Restrictions Per Zone"
 651 Within a zone, no two flows can have the same name. After adding a flow with
 652 the link specified, the link will not be required for display, modification, or
 653 deletion of the flow.
 654 .SS "Flow Properties"
 655 The following flow properties are supported. Note that the ability to set a
 656 given property to a given value depends on the driver and hardware.
 657 .sp
 658 .ne 2
 659 .na
 660 \fB\fBmaxbw\fR\fR
 661 .ad
 662 .sp .6
 663 .RS 4n
 664 Sets the full duplex bandwidth for the flow. The bandwidth is specified as an
 665 integer with one of the scale suffixes(\fBK\fR, \fBM\fR, or \fBG\fR for Kbps,
 666 Mbps, and Gbps). If no units are specified, the input value will be read as
 667 Mbps. The default is no bandwidth limit.
 668 .RE
 669 
 670 .sp
 671 .ne 2
 672 .na
 673 \fB\fBpriority\fR\fR
 674 .ad
 675 .sp .6
 676 .RS 4n
 677 Sets the relative priority for the flow. The value can be given as one of the
 678 tokens \fBhigh\fR, \fBmedium\fR, or \fBlow\fR. The default is \fBmedium\fR.
 679 .RE
 680 
 681 .SH EXAMPLES
 682 \fBExample 1 \fRCreating a Policy Around a Mission-Critical Port
 683 .sp
 684 .LP
 685 The command below creates a policy around inbound HTTPS traffic on an HTTPS
 686 server so that HTTPS obtains dedicated NIC hardware and kernel TCP/IP
 687 resources. The name specified, \fBhttps-1\fR, can be used later to modify or
 688 delete the policy.
 689 
 690 .sp
 691 .in +2
 692 .nf
 693 # \fBflowadm add-flow -l bge0 -a transport=TCP,local_port=443 https-1\fR
 694 # \fBflowadm show-flow -l bge0\fR
 695 FLOW         LINK       IPADDR                   PROTO  LPORT   RPORT   DSFLD
 696 https1       bge0       --                       tcp    443     --      --
 697 .fi
 698 .in -2
 699 .sp
 700 
 701 .LP
 702 \fBExample 2 \fRModifying an Existing Policy to Add Bandwidth Resource Control
 703 .sp
 704 .LP
 705 The following command modifies the \fBhttps-1\fR policy from the preceding
 706 example. The command adds bandwidth control and give the policy a high
 707 priority.
 708 
 709 .sp
 710 .in +2
 711 .nf
 712 # \fBflowadm set-flowprop -p maxbw=500M,priority=high https-1\fR
 713 # \fBflowadm show-flow https-1\fR
 714 FLOW        LINK        IPADDR                   PROTO  LPORT   RPORT   DSFLD
 715 https-1     bge0        --                       tcp    443     --      --
 716 
 717 # \fBflowadm show-flowprop https-1\fR
 718 FLOW         PROPERTY        VALUE          DEFAULT        POSSIBLE
 719 https-1      maxbw             500          --             --
 720 https-1      priority        high           --             low,medium,high
 721 .fi
 722 .in -2
 723 .sp
 724 
 725 .LP
 726 \fBExample 3 \fRLimiting the UDP Bandwidth Usage
 727 .sp
 728 .LP
 729 The following command creates a policy for UDP protocol so that it cannot
 730 consume more than 100Mbps of available bandwidth. The flow is named
 731 \fBlimit-udp-1\fR.
 732 
 733 .sp
 734 .in +2
 735 .nf
 736 # \fBflowadm add-flow -l bge0 -a transport=UDP -p maxbw=100M, \e
 737 priority=low limit-udp-1\fR
 738 .fi
 739 .in -2
 740 .sp
 741 
 742 .LP
 743 \fBExample 4 \fRSetting Policy, Making Use of \fBdsfield\fR Attribute
 744 .sp
 745 .LP
 746 The following command sets a policy for EF PHB (DSCP value of 101110 from RFC
 747 2598) with a bandwidth of 500 Mbps and a high priority. The \fBdsfield\fR value
 748 for this flow will be \fB0x2e\fR (101110) with the \fBdsfield_mask\fR being
 749 \fB0xfc\fR (because we want to ignore the 2 least significant bits).
 750 
 751 .sp
 752 .in +2
 753 .nf
 754 # \fBflowadm add-flow -l bge0 -a dsfield=0x2e:0xfc \e
 755 -p maxbw=500M,priority=high efphb-flow\fR
 756 .fi
 757 .in -2
 758 .sp
 759 
 760 .SH EXIT STATUS
 761 .ne 2
 762 .na
 763 \fB\fB0\fR\fR
 764 .ad
 765 .sp .6
 766 .RS 4n
 767 All actions were performed successfully.
 768 .RE
 769 
 770 .sp
 771 .ne 2
 772 .na
 773 \fB\fB>0\fR\fR
 774 .ad
 775 .sp .6
 776 .RS 4n
 777 An error occurred.
 778 .RE
 779 
 780 .SH ATTRIBUTES
 781 See \fBattributes\fR(5) for descriptions of the following attributes:
 782 .sp
 783 
 784 .sp
 785 .TS
 786 box;
 787 c | c
 788 l | l .
 789 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 790 _
 791 Interface Stability     Committed
 792 .TE
 793 
 794 .SH SEE ALSO
 795 \fBdladm\fR(1M), \fBflowstat\fR(1M), \fBifconfig\fR(1M),
 796 \fBroute\fR(1M), \fBattributes\fR(5)
 797 
 798 .SH NOTES
 799 The display of statistics by the \fBshow-flow\fR subcommand, and the
 800 \fBshow-usage\fR subcommand, have been removed. This functionality can
 801 now be accessed using the \fBflowstat\fR(1M) utility.