From: Timothy Smith Date: Wed, 16 Feb 2011 13:59:06 +0000 Subject: [ath9k-devel] radiotap.mactime appears to be wrong In-Reply-To: References: <201102161001.48326.Timothy.Smith@csr.com> Message-ID: <201102161359.06523.Timothy.Smith@csr.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On Wednesday 16 February 2011 13:11:32 Mohammed Shafi wrote: > On Wed, Feb 16, 2011 at 3:31 PM, Timothy Smith wrote: > > I'm not sure if this specific to the ath9k drivers, or a general problem > > across many, but I have seen it here so I'll report it here first. It's > > actually been the case for quite a while and IIRC the ath5k does this > > too, but I haven't checked it recently. > > > > radiotap.org defines the mactime field as > > > > "Value in microseconds of the MAC's 64-bit 802.11 Time Synchronization > > Function timer when the first bit of the MPDU arrived at the MAC" > > > > Now I'm looking at a recent sniffer trace I took using an ath9k from > > compat- wireless-2011-01-30 and I observe a sequence of frames like > > this: > > > > Data: radiotap.mactime == 23322989. > > ACK: radiotap.mactime == 23323032 > > Data: radiotap.mactime == 23323556 > > > > That gives the difference between the ACK timestamp and the preceding > > data frame as 43 microseconds, and the difference between the data frame > > and its preceding ACK as 524 microseconds. > > > > This is consistent with radiotap.mactime being the value of the TSF when > > the LAST bit of the MPDU arrived at the MAC, not the first as both > > radiotap.org and wireshark's online help say should be the case. > > Hi, I understand you are saying we are doing the time stamping > wrongly by looking at the last bit instead of the first bit of MPDU. > please correct me if I am wrong That's certainly what it looks like. If the timestamp were at the first bit of the MPDU, I would expect the Data=>ACK gap to be bigger (Length of data + SIFS), whereas what we get is much more consistent with (Length of ACK + SIFS + AIFSN + rand(CWmin)) -- Tim Smith Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom