Article 5P447 traceroute(8) gets speed boost

traceroute(8) gets speed boost

by
from OpenBSD Journal on (#5P447)

Florian Obser (florian@)has committeda significant speed boost fortraceroute(8):

CVSROOT:/cvsModule name:srcChanges by:florian@cvs.openbsd.org2021/09/03 03:13:00Modified files:usr.sbin/traceroute: Makefile traceroute.8 traceroute.c traceroute.h worker.c Log message:Make traceroute(8) faster by sending probes and doing DNS async.Traditional traceroute would send one probe and then wait for up to 5seconds for a reply and then send the next probe. On a lossy link thateventually ends in a black hole this would take about 15 minutes andpeople would hit control-c in anger.This rewrites the traceroute engine to use libevent and asr's asyncDNS interface. Probes are now send every 30ms or as soon as we get ananswer back. With that we got the 15 minute worse case down to about10 seconds.A minor adjustment that is possible with this is to delay printing aline until we get to a line with answers. This has two effects:1) If there are intermediate hops that don't answer, output pauses fora bit so we keep the visual cue of "something might be wrong here".2) If there is a black hole at the end, we don't print out many "* * *"lines and thus scrolling the interesting bits out of the terminal.We collapse those lines and just print64 * * *at the end.Unfortunately the -c option to send udp probes to a fixed port had togo for now. But we should be able to add it back."Once you have seen the new one you can't go back to the old one" &enthusiastic OK deraadt@OK sthen@"I am very distressed that florian went to bed without committing it"beck@

Florian tootedlinks to recordings showing theoldandnewbehaviours with an earlier version of this work.

External Content
Source RSS or Atom Feed
Feed Location http://undeadly.org/cgi?action=rss
Feed Title OpenBSD Journal
Feed Link http://undeadly.org/
Reply 0 comments