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

Overview

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  |        |
|      | <-------- |        | <-------- |        | <-------- |        | <-------- |        |
+------+           +--------+           +--------+           +--------+           +--------+
Owner
James
Busily reinventing the wheel
James
A Python module and command-line utility for converting .ANS format ANSI art to HTML

ansipants A Python module and command-line utility for converting .ANS format ANSI art to HTML. Installation pip install ansipants Command-line usage

4 Oct 16, 2022
A set of libraries and functions for simplifying automating Cisco devices through SecureCRT.

This is a set of libraries for automating Cisco devices (and to a lesser extent, bash prompts) over ssh/telnet in SecureCRT.

Matthew Spangler 7 Mar 30, 2022
Python script to tabulate data formats like json, csv, html, etc

pyT PyT is a a command line tool and as well a library for visualising various data formats like: JSON HTML Table CSV XML, etc. Features Print table o

Mobolaji Abdulsalam 1 Dec 30, 2021
This tool is a free and unlimited python CLI for google translate. based on google_trans_new.

GoTransPy A free and unlimited python CLI for google translate based on google_trans_new. It's very easy to use and solve the problem that the old api

Youssef Mohamed 2 Jan 10, 2022
DShell, a tool that combines with discord.py and Jishaku to present to you, shell channels.

Discord shell or dshell for short is a Python package that combines with discord.py and Jishaku to transform an ordinary Discord channel into one capable of running bash commands using a Discord bot.

11 Nov 15, 2022
🪛 A simple pydantic to Form FastAPI model converter.

pyfa-converter Makes it pretty easy to create a model based on Field [pydantic] and use the model for www-form-data. How to install? pip install pyfa_

20 Dec 22, 2022
A command line tool to publish ads on ebay-kleinanzeigen.de

kleinanzeigen-bot Feedback and high-quality pull requests are highly welcome! About Installation Usage Development Notes License About kleinanzeigen-b

83 Dec 26, 2022
A CLI/Shell supporting OpenRobot API and more!

A CLI/Shell supporting JeyyAPI, OpenRobot API and RePI API.

OpenRobot Packages 1 Jan 06, 2022
CLI/library to control FNIRSI DC Power Supply (DC-6006L, etc)

dc6006l - CLI/library to control FNIRSI DC Power Supply (DC-6006L, etc) What is this? FNIRSI DC6006L is a programmable DC power supply that is quite c

Taisuke Yamada 7 Sep 25, 2022
A very simple OpenContest command line client written in Python

OpenContest Client A very simple OpenContest command line client written in Python. The only dependency is the requests library. Tested with Linux onl

Ladue Computer Science 1 May 25, 2022
A python-based terminal application that displays current cryptocurrency prices

CryptoAssetPrices A python-based terminal application that displays current cryptocurrency prices. Covered Cryptocurrencies Bitcoin (BTC) Ethereum (ET

3 Apr 21, 2022
Enlighten Progress Bar is a console progress bar library for Python.

Overview Enlighten Progress Bar is a console progress bar library for Python. The main advantage of Enlighten is it allows writing to stdout and stder

Rockhopper Technologies 265 Dec 28, 2022
texel - Command line interface for reading spreadsheets inside terminal

texel - Command line interface for reading spreadsheets inside terminal. Sometimes, you have to deal with spreadsheets. Those are sad times. Fortunate

128 Dec 19, 2022
A simple script that outputs the current date on the user interface/terminal.

Py-Date A simple script that outputs the current date on the user interface/terminal. How to Run Open your terminal and cd into the folder containi

Arinzechukwu Okoye 1 Jan 13, 2022
🌈 Generate color palettes based on Neovim colorschemes.

Iris Iris is a Neovim plugin that generates a normalized color palette based on your colorscheme. It is named for the goddess Iris of Greek mythology,

N. G. Scheurich 45 Jul 28, 2022
A simple command line virtual operating system, written in python

Virtual operating system A simple virtual operating system written in python. (Under development). Currently, the following commands are supported: Co

B.Jothin kumar 7 Nov 15, 2022
PwnWiki command line searching tool & bindings written in Python

pwsearch PwnWiki 数据库搜索命令行工具。 安装 您可以直接用 pip 命令从 PyPI 安装 pwsearch: pip3 install -U pwsearch 您也可以 clone 该仓库并直接从源码启动

PwnWiki 20 Jun 21, 2021
A CLI tools to get you started on any project in any language

Any Template A faster easier to Quick start any programming project. Installation pip3 install any-template Features No third party dependencies. Tem

Adwaith Rajesh 2 Jan 11, 2022
A CLI password generator

passgen - A CLI password generator Usage python3 main.py arguments Arguments Argument Short Description --length -l The length of the password to ge

1 Nov 13, 2021
A selfbot made with DPY, doesn't have much commands but there's some useful commands to use.

Phantom Selfbot A selfbot made in DPY, made by Zenith. How to use Add your token in token = 'YOUR-MOMS-TOKEN-HERE' Change the prefix in prefix = If

[Ͼ⁴] Ƶephyr 2 Dec 02, 2021