Skip to content

Commit 0281842

Browse files
authored
Merge pull request #257060 from asudbring/vnet-tcp-test
Testing of steps in how to for testing throughput and fixes from Github issues
2 parents 192cd75 + 1b0f3f9 commit 0281842

File tree

1 file changed

+135
-52
lines changed

1 file changed

+135
-52
lines changed

articles/virtual-network/virtual-network-bandwidth-testing.md

Lines changed: 135 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: asudbring
66
ms.service: virtual-network
77
ms.topic: how-to
88
ms.workload: infrastructure-services
9-
ms.date: 03/23/2023
9+
ms.date: 11/01/2023
1010
ms.author: allensu
1111
---
1212

@@ -16,33 +16,56 @@ This article describes how to use the free NTTTCP tool from Microsoft to test ne
1616

1717
## Prerequisites
1818

19-
To test throughput, you need two VMs of the same size to function as *sender* and *receiver*. The two VMs should be in the same [proximity placement group](/azure/virtual-machines/co-location) or [availability set](/azure/virtual-machines/availability-set-overview), so you can use their internal IP addresses and exclude load balancers from the test.
20-
21-
Note the number of VM cores and the receiver VM IP address to use in the commands. Both the sender and receiver commands use the receiver's IP address.
19+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
20+
- Two Windows or Linux virtual machines in Azure. [Create a Windows VM](/azure/virtual-machines/windows/quick-create-portal) or [create a Linux VM](/azure/virtual-machines/linux/quick-create-portal).
21+
- To test throughput, you need two VMs of the same size to function as *sender* and *receiver*. The two VMs should be in the same [proximity placement group](/azure/virtual-machines/co-location) or [availability set](/azure/virtual-machines/availability-set-overview), so you can use their internal IP addresses and exclude load balancers from the test.
22+
- Note the number of VM cores and the receiver VM IP address to use in the commands. Both the sender and receiver commands use the receiver's IP address.
2223

2324
>[!NOTE]
2425
>Testing by using a virtual IP (VIP) is possible, but is beyond the scope of this article.
2526
27+
**Examples used in this article**
28+
29+
| Setting | Value |
30+
|---|---|
31+
| Receiver VM IP address | **10.0.0.5** |
32+
| Number of VM cores | **2** |
33+
2634
## Test throughput with Windows VMs or Linux VMs
2735

