Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Sep 2004 22:54:41 +1200
From:      Matthew Luckie <mjl@luckie.org.nz>
To:        tcpdump-workers@lists.tcpdump.org
Cc:        freebsd-net@FreeBSD.org
Subject:   Re: [tcpdump-workers] [PATCH] Add ioctl to disable bpf timestamping
Message-ID:  <41554E71.3020708@luckie.org.nz>
In-Reply-To: <200409250714.RAA28547@avalon.reed.wattle.id.au>
References:  <200409250714.RAA28547@avalon.reed.wattle.id.au>

next in thread | previous in thread | raw e-mail | index | archive | help
>>This is probably a pointless optimization, as you probably relatively 
>>rarely have multiple BPF devices bound to the same interface receiving 
>>the bulk of the packets (as opposed to some daemon with a filter that 
>>passes only the packets it's interested in), but would there be any 
>>advantage to having "bpf_tap()" and "bpf_mtap()" fetch the time stamp 
>>and pass that to "catchpacket()", so that in the case where there *is* 
>>more than one tap, the time stamp is only fetched once?
> 
> That makes sense and allows you to correllate packet time stamps from
> a daemon collecting packets with those you see in tcpdump output when
> you run that in parallel to make sure things are moving.

i've generated a patch to accomplish this on FreeBSD 4.10 and submitted 
a PR for it just a couple of weeks ago, when i noticed a small 
difference between the timestamp I captured in an application compared 
to what i saw with tcpdump.

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/71711

The motivation for this patch was to obtain something resembling the 
timestamp closest to when a packet I generated and transmitted hit the 
wire, to infer a more accurate RTT with an associated response packet. 
I'm not sure if what I've used BPF for in this case is 'correct' in that 
I've not done any real study to see how the timestamp compares to what a 
DAG would report.

There is an argument to be made for generating the timestamp just the 
once after it actually passes a filter, but I've not done that in my patch.

Feedback appreciated.

Matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41554E71.3020708>