Trace packets through every network layer. Capture traffic with libpcap, parse Ethernet frames, IPv4 packets, TCP segments, and UDP/ICMP datagrams by hand.