Show HN: Implementing ping from the Ethernet layer (ARP,IPv4,ICMP in user space)(github.com)
github.com
Show HN: Implementing ping from the Ethernet layer (ARP,IPv4,ICMP in user space)
https://github.com/v420v/ping
2 comments
Fragment reassembly in user space is the part most toy implementations skip. Handling the DF bit and ICMP Fragmentation Needed (Type 3/4) means it actually deals with path MTU discovery scenarios. Most stop at basic echo/reply.
RFC815 [0] for a nice efficient data structure and algorithm to reassemble fragments; shouldn't be much for an LLM to read and construct the data structure if inclined to do so.
[0] https://datatracker.ietf.org/doc/html/rfc815
[0] https://datatracker.ietf.org/doc/html/rfc815
- ARP (packet format, cache with aging, re-ARP, conflict handling) - IPv4 header construction and checksum - DF handling and ICMP Fragmentation Needed (Type 3 Code 4) - IP fragment reassembly - ICMP echo request/reply parsing - A basic ping loop with loss statistics
The goal was to understand how packets actually move from Layer 2 upward.