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 outfoing transfer sessions intiated by all users, groups, or sets of specific users, you can use a virtual link (Vlink).

Vlinks are "virtual" bandwidth caps, in that they are not assigned to a specific transfer session, but to all sessions assigned to the same Vlink. The total bandwidth that is used by all incoming or outgoing transfer sessions initiated by users who are assigned to the same Vlink does not exceed the Vlink capacity.

For example, if you want to limit all incoming FASP transfers to 100 Mbps, you can create a Vlink with a 100 Mbps capacity and assign it globally to all incoming transfers. If a user attempts an upload at 50 Mbps but other incoming transfers are already using 75 Mbps, then the transfer rates adjust (based on transfer policy) so that the total does not exceed 100 Mbps.

For another example, if you want to limit to 10 Mbps the total bandwidth that is used by outgoing FASP transfers (downloads) that are initiated by three specific users, you can create a Vlink with a 10 Mbps capacity and assign it to outgoing transfers for those three users. If the three users are running download sessions that already use 10 Mbps and another download is started by one of the users, the transfer rates of all sessions adjust so that the total bandwidth use by those users remains 10 Mbps.

  1. Create a Vlink.
    Vlinks are created in your server's configuration file. 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:

    > 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 Select true to activate this Vlink; select 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 Specifiying a time varying schedule for a Vlink at https://support.asperasoft.com/hc/en-us/articles/216127698-Specifying-a-time-varying-schedule-for-a-Vlink.

    You can edit aspera.conf manually, rather than running asconfigurator commands, by opening the file with write permissions from the following location:

    C:\Program Files (x86)\Aspera\Enterprise Server\etc\aspera.conf

    Validate the aspera.conf file using the asuserdata utility:
    > asuserdata -v
  2. Apply the Vlink.
    You can 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 minimum rate that exceeds the vlink 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"