Initial ICMP support
Created by: batonius
Problem: Redox doesn't support ICMP, it doesn't respond to ECHO requests, it doesn't have the ping
utility.
Solution: Introduce the icmpd
daemon to handle incoming ICMP messages and provide file system abstraction of ICMP to other processes via the icmp:
scheme.
Changes introduced by this pull request:
- The
icmpd
daemon has been added. - The daemon replies to incoming ICMP ECHO_REQUEST packets with valid ECHO_RESPOND packets.
- The daemon listens to
ip:1
and creates the:icmp
scheme. - The new scheme supports
echo/<ip-addr>
paths to interact with ICMP. - Writing to an
echo/*
file sends an ICMP ECHO_REQUEST packet with the buffer argument as the packet's payload.icmpd
sets the packet's id field to the value of the file handle used. - An
echo/*
file produces an event on incoming ICMP ECHO_RESPONSE with id equal to the id assigned to the file handle. - Reading from an
echo/*
file produces payload from the received packet.
Drawbacks:
- Client processes has no access to the underlying network headers. For example, they can't check TTL of a response.
State: Redox replies to incoming ECHO requests and is able to send ECHO requests and process ECHO responses via the ping
utility.
TODOs:
- Add support for
*_UNREACHABLE
messages toicmpd
. - Add
*_unreachable
methods toicmpd
scheme. - Add support for
icmpd
toipd
,udpd
andtcpd
.
Other: The qemu's default netwok settings don't support forwarding of ICMP packets, so additional configuration is required. Here's the configuration I'm using.