Windows network troubleshooting: layer by layer with pktmon

“The network is slow” and “I can’t connect” are the tickets you’ll see more than any others. Good Windows network troubleshooting means you stop guessing and check one layer at a time, starting at the cable and working up to the application.

You’ll check the link, IP, DNS, ports and the path from CL01 to SRV01, and then capture real packets with pktmon, the packet capture tool that ships with Windows.

TimeYou needBy the end you can
About 75 minutesDC01, SRV01 (with the intranet site) and CL01Find which layer is broken in minutes and prove it with a packet capture

What it is, in one line

Windows network troubleshooting means checking a connection layer by layer (link, IP, name, route, port, application) until you hit the first layer that fails.

In Simple Words

In Simple Words

Think about posting a letter to a friend. There has to be a road from your house, the address has to be right, the post office has to know the route, and at the end your friend has to be home to open the door. If the letter doesn’t turn up, you don’t blame your friend straight away. You check whether the road was open, whether the address was right, whether it went the right way and whether anyone was home, and network checks go in that same order, from the road up to the door.

Engineer's View

Engineer’s View

Link: Get-NetAdapter shows status and speed. If a server shows Down or 10 Mbps, you’re looking at a cable, switch or driver problem.

IP: Get-NetIPConfiguration shows the address, gateway and DNS servers. A 169.254.x.x (APIPA) address means DHCP failed, and a missing gateway means only the local subnet will work.

Name: Resolve-DnsName uses DNS only and skips NetBIOS, which ping doesn’t. Add -Server to ask one particular DNS server, and look at the hosts file and client cache for stale answers.

Route: Get-NetRoute shows the routing table, tracert lists the hops, and pathping goes further by measuring packet loss at each hop over a period of time.

Port: Test-NetConnection -Port tests a TCP handshake. When ping works but the port fails, either nothing is listening (check Get-NetTCPConnection -State Listen) or a firewall is dropping it.

Packets: pktmon captures traffic at each layer of the Windows network stack, drops included, and can convert the capture to pcapng for Wireshark. There’s nothing to install.

How it works, step by step

Work from the bottom up and stop at the first layer that fails:

Windows network troubleshooting layers: link, IP, name, route, port and application

Most problems sit somewhere in the middle: DNS hands back the wrong IP, a firewall rule blocks one port, or a server has the wrong gateway, and checking from the bottom up finds them in a few commands.

Don’t lean on ping. Lots of servers block ICMP, and even a successful ping tells you nothing about port 443, so always test the port the application really uses.

If your tests don’t match what the user is seeing, capture packets. A capture shows what really left one machine and arrived at the other, and it settles arguments between teams quickly.

Which symptom points to which command:

Windows network troubleshooting: which command to run for each symptom

In the lab you’ll go through each layer from CL01 to the intranet on SRV01:

  • Link and IP configuration on CL01.
  • Name resolution against each DNS server.
  • Ports, and which process is listening on SRV01.
  • The path to the internet with pathping.
  • A packet capture of HTTPS traffic with pktmon.

Hands-on lab: check every layer

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Start DC01, DC02, SRV01 and CL01, and work as SAATLAB\adm.rahul in PowerShell as administrator.

1Check link and IP on CL01

On CL01:

Get-NetAdapter | Select-Object Name, Status, LinkSpeed
Get-NetIPConfiguration | Select-Object InterfaceAlias,
    @{ n = 'IPv4';    e = { $_.IPv4Address.IPAddress } },
    @{ n = 'Gateway'; e = { $_.IPv4DefaultGateway.NextHop } },
    @{ n = 'DNS';     e = { $_.DNSServer.ServerAddresses -join ', ' } }

You’ll see something like this:

Name     Status LinkSpeed
----     ------ ---------
Ethernet Up     1 Gbps

InterfaceAlias IPv4       Gateway  DNS
-------------- ----       -------  ---
Ethernet       10.0.0.150 10.0.0.1 10.0.0.10, 10.0.0.11

The link is up, the client has the reserved address from Lesson 15 and a gateway, and both DCs are listed as DNS servers, so the bottom two layers are fine.

✅ Checkpoint: CL01 shows Up, 10.0.0.150, gateway 10.0.0.1 and DNS 10.0.0.10 and 10.0.0.11.

2Check name resolution against each DNS server

On CL01, ask each DNS server directly and then look at the hosts file:

foreach ($s in '10.0.0.10', '10.0.0.11') {
    $r = Resolve-DnsName intranet.saatlab.internal -Server $s -DnsOnly
    [pscustomobject]@{ Server = $s; Name = $r.Name; IPAddress = $r.IPAddress }
}
Get-Content C:\Windows\System32\drivers\etc\hosts | Where-Object { $_ -notmatch '^\s*#' -and $_.Trim() }