2836
You can test throughput from Windows VMs by using [NTTTCP](https://github.com/microsoft/ntttcp) or from Linux VMs by using [NTTTCP-for-Linux](https://github.com/Microsoft/ntttcp-for-linux).
2937

3038
# [Windows](#tab/windows)
3139

32-
### Set up NTTTCP and test configuration
40+
### Prepare VMs and install NTTTCP-for-Windows
3341

34-
1. On both the sender and receiver VMs, [download the latest version of NTTTCP](https://github.com/microsoft/ntttcp/releases/latest) into a separate folder like *c:\\tools*.
42+
1. On both the sender and receiver VMs, [download the latest version of NTTTCP](https://github.com/microsoft/ntttcp/releases/latest) into a separate folder like **c:\\tools**.
3543

36-
1. On the receiver VM, create a Windows Defender Firewall `allow` rule to allow the NTTTCP traffic to arrive. It's easier to allow *nttcp.exe* by name than to allow specific inbound TCP ports. Run the following command, replacing `c:\tools` with your download path for *ntttcp.exe* if different.
44+
1. Open the Windows command line and navigate to the folder where you downloaded **ntttcp.exe**.
3745

38-
```cmd
39-
netsh advfirewall firewall add rule program=c:\tools\ntttcp.exe name="ntttcp" protocol=any dir=in action=allow enable=yes profile=ANY
40-
```
46+
1. On the receiver VM, create a Windows Firewall `allow` rule to allow the NTTTCP traffic to arrive. It's easier to allow **nttcp.exe** by name than to allow specific inbound TCP ports. Run the following command, replacing `c:\tools` with your download path for **ntttcp.exe** if different.
47+
48+
```cmd
49+
netsh advfirewall firewall add rule program=c:\tools\ntttcp.exe name="ntttcp" protocol=any dir=in action=allow enable=yes profile=ANY
50+
```
4151
42-
1. To confirm your configuration, test a single Transfer Control Protocol (TCP) stream for 10 seconds by running the following commands:
52+
1. To confirm your configuration, use the following commands to test a single Transfer Control Protocol (TCP) stream for 10 seconds on the receiver and sender virtual machines:
4353
44-
- On the receiver VM, run `ntttcp -r -t 10 -P 1`.
45-
- On the sender VM, run `ntttcp -s<receiver IP address> -t 10 -n 1 -P 1`.
54+
**Receiver VM**
55+
56+
`ntttcp -r -m [<number of VM cores> x 2],*,<receiver IP address> -t 10 -P 1`
57+
58+
```cmd
59+
ntttcp -r -m 4,*,10.0.0.5 -t 10 -P 1
60+
```
61+
62+
**Sender VM**
63+
64+
`ntttcp -s -m [<number of VM cores> x 2],*,<receiver IP address> -t 10 -P 1`
65+
66+
```cmd
67+
ntttcp -s -m 4,*,10.0.0.5 -t 10 -P 1
68+
```
4669
4770
>[!NOTE]
4871
>Use the preceding commands only to test configuration.
@@ -52,31 +75,65 @@ You can test throughput from Windows VMs by using [NTTTCP](https://github.com/mi
5275
5376
### Run throughput tests
5477
55-
Run *ntttcp.exe* from the Windows command line, not from PowerShell. Run the test for 300 seconds, or five minutes, on both the sender and receiver VMs. The sender and receiver must specify the same test duration for the `-t` parameter.
78+
Run the test for 300 seconds, or five minutes, on both the sender and receiver VMs. The sender and receiver must specify the same test duration for the `-t` parameter.
5679
5780
1. On the receiver VM, run the following command, replacing the `<number of VM cores>`, and `<receiver IP address>` placeholders with your own values.
81+
82+
**`ntttcp -r -m [<number of VM cores> x 2],*,<receiver IP address> -t 300`**
83+
84+
```cmd
85+
ntttcp -r -m 4,*,10.0.0.5 -t 300
86+
```
87+
88+
1. On the sender VM, run the following command. The sender and receiver commands differ only in the `-s` or `-r` parameter that designates the sender or receiver VM.
89+
90+
**`ntttcp -s -m [<number of VM cores> x 2],*,<receiver IP address> -t 300`**
5891
5992
```cmd
60-
ntttcp -r -m [<number of VM cores> x 2],*,<receiver IP address> -t 300
93+
ntttcp -s -m 4,*,10.0.0.5 -t 300
6194
```
6295

63-
The following example shows a command for a VM with four cores and an IP address of `10.0.0.4`.
96+
1. Wait for the results.
6497

65-
`ntttcp -r -m 8,*,10.0.0.4 -t 300`
98+
When the test is complete, the output should be similar as the following example:
99+
100+
```output
101+
C:\tools>ntttcp -s -m 4,*,10.0.0.5 -t 300
102+
Copyright Version 5.39
103+
Network activity progressing...
66104
67-
1. On the sender VM, run the following command. The sender and receiver commands differ only in the `-s` or `-r` parameter that designates the sender or receiver VM.
68105
69-
```cmd
70-
ntttcp -s -m [<number of VM cores> x 2],*,<receiver IP address> -t 300
71-
```
106+
Thread Time(s) Throughput(KB/s) Avg B / Compl
107+
====== ======= ================ =============
108+
0 300.006 29617.328 65536.000
109+
1 300.006 29267.468 65536.000
110+
2 300.006 28978.834 65536.000
111+
3 300.006 29016.806 65536.000
72112
73-
The following example shows the sender command for a receiver IP address of `10.0.0.4`.
74-
75-
```cmd
76-
ntttcp -s -m 8,*,10.0.0.4 -t 300 
77-
```
78113
79-
1. Wait for the results.
114+
##### Totals: #####
115+
116+
117+
Bytes(MEG) realtime(s) Avg Frame Size Throughput(MB/s)
118+
================ =========== ============== ================
119+
34243.000000 300.005 1417.829 114.141
120+
121+
122+
Throughput(Buffers/s) Cycles/Byte Buffers
123+
===================== =========== =============
124+
1826.262 7.036 547888.000
125+
126+
127+
DPCs(count/s) Pkts(num/DPC) Intr(count/s) Pkts(num/intr)
128+
============= ============= =============== ==============
129+
4218.744 1.708 6055.769 1.190
130+
131+
132+
Packets Sent Packets Received Retransmits Errors Avg. CPU %
133+
============ ================ =========== ====== ==========
134+
25324915 2161992 60412 0 15.075
135+
136+
```
80137

81138
# [Linux](#tab/linux)
82139

@@ -86,32 +143,33 @@ To measure throughput from Linux machines, use [NTTTCP-for-Linux](https://github
86143

87144
1. Prepare both the sender and receiver VMs for NTTTCP-for-Linux by running the following commands, depending on your distro:
88145

89-
- For **CentOS**, install `gcc` and `git`.
146+
- For **CentOS**, install `gcc` , `make` and `git`.
90147

91148
``` bash
92-
yum install gcc -y
93-
yum install git -y
149+
sudo yum install gcc -y
150+
sudo yum install git -y
151+
sudo yum install make -y
94152
```
95153

96154
- For **Ubuntu**, install `build-essential` and `git`.
97155

98-
``` bash
99-
apt-get -y install build-essential
100-
apt-get -y install git
156+
```bash
157+
sudo apt-get -y install build-essential
158+
sudo apt-get -y install git
101159
```
102160

103161
- For **SUSE**, install `git-core`, `gcc`, and `make`.
104162

105-
``` bash
106-
zypper in -y git-core gcc make
163+
```bash
164+
sudo zypper in -y git-core gcc make
107165
```
108166

109167
1. Make and install NTTTCP-for-Linux.
110168

111-
``` bash
169+
```bash
112170
git clone https://github.com/Microsoft/ntttcp-for-linux
113171
cd ntttcp-for-linux/src
114-
make && make install
172+
sudo make && sudo make install
115173
```
116174

117175
### Run throughput tests
@@ -120,17 +178,47 @@ Run the NTTTCP test for 300 seconds, or five minutes, on both the sender VM and
120178
121179
1. On the receiver VM, run the following command:
122180
123-
``` bash
124-
ntttcp -r -t 300
181+
```bash
182+
ntttcp -r -m 4,*,10.0.0.5 -t 300
125183
```
126184
127-
1. On the sender VM, run the following command. This example shows a sender command for a receiver IP address of `10.0.0.4`.
185+
1. On the sender VM, run the following command. This example shows a sender command for a receiver IP address of `10.0.0.5`.
128186
129-
``` bash
130-
ntttcp -s10.0.0.4 -t 300
187+
```bash
188+
ntttcp -s -m 4,*,10.0.0.5 -t 300
131189
```
132190
191+
When the test is complete, the output should be similar as the following example:
192+
193+
```output
194+
azureuser@vm-3:~/ntttcp-for-linux/src$ ntttcp -s -m 4,*,10.0.0.5 -t 300
195+
NTTTCP for Linux 1.4.0
196+
---------------------------------------------------------
197+
23:59:01 INFO: 4 threads created
198+
23:59:01 INFO: 4 connections created in 1933 microseconds
199+
23:59:01 INFO: Network activity progressing...
200+
00:04:01 INFO: Test run completed.
201+
00:04:01 INFO: Test cycle finished.
202+
00:04:01 INFO: 4 connections tested
203+
00:04:01 INFO: ##### Totals: #####
204+
00:04:01 INFO: test duration:300.00 seconds
205+
00:04:01 INFO: total bytes:35750674432
206+
00:04:01 INFO: throughput:953.35Mbps
207+
00:04:01 INFO: retrans segs:13889
208+
00:04:01 INFO: cpu cores:2
209+
00:04:01 INFO: cpu speed:2793.437MHz
210+
00:04:01 INFO: user:0.16%
211+
00:04:01 INFO: system:1.60%
212+
00:04:01 INFO: idle:98.07%
213+
00:04:01 INFO: iowait:0.05%
214+
00:04:01 INFO: softirq:0.12%
215+
00:04:01 INFO: cycles/byte:0.91
216+
00:04:01 INFO: cpu busy (all):3.96%
217+
---------------------------------------------------------
218+
```
219+
133220
---
221+
134222
## Test throughput between a Windows VM and a Linux VM
135223
136224
To run NTTTCP throughput tests between a Windows VM and a Linux VM, enable no-sync mode by using the `-ns` flag on Windows or the `-N` flag on Linux.
@@ -142,6 +230,7 @@ To test with the Windows VM as the receiver, run the following command:
142230
```cmd
143231
ntttcp -r -m [<number of VM cores> x 2],*,<Linux VM IP address> -t 300
144232
```
233+
145234
To test with the Windows VM as the sender, run the following command:
146235
147236
```cmd
@@ -161,21 +250,15 @@ To test with the Linux VM as the sender, run the following command:
161250
```bash
162251
ntttcp -s -m [<number of VM cores> x 2],*,<Windows VM IP address> -N -t 300
163252
```
164-
---
165-
166-
## Test Cloud Service instances
167-
168-
Add the following section to *ServiceDefinition.csdef*:
169253
170-
```xml
171-
<Endpoints>
172-
<InternalEndpoint name="Endpoint3" protocol="any" />
173-
</Endpoints>
174-
```
254+
---
175255
176256
## Next steps
177257
178258
- [Optimize network throughput for Azure virtual machines](virtual-network-optimize-network-bandwidth.md).
259+
179260
- [Virtual machine network bandwidth](virtual-machine-network-throughput.md).
261+
180262
- [Test VM network latency](virtual-network-test-latency.md)
263+
181264
- [Azure Virtual Network frequently asked questions (FAQ)](virtual-networks-faq.md)

0 commit comments

Comments
 (0)