Configure Accelerated Networking for an Azure VM

1.5 hours
  • 5 Learning Objectives

About this Hands-on Lab

Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. This high-performance path bypasses the host from the datapath, reducing latency, jitter, and CPU utilization, for use with the most demanding network workloads on supported VM types. In this lab, we will see firsthand how enabling accelerated networking can drastically improve network throughput between two virtual machines in the same virtual network.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Log In to the Azure Portal and Log On to the Virtual Machines
  1. Log in to the Azure Portal with the credentials provided.
  2. Click on All Resources in the navigation hub menu and familiarize yourself with the Azure resources that have been provisioned, including:

    • An Azure virtual network and network security group allowing SSH access to virtual machines
    • Two Windows virtual machines, along with supporting components (NIC, public IP, disk, etc.)
    • One Azure storage account

Log On to the Virtual Machines

  1. Click on the virtual machine named vm1-XXXXX, where XXXXX is a five-character unique lab ID for this lab.
  2. Inside the virtual machine blade, click the Connect button to download an RDP file for connecting to the virtual machine.
  3. Click on the virtual machine named vm2-XXXXX, where XXXXX is a five-character unique lab ID for this lab.
  4. Inside the virtual machine blade, click the Connect button to download an RDP file for connecting to the virtual machine.
  5. Using a remote desktop program of your choosing, use the files you just downloaded to connect and log in to the virtual machines with the following credentials:

    • Username: azureuser
    • Password: LA!2019!Lab1
Install Network Tools and Test Network Throughput

Verify Accelerated Networking Is Disabled

  1. On each virtual machine, click the Windows icon in the bottom-right corner of the screen.
  2. Click on Windows Administrative Tools in the menu and then click on Computer Management.
  3. In the Computer Management console, click on Device Manager in the left-hand pane.
  4. In the right-hand pane, expand Network adapters and note that the only network adapter for the VM is the Microsoft Hyper-V Network Adapter.

NIC results

Disable Windows Firewall

To ensure Windows Firewall does not inadvertently block or slow traffic between our virtual machines, we will disable it for this lab.

  1. On each virtual machine, open a PowerShell window and run the following script:

    Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

Download Networking Tools onto the Virtual Machines

  1. Download PSTools and NTttcp onto each virtual machine by opening a PowerShell window and running the following script:

    Add-Type -AssemblyName System.IO.Compression.FileSystem
    
    $url = "https://download.sysinternals.com/files/PSTools.zip"
    $url2 = "https://github.com/microsoft/ntttcp/releases/download/v5.36/NTttcp.exe"
    
    $zipfile = "C:UsersazureuserDesktopPSTools.zip"
    
    $folder = "C:UsersazureuserDesktopPSTools"
    
    Invoke-WebRequest -UseBasicParsing -OutFile $zipfile $url 
    
    Invoke-WebRequest -UseBasicParsing -OutFile $zipfile $url2 
    
    [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $folder)
    
    Remove-Item -Path $zipfile

PSPing – Determine Network Latency

Start PSPing in Server Mode on vm2-XXXXX

  1. On vm2-XXXXX, open up a command prompt by clicking the Windows icon.

  2. Click on Windows System in the menu and then click on Command Prompt.

  3. In the command prompt, start PSPing in server mode by typing the following commands:

    cd c:usersazureuserdesktoppstools
    
    psping.exe -f -s 10.0.1.4:1433
  4. Click Agree to agree to the licensing terms. PSPing will begin listening on TCP port 1433.

Start PSPing in Client Mode on vm1-XXXXX

  1. On vm1-XXXXX, open up a command prompt by clickung the Windows icon.

  2. Click on Windows System in the menu and then click on Command Prompt.

  3. In the command prompt, start PSPing in client mode by typing the following commands:

    cd c:usersazureuserdesktoppstools
    
    psping.exe -l 10m -n 2000 -4 -h -f 10.0.1.4:1433
  4. Click Agree to agree to the licensing terms.

  5. PSPing will begin a network latency test to vm2-XXXXX. Note the output of the test, which should look similar to the following:

PSPing1 results

  1. On vm2-XXXXX, type Control+C (Command+C on MacOS) to exit PSPing.

NTttcp – Determine Network Throughput

