Haiku's network stack follows a top-down approach with clear boundaries, pure object oriented design. However, TCP/IP protocol stack was designed more than 30 years ago with different idea in mind. It's mostly speed, fast processing and stability that designers were looking for back then. That's why many boundaries in the TCP/IP protocol suite design are blurred somehow.
Basic hierarchy is established. Datalink layer protocol (Ethernet, PPP, etc.) is followed by a Network layer protocol (IP), which is followed by a Transport layer protocol (TCP, UDP, SCTP, etc).
According to current Haiku source ICMP implementation is only a … framework. Only ICMP echo request messages are processed.
There are essentially two RFCs that should be considered when implementing ICMP (for IPv4). RFC792 - ‘INTERNET CONTROL MESSAGE PROTCOL’ and RFC1122 - ‘Requirements for Internet Hosts – Communication Layers’.
According to RFC1122, paragraph 3.2.2. there are two types of ICMP messages a host must process:
ICMP Error Messages Destination Unreachable Redirect Source Quench Time Exceeded Parameter Problem ICMP query messages: Echo Information Timestamp Address Mask First of all, I plan to implement a generic icmp_send_data() that should be used whenever sending ICMP messages.