Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,24 @@ public bool? NoSyncEnabled
}
}

/// <summary>
/// Duplex mode for the network workload. Valid values are "Half" (default) and "Full".
/// In full-duplex mode, each node runs both a sender and receiver process simultaneously.
/// </summary>
public string DuplexMode
{
get
{
this.Parameters.TryGetValue(nameof(NetworkingWorkloadExecutor.DuplexMode), out IConvertible duplexMode);
return duplexMode?.ToString();
}

set
{
this.Parameters[nameof(NetworkingWorkloadExecutor.DuplexMode)] = value;
}
}

/// <summary>
/// Cancellation Token Source for Server.
/// </summary>
Expand Down Expand Up @@ -816,6 +834,7 @@ protected void OnInstructionsReceived(object sender, JObject instructions)
this.ProfilingPeriod = serverInstructions.ProfilingPeriod;
this.ProfilingWarmUpPeriod = serverInstructions.ProfilingWarmUpPeriod;
this.NoSyncEnabled = serverInstructions.NoSyncEnabled;
this.DuplexMode = serverInstructions.DuplexMode;

if (serverInstructions.Metadata?.Any() == true)
{
Expand Down Expand Up @@ -985,7 +1004,8 @@ await this.ClientExecutionRetryPolicy.ExecuteAsync(async () =>
this.ProfilingPeriod.ToString(),
this.ProfilingWarmUpPeriod.ToString(),
this.NoSyncEnabled,
requestId);
requestId,
duplexMode: this.DuplexMode);

Item<State> instructions = new Item<State>(nameof(NetworkingWorkloadState), workloadInstructions);
relatedContext.AddContext("instructions", instructions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public NetworkingWorkloadState(
string profilingWarmUpPeriod = null,
bool? noSyncEnabled = null,
Guid? clientRequestId = null,
IDictionary<string, IConvertible> metadata = null)
IDictionary<string, IConvertible> metadata = null,
string duplexMode = null)
{
packageName.ThrowIfNull(nameof(packageName));
scenario.ThrowIfNull(nameof(scenario));
Expand Down Expand Up @@ -170,6 +171,7 @@ public NetworkingWorkloadState(
this.Properties[nameof(this.ProfilingPeriod)] = profilingPeriod;
this.Properties[nameof(this.ProfilingWarmUpPeriod)] = profilingWarmUpPeriod;
this.Properties[nameof(this.NoSyncEnabled)] = noSyncEnabled;
this.Properties[nameof(this.DuplexMode)] = duplexMode;
this.ClientRequestId = clientRequestId;

this.Metadata = new Dictionary<string, IConvertible>(StringComparer.OrdinalIgnoreCase);
Expand Down Expand Up @@ -545,6 +547,24 @@ public double? ConfidenceLevel
}
}

/// <summary>
/// Duplex mode for the test (Half or Full). Half-duplex is the default.
/// In full-duplex mode, both nodes run sender and receiver simultaneously.
/// </summary>
public string DuplexMode
{
get
{
this.Properties.TryGetValue(nameof(this.DuplexMode), out IConvertible duplexMode);
return duplexMode?.ToString();
}

set
{
this.Properties[nameof(this.DuplexMode)] = value;
}
}

/// <summary>
/// Metadata associated with the component.
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions src/VirtualClient/VirtualClient.Common/ProcessProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ public virtual async Task WaitForExitAsync(CancellationToken cancellationToken,

await this.WaitForExitCodeConfirmationAsync(cancellationToken, timeout);
}
catch (TimeoutException) when (timeout != null)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed. There is a generic "catch" block. This catches ALL exceptions including TimeoutException.

{
// Expected timeout when timeout was specified.
}
catch
{
// Expected whenever the CancellationToken receives a cancellation request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"NTttcpDuration": "00:01:00",
"ProfilingEnabled": false,
"ProfilingMode": "None",
"TestDuration": "00:01:00"
"TestDuration": "00:01:00",
"DuplexMode": "Half"
},
"Actions": [
{
Expand All @@ -28,7 +29,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_4K_Buffer_T1",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -45,7 +47,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_64K_Buffer_T1",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -62,7 +65,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_256K_Buffer_T1",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -79,7 +83,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_4K_Buffer_T32",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -96,7 +101,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_64K_Buffer_T32",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -113,7 +119,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_256K_Buffer_T32",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -130,7 +137,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_4K_Buffer_T256",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -147,7 +155,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_64K_Buffer_T256",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -164,7 +173,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_TCP_256K_Buffer_T256",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -181,7 +191,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_UDP_1400B_Buffer_T1",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
},
{
Expand All @@ -198,7 +209,8 @@
"Port": "$.Parameters.NTttcpPort",
"ProfilingScenario": "NTttcp_UDP_1400B_Buffer_T32",
"ProfilingEnabled": "$.Parameters.ProfilingEnabled",
"ProfilingMode": "$.Parameters.ProfilingMode"
"ProfilingMode": "$.Parameters.ProfilingMode",
"DuplexMode": "$.Parameters.DuplexMode"
}
}
],
Expand Down
82 changes: 82 additions & 0 deletions website/docs/workloads/network-suite/network-ntttcp-fullduplex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# NTTTCP Full-Duplex Mode
The existing `PERF-NETWORK-NTTTCP.json` profile supports an optional `DuplexMode` parameter that enables bidirectional network throughput testing.
In full-duplex mode, both nodes simultaneously send and receive traffic, producing separate TX and RX throughput metrics per direction.

* [Network Suite Workload Details](./network-suite.md)
* [Client/Server Workloads](../../guides/0020-client-server.md)

## How Full-Duplex Differs from Half-Duplex
In the standard (half-duplex) mode, one node sends while the other receives. In full-duplex mode, each node runs **two NTttcp processes
simultaneously**: one sender and one receiver. This results in 4 NTttcp processes total across the two systems.

| Direction | Port | Client | Server |
|-----------|------|--------|--------|
| Forward | base port (default 5500) | Sender (`-s`) | Receiver (`-r`) |
| Reverse | base port + 100 (default 5600) | Receiver (`-r`) | Sender (`-s`) |

## Usage

``` bash
# Half-duplex (default, unchanged behavior)
VirtualClient.exe --profile=PERF-NETWORK-NTTTCP.json --clientId=Client01 --layout-path=/path/to/layout.json

# Full-duplex (override DuplexMode parameter)
VirtualClient.exe --profile=PERF-NETWORK-NTTTCP.json --clientId=Client01 --layout-path=/path/to/layout.json --parameters=DuplexMode=Full
```

## PERF-NETWORK-NTTTCP.json
The standard NTttcp profile now includes the `DuplexMode` parameter (default: `Half`). All existing scenarios work unchanged.
Override with `--parameters=DuplexMode=Full` to enable full-duplex.

* [Workload Profile](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/PERF-NETWORK-NTTTCP.json)

* **Supported Platform/Architectures**
* linux-x64
* linux-arm64
* win-x64
* win-arm64

* **Supports Disconnected Scenarios**
* No. Internet connection required.

* **Dependencies**
Same as the standard PERF-NETWORK-NTTTCP.json profile:
* Internet connection.
* The IP addresses defined in the environment layout for the Client and Server systems must be correct.
* The name of the Client and Server instances defined in the environment layout must match the agent/client IDs supplied on the command line.
* Ports 5500 (forward direction) and 5600 (reverse direction) must be available on both systems when using full-duplex mode.

* **Profile Parameters**
The following parameter is added for full-duplex support. All other parameters remain unchanged.

| Parameter | Purpose | Default |
|-----------|---------|---------|
| DuplexMode | Set to "Full" for bidirectional testing. Any other value (or unset) uses standard unidirectional testing. | Half |

* **Scenarios**
All existing NTTTCP scenarios support full-duplex mode. When `DuplexMode=Full`, each scenario runs both send and receive
processes on each node. The existing scenario names are unchanged — the `direction` and `duplexMode` metadata in telemetry
distinguish full-duplex results from half-duplex.

## Workload Metrics
Each scenario produces **four sets of metrics** — sender and receiver metrics on both client and server. The scenario name includes the direction:

| Metric Name | Unit | Relativity |
|-------------|------|------------|
| ThroughputMbps | mbps | Higher is better |
| TotalBytesMB | MB | Higher is better |
| AvgBytesPerCompl | B | - |
| AvgFrameSize | B | - |
| AvgPacketsPerInterrupt | packets/interrupt | - |
| InterruptsPerSec | count/sec | - |
| PacketsRetransmitted | count | Lower is better |
| Errors | count | Lower is better |
| CyclesPerByte | cycles/byte | Lower is better |
| AvgCpuPercentage | % | - |
| TcpAverageRtt | ms | Lower is better |

**Telemetry scenario names** follow the pattern:
* `{Scenario} Client Send` — Client's sender metrics (forward direction)
* `{Scenario} Client Receive` — Client's receiver metrics (reverse direction)
* `{Scenario} Server Send` — Server's sender metrics (reverse direction)
* `{Scenario} Server Receive` — Server's receiver metrics (forward direction)