A cross-platform utility that classifies network packets into flows using the essential 4-tuple (src_ip, dst_ip, src_port, dst_port).
pkt2flow is a command-line utility that classifies network packets into individual flows based on the 4-tuple (source/destination IP and port). It takes a pcap file as input and outputs separate pcap files for each flow, enabling researchers and analysts to examine traffic patterns without payload reassembly or extra processing.
Network researchers, security analysts, and developers working with packet capture data who need to separate traffic into flows for deep packet inspection, traffic classification, or academic research.
Unlike tools like tcpflow that reassemble payloads, pkt2flow focuses purely on flow separation, making it faster and simpler for scenarios where only packet classification is needed. Its cross-platform support and minimal dependencies make it easy to integrate into analysis pipelines.
A simple, cross-platform utility to classify packets into flows using only the essential 4-tuple.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses only the essential 4-tuple (source/destination IP and port) to separate packets, making it fast and focused on flow-level analysis without the overhead of payload reassembly.
Runs on both Linux and macOS, including native Apple Silicon support, with clear build instructions using CMake and standard libraries like libpcap.
Avoids payload reassembly entirely, preserving packets as-is in the output, which simplifies analysis for traffic pattern studies and reduces processing complexity.
Saves each flow as a separate pcap file named with the 4-tuple and first packet timestamp, facilitating easy identification and integration with tools like Wireshark.
Intentionally omits TCP stream or payload reassembly, limiting its utility for applications that need to inspect application-layer data or reassembled conversations.
On Apple Silicon, users must manually set PKG_CONFIG_PATH for libpcap, as noted in the troubleshooting section, adding extra steps and potential errors during installation.
Operates solely on static pcap files and lacks support for real-time packet capture or streaming, making it unsuitable for dynamic network monitoring scenarios.
Creates a separate pcap file for each flow, which can lead to an overwhelming number of files in large captures, complicating storage and management.
pkt2flow is an open-source alternative to the following products:
tcpslice is a tool for extracting portions of pcap files based on time, useful for analyzing specific periods of network traffic.
tcpsplit is a utility for splitting large pcap files into smaller ones, often used for managing large network capture files.
tcpflow is a program that captures TCP traffic and stores the data in a way that is convenient for protocol analysis and debugging.