Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WAN TCP Diagnostic Harness

A PowerShell diagnostic harness for the classic "Windows Server sends slowly over the site-to-site VPN" problem — where file transfers from a server crawl at single-digit Mbps while Windows 11 clients and NAS devices on the exact same path run at full speed.

The tool measures raw TCP throughput with iperf3 (taking SMB and file-copy out of the equation), inventories the sender's TCP stack, probes for MTU blackholes, and issues an automated verdict pointing at the likely culprit: broken window scaling, packet loss, MTU problems, or host-side throttling.

How it works

The harness is always run in pairs — once on a slow sender (the suspect server) and once on a known-fast sender (a Win11 box) at the same site, aimed at the same receiver. The difference between the two result sets is the diagnosis.

It runs a seven-phase sequence:

Phase What it does
0 Preflight — iperf3 present, elevation, reachability
1 TCP stack / template / transport filter / NIC offload / MTU inventory
2 MTU blackhole probe (DF-bit ping walk)
3 iperf3 baseline single stream, with live AppliedSetting capture and retransmission-rate measurement
4 iperf3 with an explicit 4M socket buffer (-w) to bypass autotuning
5 iperf3 with 8 parallel streams (-P 8)
6 iperf3 reverse direction (-R) — the far end sends, catching asymmetric firewall handling
7 (opt-in via -IncludeUdp) UDP probe — a TCP-vs-UDP differential that hints at firewall TCP-state inspection
8 Automated verdict based on the evidence collected

Each run writes a timestamped output folder containing diag.log, results.json, and per-phase raw captures.

Requirements

  • Windows PowerShell 5.1 or PowerShell 7
  • iperf3 for Windows on the sender — and the same iperf3 version running iperf3 -s at the receiver (mixed versions corrupt the UDP loss figure and skew TCP results)
  • An elevated PowerShell session (some NIC queries need it)
  • iperf3 -s running at the far end of the tunnel

Quick start

On the receiving site, start the iperf3 server:

iperf3 -s --logfile C:\tools\iperf-server.log

On the sending machine, in an elevated PowerShell:

.\WanTcpDiag.ps1 -RemoteHost <receiver-IP> -IperfPath D:\tools

Then repeat on a known-fast Windows 11 box at the same site, aimed at the same receiver, and compare the two output folders.

Parameters

Parameter Description
-RemoteHost (required) IP/hostname of the machine running iperf3 -s
-IperfPath Folder or full path to iperf3.exe. Defaults to PATH, then C:\Masters\iperf-3.21-win64
-Port iperf3 server port. Default 5201
-Duration Seconds per iperf3 run. Default 30
-SlowThresholdMbps Baseline below this counts as "slow" and triggers diagnostics. Set to ~20-30% of the expected WAN rate. Default 200
-IncludeUdp Adds the UDP probe phase (pushes sustained UDP at the threshold rate onto the WAN — opt-in for a reason)
-OutDir Output folder. Default .\WanTcpDiag_<host>_<timestamp>

Documentation

Full operating instructions, the field playbook, and result interpretation are in the runbook:

Rebuilding the PDF

The runbook Markdown is the source of truth; the PDF is generated from it. To regenerate after editing the .md, run:

.\build-docs.ps1

This requires pandoc and the tectonic PDF engine on your PATH:

winget install JohnMacFarlane.Pandoc
winget install TectonicTypesetting.Tectonic

Authorship

Written by Jose A. Diaz, with lots of help from Fable.

License

Released under the MIT License. See the full text below.


MIT License

Copyright (c) 2026 Jose A. Diaz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

An Admin Friedly WAN TCP Diagnostic Harness

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages