Does anyone know of an easy way to filter on a specific AID (association ID) for a WLAN client to see if it is in the partial virtual bitmap (PVM)? With a only a limited number of devices and low AID values, I can do some simple comparisons, if I know how large the bitmap could be:
However, on some systems, my AID values could be in the 100s, so I want to filter on AID == 132 (or whatever), and have it match if that bit is high. The problem is the IE for TIM includes a length and an offset, so I may get a couple of bytes or many bytes, depending on how many stations have data waiting for them, and we need the offset to determine where this particular device is. I can decode by hand, but would be great if Wireshark could tell me. The natural choice is wlan.aid == 132 (or whatever), but this does not match the partial virtual bitmap. However, this filter works well to pick up the PS-Poll frames, but to verify proper 802.11 operation, I should see the device AID in the PVM, then the PS-Poll frame. Some sample results: One beacon might give this to me as the PVM
So I know device 132 has data waiting. Another beacon a little while later -
Again, device 132 has data waiting. Reference: http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_Power_Save asked 12 Jan ‘16, 09:51 Bob Jones showing 5 of 9 show 4 more comments |
2 Answers:
A Lua post-dissector, creating a pseudo-field which is a duplicate copy of the original bitmap left-stuffed with 0s in order to allow use of a fixed bit address in the display filter, is below. The display filter condition is
So for AID=132, it would be The Lua script itself, to be placed into a .lua file in your plugin directory, is:
answered 06 Jun ‘16, 22:21 sindy edited 11 Jun ‘16, 04:18 Thanks - I owe you a beer. I’m out of the office this week on business, but I will try this as soon as I get a chance. (07 Jun ‘16, 03:09) Bob Jones I tested this and it looks good. Thanks for your help. I validated with a couple of different cases: AID of 16 and AID of 1 - two simple cases I could inspect to be sure, it works. (11 Jun ‘16, 01:21) Bob Jones |
Please open an enhancement bug at bugs.wireshark.org, attach a sample capture that contains (at least) two beacons: one with no offset into the tim map and one with an offset. If you are worried about keeping the information non-public set the attachment to private. Last but not least: assign the bug to me: [email protected] I will add proper decoding and thus filtering but I need some captures to test against. answered 17 Jun '16, 16:26 jmayer This is great, thanks. Enhancement request is done: Bug 12545 - Enhancement: Decode TIM Map in 802.11 Beacon Frame If you need a tester, let me know. I have plenty of traces to test against. (18 Jun '16, 02:02) Bob Jones |
can you provide a small sample pcap?
Trace is here:
https://www.cloudshark.org/captures/169a75f46227
Two packets - a beacon with TIM IE, and a PS Poll frame.
For this example, this is what I have for the TIM map:
AID 64 -> 00000100 AID 72 -> 00000000 AID 80 -> 00000000 AID 88 -> 00000000 AID 96 -> 00000000 AID 104 -> 00000000 AID 112 -> 00000000 AID 120 -> 00000000 AID 128 -> 00001000 <--- device 132, per AID in PS-Poll AID 136 -> 00000000 AID 144 -> 00000100 AID 152 -> 00000000
None of the anonymizer tools seemed to work on wlan addresses. I had to edit hex manually. Know of a tool like tracewrangler for 802.11 capture files?
Bump.
I ran into this again at a customer site last week with a large wifi infrastructure - more than 1200 APs. I have to feed the packet captures into OmniPeek as it decodes the actual AIDs in the TIM map. Any tips for Wireshark, or would this be a new feature request to enhance the TIM IE decoding?
Would a Lua post-dissector creating up to thousands of individual pseudo-fields out of the individual bits of the TIM submap help you? Display filters do not support arithmetic to calculate offsets and protocol fields cannot be organized into arrays.
Or, as I think about it, rather a duplicate copy of the original bitmap which would be left-stuffed with 0s to allow use of a fixed offset, so for AID 132, you could always use
xxx.xxx.my_bitmap[16:1] & 8
This sounds like it would do. What I observe is something like this...
So root cause of data loss is that no data is sent FromDS for this period, as client is not requesting it. But it's not really root cause: client will only send PS-Poll if informed that data is buffered at the AP with the TIM map entry, so to figure which device is at fault, we need to look at the TIM map to see if the AP is indicating data is waiting. If the bit is set, and no PS-Poll, it's a client issue. If not set, then need a wired trace to prove wired data arrives at AP, but it does not set the TIM map.
So a Lua dissector, as you describe, would allow me to filter by PS-Poll and then by Beacons that had this bit set, so Wireshark will easily show periods of no PS-Poll - and then whether there are beacons or not during that period.
I have not done any Lua with Wireshark before, so sounds like I need to get on it. I'll start the Lua tutorial for a dissector and see how far I get.
Well, I was afraid of posting an optimistic nonsense so I'd better checked I haven't... so if you don't want to use this as an impulse to dive into Lua, you may have my proof of concept code :-)
Proof of concept code would be gladly accepted and greatly appreciated, but I don't want to expect that others would just do it if I won't try first. Thanks for any help you could provide, anyway. I am not sure what the learning curve might be...
OK. So I don't delete those 16 lines of Lua code until you state clearly either that you want them or that you have written your own ones.
Just an idea if you're going to take Lua programming seriously: I was thinking of an alternative solution consisting in creation of a value-less pseudofield for each bit which has a value of 1. This would make the addressing in the display filter expression more convenient as you wouldn't have to manually calculate the byte offset and bit position, but it could cost quite some CPU time. The display filter condition would then look just like
wlan_mgt.tim.data_waiting.aid_132
(no== 1
necessary).Please share!