This section describes how to create flows and set flow properties to implement resource control.
Before You Begin
Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.
$ dladm show-link
$ ipadm show-addr
$ flowadm add-flow -l link -a attribute=value[,attribute=value] flow
Refers to the link on which you are configuring the flow.
A single attribute or combination of attributes that organizes network packets into a flow.
The direction attribute for a flow enables the classification of packets and implementing properties for flows on inbound or outbound packets. The direction attribute supports the values in for inbound only, out for outbound only, and bi for bidirectional. The default value for this attribute is bi. See Example 82, Creating a Flow With the direction Attribute.
Refers to the name that you assign to the flow.
For more information about flows and flow attributes, see the flowadm(8) man page.
$ dladm show-linkprop -p max-bw link
Refers to the datalink on which the flow is configured.
The range of values is listed under the POSSIBLE field of the command's output.
$ flowadm set-flowprop -p prop=value[,...] flow
For information about the properties that you can set for flows, see Setting Properties for Flows.
$ flowadm
$ flowadm show-flowprop flow
This command displays max-bw, priority, and hw-flow properties.
For an example about configuring flows and setting flow properties, see Use Case: Managing Network Resources by Setting Datalink and Flow Properties.
The following example shows how to create the flows http-in and http-out by specifying the direction attribute.
$ flowadm add-flow -l net4 -a transport=tcp,local_port=80,direction=in http-in $ flowadm add-flow -l net4 -a transport=tcp,local_port=80,direction=out http-out $ flowadm FLOW LINK PROTO LADDR LPORT RADDR RPORT DIR http-out net4 tcp -- 80 -- -- out http-in net4 tcp -- 80 -- -- in $ flowadm show-flow -o flow,link,dir FLOW LINK DIR http-out net4 out http-in net4 in
The direction value of bi is incompatible with the values in or out. If you try create a flow with the same attributes, the flow creation fails.
$ flowadm add-flow -l net4 -a transport=tcp,local_port=80 http-flow flowadm: add flow failed: a flow with identical attributes but with incompatible direction exists
You can create a flow with a different attribute and it will succeed.
$ flowadm add-flow -l net4 -a transport=tcp,local_port=443 ssl-flow $ flowadm FLOW LINK PROTO LADDR LPORT RADDR RPORT DIR http-out net4 tcp -- 80 -- -- out http-in net4 tcp -- 80 -- -- in ssl-flow net4 tcp -- 443 -- -- bi