Skip to contentSkip to conversation

namespaces and vendor extensions

RFA Johannes Berg 5 participants 14 messages Nov 26, 2009 – Jan 9, 2010 9 messages not in the archive

lore
Share & tools
lore
#0 lore raw

[Gerald: I'm copying you directly because I have a question about this patch, please see at the end of the email]

This is a request for adoption of the previously discussed namespace proposal from David.

Namespaces in radiotap serve two different use cases:
1) vendor extensions and
2) multiple uses of a single radiotap field.

Vendor extensions allows data from any number of different vendors to be present in a single radiotap header. Each vendor namespace contains present bits just like regular radiotap, but these bits are under the control of the vendor. To allow compliant parsers to read past vendor extensions, they also contain the data length.

Resetting the radiotap namespace when extending the present bitmap serves to allow a radiotap field be specified multiple times. An example for that would be specifying multi-rate retries during injection or for TX status.

In the current radiotap header, the IEEE80211_RADIOTAP_EXT bit (bit 31) is reserved in any it_present bitmap and indicates that the bitmap continues. This shall be true for bit 29 (reset radiotap namespace) and bit 30 (vendor namespace) as well.

This proposal differs from David's original one by using different alignment and size for the vendor data specification, I have opted to use 16 bits for the vendor data length since some people want to put a lot of data like raw TX/RX hardware descriptors into vendor fields. I have also clarified the data length variable to specify the fact that when switching away from a vendor namespace to another vendor namespace, the vendor namespace data is not part of the vendor namespace data length ("If a radiotap header changes from a vendor namespace to another vendor namespace, the 6-byte data describing the new vendor namespace shall not be accounted for in skip_length.") The text describing that the two fields are mutually exclusive is also new.

Correct, existing radiotap implementations are compatible with this proposal because they will stop parsing the radiotap header at bit 29/30 since even though they do not know that these bits are reserved in all namespaces and it_present words they do know that they cannot understand these bits, regardless of which it_present they encounter them in, because they were not previously defined. [It seems to me that the existing wireshark implementation is not correct -- it doesn't properly skip over extended present bitmap words.]

Note that before this proposal the bits 63, 95, (31+n*32) were reserved due to overlaying the extension bit, this proposal also reserves the bits 29+n*32 and 30+n*32 in all namespaces due to overlapping with the namespace changes bits.

The normative text of this proposal follows (minus formatting):

--- begin normative text ---
Vendor Namespace
Bit Number
not applicable, bit 30 in every it_present word
Structure

        u8 OUI[3], u8 sub_namespace, __le16 skip_length 
Required Alignment
        2 

This field is reserved in all namespaces and every it_present word, the standard radiotap namespace as well as all vendor namespaces. It is mutually exclusive with the "Reset to Radiotap Namespace" field, setting both is undefined.

The Vendor Namespace Field contains three sub-fields. The first sub-field is 3 bytes long. It contains the vendor's IEEE 802 Organizationally Unique Identifier (OUI). The fourth byte is a vendor-specific "namespace selector."

Before it resumes interpretation of presence bits in the following 32-bit presence words, if any, the interpreter shall reset its presence-bitmap index to 0, and change to the vendor namespace specified by the OUI and selector.

The fifth and sixth bytes, skip_length, comprise a 16 bit little-endian value that tells the interpreter how many bytes of data after the end of the Vendor Namespace Field can only be interpreted according to the vendor namespace. If a radiotap header changes to a namespace that the interpreter does not understand, and back, the interpreter may resume interpretation in the new namespace by skipping skip_length data bytes after the end of the Vendor Namespace Field. If a radiotap header changes from a vendor namespace to another vendor namespace, the 6-byte data describing the new vendor namespace shall not be accounted for in skip_length.

Reset to Radiotap Namespace
Bit Number
not applicable, bit 29 in every it_present word
Structure
no contents
Required Alignment

        N/A

This field is reserved in all namespaces and every it_present word, the standard radiotap namespace as well as all vendor namespaces. It is mutually exclusive with the "Vendor Namespace" field, setting both is undefined.

Upon interpreting this field, the interpreter shall reset its presence-bitmap index to 0 and its namespace to the default radiotap namespace, and change to the default radiotap namespace, before it interprets subsequent presence-bitmap words.

--- end normative text ---

I have implemented this proposal in Andy Green's and my stand-alone radiotap parser library available on
http://git.sipsolutions.net/radiotap.git/
(git clone http://git.sipsolutions.net/radiotap.git/ to get it, the web interface can also generate tarballs).

I have additionally implemented this proposal in wireshark, without any vendor extension parsing, by making wireshark use a copy of the above library.

Gerald: Here's where I have a question -- is that acceptable to you? The files are licensed properly, but it does require pulling the entire radiotap header into memory with ep_tvb_memdup(). Are you ok with that? Everything else would be rather complicated, requiring a complete re-implementation of the parser which doesn't seem all that helpful.

johannes

---
 epan/dissectors/Makefile.am                |    2 
 epan/dissectors/Makefile.common            |    3 
 epan/dissectors/Makefile.nmake             |    2 
 epan/dissectors/packet-radiotap-defs.h     |  245 ++++++
 epan/dissectors/packet-radiotap-iter.c     |  378 ++++++++++
 epan/dissectors/packet-radiotap-iter.h     |   96 ++
 epan/dissectors/packet-radiotap-platform.h |    9 
 epan/dissectors/packet-radiotap.c          | 1069 +++++++++++++----------------
 8 files changed, 1224 insertions(+), 580 deletions(-)
epan/dissectors/packet-radiotap-defs.h new file +245 -0
@@ -0,0 +1,245 @@
+/*-
+ * Copyright (c) 2003, 2004 David Young.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of David Young may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DAVID
+ * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ */
+
+/*
+ * Modifications to fit into the linux IEEE 802.11 stack,
+ * Mike Kershaw ([email protected])
+ */
+
+#ifndef IEEE80211RADIOTAP_H
+#define IEEE80211RADIOTAP_H
+
+#include <stdint.h>
+
+/* Base version of the radiotap packet header data */
+#define PKTHDR_RADIOTAP_VERSION		0
+
+/* A generic radio capture format is desirable. There is one for
+ * Linux, but it is neither rigidly defined (there were not even
+ * units given for some fields) nor easily extensible.
+ *
+ * I suggest the following extensible radio capture format. It is
+ * based on a bitmap indicating which fields are present.
+ *
+ * I am trying to describe precisely what the application programmer
+ * should expect in the following, and for that reason I tell the
+ * units and origin of each measurement (where it applies), or else I
+ * use sufficiently weaselly language ("is a monotonically nondecreasing
+ * function of...") that I cannot set false expectations for lawyerly
+ * readers.
+ */
+
+/* The radio capture header precedes the 802.11 header.
+ * All data in the header is little endian on all platforms.
+ */
+struct ieee80211_radiotap_header {
+	uint8_t it_version;	/* Version 0. Only increases
+				 * for drastic changes,
+				 * introduction of compatible
+				 * new fields does not count.
+				 */
+	uint8_t it_pad;
+	uint16_t it_len;	/* length of the whole
+				 * header in bytes, including
+				 * it_version, it_pad,
+				 * it_len, and data fields.
+				 */
+	uint32_t it_present;	/* A bitmap telling which
+				 * fields are present. Set bit 31
+				 * (0x80000000) to extend the
+				 * bitmap by another 32 bits.
+				 * Additional extensions are made
+				 * by setting bit 31.
+				 */
+};
+
+/* Name                                 Data type    Units
+ * ----                                 ---------    -----
+ *
+ * IEEE80211_RADIOTAP_TSFT              __le64       microseconds
+ *
+ *      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. For received frames, only.
+ *
+ * IEEE80211_RADIOTAP_CHANNEL           2 x uint16_t   MHz, bitmap
+ *
+ *      Tx/Rx frequency in MHz, followed by flags (see below).
+ *
+ * IEEE80211_RADIOTAP_FHSS              uint16_t       see below
+ *
+ *      For frequency-hopping radios, the hop set (first byte)
+ *      and pattern (second byte).
+ *
+ * IEEE80211_RADIOTAP_RATE              u8           500kb/s
+ *
+ *      Tx/Rx data rate
+ *
+ * IEEE80211_RADIOTAP_DBM_ANTSIGNAL     s8           decibels from
+ *                                                   one milliwatt (dBm)
+ *
+ *      RF signal power at the antenna, decibel difference from
+ *      one milliwatt.
+ *
+ * IEEE80211_RADIOTAP_DBM_ANTNOISE      s8           decibels from
+ *                                                   one milliwatt (dBm)
+ *
+ *      RF noise power at the antenna, decibel difference from one
+ *      milliwatt.
+ *
+ * IEEE80211_RADIOTAP_DB_ANTSIGNAL      u8           decibel (dB)
+ *
+ *      RF signal power at the antenna, decibel difference from an
+ *      arbitrary, fixed reference.
+ *
+ * IEEE80211_RADIOTAP_DB_ANTNOISE       u8           decibel (dB)
+ *
+ *      RF noise power at the antenna, decibel difference from an
+ *      arbitrary, fixed reference point.
+ *
+ * IEEE80211_RADIOTAP_LOCK_QUALITY      uint16_t       unitless
+ *
+ *      Quality of Barker code lock. Unitless. Monotonically
+ *      nondecreasing with "better" lock strength. Called "Signal
+ *      Quality" in datasheets.  (Is there a standard way to measure
+ *      this?)
+ *
+ * IEEE80211_RADIOTAP_TX_ATTENUATION    uint16_t       unitless
+ *
+ *      Transmit power expressed as unitless distance from max
+ *      power set at factory calibration.  0 is max power.
+ *      Monotonically nondecreasing with lower power levels.
+ *
+ * IEEE80211_RADIOTAP_DB_TX_ATTENUATION uint16_t       decibels (dB)
+ *
+ *      Transmit power expressed as decibel distance from max power
+ *      set at factory calibration.  0 is max power.  Monotonically
+ *      nondecreasing with lower power levels.
+ *
+ * IEEE80211_RADIOTAP_DBM_TX_POWER      s8           decibels from
+ *                                                   one milliwatt (dBm)
+ *
+ *      Transmit power expressed as dBm (decibels from a 1 milliwatt
+ *      reference). This is the absolute power level measured at
+ *      the antenna port.
+ *
+ * IEEE80211_RADIOTAP_FLAGS             u8           bitmap
+ *
+ *      Properties of transmitted and received frames. See flags
+ *      defined below.
+ *
+ * IEEE80211_RADIOTAP_ANTENNA           u8           antenna index
+ *
+ *      Unitless indication of the Rx/Tx antenna for this packet.
+ *      The first antenna is antenna 0.
+ *
+ * IEEE80211_RADIOTAP_RX_FLAGS          uint16_t       bitmap
+ *
+ *     Properties of received frames. See flags defined below.
+ *
+ * IEEE80211_RADIOTAP_TX_FLAGS          uint16_t       bitmap
+ *
+ *     Properties of transmitted frames. See flags defined below.
+ *
+ * IEEE80211_RADIOTAP_RTS_RETRIES       u8           data
+ *
+ *     Number of rts retries a transmitted frame used.
+ *
+ * IEEE80211_RADIOTAP_DATA_RETRIES      u8           data
+ *
+ *     Number of unicast retries a transmitted frame used.
+ *
+ */
+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_RX_FLAGS = 14,
+	IEEE80211_RADIOTAP_TX_FLAGS = 15,
+	IEEE80211_RADIOTAP_RTS_RETRIES = 16,
+	IEEE80211_RADIOTAP_DATA_RETRIES = 17,
+
+	/* valid in every it_present bitmap, even vendor namespaces */
+	IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
+	IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
+	IEEE80211_RADIOTAP_EXT = 31
+};
+
+/* Channel flags. */
+#define	IEEE80211_CHAN_TURBO	0x0010	/* Turbo channel */
+#define	IEEE80211_CHAN_CCK	0x0020	/* CCK channel */
+#define	IEEE80211_CHAN_OFDM	0x0040	/* OFDM channel */
+#define	IEEE80211_CHAN_2GHZ	0x0080	/* 2 GHz spectrum channel. */
+#define	IEEE80211_CHAN_5GHZ	0x0100	/* 5 GHz spectrum channel */
+#define	IEEE80211_CHAN_PASSIVE	0x0200	/* Only passive scan allowed */
+#define	IEEE80211_CHAN_DYN	0x0400	/* Dynamic CCK-OFDM channel */
+#define	IEEE80211_CHAN_GFSK	0x0800	/* GFSK channel (FHSS PHY) */
+
+/* For IEEE80211_RADIOTAP_FLAGS */
+#define	IEEE80211_RADIOTAP_F_CFP	0x01	/* sent/received
+						 * during CFP
+						 */
+#define	IEEE80211_RADIOTAP_F_SHORTPRE	0x02	/* sent/received
+						 * with short
+						 * preamble
+						 */
+#define	IEEE80211_RADIOTAP_F_WEP	0x04	/* sent/received
+						 * with WEP encryption
+						 */
+#define	IEEE80211_RADIOTAP_F_FRAG	0x08	/* sent/received
+						 * with fragmentation
+						 */
+#define	IEEE80211_RADIOTAP_F_FCS	0x10	/* frame includes FCS */
+#define	IEEE80211_RADIOTAP_F_DATAPAD	0x20	/* frame has padding between
+						 * 802.11 header and payload
+						 * (to 32-bit boundary)
+						 */
+#define IEEE80211_RADIOTAP_F_BADFCS	0x40	/* frame failed FCS check */
+
+/* For IEEE80211_RADIOTAP_RX_FLAGS */
+#define IEEE80211_RADIOTAP_F_RX_BADPLCP	0x0002 /* bad PLCP */
+
+/* For IEEE80211_RADIOTAP_TX_FLAGS */
+#define IEEE80211_RADIOTAP_F_TX_FAIL	0x0001	/* failed due to excessive
+						 * retries */
+#define IEEE80211_RADIOTAP_F_TX_CTS	0x0002	/* used cts 'protection' */
+#define IEEE80211_RADIOTAP_F_TX_RTS	0x0004	/* used rts/cts handshake */
+
+#endif				/* IEEE80211_RADIOTAP_H */
epan/dissectors/packet-radiotap-iter.c new file +378 -0

378 lines not on this page · raw message

epan/dissectors/packet-radiotap-iter.h new file +96 -0

96 lines not on this page · raw message

epan/dissectors/Makefile.am +1 -1
@@ -40,7 +40,7 @@ libdissectors_la_SOURCES = \
 	$(ASN1_DISSECTOR_SRC) \
 	$(PIDL_DISSECTOR_SRC) \
 	$(DISSECTOR_SUPPORT_SRC)
-libdissectors_la_CFLAGS = $(AM_CLEAN_CFLAGS)
+libdissectors_la_CFLAGS = $(AM_CLEAN_CFLAGS) -DRADIOTAP_SUPPORT_OVERRIDES
 
 
 EXTRA_DIST = \
epan/dissectors/packet-radiotap-platform.h new file +9 -0
@@ -0,0 +1,9 @@
+#include <stddef.h>
+#include <errno.h>
+#include <glib.h>
+#include "pint.h"
+
+#define le16_to_cpu		GINT16_FROM_LE
+#define le32_to_cpu		GINT32_FROM_LE
+#define get_unaligned_le16	pletohs
+#define get_unaligned_le32	pletohl
epan/dissectors/packet-radiotap.c +491 -578

1,300 lines not on this page · raw message

epan/dissectors/Makefile.common +3 -0
@@ -740,6 +740,7 @@ DISSECTOR_SRC = \
 	packet-radius.c		\
 	packet-radius_packetcable.c	\
 	packet-radiotap.c	\
+	packet-radiotap-iter.c	\
 	packet-raw.c		\
 	packet-rdm.c		\
 	packet-rdt.c		\
@@ -1168,6 +1169,8 @@ DISSECTOR_INCLUDES =	\
 	packet-q932.h	\
 	packet-qsig.h	\
 	packet-radiotap.h	\
+	packet-radiotap-iter.h	\
+	packet-radiotap-defs.h	\
 	packet-radius.h	\
 	packet-ranap.h	\
 	packet-raw.h	\
epan/dissectors/Makefile.nmake +1 -1
@@ -12,7 +12,7 @@ include Custom.nmake
 include Makefile.common
 
 CFLAGS=-WX -DHAVE_CONFIG_H /I. /I.. /I../.. $(GLIB_CFLAGS) \
-	$(ZLIB_CFLAGS) \
+	$(ZLIB_CFLAGS) -DRADIOTAP_SUPPORT_OVERRIDES \
 	$(PCRE_CFLAGS) $(GNUTLS_CFLAGS) $(NETTLE_CFLAGS) \
 	$(KFW_CFLAGS) $(AIRPCAP_CFLAGS) $(GEOIP_CFLAGS) \
 	/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)

