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
Kattis shell for getting examples, testing and submitting.

Kattis shell for getting examples, testing and submitting.

Simon Green Kristensen 15 Sep 30, 2022
bsp_tool provides a Command Line Interface for analysing .bsp files

bsp_tool Python library for analysing .bsp files bsp_tool provides a Command Line Interface for analysing .bsp files Current development is focused on

Jared Ketterer 64 Dec 28, 2022
YouCompleteMe: a code-completion engine for Vim

YouCompleteMe: a code-completion engine for Vim Help, Advice, Support Looking for help, advice or support? Having problems getting YCM to work? First

24.5k Jan 06, 2023
Turdshovel is an interactive CLI tool that allows users to dump objects from .NET memory dumps

Turdshovel Description Turdshovel is an interactive CLI tool that allows users to dump objects from .NET memory dumps without having to fully understa

Leron Gray 41 Jul 27, 2022
TermPair lets developers securely share and control terminals in real time๐Ÿ”’

View and control terminals from your browser with end-to-end encryption ๐Ÿ”’

Chad Smith 1.5k Jan 05, 2023
Python CLI for accessing CSCI320 PDM Database

p320_14 Python CLI for accessing CSCI320 PDM Database Authors: Aidan Mellin Dan Skigen Jacob Auger Kyle Baptiste Before running the application for th

Aidan Mellin 1 Nov 23, 2021
A Python command-line utility for validating that the outputs of a given Declarative Form Azure Portal UI JSON template map to the input parameters of a given ARM Deployment Template JSON template

A Python command-line utility for validating that the outputs of a given Declarative Form Azure Portal UI JSON template map to the input parameters of a given ARM Deployment Template JSON template

Glenn Musa 1 Feb 03, 2022
A command-line utility that, given a markdown file, checks whether all its links work.

A command-line utility written in Python that checks validity of links in a markdown file.

Teclado 2 Dec 08, 2021
Command line interface for testing internet bandwidth using speedtest.net

speedtest-cli Command line interface for testing internet bandwidth using speedtest.net Versions speedtest-cli works with Python 2.4-3.7 Installation

Matt Martz 12.4k Jan 08, 2023
Easily handle day to day CLI operation via Python instead of regular Bash programs.

pz Ever wished to use Python in Bash? Would you choose the Python syntax over sed, awk, ...? Should you exactly know what command would you use in Pyt

CZ.NIC 697 Jan 03, 2023
RSS reader client for CLI (Command Line Interface),

rReader is RSS reader client for CLI(Command Line Interface)

Lee JunHaeng 10 Dec 24, 2022
Centauro - a command line tool with some network management functionality

Centauro Ferramenta de rede O Centauro รฉ uma ferramenta de linha de comando com

1 Jan 01, 2022
Wordle for CLUE - WORDLE clone for Adafruit Clue

Wordle_for_CLUE This project is a clone of the very popular word solving puzzle

Michael Lacock 4 Feb 15, 2022
A command line utility for tracking a stock market portfolio. Primarily featuring high resolution braille graphs.

A command line stock market / portfolio tracker originally insipred by Ericm's Stonks program, featuring unicode for incredibly high detailed graphs even in a terminal.

Conrad Selig 51 Nov 29, 2022
Random scripts and other bits for interacting with the SpaceX Starlink user terminal hardware

starlink-grpc-tools This repository has a handful of tools for interacting with the gRPC service implemented on the Starlink user terminal (AKA "the d

270 Dec 29, 2022
๐Ÿพ Get the nftables counters easier to read

nft-stats Get the nftables counters easier to read It kind of hard to read the output of nft list ruleset so there is a small program parcising the ou

7 Oct 08, 2022
Color preview command-line tool written in python

Color preview command-line tool written in python

Arnau 1 Dec 27, 2021
Command-line tool to use LNURL with your LND instance

Sprint planner Sprint planner is a Python script for planning your Jira tasks based on your calendar availability. Installation Use the package manage

Djuri Baars 6 Jan 14, 2022
Message commands extension for discord-py-interactions

interactions-message-commands Message commands extension for discord-py-interactions README IS NOT FINISHED YET BUT IT IS A GOOD START Installation pi

2 Aug 04, 2022
Use case: quick JSON processing/restructuring with jq without terminal

alfred-jq Alfred workflow to conveniently process JQ on clipboard based on a jq query Also available at: packal/jq Use case: quick JSON processing/res

T on Meta Mode 5 Sep 30, 2022