https://www.masarlabs.com/article/patd-1.0.0/

Masar Labs

PatD: MasarLabs Ping and Traceroute Daemon

For a project I'm working on I have to ping many hosts from a Java program: I could to run Java as root or I could fork external executables like fping (http://fping.org), but I don't like these options, so I wrote patd (/patd).

Features

  • Does ping and traceroute.
  • Supports both IPv4 and IPv6.
  • Single daemon listening on a TCP local port.
  • Single threaded.
  • Does not run as root but uses capabilities to send ICMP packets.

There is also a client pat (/patd/pat.html) to send commands to patd (/patd).

Downloads

You can download the sources of patd from here (/download).

There are also binary compiled for Debian Linux (http://www.debian.org) in our APT Repository (/debian)

Examples

Here are two examples of pat/patd.

Ping an host

  1. $> pat www.example.com
  2. pat6 2606:2800:0220:006D:2626:1447:1097:0AA7
  3. O 2606:2800:0220:006D:26BF:1447:1097:0AA7 seq=1 time=88.374781 ms
  4. pat4 93.184.216.119
  5. O 93.184.216.119 seq=1 time=129.832764 ms

Tracerout an Host

  1. $> pat -T www.example.com
  2. pat6 2606:2800:0220:006D:2626:1447:1097:0AA7
  3. t 2001:4B78:0002:0000:0000:0000:0000:0162 seq=1 time=0.579375 ms
  4. t 2001:4B78:0002:000C:0000:0000:0000:0002 seq=2 time=0.577010 ms
  5. t 2001:0450:2002:0043:0000:0000:0000:0001 seq=3 time=0.641369 ms
  6. t 2001:0450:2008:0101:0000:0000:0000:0012 seq=4 time=18.460314 ms
  7. t 2001:2000:3018:0039:0000:0000:0000:0001 seq=5 time=99.657094 ms
  8. t 2001:2000:3080:0608:0000:0000:0000:0002 seq=6 time=91.176435 ms
  9. O 2606:2800:0220:006D:26BF:1447:1097:0AA7 seq=7 time=88.250489 ms
  10. pat4 93.184.216.119
  11. t 169.254.1.1 seq=1 time=0.320014 ms
  12. t 95.174.9.65 seq=2 time=0.669792 ms
  13. t 85.94.192.251 seq=3 time=135.209402 ms
  14. t 64.214.148.121 seq=4 time=0.569375 ms
  15. t 67.16.145.242 seq=5 time=9.398323 ms
  16. t 213.248.89.181 seq=6 time=9.287580 ms
  17. t 80.91.251.233 seq=7 time=10.076306 ms
  18. t 80.91.246.64 seq=8 time=113.164281 ms
  19. t 213.155.130.3 seq=9 time=141.216692 ms
  20. t 62.115.12.62 seq=10 time=133.022995 ms
  21. O 93.184.216.119 seq=11 time=119.194537 ms

The protocol is very simple and documented in the man page of patd (/patd).

SuMoTuWeThFrSa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28