I just released a major update to NimPacket, a low-level network packet manipulation library written in Nim. This version adds full Python interoperability while keeping the core fast and hardened.
What’s new:
Native Python bindings. You can import NimPacket directly into Python with no wrappers or subprocess calls. It compiles into a native .pyd or .so extension using nimpy.
Full protocol access from Python. You can craft, parse, and inspect IPv4, IPv6, TCP, UDP, ICMP, ICMPv6, ARP, Ethernet, DNS with 10 record types, and DHCP with 8 message types.
Simple one-line packet builders like build_tcp_syn_packet(), build_icmp_echo_packet(), build_udp_packet(), and create_arp_frame(). These let you build complete packets from the IP layer up in a single call.
Deep packet parsing using parse_packet(), which automatically detects the protocol stack and returns structured data.
A complete DNS toolkit with query creation and full encode and decode support for A, AAAA, MX, CNAME, TXT, NS, SOA, PTR, SRV, and CAA records.
DHCP client simulation with proper option handling for DISCOVER, REQUEST, RELEASE, INFORM, DECLINE, and NAK packets.
Five IP fragmentation strategies: Tiny Fragment, Overlapping, Out-of-Order, Time-Delayed, and Polymorphic, all usable from Python.
Raw socket support with automatic privilege detection.
A fix for a critical DHCP serialization bug where the magic cookie was written at the wrong offset.
233 unit tests covering every exported function and constant.
Static compilation on Windows with no external DLL dependencies.
Full documentation with working examples and a complete API reference.
This is built for security researchers, network engineers, and anyone who needs precise control over packets on the wire. You get Nim-level performance with the convenience of Python.