tntech-ngin / ndn-traffic-plotting-scripts

NDN traffic traces - Plotting scripts
https://www.tntech-ngin.net/datasets
Apache License 2.0
2 stars 0 forks source link
ndn

Description

This project is a packet analyser for Named Data Networking (NDN) packets. It uses a MongoDB database to store the packets and provides various plotting scripts to visualise the data. The included plotting scripts are:

Getting Started

Prerequisites

Installation

  1. Create virtual environment and activate
    cd ndn-packet-view
    python3 -m venv venv
    source venv/bin/activate
  2. Install dependencies
    pip install -r requirements.txt
  3. Create .env
    cp .env.sample .env
  4. Create ndjson from pcapng.zst dump file
    • Find the local MAC address
      zstdcat <file_path_to_pcapng.zst> | tcpdump -r- -n -e | head -5
    • Extract into ndjson
      ndntdump -r <file_path_to_pcapng.zst> --local <local_mac_address> -L <path_to_output_file>
  5. Edit .env file and change the MONGO_DB_NAME to the name of the database you want to use
  6. Index ndjson file into MongoDB
    python -m tools.index <file_path>
  7. Run the plotting scripts
    python -m tools.plots.<script_name>

Linters and Formatters

The project uses git pre-commit hooks to run linters and formatters. To enable the pre-commit hooks, run the following command:

pre-commit install

Troubleshooting

If the commit reports conflicts with the unstaged changes, run the pre-commit hooks manually and commit again:

pre-commit run --all-files

or use --no-verify flag to skip the pre-commit verification:

git commit --no-verify -m <message>