You’ll see something like this:

Server    Name                      IPAddress
------    ----                      ---------
10.0.0.10 intranet.saatlab.internal 10.0.0.20
10.0.0.11 intranet.saatlab.internal 10.0.0.20

Both DNS servers return the same answer and the hosts file has no active entries. If the two had disagreed, your next stop would be AD replication (Lesson 31).

✅ Checkpoint: Both DCs resolve intranet.saatlab.internal to 10.0.0.20, and the hosts file is empty.

3Check ports and who is listening

On CL01, test the ports that SRV01 is supposed to offer:

foreach ($p in 443, 445, 3389, 5985) {
    $t = Test-NetConnection SRV01 -Port $p -WarningAction SilentlyContinue
    [pscustomobject]@{ Port = $p; Open = $t.TcpTestSucceeded }
}

You’ll see something like this:

Port Open
---- ----
 443 True
 445 True
3389 True
5985 True

On SRV01, find out which process owns port 443:

Get-NetTCPConnection -State Listen -LocalPort 443 |
    Select-Object LocalAddress, LocalPort, OwningProcess,
        @{ n = 'Process'; e = { (Get-Process -Id $_.OwningProcess).ProcessName } }

You’ll see something like this:

LocalAddress LocalPort OwningProcess Process
------------ --------- ------------- -------
::                 443             4 System
0.0.0.0            443             4 System

IIS listens through HTTP.sys, the kernel web listener, so the owner shows up as System (PID 4) rather than w3wp.exe. Other apps show their real process name, which tells you which service to look at.

✅ Checkpoint: All four ports are open, and port 443 is owned by System (HTTP.sys).

Windows network troubleshooting lab: port 443 listener owned by System on SRV01
Windows network troubleshooting: HTTP.sys (System, PID 4) listens on port 443

4Check the path with pathping

On CL01:

pathping -n -q 20 1.1.1.1

You’ll see something like this:

Tracing route to 1.1.1.1 over a maximum of 30 hops

  0  10.0.0.150
  1  10.0.0.1
  2  1.1.1.1

Computing statistics for 50 seconds...
            Source to Here   This Node/Link
Hop  RTT    Lost/Sent = Pct  Lost/Sent = Pct  Address
  0                                           10.0.0.150
                                0/  20 =  0%   |
  1    0ms     0/  20 =  0%     0/  20 =  0%  10.0.0.1
                                0/  20 =  0%   |
  2   12ms     0/  20 =  0%     0/  20 =  0%  1.1.1.1

VirtualBox NAT hides the real hops, so you’ll only see the gateway and the target here. On a real network every router shows up, and the “This Node/Link” column tells you where the packets are being lost.

✅ Checkpoint: pathping shows each hop with 0% loss.

5Capture HTTPS packets with pktmon

On SRV01, add a filter for port 443 and start capturing:

pktmon filter add Web -p 443
pktmon start --capture --pkt-size 0 --file-name C:\Lab\web.etl

On CL01, send a single request:

