Tracetcp is a tool primarily used by end users to test TCP port connectivity from the Windows command line. Instead of using ICMP or UDP packets like traditional traceroute implementations, tracetcp
uses TCP SYN packets. This allows it to bypass gateways that block traditional traceroute packets, providing a more reliable method for tracing the path of TCP traffic across a network.
To run tracetcp in Windows, two components are required:
- WinPcap
- tracetcp.exe
WinPcap allows applications to capture and transmit network packets bypassing the protocol stack, while tracetcp
is an application that sends TCP SYN packets from the source machine.
Steps to Run tracetcp
in Windows
- Download and Install WinPcap:
- Download WinPcap from its official website.
- Install WinPcap on your system by following the installation instructions.
- Download and Prepare tracetcp:
- Download the
tracetcp
ZIP file. - Extract the ZIP file.
- Copy the
tracetcp.exe
file to the C: drive.
- Download the
- Run tracetcp in windows:
- Open Command Prompt with administrative privileges.
- Navigate to the root of the C: drive
C:\Users\username>cd\
- Use the following commands to run
tracetcp
:tracetcp.exe hostname:port
ortracetcp.exe ip:port
Examples
Using hostname:
C:>tracetcp.exe google.com:443
Tracing route to 172.217.26.238 [bom05s09-in-f14.1e100.net] on port 443
Over a maximum of 30 hops.
1 2 ms 3 ms 1 ms 10.222.200.2
2 1 ms 1 ms 2 ms 144.36.206.2
3 4 ms 8 ms 2 ms 115.110.236.89 [115.110.236.89.static.bangalore.vsnl.net.in]
Using IP address:
C:>tracetcp.exe 8.8.8.8:443
Tracing route to 8.8.8.8 [google-public-dns-a.google.com] on port 443
Over a maximum of 30 hops.
1 1 ms 1 ms 0 ms 10.222.200.2
2 2 ms 1 ms 2 ms 144.36.206.2
3 4 ms 5 ms 3 ms 115.110.236.89 [115.110.236.89.static.bangalore.vsnl.net.in]
Running tcptraceroute on Linux and macOS
tcptraceroute
is a utility for tracing the path of TCP packets to a destination. It is included by default in most Unix-based distributions, but on macOS, it needs to be installed using Homebrew.
Installing tcptraceroute on macOS
To install tcptraceroute
on macOS, follow these steps:
- Install Homebrew:
- If you don’t have Homebrew installed, you can install it by running
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- If you don’t have Homebrew installed, you can install it by running
- Install tcptraceroute:
- Once Homebrew is installed, use it to install
tcptraceroute
brew install tcptraceroute
- Once Homebrew is installed, use it to install
Running tcptraceroute
The command syntax for running tcptraceroute
is as follows:
tcptraceroute hostname port
Example Usage on Linux and macOS
On some operating systems like macOS, you may need to run tcptraceroute
with root privileges. Use sudo
to achieve this. Here’s an example:
sudo tcptraceroute api.opendns.com 443
Example Output
admin-0369:Tools admin$ sudo tcptraceroute api.opendns.com 443
Selected device en0, address 192.168.10.63, port 60749 for outgoing packets
Tracing the path to api.opendns.com (67.215.92.210) on TCP port 443 (https), 30 hops max
1 192.168.10.254 1.893 ms 1.787 ms 1.123 ms
2 * * *
3 te-0-7-0-11-sur02.lowell.ma.boston.comcast.net (68.85.161.117) 11.768 ms 36.209 ms 11.473 ms
4 be-21-ar01.needham.ma.boston.comcast.net (68.85.106.45) 14.006 ms 12.382 ms 21.340 ms
5 be-7015-cr01.newyork.ny.ibone.comcast.net (68.86.90.217) 40.690 ms 67.974 ms 41.689 ms
6 ae12.edge1.newyork2.level3.net (4.68.127.1) 42.198 ms 19.511 ms 22.600 ms
7 ae-32-80.car2.sanjose1.level3.net (4.69.152.132) 121.049 ms 130.360 ms 125.898 ms
8 ae-32-80.car2.sanjose1.level3.net (4.69.152.132) 124.555 ms 139.251 ms 136.524 ms
9 open-dns-in.car2.sanjose1.level3.net (4.28.12.198) 86.392 ms 99.180 ms 88.102 ms
10 vlan130.fw1.sjc.opendns.com (67.215.78.6) 89.775 ms 88.160 ms 90.077 ms
11 api.opendns.com (67.215.92.210) [open] 126.455 ms 87.454 ms 89.881 ms