A message that is not in the archive (sent off-list or not yet received): 1259258152.32372.90.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org

#2 lore raw

Johannes,

I support to extend the current radiotap field definitions especailly for vendor extension part. I hope Wireshark can soon adopt the idea of vendor extension. I have comments on a few details in your proposal.

For the structure of the vendor space, you extend 'skip_length' from 8 bits to 16 bits.

Quoted 2 lines

Structure

       u8 OUI[3], u8 sub_namespace, __le16 skip_length

I'm neutral on that. My question is why not extend 'sub_namespace' to 16 bits too? I hardly see that a vendor extension part can go over 255 bytes. But if that happens, it's quite likely that the extension may contain more than 8 fields.

Personally I'm not in favor of the proposed bit 29 "reset namespace". But I'm ok with it if everyone else adopts it.

Thanks,
Joshua

Quoted 129 lines · Johannes Berg

[Gerald: I'm copying you directly because I have a question about this patch, please see at the end of the email]

This is a request for adoption of the previously discussed namespace proposal from David.

Namespaces in radiotap serve two different use cases:
 1) vendor extensions and
 2) multiple uses of a single radiotap field.

Vendor extensions allows data from any number of different vendors to be present in a single radiotap header. Each vendor namespace contains present bits just like regular radiotap, but these bits are under the control of the vendor. To allow compliant parsers to read past vendor extensions, they also contain the data length.

