Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial ICMP support #1

Merged
merged 5 commits into from Jun 13, 2017

Conversation

@batonius
Copy link
Member

commented Jun 13, 2017

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 to icmpd.
  • Add *_unreachable methods to icmpd scheme.
  • Add support for icmpd to ipd, udpd and tcpd.

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.

@batonius batonius referenced this pull request Jun 13, 2017
@batonius

This comment has been minimized.

Copy link
Member Author

commented Jun 13, 2017

Paired PR for ping: redox-os/netutils#21.

@jackpot51

This comment has been minimized.

Copy link
Member

commented Jun 13, 2017

Looks really good!

@jackpot51 jackpot51 merged commit b027725 into redox-os:master Jun 13, 2017
@batonius batonius deleted the batonius:icmpd branch Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.