6.7 Network diagnostics utilities: ping, tracert, and traceroute

Effective network connection diagnostics are critically important for network administrators and users. The ping, tracert, and traceroute utilities are basic tools that allow checking the availability of remote hosts and determining the packet routing path in a network.

Reminder: these commands are available in both Windows and Linux systems, although the syntax may slightly differ.

Ping Command

Ping (Packet InterNet Groper) is a utility for checking the availability of a remote host by sending ICMP packets (Internet Control Message Protocol). The working principle is based on sending special ICMP messages "echo-request" to the target host and waiting for a "echo-reply".

Main ping functions:

  • Checking host availability on the network.
  • Measuring response time (latency).
  • Detecting packet loss.
  • Testing network connection quality.
  • Identifying routing problems.

Informing: response time is measured in milliseconds (ms) and shows how long it takes for a packet to reach the target host and return back.

Ping on Windows

Launch methods:

  1. Through Command Prompt (cmd.exe):
    • Press Win + R.
    • Enter cmd or cmd.exe and press Enter.

Command Prompt

  1. Through PowerShell:
    • Press Win + X.
    • Select Windows PowerShell or Windows Terminal. PowerShell

Syntax:

Command template.
  1. ping [parameters] target_address

Instead of target_address, You need to insert a domain or IP address of the desired host.

Main parameters:
  • -t - send packets until forced stop (Ctrl + C combination).
  • -n number - number of requests to send.
  • -l size - send buffer size.
  • -w timeout - timeout in milliseconds.
  • -4 - force using IPv4.
  • -6 - force using IPv6.

Examples:

Command template for domain.
  1. ping google.com
Command template for IP address.
  1. ping 192.168.1.1

Ping on Linux/MacOS

Launch methods:

  1. Through Terminal:

    • Press Ctrl + Alt + T.
    • or launch terminal emulator from the menu.
  2. Through Console:

    • Switch to text mode Ctrl + Alt + F1.

Syntax:

Command template.
  1. ping [parameters] target_address

Instead of target_address, You need to insert a domain or IP address of the desired host.

Main parameters:
  • -c number - number of packets to send.
  • -s size - packet size in bytes.
  • -i interval - interval between packets in seconds.
  • -W timeout - response waiting time.
  • -4 - use only IPv4.
  • -6 - use only IPv6.
  • -f - flood ping.
  • -q - quiet mode, shows only summary.

Examples:

Command template for domain with added parameters.
  1. ping -c 5 google.com
Command template for IP address with added parameters.
  1. ping -i 2 192.168.1.1

Tracert/Traceroute Commands

Tracert (Windows) and traceroute (Linux/MacOS) are similar utilities that track the data packet routing path from the source to the target host through the Internet or local network. The difference is only in the name and some parameters, but the working principle is the same.

Working principle:
  • Sending a series of packets with gradually increasing TTL (Time To Live) value.
  • Each router on the path reduces TTL by 1.
  • When TTL reaches 0, the router sends an error message.
  • This allows identifying each “hop” on the path to the destination.
Main functions:
  • Determining the full route to the target host.
  • Identifying problematic network segments.
  • Analyzing delays at each node.
  • Diagnosing routing problems.
  • Detecting network loops.

Informing: each “hop” represents a router or other network device on the path to the target host.

Tracert on Windows

Launch methods:

  1. Through Command Prompt (cmd.exe):
    • Press Win + R.
    • Enter cmd or cmd.exe and press Enter.

Command Prompt

  1. Through PowerShell:
    • Press Win + X.
    • Select Windows PowerShell or Windows Terminal. PowerShell

Syntax:

Command template.
  1. tracert [parameters] target_address

Instead of target_address, You need to insert a domain or IP address of the desired host.

Main parameters:
  • -d - do not convert IP addresses to names.
  • -h max_hops - maximum number of hops.
  • -w timeout - timeout for each response in milliseconds.
  • -4 - force using IPv4.
  • -6 - force using IPv6.

Examples:

Command template for domain with added parameters.
  1. tracert google.com
Command template for IP address with added parameters.
  1. tracert -d -h 15 8.8.8.8

Traceroute on Linux/MacOS

Launch methods:

  1. Through Terminal:

    • Press Ctrl + Alt + T.
    • or launch terminal emulator from the menu.
  2. Through Console:

    • Switch to text mode Ctrl + Alt + F1.

Syntax:

Command template for domain/IP address.
  1. traceroute [parameters] target_address

Instead of target_address, You need to insert a domain or IP address of the desired host.

Main parameters:
  • -n - do not convert IP to host names.
  • -m max_hops - maximum number of hops.
  • -w timeout - response waiting time.
  • -4 - use only IPv4.
  • -6 - use only IPv6.
  • -I - use ICMP queries.
  • -T - use TCP SYN for queries.
  • -U - use UDP for queries.

Examples:

Command template with various parameters for domain.
  1. traceroute google.com
Command template with various parameters for IP address.
  1. traceroute -n -w 2 8.8.8.8
  2. traceroute -I 192.168.1.1

Informing: in Linux, traceroute uses UDP traffic by default.

  • In Windows, tracert uses ICMP Echo Request.
  • Administrator rights may be required to obtain results.

Important: some network devices may block ICMP packets.

  • Firewalls may block traceroute/tracert.
  • Results may differ on repeated runs.

Practical Usage Examples

Network Problem Diagnostics

  1. Basic Availability Check:
Checking ping on IP address 8.8.8.8.
  1. ping 8.8.8.8
  1. Connection Stability Analysis:
Checking ping on google.com domain.
  1. ping -t google.com

The -t parameter performs an unlimited number of pings to the host You specified. To end the process, use the Ctrl + C keyboard combination.

  1. Identifying Network Problem Segments:
Checking route to google.com domain.
  1. tracert google.com

Network Performance Analysis

  1. Latency Testing with Different Packet Sizes:
Command tests server availability using a 1000-byte ICMP packet.
  1. ping -l 1000 server.example.com
  1. Packet Loss Determination:
Sending 100 packets to IP address 192.168.1.1.
  1. ping -n 100 192.168.1.1