Traceroute.Sockets.UDP (traceroute v0.2.3)
View SourceA GenServer that sends a UDP traceroute probe and waits for a response.
Opens a UDP socket for sending probe packets and uses the ICMPConn singleton socket for receiving ICMP responses.
This implements the UDP-based traceroute approach where:
- UDP packets are sent to high-numbered ports with increasing TTL values
- ICMP "Time Exceeded" or "Port Unreachable" messages are received via ICMPConn
- The UDP socket triggers ICMP errors, which ICMPConn routes back to this process
If the probe reaches an open port, it will be accepted silently and no response is sent. That means that the probe will result in a timeout. You can try to increment the UDP port with every retry probe to prevent this.
Response Filtering
When multiple UDP probes run in parallel, each probe registers with ICMPConn using its UDP source port. ICMPConn routes incoming ICMP responses to the correct probe process based on the source port in the embedded UDP header.
Summary
Functions
Returns a specification to start this module under a supervisor.
Sends a UDP probe packet and waits for an ICMP response.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Sends a UDP probe packet and waits for an ICMP response.
Returns {:ok, time_microseconds, reply_packet} on success, or {:error, reason} on failure.
Options
:dest_port- The destination port (default: 33434)