---
name: "traceproto"
section: "8"
platform: "linux"
package: "traceproto"
version: "1.1.2beta1-2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/traceproto"
---

# traceproto(8)

trace the route to a destination using a specified protocol and port

## NAME

Traceproto - trace the route to a destination using a specified protocol and port

## SYNOPSIS

**traceproto** \[**-cCTfAhvR**\] \[**-p** *protocol*\] \[**-d** *dst\_port*\] \[**-D** *max\_dst\_port*\] \[**-s** *src\_port*\] \[**-S** *max\_src\_port*\] \[**-m** *min\_ttl*\] \[**-M** *max\_ttl*\] \[**-w** *response\_timeout*\] \[**-W** *send\_delay*\] \[**-a** *account\_level*\] \[**-P** *payload\_size*\] \[**-F** *interface*\] \[**-k** *skips*\] \[**-I** *consecutive\_trace\_count*\] \[**-H** *packets\_per\_hop*\] \[**-i** *incr\_pattern*\] \[**-o** *output\_style*\] \[**-t** *tcp\_flags*\]

## DESCRIPTION

**traceproto** is a replacement for the venerable  **traceroute**. It serves the same function, to determine the path that traffic takes between the current host and a remote system.  Like  **traceroute** it uses the IP time-to-live (TTL) field and watches for the return ICMP packets from each successive gateway. In the current Internet environment with ubiquitous firewalls and traffic filtering it is no longer enough to assume that if some traffic is getting to the remote machine that all of it is. **traceproto** is an improvement to **traceroute** in this regard as it lets you select the protocol and destination port to trace to.

## OPTIONS

- **-p** *protocol*

  The protocol to use.  The current options are  **tcp**, **udp**, and  **icmp** with **tcp** as the default.

- **-d** *dst\_port*

  The destination port to trace to.  If **-i** is set to  '**d**' or '**D**' then this is the minimum destination port.  The default value is 80 (HTTP).

- **-D** *max\_dst\_port*

  The maximum destination port.   **-i** needs to be set to  '**d**' or '**D**' for this to have an effect.

- **-s** *src\_port*

  The port to use as the local source port.  If  **-i** is set to '**s**' or '**S**' then it is the minimum source port.  The default is 10240.

- **-S** *max\_src\_port*

  The port to use as the maximum local source port.

- **-m** *min\_ttl*

  Specifies the minimum time-to-live setting to use.  This sets how many hops away to start tracing.  (For example, if the first hop is a firewall that will not respond with an ICMP TIME\_EXCEEDED message but will allow packages through from hops that are further away, you can set the  *min\_ttl* to 2 and thereby avoid having to wait for the packets that timeout at the first hop.) The default is 1.

- **-M** *Max\_ttl*

  Specifies the maximum time-to-live setting.  This is the limit for how many hops away to trace.  The default is 30.  (Very few locations on the Internet will be further away than this.)

- **-w** *wait\_timeout*

  The timeout in seconds to wait for a return packet.  The default is 5 seconds.

- **-W** *send\_delay*

  The timeout before sending a new packet in milliseconds.  The default is 100 milliseconds.

- **-a account\_level**

  If accounting is enabled (ie. account\_level set to \> 0) traceproto will print statistics after the run is complete detailing minimum return time in milliseconds, average return time in milliseconds, maximum return time in milliseconds, number of packets returned successfully, and the number of packets that generated no response.  Possible account\_levels:

-

  **0** No accounting printed.

-

  **1** Only the totals for all of the hops combined are printed.

-

  **2** Stats are shown for each individual hop as well as the total (this is the default).

  Note that the  **-C** flag will run traceproto in continuous mode, restarting from scratch at the end of each run and will generate stats after each run.  Note also that  CTRL-C will abort the run, printing the stats at whatever level is specified with **-a** and will abort traceproto. CTRL-Z will cause traceproto to print the stats but does not abort the run.

- **-T**

  Print timestamps with the output.

- **-P** *payload\_size*

  This option specifies the payload size in bytes.  Currently the payload is filled with ' 's, though this may change in the future.  A word of caution, traceproto seems to have problems with certain combinations of payload size and protocol, especially  **udp** with payloads of under 12 bytes.  Hence the default payload is 12 bytes. The cause of this has yet to be determined.

- **-k** *skips*

  Allows the user to specify a comma separated list of hops to skip by number (ie. **-k 5** will cause traceproto to skip sending packets with a ttl of 5, going from 4 to 6).  This allows the user to skip a hop that is know to not respond, responds slowly, or that should be avoided for some reason.  The skip list only allows comma separated hops at this point, not ranges. Spaces in the list will also cause problems.  Note that  **-k 1** is functionally analogous to **-m 2**.

- **-c**

  Trace continuously.  This causes traceproto to reset its counters and begin the trace from scratch once run has been completed.  Useful for finding intermittent problems and for noting hops that use packet based routing (ie. the route used for the packet may change from one packet to the next even during the same connection).  See also **-C**.

- **-C**

  If  **-c** is set, this prints the accumulated stats at the end of each run.  Meaningless unless  **-c** is set.

- **-I** *consecutive\_trace\_count*

  Like  **-c** and  **-C**, **-I** does a continuous trace but unlike  **-c** and **-C**, it only does consecutive\_trace\_count iterations.

