I wrote this PowerShell script awhile back when I was troubleshooting MTU issues. The script does the following:
This script is a network diagnostic tool designed to figure out the Maximum Transmission Unit (MTU) between your computer and a specific destination (like a server or a website).
In plain English, it tests exactly how large a chunk of data (a packet) can travel across the network before it is forced to be broken into smaller pieces (fragmented) or gets entirely dropped.
Here is a step-by-step breakdown of what the script does under the hood:
1. Setup and Targeting
You give the script one or more targets (like or google.com). If you don’t manually specify which network card (Interface) to use, the script automatically figures out your primary internet connection by looking at your default routing table.
2. Local Health Check
Before it sends any traffic across the network, it looks at your local network adapter. It prints out a summary showing your computer’s current MTU setting (usually 1500) and checks if your network card has been dropping packets or experiencing errors recently.
3. The Math (Header Overhead)
The script has a built-in list of common network packet sizes to test, ranging from standard sizes (1400 to 1500 bytes) up to “Jumbo Frames” (9000 to 9216 bytes).
When you send a ping, the network adds an envelope to your data to make sure it gets to its destination. The script automatically subtracts 28 bytes from the MTU size you are testing. This accounts for the mandatory 20-byte IP header and 8-byte ICMP (ping) header. This ensures the test is mathematically accurate.
4. The “Don’t Fragment” Ping Tests
The script runs two distinct sets of ping tests against your targets using those calculated packet sizes:
- Test 1: DF=True (Don’t Fragment): The script sends the packet with a strict “Do Not Fragment” flag. If any router along the path cannot handle a packet of that size, it drops it. This tells you the absolute maximum packet size your network path supports natively.
- Test 2: DF=False (Allow Fragmentation): The script sends the exact same sizes again, but allows the network equipment to slice the packets into smaller pieces if necessary. This helps you figure out if large packets are failing because of a hard block, or just because a router is refusing to chop them up.
5. The Final Report
It records every successful and failed attempt. Finally, it prints out a clean summary showing exactly which packet sizes made it through, which ones failed, and provides the exact raw ping commands that caused those results so you can reproduce them manually if needed.
Looking at your sample output, the network successfully handled standard 1500-byte packets, but the “Jumbo” 9000-byte packets failed when fragmentation was strictly forbidden (DF=True), which is standard behavior for most network paths that aren’t specifically configured for Jumbo Frames end-to-end.
You can grab this script from my public GitHub repo
Here is a quick video of the script in action