The bandwidth resource control feature enables you to limit the physical network bandwidth consumed by a virtual network device. This feature is supported on a service domain that runs at least the Oracle Solaris 11 OS and is configured with a virtual switch. Oracle Solaris 10 service domains silently ignore network bandwidth settings. This feature ensures that one guest domain does not take over the available physical network bandwidth and leave none for the others.
Use the ldm add-vnet and ldm set-vnet commands to specify the bandwidth limit by providing a value for the maxbw property. Use the ldm list-bindings or the ldm list-domain -o network command to view the maxbw property value for an existing virtual network device. The minimum bandwidth limit is 10 Mbps.
The bandwidth resource control applies only to the traffic that goes through the virtual switch. Thus, inter-vnet traffic is not subjected to this limit. If you do not have a physical backend device configured, you can ignore bandwidth resource control.
The minimum supported bandwidth limit depends on the Oracle Solaris network stack in the service domain. The bandwidth limit can be configured with any desired high value. There is no upper limit. The bandwidth limit ensures only that the bandwidth does not exceed the configured value. Thus, you can configure a bandwidth limit with a value greater than the link speed of the physical network device that is assigned to the virtual switch.
Use the ldm add-vnet command to create a virtual network device and specify the bandwidth limit by providing a value for the maxbw property.
primary# ldm add-vnet maxbw=limit if-name vswitch-name domain-name
Use the ldm set-vnet command to specify the bandwidth limit for an existing virtual network device.
primary# ldm set-vnet maxbw=limit if-name domain-name
You can also clear the bandwidth limit by specifying a blank value for the maxbw property:
primary# ldm set-vnet maxbw= if-name domain-name
The following examples show how to use the ldm command to specify the bandwidth limit. The bandwidth is specified as an integer with a unit. The unit is M for megabits-per-second or G for gigabits-per-second. The unit is megabits-per-second if you do not specify a unit.
Example 41 Setting the Bandwidth Limit When Creating a Virtual Network DeviceThe following command creates a virtual network device (vnet0) that has a bandwidth limit of 100 Mbps.
primary# ldm add-vnet maxbw=100M vnet0 primary-vsw0 ldg1
The following command would issue an error message when attempting to set a bandwidth limit below the minimum value, which is 10 Mbps.
primary# ldm add-vnet maxbw=1M vnet0 primary-vsw0 ldg1Example 42 Setting the Bandwidth Limit on an Existing Virtual Network Device
The following commands sets the bandwidth limit to 200 Mbps on the existing vnet0 device.
Depending on the real-time network traffic pattern, the amount of bandwidth might not reach the specified limit of 200 Mbps. For example, the bandwidth might be 95 Mbps, which does not exceed the 200 Mbps limit.
primary# ldm set-vnet maxbw=200M vnet0 ldg1
The following command sets the bandwidth limit to 2 Gbps on the existing vnet0 device.
Because there is no upper limit on bandwidth in the MAC layer, you can still set the limit to be 2 Gbps even if the underlying physical network speed is less than 2 Gbps. In such a case, there is no bandwidth limit effect.
primary# ldm set-vnet maxbw=2G vnet0 ldg1Example 43 Clearing the Bandwidth Limit on an Existing Virtual Network Device
The following command clears the bandwidth limit on the specified virtual network device (vnet0). By clearing this value, the virtual network device uses the maximum bandwidth available, which is provided by the underlying physical device.
primary# ldm set-vnet maxbw= vnet0 ldg1Example 44 Viewing the Bandwidth Limit of an Existing Virtual Network Device
The ldm list-bindings command shows the value of the maxbw property for the specified virtual network device, if defined.
The following command shows that the vnet0 virtual network device has a bandwidth limit of 15 Mbps. If no bandwidth limit is set, the MAXBW field is blank.
primary# ldm list-bindings ... VSW NAME MAC NET-DEV ID DEVICE LINKPROP primary-vsw0 00:14:4f:f9:95:97 net0 0 switch@0 1 DEFAULT-VLAN-ID PVID VID MTU MODE INTER-VNET-LINK 1 1 1500 on PEER MAC PVID VID MTU MAXBW LINKPROP INTERVNETLINK vnet0@ldg1 00:14:4f:fb:b8:c8 1 1500 15 ... NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME ldg1 bound ------ 5000 8 2G NETWORK NAME SERVICE ID DEVICE vnet0 primary-vsw0@primary 0 network@0 MAC MODE PVID VID MTU MAXBW LINKPROP 00:14:4f:fb:b8:c8 1 1500 15 PEER MAC MODE PVID VID primary-vsw0@primary 00:14:4f:f9:95:97 1 MTU MAXBW LINKPROP 1500
You can also use the dladm show-linkprop command to view the maxbw property value as follows:
# dladm show-linkprop -p maxbw LINK PROPERTY PERM VALUE EFFECTIVE DEFAULT POSSIBLE ... ldoms-vsw0.vport0 maxbw rw 15 15 -- --