Implementing ARP is an awesome introduction to networking and low level packet processing. This was often the first task I would give out during training for Real Time / Embedded programmers
A few things I'm missing for this to be a more complete ARP implementation:
1. Answer Ip to Mac conversion requests from the above stack
2. Send an ARP Request if the mac is missing (+Retries)
4. ARP entry aging. Otherwise you'll run really quickly into "ERR: No free space in ARP translation table\n"
(And of course a much larger cache than 32 entries)
I also did ICMP OS detection about 5 years before it became public. In those days, I used to run home from school to see which militaries had visited my page that day. They never used to hide their IP then. You'd get US Pacific Command, Korea and Japanese militaries, etc. I felt like I had a front row seat at the militarization of the internet. Unfortunately archive.org never indexed the page I announced it on off this one: https://web.archive.org/web/19991128100455/http://pho.2600.o... .. but an early version of the list of interesting visitors was archived: https://web.archive.org/web/19991128111635/http://pho.2600.o...
Is there some kind of VM I could play with this on? Happy to go to something like Buildroot but I've never thought of arp like a daemon, it's always just there.
A few things I'm missing for this to be a more complete ARP implementation: 1. Answer Ip to Mac conversion requests from the above stack
2. Send an ARP Request if the mac is missing (+Retries)
3. Static ARP configurations (To prevent ARP spoofing attacks)
4. ARP entry aging. Otherwise you'll run really quickly into "ERR: No free space in ARP translation table\n" (And of course a much larger cache than 32 entries)
5. Ignore unsolicited ARP replies (Helps prevent ARP spoofing attacks as well)
6. use uint8_t instead of "unsigned char" for packet structures.
Awesome work!