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:
components_hexbin.py
- plots the distribution of number of components to its name lengthgrid_throughput.py
- plots the throughput graph of four nodeshoplimit.py
- plots the hop limit of packetslifetime_freshness.py
- plots cdf of lifetime and freshness of packetsthroughput.py
- plots the throughput graph of a node with number of packets and size of packets in separate plotspopular_prefixes.py
- plots the most popular prefixes in interest and data packetscontent_size_distribution
- plots the distribution of content size of NLSR traffic
- Python >= 3.10
- MongoDB >= 6.0.6
- ndntdump
- Create virtual environment and activate
cd ndn-packet-view
python3 -m venv venv
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Create .env
cp .env.sample .env
- 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>
- Edit
.env
file and change the MONGO_DB_NAME to the name of the database you want to use - Index ndjson file into MongoDB
python -m tools.index <file_path>
- Run the plotting scripts
python -m tools.plots.<script_name>
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
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>