Giter VIP home page Giter VIP logo

traceroute's Introduction

Traceroute

A simple command-line tracert implementation in Python 3 using ICMP packets

Screenshot

Details

Traceroute is a networking tool designed for tracing the movement of packets across a network. In this Python 3 implementation, ICMP 'ping' packets are used, much like the Windows tracert.exe program (and unlike Unix tracert which typically uses UDP packets).

The application sends a sequence of ICMP packets to the host, initially with the Time-To-Live field set to 1. As the packet travels across the network to its final destination, each node it passes through will decrement the TTL field by 1. When the field reaches zero the node will respond by saying that the packet could not reach its destination.

+------+           +--------+
|      |  TTL = 1  |        |
|      | --------> |        |
| HOST |           | node 1 |
|      |  timeout  |        |
|      | <-------- |        |
+------+           +--------+

Having now identified the first node that the packet passes through, tracert now sends another ICMP packet with TTL set to 2, which will timeout when it reaches the second node, and so on.

+------+           +--------+           +--------+
|      |  TTL = 2  |        |  TTL = 1  |        |
|      | --------> |        | --------> |        |
| HOST |           | node 1 |           | node 2 |
|      |  timeout  |        |  timeout  |        |
|      | <-------- |        | <-------- |        |
+------+           +--------+           +--------+


+------+           +--------+           +--------+           +--------+
|      |  TTL = 3  |        |  TTL = 2  |        |  TTL = 1  |        |
|      | --------> |        | --------> |        | --------> |        |
| HOST |           | node 1 |           | node 2 |           | node 3 |
|      |  timeout  |        |  timeout  |        |  timeout  |        |
|      | <-------- |        | <-------- |        | <-------- |        |
+------+           +--------+           +--------+           +--------+

Eventually, an ICMP packet will be sent with a sufficiently large TTL value that it can reach the final destination, at which point the process is complete.

+------+           +--------+           +--------+           +--------+           +--------+
|      |  TTL = 4  |        |  TTL = 3  |        |  TTL = 2  |        |  TTL = 1  |        |
|      | --------> |        | --------> |        | --------> |        | --------> |        |
| HOST |           | node 1 |           | node 2 |           | node 3 |           | TARGET |
|      |  success  |        |  success  |        |  success  |        |  success  |        |
|      | <-------- |        | <-------- |        | <-------- |        | <-------- |        |
+------+           +--------+           +--------+           +--------+           +--------+

traceroute's People

Contributors

james-p-d avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sorenandersen1

traceroute's Issues

All results are "timeout". This code can't run successfully.

1 5011 ms ???.???.???.??? (Timeout)
2 5010 ms ???.???.???.??? (Timeout)
3 5003 ms ???.???.???.??? (Timeout)
4 5003 ms ???.???.???.??? (Timeout)
5 5007 ms ???.???.???.??? (Timeout)
6 5010 ms ???.???.???.??? (Timeout)
7 5013 ms ???.???.???.??? (Timeout)
8 5004 ms ???.???.???.??? (Timeout)
9 5012 ms ???.???.???.??? (Timeout)
10 5012 ms ???.???.???.??? (Timeout)
11 5000 ms ???.???.???.??? (Timeout)
12 5005 ms ???.???.???.??? (Timeout)
13 5006 ms ???.???.???.??? (Timeout)
14 5008 ms ???.???.???.??? (Timeout)
15 5004 ms ???.???.???.??? (Timeout)
16 5010 ms ???.???.???.??? (Timeout)
17 5012 ms ???.???.???.??? (Timeout)
18 5000 ms ???.???.???.??? (Timeout)
19 5007 ms ???.???.???.??? (Timeout)
20 5007 ms ???.???.???.??? (Timeout)
21 5004 ms ???.???.???.??? (Timeout)
22 5012 ms ???.???.???.??? (Timeout)
23 5001 ms ???.???.???.??? (Timeout)
24 5009 ms ???.???.???.??? (Timeout)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.