Internet
A networking library providing codecs, in-place parsing and mutation.
Architecture
Mappings: In-Place Parsing and Mutation
Access protocol fields directly on the underlying buffer with zero allocations:
use ;
// Parse in-place
let udp = new;
let src_port = udp.read_source_port;
let dst_port = udp.read_destination_port;
println!;
// Mutate in-place
let udp_mut_bytes = &mut ;
let mut udp = new;
udp.write_source_port.unwrap;
Codecs: Type-Safe Serialization and Deserialization
High-level protocol types with encode/decode methods:
use ;
use ;
// Decode from buffer
let mut alert = decode.unwrap;
alert.description = DecodeError;
println!;
// Encode to buffer
let mut writer = new;
alert.encode.unwrap;
Scope
This library provides zero-copy, type-safe implementations of dozens of internet protocols across all network layers:
- Layer 2 (Data Link): Ethernet, VLAN, ARP
- Layer 3 (Network): IPv4, IPv6, ICMPv4/6, IGMP (v1-3), NDP, MLD (v1/2), SLAAC
- Layer 4 (Transport): TCP, UDP, QUIC (v1/2)
- Layer 5-7 (Application): HTTP/1.1, HTTP/2, HTTP/3, TLS (1.0-1.3), DHCPv4/6
Future releases will expand coverage to hundreds of protocols including BGP, DNS, SMTP, and 3GPP mobile standards.
Modules
egpp— 3GPP mobile protocols (LTE, 5G, etc.)ieee— IEEE family (Ethernet, VLAN, Wi-Fi, etc.)ietf— IETF protocols (IP, TCP, UDP, HTTP, TLS, etc.)
Core Traits
Buf,BufMut— Buffer traits for zero-copy operationsCodec— Trait for type-safe encoding/decodingCursor— Cursor wrapper for buffer operations
Design Goals
- Zero-copy: Parse packets without allocations
- Type-safe: Compile-time guarantees on protocol structure
- Comprehensive: Cover the entire internet protocol stack
- Extensible: Easy to add new protocols following the same pattern
Status
This library is under active development. Currently implements 30+ protocols with more being added regularly.
Unstable API — Breaking changes expected until 1.0.0.
Then more standards and protocols we met — then more ideas we got. Then more areas we explore — then more name spaces and conflicts we got. Then more goals we set — then more scales we got. Then more time we lived — then more times we changed.