Controlling Bandwidth Usage with Virtual Links (Command Line)

FASP transfers attempt to transfer at the maximum transfer rate available. However, too many simultaneous transfers can overwhelm your storage or leave little bandwidth available for other network activity. To set a bandwidth cap on the total bandwidth used by incoming or outgoing transfer sessions initiated by all users, groups, or sets of specific users, set up a virtual link (Vlink).

  1. Create a Vlink.
    To create a Vlink, run the following command as administrator:
    # asconfigurator -x "set_trunk_data;id,vlink_id;trunk_capacity,bandwidth;trunk_on,true"

    You can also specify a multicast port and time-to-live, among other settings. To see a complete list of parameters with their corresponding asconfigurator commands, run the following command:

    # /opt/aspera/bin/asuserdata -+

    The following table describes several parameters that are frequently used:

    Tag Description Values Default
    Vlink ID The Vlink ID. Sessions assigned with the same trunk ID share the same bandwidth cap. positive integer between 1 and 255. N/A
    Vlink Name The Vlink name. This value has no impact on actual bandwidth capping. text string blank
    Capacity This value reflects the virtual bandwidth cap in Kbps. When applying this Vlink to a transfer (e.g. Default outgoing), the transfer's bandwidth will be restricted by this value. positive integer in Kbps 50000
    On Set to true to activate this Vlink; set to false to deactivate it. true/false false
    Multicast Port This sets the UDP port through which virtual link sends and receives multicast communication messages. Sessions sharing the same virtual bandwidth cap needs to have the same port number. To avoid port conflicts, it is recommended to use the default UDP port 55001. Do NOT set the port number to the same one used by FASP data transfer (33001).
    Important: If you have a local firewall on your server (for example, Windows firewall, Linux iptables, or Mac ipfw), you will need to allow the Vlink UDP port (55001, by default) for multicast traffic.
    positive integer between 1 and 65535 55001
    Multicast TTL This sets the Time-to-Live (TTL) field in the IP header for Vlink multicast packets. positive integer between 1 and 255 blank

    For example, to create a Vlink with an ID of 108, named "50Mbps cap", with a capacity of 50 Mbps (50000 kbps), run the following command:

    # asconfigurator -x "set_trunk_data;id,108;trunk_name,50Mbps cap;trunk_capacity,50000;trunk_on,true"

    This creates the following text in aspera.conf:

    <CONF version="2">
      ...
      <trunks>
        <trunk>
          <id>108</id>                                   <!-- Vlink ID -->
          <name>50Mbps cap</name>                        <!-- Vlink Name -->
          <capacity>
            <schedule format="ranges">50000</schedule>   <!-- Capacity -->
          </capacity>
          <on>true</on>                                  <!-- On -->  
        </trunk>
      </trunks>
    </CONF>

    The capacity of the Vlink is set within a <schedule> tag because the capacity can be scheduled as one value during a specified time period, and a default value at all other times. For more information on this configuration, see the knowledge base article Specifying a time varying schedule for a Vlink at https://www.ibm.com/support/pages/specifying-time-varying-schedule-vlink.

    To edit aspera.conf manually, rather than running asconfigurator commands, open the file with write permissions from the following location:

    /opt/aspera/etc/aspera.conf

    Validate the aspera.conf file using the asuserdata utility:
    # /opt/aspera/bin/asuserdata -v
  2. Apply the Vlink.
    Assign a Vlink to global, group, or user settings for transfers in or out. Use the following syntax, updating the direction (in or out) depending on your needs:
    # asconfigurator -x "set_node_data;transfer_in_bandwidth_aggregate_trunk_id,id"
    # asconfigurator -x "set_group_data;group_name,groupname;transfer_out_bandwidth_aggregate_trunk_id,id"
    # asconfigurator -x "set_user_data;user_name,username;transfer_out_bandwidth_aggregate_trunk_id,id"

    For example, to set Vlink 108 as the default for transfers out and set Vlink 109 to the user aspera_user_1 for transfers out, run the following commands:

    # asconfigurator -x "set_node_data;transfer_out_bandwidth_aggregate_trunk_id,108"
    # asconfigurator -x "set_user_data;user_name,aspera_user_1;transfer_out_bandwidth_aggregate_trunk_id,109"

    These commands add the following lines to aspera.conf:

    <CONF version="2">
      ...
      <default>
        <transfer>
          <out>
            <bandwidth><aggregate>
              <trunk_id>108</trunk_id> <!-- Vlink #108 for the default outgoing sessions. -->
            </aggregate></bandwidth>
          </out>
          <in>
           ...
          </in>
        </transfer>
      </default>
      <aaa><realms><realm>
        <users>
          <user>
            <name>aspera_user_1</name>
            <transfer>
              <out>
                <bandwidth><aggregate>
                  <trunk_id>109</trunk_id> <!-- Vlink #109 to the user aspera_user_1's outgoing sessions. -->
                </aggregate></bandwidth>
              </out>
              <in>
               ...
              </in>
            </transfer>
          </user>
        </users>
      </realm></realms></aaa>
    </CONF>
  3. Prevent users from overriding the Vlink settings.
    If a user requests a high minimum rate and minimum rates are not locked, the transfer can exceed Vlink limits. To prevent this:
    1. Set the default incoming or outgoing minimum rate to zero (zero is the default) by running the appropriate command:
      # asconfigurator -x "set_node_data;transfer_in_bandwidth_flow_min_rate_default,0"
      # asconfigurator -x "set_node_data;transfer_out_bandwidth_flow_min_rate_default,0"
    2. Lock the minimum default transfer rate for select users or globally. The following commands lock minimum incoming and outgoing transfer rates for all users:
      # asconfigurator -x "set_node_data;transfer_in_bandwidth_flow_min_rate_lock,true"
      # asconfigurator -x "set_node_data;transfer_out_bandwidth_flow_min_rate_lock,true"