Most of this information is taken from the madwifi wiki: http://madwifi.org/wiki/
Background
The radiotap header format is a mechanism to supply additional information about frames from the driver to userspace applications based on WinPcap/libpcap. Designed initially for NetBSD systems by David Young, the radiotap header format is compact, flexible, and allows the driver to specify an arbitrary number of fields based on a bitmask presence field in the radiotap header.
Format Specification
The radiotap capture format starts with a radiotap header:
struct ieee80211_radiotap_header { u_int8_t it_version; /* set to 0 */ u_int8_t it_pad; u_int16_t it_len; /* entire length */ u_int32_t it_present; /* fields present */ };
The it_version field indicates which major version of the radiotap header is in use. Currently, this is always 0. Adding support for additional radiotap fields does not change the version number.
The it_pad field is currently unused, it simply aligns the fields onto natural word boundaries.
The it_len field indicates the entire length of the radiotap data, including the radiotap header. This is valuable for the developer so they can consistently locate the beginning of the 802.11 frame that follows the radiotap data, even if their parser doesn't understand all of the data fields specified.
The it_present field is a bitmask of the radiotap data fields that follows the radiotap header. The currently supported list of radiotap header fields can be found in ieee80211_radiotap.h. Briefly, they are identified as follows:
enum ieee80211_radiotap_type {
IEEE80211_RADIOTAP_TSFT = 0,
IEEE80211_RADIOTAP_FLAGS = 1,
IEEE80211_RADIOTAP_RATE = 2,
IEEE80211_RADIOTAP_CHANNEL = 3,
IEEE80211_RADIOTAP_FHSS = 4,
IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5,
IEEE80211_RADIOTAP_DBM_ANTNOISE = 6,
IEEE80211_RADIOTAP_LOCK_QUALITY = 7,
IEEE80211_RADIOTAP_TX_ATTENUATION = 8,
IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9,
IEEE80211_RADIOTAP_DBM_TX_POWER = 10,
IEEE80211_RADIOTAP_ANTENNA = 11,
IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
IEEE80211_RADIOTAP_FCS = 14,
IEEE80211_RADIOTAP_EXT = 31,
};
Provided the IEEE80211_RADIOTAP_EXT bit is not set, the data for fields specified in the it_present bitmask immediately follow the radiotap header.
One of the advantages of radiotap is that new fields can be added to the end of the radiotap data without breaking existing parsers. If a parser identifies a bitmask value that is not recognized, it can skip to the end of the radiotap data by referencing the header it_len field.
Important Radiotap Characteristics
Alignment in Radiotap
The Radiotap Manual Page indicates that fields in the radiotap header aligned to natural boundaries:
Radiotap capture fields must be naturally aligned. That is, 16-, 32-, and 64-bit fields must begin on 16-, 32-, and 64-bit boundaries, respectively. In this way, drivers can avoid unaligned accesses to radiotap capture fields. radiotap-compliant drivers must insert padding before a capture field to ensure its natural alignment. radiotap-compliant packet dissectors, such as WinDump (http://www.winpcap.org/windump), expect the padding.
Developers beware: all compilers may not pack structs alike. If a driver developer constructs their radiotap header with a packed structure, in order to ensure natural alignment, then it is important that they insert padding bytes by themselves.
AirPcap and Radiotap
The radiotap fields currently exported by AirPcap are the folowing:
The best references for extracting and interpreting these fields are the developer's pack sample programs: both the Capture_radio and the airpcap_and_libpcap samples show how to decode the radiotap header and access the frame content after it.
How to Convert the Signal Power Returned by AirPcap into a dBm value?
This is a common question raised by developers that use AirPcap in their products.
The AirPcap signal strength information is in dB above the noise floor, therefore it's actually Signal to Noise Ratio information. If you assume that the noise floor is -95, which is in most cases a good assumption, then you can derive the absolute signal strength with the following formula:
DbmValue = DbValue - 95
AirPcap documentation. Copyright (c) 2006-2008
CACE Technologies, Inc. All rights reserved.