Start NTttcp in Server Mode on vm2-XXXXX

  1. On vm2-XXXXX, open up a command prompt by clicking the Windows icon and typing cmd.
  2. In the command prompt, start NTttcp in receiver mode by typing the following commands:

    cd c:usersazureuserdesktopntttcpamd64fre
    
    NTttcp.exe -r -p 50002 -m 8,*,10.0.1.4 -rb 10m -a 16 -t 300

    NTttcp will begin listening on TCP port 50002.

Start NTttcp in Client Mode on vm1-XXXXX

  1. On vm1-XXXXX, open up a command prompt by clicking the Windows icon and typing cmd.

  2. In the command prompt, start NTttcp in sender mode by typing the following commands:

    cd c:usersazureuserdesktopntttcpamd64fre
    
    NTttcp.exe -s -p 50002 -m 8,*,10.0.1.4 -l 10m -a 2 -t 300
  3. NTttcp will begin a network throughput test to vm2-XXXXX. Note the output of the test, which should look similar to the following:

NTttcp1 results

Configure Cloud Shell
  1. In the Azure Portal, click the Cloud Shell button in the top right-hand corner of the screen:

Azure Cloud Shell

  1. Set up Azure Cloud Shell for Bash using the advanced settings.

Azure Cloud Shell Advanced

  1. Configure the Cloud Shell with the following settings:

    • Subscription: Use the default
    • Resource group: Use existing, and ensure the resource group for the lab is selected.
    • Cloud Shell region: West US
    • Storage account: Use existing, and ensure the storage account named saXXXXX (where XXXXX represents a unique five-character lab ID) is selected.
    • File share: Create new, and name this anything you wish (no spaces).

Azure Cloud Shell Advanced

  1. Click Create storage to create the Cloud Shell environment.
Shut Down the Virtual Machines and Enable Accelerated Networking

In order to enable accelerated networking, we must first stop and deallocate the virtual machines in order to "free" the attched network intefaces. Let’s do that now.

Stop and Deallocate the Virtual Machines

  1. In Cloud Shell, shut down and deallocate each virtual machine with the following command:

    az vm deallocate --resource-group ResourceGroup --name vm-name
  2. Use your lab resource group and virtual machine names in place of ResourceGroup and vm-name. You can use the Tab key to populate the name of the resource group in this lab.

Enable accelerated networking on the network interfaces

  1. Now that our VMs have been stopped and deallocated, let’s update the network interfaces to enable accelerated networking:

    az network nic update --resource-group ResourceGroup --name nic-name --accelerated-networking true
  2. Use your lab resource group and network interface names in place of ResourceGroup and nic-name. You can use the Tab key to populate the name of the resource group in this lab.

Start the Virtual Machines

  1. In Cloud Shell, start each virtual machine with the following command:

    az vm start --resource-group ResourceGroup --name vm-name
  2. Use your lab resource group and virtual machine names in place of ResourceGroup and vm-name. You can use the Tab key to populate the name of the resource group in this lab.

Log On to Each VM and Retest the Networking Throughput
  1. Using a remote desktop program of your choosing, use the files downloaded in objective 1 to connect and log into the virtual machines. Use the following credentials:

    • Username: azureuser
    • Password: LA!2019!Lab1

Verify Accelerated Networking Is Enabled

  1. On each virtual machine, click the Windows icon.
  2. Click on Windows Administrative Tools in the menu and then click on Computer Management.
  3. In the Computer Management console, click on Device Manager in the left-hand pane.
  4. In the right-hand pane, expand Network adapters and note that an additional network adapter for the VM exists and is named the Mellanox ConnectX-3 Virtual Function Ethernet Adapter.

NIC results

Retest PSPing and NTttcp Tests from Earlier in the Lab

  1. Follow the steps for testing PSPing and NTttcp again. Note the results, which should show improvement in both latency and throughput.

Additional Resources

Scenario

In this lab, you are the Azure administrator for Astro Sporting Goods. You have two virtual machines in your Azure subscription:

  • vm1-XXXXX, which is an application server
  • vm2-XXXXX, which is a MySQL DB server

Note: XXXXX symbolizes a unique five-character lab ID for this lab.

You are receiving reports that throughput between the two servers is high and affecting production. You are tasked to improve network performance between the two virtual machines.

RDP Access to Virtual Machines

We will be using RDP to access our Windows virtual machines in this lab. For MacOS and Linux workstations, you may need to download an RDP application in order to connect to these virtual machines:

Additional Information

Additional information on accelerated networking can be found here.

The NTttcp.exe can now be found here: https://github.com/microsoft/ntttcp/releases/

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?