<div dir="ltr"><div>Ideally, yes, you would use kernel timestamps for both sent and received packets.  However, ldns does not give you (me) the ability to do this from queries sent via ldns_resolver_query() since it keeps the sockets internally.  In theory, I could just build the packet using ldns and send the packets myself on sockets I create (so that I can set the proper socket options), but it would be nice if ldns did this for me.<br><br></div>Ryan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 20, 2015 at 2:10 PM, Robert Edmonds <span dir="ltr"><<a href="mailto:edmonds@debian.org" target="_blank">edmonds@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Ryan Braud wrote:<br>
> Hi everyone, I'm not sure if this is the correct list for this question,<br>
> but I had a question/enhancement request for ldns.  Currently, the function<br>
> ldns_pkt_querytime() returns the amount of time a request took, measured<br>
> with gettimeofday().  I was wondering if there was a good reason why this<br>
> time is not calculated from a kernel timestamp via the SIOCGSTAMP ioctl?<br>
> We are using libldns in our production environment and when the processor<br>
> gets busy, we end up with random spikes in latency due to scheduling<br>
> overhead, etc.<br>
<br>
</div></div>Hi, Ryan:<br>
<br>
Doesn't SIOCGSTAMP only give you the timestamp of the last received<br>
packet?  If you want the "real" request latency, wouldn't you want<br>
kernel timestamps on both the sent and received packets?<br>
<br>
(I think you can do this, at least on Linux, with SO_TIMESTAMPING.)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Robert Edmonds<br>
<a href="mailto:edmonds@debian.org">edmonds@debian.org</a><br>
_______________________________________________<br>
ldns-users mailing list<br>
<a href="mailto:ldns-users@open.nlnetlabs.nl">ldns-users@open.nlnetlabs.nl</a><br>
<a href="http://open.nlnetlabs.nl/mailman/listinfo/ldns-users" target="_blank">http://open.nlnetlabs.nl/mailman/listinfo/ldns-users</a><br>
</font></span></blockquote></div><br></div>