5GPacketParser is an open-source Python tool for parsing NGAP and NAS protocol packets from 5G network traffic and extracting meaningful features from pcap files. This tool is designed for applications in network analysis, performance monitoring, anomaly detection, and research in 5G communication systems.
About This Project: The development of 5GPacketParser is part of ongoing research at Technische Universität Chemnitz, Germany. This work is supported by research projects funded by BSI (the German Federal Cybersecurity Authority).
- Comprehensive Parsing: Handles NGAP and NAS protocol layers encapsulated in SCTP and IP packets.
- 5G Traffic Insights: Focuses on 5G-specific protocols, enabling precise analysis of 5G network behavior.
- Customizable Workflow: Offers flexibility in filtering packets and customizing output formats, i.e., CSV (Currently).
-
Current Version 1.0.1: In the current version of 5GPacketParser, the tool extracts a fixed set of features, including:
RequestMessages, SuccessfulResponseMessages, RequestResponseRatio, RegistrationRate, PDURequestRate, RequestIAT, ProcedureCodeNumber, ProcedureCodeRate.
-
Upcoming Version (Under Development): The next version of 5GPacketParser will introduce user-defined feature extraction, allowing users to specify and customize the extracted features according to their needs. This enhancement will provide greater flexibility for network traffic analysis and research purposes.
Stay tuned for updates! 🚀
- Network Performance Monitoring: Analyze flow behavior to optimize 5G network performance.
- Security Analysis: Extract features for use in intrusion detection or anomaly detection systems.
- Research Applications: Study traffic characteristics for academic or commercial research.
- Clone the repository:
git clone https://github.com/trungpv92/5GPacketParser.git- Navigate to the project directory:
cd 5GPacketParserBefore using 5GPacketParser, ensure your environment meets the following requirements:
- Python 3.7 or higher
scapy(for packet parsing)pycrate(for NGAP and NAS encoders and decoders)- Additional libraries listed in
requirements.txt
Install dependencies with:
pip install -r requirements.txt- Place your pcap file(s) in the
pcaps/directory. - Execute the tool with:
python 5GPacketParser.py --input pcaps/example.pcap --output output/features.csv --packetcount 0 --windowtime 1.0- Command-line options:
- --input: Path to the input pcap file.
- --output: Path to save extracted features.
- --packetcount: Number of packets to process (default: 0 that means all packets).
- --windowtime: Time window for packet capture in seconds (default: 1.0).
This project is licensed under the MIT License. See the LICENSE file for details.
For any issues, questions, or feature requests, feel free to reach out:
- Author: Trung Phan Van (trungpv92)
- Email: trung.phan-van@etit.tu-chemnitz.de