(Invoke-WebRequest https://intranet.saatlab.internal -UseDefaultCredentials -UseBasicParsing).StatusCode

Back on SRV01, stop the capture, convert it for Wireshark and remove the filter:

pktmon stop
pktmon etl2pcap C:\Lab\web.etl --out C:\Lab\web.pcapng
pktmon filter remove
Get-Item C:\Lab\web.* | Select-Object Name, Length

You’ll see something like this:

Name        Length
----        ------
web.etl    1052672
web.pcapng   48224

Copy web.pcapng to your laptop and open it in Wireshark. You’ll find the TCP handshake (SYN, SYN-ACK, ACK) from 10.0.0.150 to 10.0.0.20, followed by the TLS session.

[Add your screenshot here]

✅ Checkpoint: pktmon created web.etl and web.pcapng with the HTTPS conversation between CL01 and SRV01.

Break It, Then Fix It

Here are two classic faults: a client pointed at the wrong DNS server, and a firewall rule that blocks one port while everything else carries on working.

1Break it: CL01 uses a public DNS server

On CL01, point DNS at a public resolver, which is a “quick fix” people try more often than you’d think:

Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 1.1.1.1
Clear-DnsClientCache
Resolve-DnsName intranet.saatlab.internal
Resolve-DnsName www.microsoft.com | Select-Object -First 1 Name, Type

You’ll see something like this:

Resolve-DnsName : intranet.saatlab.internal : DNS name does not exist

Name              Type
----              ----
www.microsoft.com CNAME

The internet still works, so the user tells you “the network is fine but the intranet is broken”. Internal names, domain logons and Group Policy all fail, because your DCs are the only ones that know about saatlab.internal.

To fix it, check which DNS server the client is using and then put it back on the DHCP settings:

Get-DnsClientServerAddress -InterfaceAlias Ethernet -AddressFamily IPv4 | Select-Object ServerAddresses
Set-DnsClientServerAddress -InterfaceAlias Ethernet -ResetServerAddresses
Clear-DnsClientCache
(Resolve-DnsName intranet.saatlab.internal).IPAddress

You’ll see something like this:

ServerAddresses
---------------
{1.1.1.1}

10.0.0.20

✅ Checkpoint: With 1.1.1.1 the internal name failed; after resetting to DHCP it resolves to 10.0.0.20.

2Break it: a firewall rule blocks only HTTPS

On SRV01, add a block rule for port 443:

New-NetFirewallRule -DisplayName 'Block 443 test' -Direction Inbound -Protocol TCP -LocalPort 443 -Action Block

On CL01, test one layer at a time:

Test-NetConnection SRV01 -Port 445 | Select-Object PingSucceeded, TcpTestSucceeded
Test-NetConnection SRV01 -Port 443 | Select-Object PingSucceeded, TcpTestSucceeded

You’ll see something like this:

PingSucceeded TcpTestSucceeded
------------- ----------------
True          True

PingSucceeded TcpTestSucceeded
------------- ----------------
True          False
Windows network troubleshooting break lab: a block rule stops only port 443
Ping works, port 443 fails, and a block rule is the reason

Ping and SMB work and only 443 fails. You saw in Step 3 of the lab that something is listening on 443, so the firewall is the next suspect, and remember that a block rule always wins over an allow rule.

To fix it, find the enabled block rules for that port on SRV01 and remove the one causing it:

Get-NetFirewallRule -Direction Inbound -Action Block -Enabled True |
    Where-Object { ($_ | Get-NetFirewallPortFilter).LocalPort -contains '443' } |
    Select-Object DisplayName, Profile
Remove-NetFirewallRule -DisplayName 'Block 443 test'

You’ll see something like this:

DisplayName    Profile
-----------    -------
Block 443 test Any

✅ Checkpoint: Only port 443 failed while the rule existed, and the test passes again after removing it.

This happened at work

The file copies that died at 99 KB

This one came from a branch office that had just moved to a new VPN. Users could browse the intranet and open small files, but any big copy from the head office file server hung after a few seconds. Ping worked, DNS worked and port 445 was open, so every team blamed someone else, until an engineer tried ping -f -l 1472 FILESRV. It failed with “Packet needs to be fragmented but DF set”, while -l 1350 went through fine. The VPN tunnel had a smaller MTU, and a firewall was dropping the ICMP messages that tell senders to use smaller packets, so small packets passed and full-size ones vanished. That’s what people call an MTU black hole.

The fix: the VPN team turned on TCP MSS clamping for the tunnel and allowed the ICMP “fragmentation needed” messages through.

The lesson: when small things work and big things hang, test the packet size as well as reachability.

Common mistakes and troubleshooting

MistakeWhat happensWhat to do instead
Trusting ping aloneICMP may be blocked, or the port may still failTest the real port with Test-NetConnection -Port
Using nslookup onlyIt ignores the hosts file and client cacheUse Resolve-DnsName and check the cache and hosts file
Public DNS on domain machinesInternal names and logons failOnly internal DNS servers on members
Assuming no listener means firewallYou chase the wrong teamCheck Get-NetTCPConnection -State Listen first
Forgetting that block rules winAllow rules seem to be ignoredList enabled block rules for the port
Ignoring packet sizeLarge transfers hangTest with ping -f -l and check MTU
Leaving pktmon filters behindNext capture misses trafficRun pktmon filter remove after each capture
Capturing without a filter on busy serversHuge files and noiseFilter by port and IP

Interview questions

Click a question to open it. Each one is worded the way an interviewer would ask it, and underneath you’ll see why they ask and one way you could answer in your own words.

Fresher level

1. A user says they can’t reach a website. What would you check, and in what order?

Why they ask this: They’re checking that you work layer by layer and don’t jump around.

How you might answer: I start at the bottom: is the link up, and has the machine got an IP address and a gateway? Then I check DNS with Resolve-DnsName and try a ping. If that’s all fine, I test the real port with Test-NetConnection, and only after that do I look at the application itself.

2. You run ipconfig on a user’s PC and the address starts with 169.254. What does that tell you?

Why they ask this: They want to know you recognise APIPA and know where to look next.

How you might answer: It means the PC didn’t get a DHCP lease and gave itself an automatic private address, so it won’t reach much. I’d look at the DHCP server, whether the scope still has free addresses, and the network path between the PC and the DHCP server.

3. What’s the difference between ping and Test-NetConnection with -Port, and which one do you trust more?

Why they ask this: They want to see you test what the user needs, not only whether a machine answers.

How you might answer: Ping only tests ICMP, so all it tells me is that the machine answers. Test-NetConnection -Port makes a TCP connection to the application’s port, and since that’s what users need, it’s the one I trust. Ping can also be blocked while the app works perfectly well.

2–5 years experience

4. Ping to the server works, but the application port fails. What would you check next?

Why they ask this: They want to see you can break the problem into smaller pieces and check each one.

How you might answer: First I’d use Get-NetTCPConnection to make sure something is listening on the server, because if nothing is, it’s the service and not the network. If it is listening, I’d check the firewall rules on the server and in the network, and then the app’s binding, say if it only listens on one IP.

5. You need a packet capture from a Windows server, but you’re not allowed to install anything. How would you do it?

Why they ask this: They’re checking you know the built-in tools for times when installing software isn’t allowed.

How you might answer: I’d use pktmon, which comes with Windows. I add a filter, start the capture, reproduce the problem and stop it, then convert the file with pktmon etl2pcap and open it in Wireshark on my own machine.

6. Two domain controllers give different DNS answers for the same name. Why might that happen?

Why they ask this: They want to see you link DNS problems back to AD replication.

How you might answer: AD-integrated zones replicate with Active Directory, so the first thing I’d look at is AD replication between those two DCs. After that I’d check the record’s timestamp and scavenging, and whether one DC is holding a local or stale copy of the zone.

Senior level

7. Over the VPN, small file copies work but large ones just hang. What do you think is going on?

Why they ask this: They want to know if you’ve met the classic MTU problem and can prove it.

How you might answer: That sounds like an MTU black hole, where small packets fit through the tunnel but big ones get dropped and the error message never makes it back. I’d test with ping -f -l at different sizes to find the largest one that gets through, and then check the tunnel MTU, MSS clamping and whether ICMP is being filtered.

8. The network team says their network is fine, but you believe packets are being dropped. How would you prove it?

Why they ask this: They want to see you settle an argument between teams with evidence.

How you might answer: I’d capture at both ends at the same time, on the client and on the server, and compare the two. If the SYN packets leave the client and never reach the server, the drop is somewhere in between, and that’s hard to argue with.

9. Users report packet loss a few times a day, but every time you test, it’s fine. How would you track it down?

Why they ask this: They want to see you think over time and keep collecting data until the problem shows itself.

How you might answer: I’d run pathping or continuous tests with timestamps so I catch it when it happens, and check the interface error counters, the NIC driver and offload settings, and the switch port stats. Then I’d line the loss times up against network load, because intermittent loss often follows the busy periods.

Quick quiz

Q1. Which command tests a TCP port?

  1. ping
  2. Test-NetConnection -Port
  3. ipconfig
Show answer

B — It tests the handshake.

Q2. Why does port 443 show owner System (PID 4)?

  1. It’s a virus
  2. IIS listens through HTTP.sys in the kernel
  3. The firewall owns it
Show answer

B — HTTP.sys is the kernel listener.

Q3. In Break It step 1, why did the intranet fail but the internet worked?

  1. IIS was down
  2. CL01 used a public DNS server
  3. The gateway was wrong
Show answer

B — Only internal DNS knows saatlab.internal.

Q4. Which tool shows packet loss per hop over time?

  1. pathping
  2. Resolve-DnsName
  3. Get-NetAdapter
Show answer

A — It combines tracert with statistics.

Q5. In the work story, what caused hanging copies?

  1. DNS
  2. An MTU black hole
  3. SMB signing
Show answer

B — Big packets were dropped silently.

Quick recap

  • Windows network troubleshooting works from the bottom up: link, IP, name, route, port, then the application.
  • Get-NetIPConfiguration and Resolve-DnsName -Server catch most configuration faults.
  • Test the real port first, then look at the listener and the firewall rules.
  • pathping shows loss per hop; ping -f -l tests MTU.
  • pktmon captures packets without installing anything, and you convert them to pcapng for Wireshark.

Next lesson

Lesson 45: AD and authentication troubleshooting → Next you’ll diagnose domain problems with dcdiag, repadmin, nltest, klist and w32tm, track down a duplicate SPN, and follow an account lockout back to where it starts.

Further reading: Windows network troubleshooting

Want to go deeper into Windows network troubleshooting? Microsoft’s Packet Monitor overview explains pktmon, and the pktmon start reference lists every capture option. You can also see the full plan for this course on the Windows Server Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.