6.7 Network diagnostics utilities: ping, tracert, traceroute and mtr
Imagine that your computer is a car, and the Internet is a huge highway. Sometimes there are “traffic jams”, “pits” or “closed areas” on this highway. How to find out where exactly the problem arose? There are special tools for this, which will be discussed later.
Network diagnostics in Windows
Ping testing
What is Ping?
Ping is like a “Can You hear me?” signal in the world of computer networks. This command:
- Checks if a remote computer or server is “alive.”
- Measures response time (communication speed).
- Shows possible data packet losses.
When to use Ping?
If You suspect that:
- A website is not working.
- Internet connection is unstable.
- There are problems with a specific server.
How to launch the Ping utility?
- Through command prompt (
cmd.exe
):- Press
Win+R
. - Enter
cmd
orcmd.exe
and pressEnter
.
- Press
- Through PowerShell:
- Press
Win+X
. - Select
Windows PowerShell
orWindows Terminal
.
- Press
Basic Parameters in Windows
-n
: number of requests.-l
: packet size.-t
: continuous mode.-w
: timeout.
Usage Examples
- ping google.com
- ping -n 10 google.com
- ping -l 1000 google.com
- ping -t google.com
Example: successful ping check to google.com
domain.
Example: failed ping check to IP 172.172.172.172
.
What the results mean:
0% loss
– Everything’s great, no packet loss.25% - 50% loss
– There are connection stability issues.100% loss
– The server is either completely inaccessible or blocked.
Routing with Tracert
What is Tracert?
Tracert is like GPS for network packets. It:
- Shows the complete path from Your computer to the target server.
- Identifies each intermediate node (computer/router).
- Measures transit time at each stage.
When to use Tracert?
If You want to understand:
- Why the internet is working slowly.
- At what stage delays occur.
- Where there might be a routing problem.
How to launch the Tracert utility?
- Through command prompt (
cmd.exe
):- Press
Win+R
. - Enter
cmd
orcmd.exe
and pressEnter
.
- Press
- Through PowerShell:
- Press
Win+X
. - Select
Windows PowerShell
orWindows Terminal
.
- Press
Basic Parameters in Windows
-d
: without DNS resolution.-h
: maximum number of hops.-w
: timeout for each node.
Usage Examples
- tracert google.com
- tracert -d google.com
Example: successful trace check to google.com
domain.
Example: failed trace check to IP 100.100.100.100
.
What the results mean:
- Each line is a “hop” to the server.
*
- packet was lost or didn’t receive a response.- Lower numbers on the right indicate better speed.
Monitoring via MTR
What is MTR (WinMTR)?
MTR (My Traceroute) is the “Swiss Army knife” of network diagnostics. It combines the capabilities of Ping and Tracert, but goes much deeper.
Unique WinMTR features:
- Continuous route monitoring.
- Loss statistics at each node.
- Dynamic statistics updates.
- Graphical results presentation.
Installation in Windows
- Download WinMTR.
- Extract the archive.
- Run the version You need (32 or 64-bit).
Network diagnostics in Linux/MacOS
Connection test (Ping)
What is Ping in Linux?
Ping is a system utility for checking network connectivity that:
- Sends ICMP packets.
- Determines host availability.
- Evaluates connection quality.
How to launch the Ping utility?
-
Through terminal:
- Press
Ctrl+Alt+T
. - Or launch terminal emulator from menu.
- Press
-
Through console:
- Switch to text mode
Ctrl+Alt+F1
.
- Switch to text mode
Basic Parameters in Linux
-c
: number of packets.-i
: interval between packets.-s
: packet size.-W
: timeout.Ctrl+C
: combination to stop checking.
Usage Examples
- ping google.com
- ping -c 5 -i 2 google.com
- ping -s 1000 google.com
Example: successful ping check to google.com
domain.
Traceroute
What is Traceroute?
Traceroute is a utility for tracing packet routes that:
- Shows the path to the target node.
- Determines delays along the route.
- Helps diagnose network problems.
How to launch the Traceroute utility?
-
Through terminal:
- Press
Ctrl+Alt+T
. - Or launch terminal emulator from menu.
- Press
-
Through console:
- Switch to text mode
Ctrl+Alt+F1
.
- Switch to text mode
Basic Parameters in Linux
-n
: without DNS names.-m
: maximum number of hops.-w
: timeout.-I
: ICMP mode.
Usage Examples
- traceroute google.com
- traceroute -n google.com
- traceroute -m 15 google.com
Example: successful trace check to google.com
domain.
MTR Utility
What is MTR?
MTR is a powerful diagnostic tool that provides advanced diagnostics capabilities:
- Combines ping and traceroute.
- Provides detailed network statistics.
- Works in interactive mode.
Basic MTR Controls:
After launching mtr <address>
(for example, mtr google.com
), You’ll see an interactive interface. Here are the main control keys:
Basic commands:
- Q — quit the utility.
- H — show help.
- R — reset current statistics (update data).
- C — clear screen and start collecting statistics anew.
- P — toggle packet loss display mode (show only lost packets, ignoring others).
Display modes:
- D — toggle between detailed and simplified output.
- N — enable/disable IP address to domain name conversion.
- B — change basic display mode (reverse packet count).
Sorting:
- L — sort by packet Loss.
- R — sort by average Response Time (RTT).
- S — sort by current response time.
- J — change sorting algorithm (manual or automatic).
Additional options:
- ? — display a brief list of all hotkeys.
Installation in Linux
- sudo apt-get install mtr
- sudo yum install mtr
Basic Launch Parameters
-r
: run utility in report mode (without interactive interface). After test completion, summary statistics will be displayed.-c <number>
: specify number of requests (number of polling cycles).-i <interval>
: set interval between requests (in seconds, default is 1 second).-s <size>
: set packet size (in bytes).-p
: use only ICMP protocol (ping).-u
: use UDP for route testing.-T
: use TCP connection (useful for port testing).-n
: don’t convert IP addresses to domain names (disable DNS resolution).-b
: show both incoming and outgoing traffic.-4
: use only IPv4.-6
: use only IPv6.
Usage Example
- mtr google.com
- mtr -r google.com
Example: checking google.com
website using MTR.