Tracepath vs. Traceroute: What's the Difference?

Introduction

The tracepath and traceroute terminal programs are crucial in network diagnostics. Both commands map the network and display possible packet routes and transit delays from a source to a destination. However, there is a difference between the available options and which users can use each command.

This article outlines the difference between traceroute and tracepath and shows use cases.

Tracepath vs. Traceroute

Prerequisites

  • Stable internet connection.
  • A destination to trace (the guide offers an example).
  • Access to the terminal with sudo privileges.

Differences between Tracepath vs. Traceroute

The main difference between tracepath and traceroute is in the available options and user privileges. With default options, the two commands are similar.

Tracepath traces the path to a specified destination using UDP packets. Without any options, the command outputs:

  • TTL (Time To Live) round-trip time for a packet.
  • MTU (Maximum Transmission Units) or the largest packet that tracepath can send over the network.
  • The resolved domain name when possible.

Traceroute maps the network path to a designated destination. Without any options, the command sends UDP packets and prints:

  • The TTL round-trip time for three packets.
  • Maximum hop number and packet size in bytes.
  • IP address and resolved domain name when possible.

However, traceroute offers many advanced options to select from, such as choosing between ICMP and TCP transfer protocols and more. Some options require superuser (sudo) privileges because the command works directly with raw packets.

How is Tracepath Used?

The tracepath command syntax is:

tracepath <options> <destination IP or domain name>

For example, trace the path to one of phoenixNAP's speed test IP locations:

tracepath 184.95.56.34
Tracepath command terminal output

The Tracepath program offers some simple options. For instance, display only the IP address for a quicker output:

Tracepath -n command terminal output

The output does not show the resolved domain name. For a complete list of options, run the manual using the man command:

man tracepath

In general, use tracepath for simple network scanning.

How is Traceroute Used?

The traceroute command syntax is:

traceroute <options> <destination IP or domain name>

Note: Traceroute not installed? Use the apt package manager and install it with:

sudo apt install traceroute

The simplest way to use traceroute is without any options:

traceroute 184.95.56.34

An example command that requires sudo privileges is when specifying the TCP protocol:

sudo traceroute -T 184.95.56.34
Traceroute -T without and with sudo terminal output

The traceroute program offers many more options to customize the packet size, the number of probes sent, setting the maximum TTL, etc. For a detailed list, use:

man traceroute

Use traceroute when you need more advanced options to analyze the network.

Conclusion

After reading this guide, you know how to use traceroute and tracepath and the difference between the two commands. You can use these commands together with other Linux networking commands such as ss, netstat, and ip.

Was this article helpful?
YesNo
Milica Dancuk
Milica Dancuk is a technical writer at phoenixNAP who is passionate about programming. Her background in Electrical Engineering and Computing combined with her teaching experience give her the ability to easily explain complex technical concepts through her content.
Next you should read
Netstat Command in Linux - 28 Commands with Examples
January 28, 2021

Read about the most commonly used netstat commands for Linux and see examples of their usage.
Read more
How to Run a Traceroute on Linux, Windows & macOS
August 16, 2021

One of the most important tools when troubleshooting network problems is Traceroute. The command traces the path a packet takes between the source and...
Read more
How To Use Linux SS Command
February 3, 2021

The ss (socket statistics) tool is used for displaying various network and socket statistics. It is a faster version of the neststat tool. This article gives an in-depth overview...
Read more
How to Use IP Command in Linux with Examples
November 22, 2019

The ip command is a Linux net-tool for system and network administrators used for configuring network interfaces. Learn about the important operations the ip command can...
Read more