- **-H** *packets\_per\_hop*

  This allows the user to specify the number of packets sent out for each increment of the TTL.  This must be a number between 1 and 10.  The default is 3 packets per hop.

- **-f**

  Set the don't-fragment bit in the IP header.  Can be used in conjunction with the  **-P** flag to determine at which hop the MTR changes.

- **-F** *interface*

  Specify the network interface to use.  Note that it is quite possible to specify the wrong interface needed to reach the target.

- **-A**

  Do Autonomous System number lookups.

- **-i** *port\_incr\_pattern*

  This flag governs the source and destination increment patterns.  The pattern is a combination of one or two letters from the set  \[**sSdDnN**\] where the meanings are:

-

  **s** decrement the source port with each packet

-

  **S** increment the source port with each packet (the default for the source port)

-

  **d** decrement the destination port with each packet

-

  **D** increment the destination port with each packet

-

  **n** use a static source port

-

  **N** use a static destination port (the default for the destination port)

  Note that if contradictory options are given, the last one seen is used (ie. **-i Ss** is the same as **-i s**). Note also that  **-i nN** may cause traceproto problems in determining which response is for which packet.

- **-o** *output\_style*

  The default output style is designed to be reasonable legible and space conscious.  There are other output styles available:

-

  **s** the standard output (default).  Prints the hop number, the response protocol and type, the response machine name if available, and the response IP address on the first line.  The next line is a list of the response times as they arrive.

-

  **g** graphical output.  The first line is the same as the standard output, but the response time is printed one line per response with a variable length ascii bar indicating the relative response time.

-

  **c** classic output.  An output style (almost) identical to the original traceroute.

-

  **n** no individual hop output.  Stats will still print at whatever level is set. (Note that  **-o n -a 0** is possible, but silly.)

-

  **m** minimal output.  Prints the hop number and a single character indicating the response type.  Response times are not noted.

-

  **p** scriptable output.  Prints the hop number, ip, return packet type, and time for each packet sent.

-

  **C** (n)curses output.

- **-t** *flags*

  Sets the tcp flags to use.

-

  **S** SYN (default)

-

  **A** ACK

-

  **R** RST

-

  **U** URG

-

  **P** PUSH

-

  **F** FIN

-

  **E** ECE

-

  **C** CWR

-

  Use  **-t SEC** to test connections with Explicit Congestion Notification enabled.

- **-R**

  Reverse trace.  Starts at the max TTL and decrements the TTL for each hop.

- **-h**

  A brief usage message summarizing the options.

- **-v**

  Version info.

## USAGE

The easiest way to invoke  **traceproto** is simply to give it a target machine by name or IP address.  The default behavior is to trace using tcp and destination port 80.  Given the current state of the Internet this is the most likely to succeed though it certainly won't be appropriate for every situation.

**traceproto** assumes that the user has some understanding of the protocols involved; users who are unfamiliar with them may find that  **traceproto**'s options or output are hard to decipher.  Information on how the protocols function is widely available on the Internet and is recommended reading for the traceproto user.

There are a fair number of options for **traceproto** and there will probably be even more in the future.  Many are contradictory or illogical in combination, but unless a combination is actually problematic, **traceproto** will usually allow it to be specified.  Combinations that are illogical are generally ignored in a sensible manner; contradictions are usually resolved using the option furthest to the right on the command line.

## ENVIRONMENT

There are a number of environmental variables that can be set to effect **traceproto**'s behavior.  These variables override the default behavior; in turn they are themselves are overridden by their equivalent command line flags.

- **TP\_TIMESTAMP\_STYLE**

  Sets the format for the time-stamp printed by the  **-T** flag.  Note that there is no equivalent command line flag for this variable.

-

  **std** The std  day/alpha-month/year:hour:minute:second format.

-

  **us** US Style date of  numeric-month/day/year:hour:minute:second format.

-

  **descend** Descending time format:  year/month/day:hour:minute:second.

-

  **epoch** Number of seconds since the unix epoch.

- **TP\_DEFAULT\_IF**

  Sets the default interface.  Is overridden by the  **-F** flag.  Setting this variable causes  **traceproto** to print a message about which interface it is using, since  **traceproto** will attempt to send the traces out that interface whether or not it is the correct interface needed to reach the specified destination.

- **TP\_OUTPUT\_STYLE**

  Sets the default output style for  **traceproto.** Is overridden using the **-o** flag.

-

  **std** The standard output style.  The same as  '**-o s**'.

-

  **graphical** The graphical output style.  The same as '**-o g**'.

-

  **classic** The classic output style.  The same as '**-o c**'.

-

  **none** No output.  The same as  '**-o n**'.

-

  **minimal** Minimal output.  The same as '**-o m**'.

-

  **scriptable** Output suitable for use in scripting.  The same as '**-o p**'.

-

  **curses** (N)Curses output.  The same as '**-o C**'.

- **RA\_SERVER**

  and

- **TP\_RA\_SERVER**

  Sets the default server to to Autonomous System number lookups.  Mimics the NANOG traceroute behavior.

## SEE ALSO

[traceroute(8)](/traceroute/8.md), [hping2(8)](/hping2/8.md), [tcptraceroute(1)](/tcptraceroute/1.md), [mtr(8)](/mtr/8.md), [lft(8)](/lft/8.md).

## BUGS

None known at this time.  Please report any bugs found.