Resetting the radiotap namespace when extending the present bitmap serves to allow a radiotap field be specified multiple times. An example for that would be specifying multi-rate retries during injection or for TX status.

In the current radiotap header, the IEEE80211_RADIOTAP_EXT bit (bit 31) is reserved in any it_present bitmap and indicates that the bitmap continues. This shall be true for bit 29 (reset radiotap namespace) and bit 30 (vendor namespace) as well.

This proposal differs from David's original one by using different alignment and size for the vendor data specification, I have opted to use 16 bits for the vendor data length since some people want to put a lot of data like raw TX/RX hardware descriptors into vendor fields. I have also clarified the data length variable to specify the fact that when switching away from a vendor namespace to another vendor namespace, the vendor namespace data is not part of the vendor namespace data length ("If a radiotap header changes from a vendor namespace to another vendor namespace, the 6-byte data describing the new vendor namespace shall not be accounted for in skip_length.") The text describing that the two fields are mutually exclusive is also new.

Correct, existing radiotap implementations are compatible with this proposal because they will stop parsing the radiotap header at bit 29/30 since even though they do not know that these bits are reserved in all namespaces and it_present words they do know that they cannot understand these bits, regardless of which it_present they encounter them in, because they were not previously defined. [It seems to me that the existing wireshark implementation is not correct -- it doesn't properly skip over extended present bitmap words.]

Note that before this proposal the bits 63, 95, (31+n*32) were reserved due to overlaying the extension bit, this proposal also reserves the bits 29+n*32 and 30+n*32 in all namespaces due to overlapping with the namespace changes bits.

The normative text of this proposal follows (minus formatting):

--- begin normative text ---
Vendor Namespace
Bit Number
       not applicable, bit 30 in every it_present word Structure
       u8 OUI[3], u8 sub_namespace, __le16 skip_length Required Alignment
       2

This field is reserved in all namespaces and every it_present word, the standard radiotap namespace as well as all vendor namespaces. It is mutually exclusive with the "Reset to Radiotap Namespace" field, setting both is undefined.

The Vendor Namespace Field contains three sub-fields. The first sub-field is 3 bytes long. It contains the vendor's IEEE 802 Organizationally Unique Identifier (OUI). The fourth byte is a vendor-specific "namespace selector."

Before it resumes interpretation of presence bits in the following 32-bit presence words, if any, the interpreter shall reset its presence-bitmap index to 0, and change to the vendor namespace specified by the OUI and selector.

The fifth and sixth bytes, skip_length, comprise a 16 bit little-endian value that tells the interpreter how many bytes of data after the end of the Vendor Namespace Field can only be interpreted according to the vendor namespace. If a radiotap header changes to a namespace that the interpreter does not understand, and back, the interpreter may resume interpretation in the new namespace by skipping skip_length data bytes after the end of the Vendor Namespace Field. If a radiotap header changes from a vendor namespace to another vendor namespace, the 6-byte data describing the new vendor namespace shall not be accounted for in skip_length.

Reset to Radiotap Namespace
Bit Number
       not applicable, bit 29 in every it_present word Structure
       no contents
Required Alignment
       N/A

This field is reserved in all namespaces and every it_present word, the standard radiotap namespace as well as all vendor namespaces. It is mutually exclusive with the "Vendor Namespace" field, setting both is undefined.

Upon interpreting this field, the interpreter shall reset its presence-bitmap index to 0 and its namespace to the default radiotap namespace, and change to the default radiotap namespace, before it interprets subsequent presence-bitmap words.

--- end normative text ---

I have implemented this proposal in Andy Green's and my stand-alone radiotap parser library available on
http://git.sipsolutions.net/radiotap.git/
(git clone http://git.sipsolutions.net/radiotap.git/ to get it, the web interface can also generate tarballs).

I have additionally implemented this proposal in wireshark, without any vendor extension parsing, by making wireshark use a copy of the above library.

Gerald: Here's where I have a question -- is that acceptable to you? The files are licensed properly, but it does require pulling the entire radiotap header into memory with ep_tvb_memdup(). Are you ok with that? Everything else would be rather complicated, requiring a complete re-implementation of the parser which doesn't seem all that helpful.

johannes

A message that is not in the archive (sent off-list or not yet received): d521a2310911301441l3c5503b5hf43d31a47e83fe4b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

Joshua,

Quoted 6 lines

For the structure of the vendor space, you extend 'skip_length' from 8 bits to 16 bits.

Quoted 2 lines

Structure

       u8 OUI[3], u8 sub_namespace, __le16 skip_length

I'm neutral on that. My question is why not extend 'sub_namespace' to 16 bits too?

I don't see much point in having more than 255 sub-namespaces per OUI, do you?

Quoted 3 lines

I hardly see that a vendor extension part can go over 255 bytes. But if that happens, it's quite likely that the extension may contain more than 8 fields.

Where are you taking 8 fields from? After the vendor extensions bit, the vendor extension puts vendor-defined presence bits into the it_present bitmap. Therefore, you have an unlimited number of fields per vendor sub-namespace, as such I see little reason to support more than 255 sub-namespaces.

johannes

A message that is not in the archive (sent off-list or not yet received): 1259659011.32171.45.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org

#6 lore raw

Sorry, Johannes, you're right. I was kinda lost :(

Joshua

Quoted 24 lines · Johannes Berg

Joshua,

Quoted 6 lines

For the structure of the vendor space, you extend 'skip_length' from 8 bits to 16 bits.

Quoted 2 lines

Structure
       u8 OUI[3], u8 sub_namespace, __le16 skip_length

I'm neutral on that. My question is why not extend 'sub_namespace' to 16 bits too?

I don't see much point in having more than 255 sub-namespaces per OUI, do you?

Quoted 3 lines

I hardly see that a vendor extension part can go over 255 bytes. But if that happens, it's quite likely that the extension may contain more than 8 fields.

Where are you taking 8 fields from? After the vendor extensions bit, the vendor extension puts vendor-defined presence bits into the it_present bitmap. Therefore, you have an unlimited number of fields per vendor sub-namespace, as such I see little reason to support more than 255 sub-namespaces.

johannes

#7 lore raw
In reply to a message not in the archive
Quoted 16 lines · Johannes Berg

Joshua,

Quoted 6 lines

For the structure of the vendor space, you extend 'skip_length' from 8 bits to 16 bits.

Quoted 2 lines

Structure
       u8 OUI[3], u8 sub_namespace, __le16 skip_length

I'm neutral on that. My question is why not extend 'sub_namespace' to 16 bits too?

I don't see much point in having more than 255 sub-namespaces per OUI, do you?

Quoted 3 lines

I hardly see that a vendor extension part can go over 255 bytes. But if that happens, it's quite likely that the extension may contain more than 8 fields.

Quoted 5 lines

Where are you taking 8 fields from? After the vendor extensions bit, the vendor extension puts vendor-defined presence bits into the it_present bitmap. Therefore, you have an unlimited number of fields per vendor sub-namespace, as such I see little reason to support more than 255 sub-namespaces.

Wanted to clarify, on the vendor it_present bitmap, does it always have to also respect the bit for vendor extension bit 30? The current proposal seems to have language which would indicates so:

"This field is reserved in all namespaces and every it_present word, the standard radiotap namespace as well as all vendor namespaces. "

If so what is the point of the reset bit? What I mean is that if we give radiotap its own OUI technically we could just reset ourselves to the radiotap namespace by specifying the radiotap OUI with what I'd think would be optional radiotap subnamespace material (length could be 0 I take it).

Luis

A message that is not in the archive (sent off-list or not yet received): 43e72e890912010843y208201aawb2ad95cbec98c814-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#9 lore raw
Quoted 6 lines · Luis R. Rodriguez

Wanted to clarify, on the vendor it_present bitmap, does it always have to also respect the bit for vendor extension bit 30? The current proposal seems to have language which would indicates so:

"This field is reserved in all namespaces and every it_present word, the standard radiotap namespace as well as all vendor namespaces. "

Yes, we have already reserved bit 31 in all it_present words, and now we also reserve bits 29 and 30, so that vendor extensions can only use numbers 0-28, 32-60, 64-92, ...

Quoted 5 lines

If so what is the point of the reset bit? What I mean is that if we give radiotap its own OUI technically we could just reset ourselves to the radiotap namespace by specifying the radiotap OUI with what I'd think would be optional radiotap subnamespace material (length could be 0 I take it).

Well I personally would rather reserve a bit than try to come up with a radiotap OUI (how would it get that?) and then special-casing the length field etc. That just means _more_ special cases in the parser, rather than less.

johannes

A message that is not in the archive (sent off-list or not yet received): 1259687018.32171.96.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org

#11 lore raw
Quoted 11 lines · Johannes Berg
Quoted 5 lines · Luis R. Rodriguez

If so what is the point of the reset bit? What I mean is that if we give radiotap its own OUI technically we could just reset ourselves to the radiotap namespace by specifying the radiotap OUI with what I'd think would be optional radiotap subnamespace material (length could be 0 I take it).

Well I personally would rather reserve a bit than try to come up with a radiotap OUI (how would it get that?) and then special-casing the length field etc. That just means _more_ special cases in the parser, rather than less.

I'm not keen on adding a special case to the length field, either. Implementing the namespace-reset bit is simple.

I foresee using namespace reset a lot in the same header [1]. Using a vendor extension field of 5-plus bytes each time, instead, will use a lot of bytes fast!

I think that getting an OUI for Radiotap would be expensive.

Dave

[1] I'm thinking of using namespace-reset in re-transmission histories/strategies.

Signature · 2 lines
David Young             OJC Technologies
[email protected]      Urbana, IL * (217) 278-3933
#12 lore raw
In reply to a message not in the archive
Quoted 6 lines · Johannes Berg
Quoted 4 lines · Luis R. Rodriguez

Wanted to clarify, on the vendor it_present bitmap, does it always have to also respect the bit for vendor extension bit 30? The current proposal seems to have language which would indicates so:

Quoted 6 lines
Quoted 2 lines

"This field is reserved in all namespaces and every it_present word, the standard radiotap namespace as well as all vendor namespaces. "

Yes, we have already reserved bit 31 in all it_present words, and now we also reserve bits 29 and 30, so that vendor extensions can only use numbers 0-28, 32-60, 64-92, ...

OK thanks.

Quoted 8 lines
Quoted 5 lines

If so what is the point of the reset bit? What I mean is that if we give radiotap its own OUI technically we could just reset ourselves to the radiotap namespace by specifying the radiotap OUI with what I'd think would be optional radiotap subnamespace material (length could be 0 I take it).

Well I personally would rather reserve a bit than try to come up with a radiotap OUI (how would it get that?)

We don't have to buy an OUI. We could use a locally administered OUI, which you had pointed out a while back when were looking for a private OUI for some other purpose, I forget what it was.

Quoted 1 line

and then special-casing the length field etc.

Well I'm not saying you would *have* to force the length of the subnamespace stuff to be 0, you could technically still use it and stuff new it_present stuff with additional subnamespace radiotap stuff. With the current reset proposal if you wanted to switch from one private namespace to another you'd use two words, one to indicate the reset which will throw you back to the radiotap namespace and then a vendor extension bit on the second word to indicate a vendor extension on a new namespace.

I actually would not even bother using the it_present bitmap for my own private namespace, instead I'd just use the whole subnamespace to stuff whatever random crap I want. I also believe inserting plugins to interpret private namespaces then becomes easier to add to the code.

Quoted 2 lines

That just means _more_ special cases in the parser, rather than less.

I'm thinking of ways in which the radtiotap code which appends new radiotap information can easily be added for vendor extensions, which is what I really only care about right now. For Atheros vendor namespace for example it would seem easier to just use the vendor extension bit to indicate the atheros subnamespace will have content, then just stuff all our data there. For mac80211 this would mean just adding a possible driver->extend_radiotap() or something like this. You could certainly pass along the it_present bitmap[s] for the vendor too but it seems easier to me if that would not have to be passed at all or kept record of.

Luis

#13 lore raw
In reply to a message not in the archive
Quoted 6 lines · Johannes Berg

Joshua,

Quoted 4 lines

For the structure of the vendor space, you extend 'skip_length' from 8 bits to 16 bits.

Quoted 2 lines

Structure

       u8 OUI[3], u8 sub_namespace, __le16 skip_length

What happens if someone without an OUI wants to add a vendor extension? Do they need to purchase an OUI or IAB from the IEEE?

A message that is not in the archive (sent off-list or not yet received): 4B154CD4.8020700-IZ8446WsY0/[email protected]

#15 lore raw
Quoted 10 lines · Gerald Combs
Quoted 6 lines · Johannes Berg

Joshua,

Quoted 4 lines

For the structure of the vendor space, you extend 'skip_length' from 8 bits to 16 bits.

Quoted 2 lines

Structure
       u8 OUI[3], u8 sub_namespace, __le16 skip_length

What happens if someone without an OUI wants to add a vendor extension? Do they need to purchase an OUI or IAB from the IEEE?

No, you can use a locally administered OUI, there is a bit on the OUI you can use to mark this.

Luis

A message that is not in the archive (sent off-list or not yet received): 43e72e890912011337l704c68ebscea8fd23160f7a8b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#17 lore raw
Quoted 6 lines · Luis R. Rodriguez
Quoted 5 lines · Gerald Combs
Quoted 4 lines · Johannes Berg

Joshua,

Quoted 2 lines

For the structure of the vendor space, you extend 'skip_length' from 8 bits to 16 bits.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Structure

       u8 OUI[3], u8 sub_namespace, __le16 skip_length

What happens if someone without an OUI wants to add a vendor extension? Do they need to purchase an OUI or IAB from the IEEE?

No, you can use a locally administered OUI, there is a bit on the OUI you can use to mark this.

As we've discussed, I don't think this is true. The EUI-48 (or only MAC address?) has such a bit along with the group bit, but it is not inconceivable that OUIs could be assigned in that range for other uses.

johannes

#18 lore raw
In reply to a message not in the archive
Quoted 10 lines · Gerald Combs
Quoted 6 lines · Johannes Berg

Joshua,

Quoted 4 lines

For the structure of the vendor space, you extend 'skip_length' from 8 bits to 16 bits.

Quoted 2 lines

Structure

       u8 OUI[3], u8 sub_namespace, __le16 skip_length

What happens if someone without an OUI wants to add a vendor extension? Do they need to purchase an OUI or IAB from the IEEE?

IABs won't work, because we only have 24 bits reserved in this proposal.

However, is there a good reason for anyone to be wanting this, apart from hardware-specific (and thus probably being affiliated with a vendor) information? Shouldn't almost everything else be standardised within the regular radiotap namespace? We do have a use case on Linux, but we also have vendor backing so we'll be using a sub-namespace for that specific use case (and maintenance within that namespace is easy by controlling what patches go into the source tree).

I have no interest in helping maintain a second namespace in addition to the radiotap bit namespace, and since we do allow sub-typing, being able to use a subtype of somebody's OUI should be possible for virtually anyone. If somebody ends up being completely lost without one, there are probably enough people on this list willing to assign a sub-namespace to them.

johannes

A message that is not in the archive (sent off-list or not yet received): 1259708896.32171.132.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org

#20 lore raw

Gerald,

Did this clear up the issue you raised? If so, I think we can go ahead and adopt this proposal, or are there any other objections?

Thanks,
Johannes

A message that is not in the archive (sent off-list or not yet received): 1262798525.30225.15.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org

#22 lore raw
Quoted 4 lines · Johannes Berg

Gerald,

Did this clear up the issue you raised? If so, I think we can go ahead and adopt this proposal, or are there any other objections?

No objections here.