A fully managed, cross-platform .NET library for capturing network packets from live devices and files.
SharpPcap is a fully managed .NET library for capturing and analyzing network packets from live interfaces and capture files. It solves the problem of cross-platform packet capture by providing a unified API that works on Windows, Linux, and macOS, abstracting away platform-specific details like libpcap and Npcap.
.NET developers building network monitoring tools, security applications, protocol analyzers, or any software requiring low-level network packet inspection.
Developers choose SharpPcap for its clean, modern API, cross-platform compatibility, and performance optimizations like ReadOnlySpan<> support, which avoids unnecessary memory allocations during packet capture.
Official repository - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a unified API for Windows, Linux, and macOS, abstracting platform-specific details like libpcap and Npcap, as highlighted in the README's feature list.
Uses ReadOnlySpan<> to minimize memory allocation and copying, improving capture speed by up to 30% according to migration notes, ideal for efficient packet handling.
Compatible with .NET Core 3+ and .NET Framework, leveraging modern language features for robust development in contemporary .NET ecosystems.
Automatically resolves and loads platform-specific libraries like libpcap or Npcap, ensuring smooth operation across different systems without manual configuration.
Relies on external libraries such as libpcap or Npcap, which must be installed separately, adding deployment complexity and potential compatibility issues.
Some features like statistics mode are only fully supported on Windows with Npcap, limiting functionality on Linux and macOS, as noted in the migration section.
The migration from 5.x to 6.0 involved significant API changes, which can be disruptive for existing projects and require code updates.