Amazon Elastic Compute Cloud
User Guide (API Version 2014-06-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Enabling Enhanced Networking on Linux Instances in a VPC

With C3, R3, and I2 instances, you can enable enhanced networking capabilities. We support enhanced networking capabilities using single root I/O virtualization (SR-IOV). Enabling enhanced networking on your instance results in higher performance (packets per second), lower latency, and lower jitter.

To enable enhanced networking on your instance, you must ensure that its kernel has the required driver installed, and that you set the sriovNetSupport attribute for the instance.

Note that you can get directions for Windows from Enabling Enhanced Networking on Windows Instances in a VPC in the Amazon Elastic Compute Cloud Microsoft Windows Guide.

Requirements

  • Launch the instance from an HVM AMI with a minimum Linux kernel version of 2.6.32.

  • Launch the instance in a VPC.

  • Install either the AWS CLI or Amazon EC2 CLI tools. For more information, see Accessing Amazon EC2.

    If you choose the Amazon EC2 CLI tools, install version 1.6.12.0 or later. You can use the ec2-version command to verify the version of your CLI tools.

Using Amazon Linux

The latest Amazon Linux HVM AMIs have the driver required for enhanced networking installed and have the required attribute set. Therefore, if you launch an Amazon EBS–backed C3, R3, or I2 instance using a current Amazon Linux HVM AMI, enhanced networking is enabled for your instance. For more information, see Testing Whether Enhanced Networking Is Enabled.

If you launch your instance using an older Amazon Linux AMI, use the following procedure to enable enhanced networking on an Amazon EBS-backed instance.

To enable enhanced networking on older versions of Amazon Linux

  1. Connect to your instance.

  2. From the instance, run the following command:

    sudo yum update
  3. From your computer, reboot your instance using the Amazon EC2 console or one of the following commands: reboot-instances (AWS CLI) or ec2-reboot-instances (Amazon EC2 CLI).

  4. From your computer, stop the instance using the Amazon EC2 console or one of the following commands: stop-instances (AWS CLI) or ec2-stop-instances (Amazon EC2 CLI).

  5. From your computer, enable the enhanced networking attribute using one of the following commands. Note that there is no way to disable the networking attribute after you've enabled it.

    Warning

    Enhanced networking is supported only for HVM instances. Enabling enhanced networking with a PV instance can make it unreachable.

  6. (Optional) Create an AMI from the instance, as described in Creating an Amazon EBS-Backed Linux AMI. The AMI inherits the enhanced networking attribute from the instance. Therefore, you can use this AMI to launch a C3, R3, or I2 instance with the enhanced networking enabled by default.

  7. From your computer, start the instance using the Amazon EC2 console or one of the following commands: start-instances (AWS CLI) or ec2-start-instances (Amazon EC2 CLI).

Instance Store-Backed Instances

If your instance is an instance store–backed instance, you can't stop the instance, modify its attributes, and create an image as described in the previous procedure. Instead, create a new AMI as described in Creating an Instance Store-Backed Linux AMI. Be sure to enable the enhanced networking attribute when you register the AMI.

  • register-image (AWS CLI)

    $ aws ec2 register-image --sriov-net-support Value=simple ...
  • ec2-register (Amazon EC2 CLI)

    $ ec2-register --sriov simple ...

Using Linux Distributions Other Than Amazon Linux

The following procedure provides the general steps that you'll take when enabling enhanced networking on a Linux distribution other than Amazon Linux. For more information, such as detailed syntax for commands, see the documentation for your Linux distribution.

To enable enhanced networking on Linux

  1. Connect to your instance.

  2. Ensure that the PCI Hot Plug capability is enabled on your instance.

  3. Download and extract the source for the ixgbevf driver on your instance. Be sure to install a driver that is compatible with the kernel for your instance.

  4. Compile and install the ixgbevf driver on your instance.

  5. For the best performance, enable dynamic interrupt throttling for the installed driver as follows:

    $ echo "options ixgbevf InterruptThrottleRate=1,1,1,1,1,1,1,1" > /etc/modprobe.d/ixgbevf.conf

    Note that this is the typical location for ixgbevf.conf, but your Linux distribution might differ.

  6. From your computer, stop the instance using the Amazon EC2 console or one of the following commands: stop-instances (AWS CLI) or ec2-stop-instances (Amazon EC2 CLI).

  7. From your computer, enable the enhanced networking attribute using one of the following commands. Note that there is no way to disable the networking attribute after you've enabled it.

    Warning

    Enhanced networking is supported only for HVM instances. Enabling enhanced networking with a PV instance can make it unreachable.

  8. (Optional) Create an AMI from the instance, as described in Creating an Amazon EBS-Backed Linux AMI. The AMI inherits the enhanced networking attribute from the instance. Therefore, you can use this AMI to launch a C3, R3, or I2 instance with the enhanced networking enabled by default.

  9. From your computer, start the instance using the Amazon EC2 console or one of the following commands: start-instances (AWS CLI) or ec2-start-instances (Amazon EC2 CLI).

  10. (Optional) Connect to your instance and verify that the driver is installed.

Instance Store–Backed Instances

If your instance is an instance store–backed instance, you can't stop the instance, modify its attributes, and create an image as described in the previous procedure. Instead, create a new AMI as described in Creating an Instance Store-Backed Linux AMI. Be sure to enable the enhanced networking attribute when you register the AMI.

Warning

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

  • register-image (AWS CLI)

    $ aws ec2 register-image --sriov-net-support Value=simple ...
  • ec2-register (Amazon EC2 CLI)

    $ ec2-register --sriov simple ...

Troubleshooting Connectivity Issues

If you lose connectivity while enabling enhanced networking, the ixgbevf module might be incompatible with the kernel. Try installing the version of the ixgbevf module included with the distribution of Linux for your instance.

If you enable enhanced networking for a PV instance or AMI, this can make your instance unreachable.

Testing Whether Enhanced Networking Is Enabled

To test whether enhanced networking is enabled, verify that the driver is installed on your instance and that the sriovNetSupport attribute is set.

Driver (ixgbevf)

To verify that the ixgbevf driver is installed, use the ethtool command as follows:

$ sudo ethtool -i eth0
driver: ixgbevf
version: 2.11.3
firmware-version: N/A
bus-info: 0000:00:03.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

Attribute (sriovNetSupport)

To check whether an instance has the enhanced networking attribute set, use one of the following commands.

  • describe-instance-attribute (AWS CLI)

    $ aws ec2 describe-instance-attribute --instance-id instance_id --attribute sriovNetSupport

    If the enhanced networking attribute isn't set, SriovNetSupport is empty. Otherwise, SriovNetSupport is set as follows:

        "SriovNetSupport": {
            "Value": "simple"
        },
  • ec2-describe-instance-attribute (Amazon EC2 CLI)

    $ ec2-describe-instance-attribute instance_id --sriov

    If the enhanced networking attribute isn't set, you'll see no output for this command. Otherwise, you'll see the following output.

    sriovNetSupport instance_id   simple

To check whether an AMI already has the enhanced networking attribute set, use one of the following commands.

  • describe-image-attribute (AWS CLI)

    $ aws ec2 describe-image-attribute --image-id ami_id --attribute sriovNetSupport

    If the enhanced networking attribute isn't set, SriovNetSupport is empty. Otherwise, SriovNetSupport is set as follows:

        "SriovNetSupport": {
            "Value": "simple"
        },
  • ec2-describe-image-attribute (Amazon EC2 CLI)

    $ ec2-describe-image-attribute ami_id --sriov

    If the enhanced networking attribute isn't set, you'll see no output for this command. Otherwise, you'll see the following output.

    sriovNetSupport ami_id        simple