# google/gopacket

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/google-gopacket).**

6,781 stars · 1,154 forks · Go · BSD-3-Clause

## Links

- GitHub: https://github.com/google/gopacket
- awesome-repositories: https://awesome-repositories.com/repository/google-gopacket.md

## Description

gopacket is a Go library for live packet capture and multi-layer protocol decoding. It provides a framework for parsing raw network bytes into structured protocol layers, enabling inspection and analysis of network traffic directly from interfaces or packet capture files.

The library distinguishes itself through a layered protocol stack that organizes decoders as independent, composable layers, and an interface-based decoder registry that supports extensible custom protocol development. It offers zero-copy packet decoding for high-throughput parsing, stream-based TCP reassembly to reconstruct ordered application data from out-of-order segments, and buffer-pooled memory management to reduce garbage collection pressure during capture. Packet processing is decode-only, preserving original raw bytes for forensic workflows.

gopacket supports live traffic capture via platform-specific backends like AF_PACKET on Linux and pcap on BSD/macOS, and enables network forensics investigation, packet analysis automation, and structured inspection of network traffic.

## Tags

### Networking & Communication

- [Go Libraries](https://awesome-repositories.com/f/networking-communication/packet-engines/packet-processing-frameworks/go-libraries.md) — Provides a Go library for decoding and manipulating network packets at multiple protocol layers.
- [Framework-Based Decoders](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/wireless-network-utilities/wireless-protocol-analysis-suites/protocol-decoders/framework-based-decoders.md) — Provides a framework for parsing raw bytes into structured protocol layers and custom protocol development.
- [Network Packet Parsers](https://awesome-repositories.com/f/networking-communication/network-packet-parsers.md) — Parses raw network bytes into structured protocol layers for inspection and analysis in Go applications.
- [Cross-Platform Captures](https://awesome-repositories.com/f/networking-communication/packet-capture-engines/af-packet-capture-engines/cross-platform-captures.md) — Sniffs network packets directly from interfaces using platform-specific capture libraries like libpcap.
- [Unified Capture APIs](https://awesome-repositories.com/f/networking-communication/packet-capture-engines/af-packet-capture-engines/unified-capture-apis.md) — Provides a unified Go API for live packet capture across Linux AF_PACKET and BSD/macOS pcap.
- [Decode-Only Processors](https://awesome-repositories.com/f/networking-communication/packet-engines/packet-processing-frameworks/decode-only-processors.md) — Provides decode-only packet processing that preserves raw bytes for forensic analysis.
- [Layered Decoder Stacks](https://awesome-repositories.com/f/networking-communication/protocol-abstraction-layers/layered-decoder-stacks.md) — Organises protocol decoders as a stack of independent layers for flexible packet header traversal.
- [TCP Stream Reassembly](https://awesome-repositories.com/f/networking-communication/streaming-data-protocols/tcp-stream-reassembly.md) — Reconstructs ordered application data from out-of-order TCP segments using sequence number tracking.
- [Interface-Based Registries](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/wireless-network-utilities/wireless-protocol-analysis-suites/protocol-decoders/interface-based-registries.md) — Ships an interface-based decoder registry for extensible custom protocol development.

### Part of an Awesome List

- [Live Capture Libraries](https://awesome-repositories.com/f/awesome-lists/devtools/traffic-capture-frameworks/live-capture-libraries.md) — Sniffs packets directly from network interfaces using platform-specific capture libraries for real-time monitoring. ([source](https://cdn.jsdelivr.net/gh/google/gopacket@master/README.md))
- [Network Forensics](https://awesome-repositories.com/f/awesome-lists/data/network-forensics.md) — Analyzes captured packet data from files or live interfaces to investigate network events and security incidents.
- [Networking Libraries](https://awesome-repositories.com/f/awesome-lists/devops/networking-libraries.md) — Library for packet processing.
- [Networking Libraries](https://awesome-repositories.com/f/awesome-lists/devtools/networking-libraries.md) — Library for packet processing.

### Data & Databases

- [Zero-Copy Parsing](https://awesome-repositories.com/f/data-databases/zero-copy-data-access-libraries/zero-copy-deserialization/zero-copy-parsing.md) — Decodes network packets directly from raw byte buffers without intermediate copying for high throughput.

### Security & Cryptography

- [Packet Analysis Tools](https://awesome-repositories.com/f/security-cryptography/network-infrastructure-security/web-network-security/network-security/traffic-inspection-manipulation/packet-analysis-tools.md) — Enables building automated tools that process, filter, and inspect network packets programmatically in Go.
