The network-protocol packet parse/assemble layer of the PyTCP stack — Ethernet through TCP/UDP — fully usable on its own.
Maintained. Last release 4 months ago, commits in 10 of the last 26 weeks. Weaker on contributor spread.
pip install pmd-net-protoPyTCP-pmd_net_proto
The network-protocol packet parse / assemble / validate layer of the PyTCP TCP/IP stack — extracted as its own distribution and usable on its own.
from pmd_net_proto import IpProto
from pmd_net_proto.protocols.udp.udp__parser import UdpParser
from pmd_net_proto.protocols.udp.udp__assembler import UdpAssembler
datagram = UdpAssembler(udp__sport=12345, udp__dport=53, udp__payload=b"query")
parsed = UdpParser(packet_rx) # raises UdpIntegrityError / UdpSanityError on bad wire input
Why
Strict, RFC-grounded, fully-typed wire-format codecs for the common Internet protocols, with a single clean validation-error tree and no runtime dependencies beyond the address library it is built on.
Protocol coverage
Each protocol is a parser / assembler pair over a frozen header dataclass, with integrity + sanity validation and typed wire enums.
| Family | Governing RFC(s) |
|---|---|
| Ethernet II | RFC 894 / 7042 (EtherType) |
| IEEE 802.3 + LLC / SNAP | IEEE 802.3 / 802.2 / RFC 1042 |
| ARP | RFC 826 |
| IPv4 (+ options: LSRR/SSRR, RR, Timestamp, Router-Alert, CIPSO) | RFC 791 / 1108 / 2113 |
| IPv6 | RFC 8200 |
| IPv6 Hop-by-Hop / Destination Options (PadN, Jumbo, RouterAlert, Tunnel-Limit, CALIPSO) | RFC 8200 / 2675 / 2711 |
| IPv6 Routing / Fragment extension headers | RFC 8200 / 5095 |
| ICMPv4 | RFC 792 / 1122 |
| ICMPv6 | RFC 4443 |
| ICMPv6 Neighbor Discovery (+ options) | RFC 4861 / 8106 |
| ICMPv6 MLDv2 (+ MLDv1 compatibility) | RFC 3810 / 2710 |
| IGMP (host membership: IGMPv1/v2/v3 + source-specific) | RFC 1112 / 2236 / 3376 |
| TCP (+ options: MSS, WScale, SACK, Timestamps, AccECN, Fast-Open) | RFC 9293 / 2018 / 7323 / 9768 / 7413 |
| UDP | RFC 768 |
| DHCPv4 (+ options) | RFC 2131 / 2132 |
| DHCPv6 (+ options) | RFC 8415 |
The six-file pattern
Every protocol under protocols/<proto>/ follows the same layout
(see ):