Skip to content

Projects-AT-UGA/ComputerNetworks-4

Repository files navigation

Hide Assignment Information Instructions Objective: The goal of this project is to build your own traceroute-like program, using raw sockets, TCP and ICMP.

Language: Python or C. Submissions written in C will receive up to an additional 10 bonus points (bonus points will not apply to Python submissions).

Description: Write a command line tool that, given a target domain name or IP address, can measure the RTT latency for each hop in between the machine where the tool runs and the destination IP address. The expected output format will need to be very similar to the output generated by the traceroute command-line tool (see example below).

Requirements:

  1. You must use "raw" sockets Examples (in Python): send_ip_raw_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RAW) icmp_raw_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_ICMP) eth_raw_socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(ETH_P_IP))
  2. The probes must be generated using TCP SYN packets
  3. Packets must be sent/received using the socket API (for Python: https://docs.python.org/3/library/socket.html). Higher-level send/receive functions/libraries are not permitted.
  4. Each hop latency must be measured 3 times, as in the real traceroute

More information about raw sockets can be found here: https://linux.die.net/man/7/raw https://linux.die.net/man/7/packet

Usage:

$ ./tcp_traceroute.py -h usage: tcp_traceroute.py [-m MAX_HOPS] [-p DST_PORT] -t TARGET

optional arguments: -h, --help show this help message and exit -m MAX_HOPS Max hops to probe (default = 30) -p DST_PORT TCP destination port (default = 80) -t TARGET Target domain or IP

Example output:

$ sudo tcp_traceroute -m 10 -p 80 -t www.google.com traceroute to www.google.com (64.233.185.147), 10 hops max, TCP SYN to port 80 1 172.17.149.1 (172.17.149.1) 0.970 ms 1.407 ms 1.880 ms 2 128.192.0.5 (128.192.0.5) 0.305 ms 0.394 ms 0.484 ms 3 1023-Boyd-BAgg-R.net.uga.edu (172.31.42.106) 1.816 ms 1057-Life-BAgg-R.net.uga.edu (172.31.43.106) 1.211 ms 1023-Boyd-BAgg-R.net.uga.edu (172.31.42.106) 1.778 ms 4 0042-Peabody-Core-R.net.uga.edu (172.31.41.0) 1.739 ms 1023-Boyd-Core-R.net.uga.edu (172.31.40.0) 3.611 ms 0042-Peabody-Core-R.net.uga.edu (172.31.41.0) 1.664 ms 5 Boyd-MX-re0.net.uga.edu (172.31.41.24) 0.584 ms Peabody-MX-re0.net.uga.edu (172.31.40.26) 0.628 ms 0.612 ms 6 172.31.47.9 (172.31.47.9) 1.021 ms 0.903 ms 0.881 ms 7 Boyd-MX-re0.net.uga.edu (172.31.47.5) 1.578 ms 1.550 ms 1.905 ms 8 trcpsx.net.uga.edu (128.192.166.41) 6.074 ms 6.058 ms 6.009 ms 9 74.125.48.33 (74.125.48.33) 6.004 ms 5.974 ms 5.962 ms 10 108.170.249.44 (108.170.249.44) 7.815 ms 108.170.249.108 (108.170.249.108) 6.797 ms 108.170.249.67 (108.170.249.67) 6.571 ms

Submission guidelines: Create a directory named with your last name. Put your program's files under that directory. Then, create a FIRSTNAME-LASTNAME.tar.gz archive containing that directory. For instance, in my case those would be:

_ perdisci |___ tcp_traceroute.py

ROBERTO-PERDISCI.tar.gz

Finally, submit the .tar.gz file through eLC.

NOTE: This is an individual project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages