A TCP-based traceroute tool implemented in C++ using Linux raw sockets.
This project sends TCP SYN packets with increasing IP TTL values to discover the hop-by-hop path to a destination, similar to traceroute, but implemented from scratch at the protocol level.
- Constructs raw IPv4 + TCP packets manually
- Computes IP and TCP checksums (including TCP pseudo-header)
- Receives and parses ICMP Time Exceeded messages for intermediate hops
- Detects destination reachability via TCP RST / SYN-ACK
- Measures round-trip time (RTT) per hop
- Uses
select()to monitor ICMP and TCP sockets concurrently
sudo g++ -o tcptraceroute main.cpp
sudo ./tcptraceroute <destination>