ARP implemented from scratch over raw AF_PACKET sockets in promiscuous mode, with no networking libraries. It covers Ethernet frame parsing and construction, ARP request/reply handling, MAC resolution, the ARP cache, and packet transmission.

Write-up: Writing ARP From Scratch and My Learnings

Source: github.com/madhavkhoslaa/arp-from-scratch (External link)