HT extensions
Subsystems (2)
This is a request for adoption of the MCS/HT information we've talked about earlier, based on my second proposal that includes valid bits within the field.
This proposal adds the following new field:
Bit Number: 19
Structure: u8 known, u8 flags, u8 mcs
Required Alignment: 1
The "mcs" field indicates the MCS rate index as in IEEE_802.11n-2009.
The "known" field indicates which flags are known:
0x01: bandwidth0x02: MCS index known (in mcs part of the field) 0x04: guard interval0x08: HT format0x10: FEC type0x20: a-MPDU status0x40: a-MPDU beginning/end0x80: reserved
The flags is any combination of the following:0x03: bandwidth - 0: 20, 1: 40, 2: 20L, 3: 20U0x04: short GI0x08: 0: mixed, 1: greenfield0x10: 0: BCC, 1: LDPC0x20: a-MPDU status - 0: not part of an a-MPDU, 1: part of a-MPDU 0x40: 0: first frame, 1: last frame0x80: reserved
Attached is a patch to Linux to generate this information (partially) and a patch for wireshark to read it -- the wireshark patch is on top of the refactoring I did in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4421
johannes
--- include/net/ieee80211_radiotap.h | 24 ++++++++++++++++++++++++ net/mac80211/rx.c | 17 +++++++++++++++++ 2 files changed, 41 insertions(+)
net/mac80211/rx.c +17 -0
@@ -85,6 +85,9 @@ ieee80211_rx_radiotap_len(struct ieee802if (len &1 )/* padding for RX_FLAGS if necessary */ len++; +if (status->flag &RX_FLAG_HT )/* HT info */ + len +=3 ; +return len; }
@@ -193,6 +196,20 @@ ieee80211_add_rx_radiotap_header(struct rx_flags |=IEEE80211_RADIOTAP_F_RX_BADPLCP ;put_unaligned_le16 (rx_flags, pos); pos +=2 ; + +if (status->flag &RX_FLAG_HT ) { + rthdr->it_present |=cpu_to_le32 (1 <<IEEE80211_RADIOTAP_HT ); + *pos++ =IEEE80211_RADIOTAP_HT_HAVE_MCS | +IEEE80211_RADIOTAP_HT_HAVE_GI | +IEEE80211_RADIOTAP_HT_HAVE_BW ; + *pos =0 ; +if (status->flag &RX_FLAG_SHORT_GI ) + *pos |=IEEE80211_RADIOTAP_HT_SGI ; +if (status->flag &RX_FLAG_40MHZ ) + *pos |=IEEE80211_RADIOTAP_HT_BW_40 ; + pos++; + *pos++ = status->rate_idx; + } }/*
include/net/ieee80211_radiotap.h +24 -0
@@ -199,6 +199,8 @@ enum ieee80211_radiotap_type {IEEE80211_RADIOTAP_RTS_RETRIES =16 ,IEEE80211_RADIOTAP_DATA_RETRIES =17 , +IEEE80211_RADIOTAP_HT =19 , +/* valid in every it_present bitmap, even vendor namespaces */ IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE =29 , IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
@@ -245,6 +247,28 @@ enum ieee80211_radiotap_type {#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002/* used cts 'protection' */ #define IEEE80211_RADIOTAP_F_TX_RTS 0x0004/* used rts/cts handshake */ + +/* For IEEE80211_RADIOTAP_HT */ +#define IEEE80211_RADIOTAP_HT_HAVE_BW 0x01 +#define IEEE80211_RADIOTAP_HT_HAVE_MCS 0x02 +#define IEEE80211_RADIOTAP_HT_HAVE_GI 0x04 +#define IEEE80211_RADIOTAP_HT_HAVE_FMT 0x08 +#define IEEE80211_RADIOTAP_HT_HAVE_FEC 0x10 +#define IEEE80211_RADIOTAP_HT_HAVE_AMPDU_STAT 0x20 +#define IEEE80211_RADIOTAP_HT_HAVE_AMPDU_POS 0x40 + +#define IEEE80211_RADIOTAP_HT_BW_MASK 0x03 +#define IEEE80211_RADIOTAP_HT_BW_20 0 +#define IEEE80211_RADIOTAP_HT_BW_40 1 +#define IEEE80211_RADIOTAP_HT_BW_20L 2 +#define IEEE80211_RADIOTAP_HT_BW_20U 3 +#define IEEE80211_RADIOTAP_HT_SGI 0x04 +#define IEEE80211_RADIOTAP_HT_FMT_GF 0x08 +#define IEEE80211_RADIOTAP_HT_FEC_LDPC 0x10 +#define IEEE80211_RADIOTAP_HT_AMPDU_PART 0x20 +#define IEEE80211_RADIOTAP_HT_AMPDU_END 0x40 + +/* Ugly macro to convert literal channel numbers into their mhz equivalents * There are certianly some conditions that will break this (like feeding it '30') * but they shouldn't arise since nothing talks on channel 30. */
--- epan/dissectors/packet-radiotap-defs.h | 23 ++++++ epan/dissectors/packet-radiotap-iter.c | 1 epan/dissectors/packet-radiotap.c | 118 +++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+)
epan/dissectors/packet-radiotap-defs.h +23 -0
@@ -196,6 +196,8 @@ enum ieee80211_radiotap_type {IEEE80211_RADIOTAP_RTS_RETRIES =16 ,IEEE80211_RADIOTAP_DATA_RETRIES =17 , +IEEE80211_RADIOTAP_HT =19 , +/* valid in every it_present bitmap, even vendor namespaces */ IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE =29 , IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
@@ -242,4 +244,25 @@ enum ieee80211_radiotap_type {#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002/* used cts 'protection' */ #define IEEE80211_RADIOTAP_F_TX_RTS 0x0004/* used rts/cts handshake */ + +/* For IEEE80211_RADIOTAP_HT */ +#define IEEE80211_RADIOTAP_HT_HAVE_BW 0x01 +#define IEEE80211_RADIOTAP_HT_HAVE_MCS 0x02 +#define IEEE80211_RADIOTAP_HT_HAVE_GI 0x04 +#define IEEE80211_RADIOTAP_HT_HAVE_FMT 0x08 +#define IEEE80211_RADIOTAP_HT_HAVE_FEC 0x10 +#define IEEE80211_RADIOTAP_HT_HAVE_AMPDU_STAT 0x20 +#define IEEE80211_RADIOTAP_HT_HAVE_AMPDU_POS 0x40 + +#define IEEE80211_RADIOTAP_HT_BW_MASK 0x03 +#define IEEE80211_RADIOTAP_HT_BW_20 0 +#define IEEE80211_RADIOTAP_HT_BW_40 1 +#define IEEE80211_RADIOTAP_HT_BW_20L 2 +#define IEEE80211_RADIOTAP_HT_BW_20U 3 +#define IEEE80211_RADIOTAP_HT_SGI 0x04 +#define IEEE80211_RADIOTAP_HT_FMT_GF 0x08 +#define IEEE80211_RADIOTAP_HT_FEC_LDPC 0x10 +#define IEEE80211_RADIOTAP_HT_AMPDU_PART 0x20 +#define IEEE80211_RADIOTAP_HT_AMPDU_END 0x40 +#endif /* IEEE80211_RADIOTAP_H */
epan/dissectors/packet-radiotap-iter.c +1 -0
@@ -37,6 +37,7 @@ static const struct radiotap_align_size [IEEE80211_RADIOTAP_TX_FLAGS] = { .align = 2, .size = 2, }, [IEEE80211_RADIOTAP_RTS_RETRIES] = { .align = 1, .size = 1, }, [IEEE80211_RADIOTAP_DATA_RETRIES] = { .align = 1, .size = 1, }, + [IEEE80211_RADIOTAP_HT] = { .align = 1, .size = 3, },/* * add more here as they are defined in * include/net/ieee80211_radiotap.h
epan/dissectors/packet-radiotap.c +118 -0
166 lines not on this page · raw message
Quoted 34 lines · Johannes Berg
This is a request for adoption of the MCS/HT information we've talked about earlier, based on my second proposal that includes valid bits within the field.
This proposal adds the following new field:
Bit Number: 19
Structure: u8 known, u8 flags, u8 mcs
Required Alignment: 1The "mcs" field indicates the MCS rate index as in IEEE_802.11n-2009.
The "known" field indicates which flags are known:
0x01: bandwidth0x02: MCS index known (inmcspart of the field)0x04: guard interval0x08: HT format0x10: FEC type0x20: a-MPDU status0x40: a-MPDU beginning/end0x80: reservedThe
flagsis any combination of the following:0x03: bandwidth - 0: 20, 1: 40, 2: 20L, 3: 20U0x04: short GI0x08: 0: mixed, 1: greenfield0x10: 0: BCC, 1: LDPC0x20: a-MPDU status - 0: not part of an a-MPDU, 1: part of a-MPDU0x40: 0: first frame, 1: last frame0x80: reserved
Quoted 7 lines
Attached is a patch to Linux to generate this information (partially) and a patch for wireshark to read it -- the wireshark patch is on top of the refactoring I did in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4421johannes
Even if I'm the author of the original proposal I agree with the new format, as many chipset can't report all the informations correctly.
Signature · 12 lines
Matteo Croce OpenWrt developer _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M KAMIKAZE (bleeding edge) ------------------ * 10 oz Vodka Shake well with ice and strain * 10 oz Triple sec mixture into 10 shot glasses. * 10 oz lime juice Salute! ---------------------------------------------------
Quoted 3 lines · Johannes Berg
This is a request for adoption of the MCS/HT information we've talked about earlier, based on my second proposal that includes valid bits within the field.
No comments on this, but I also forgot to set a timeline.
Since I'll be on vacation fairly soon, how about this:
Oct. 24th: comment period ends Oct. 25th: tentatively adopt Nov. 3rd: fully adopt
Unless anyone has comments, changes, etc. of course.
johannes
Quoted 23 lines · Johannes Berg
This is a request for adoption of the MCS/HT information we've talked about earlier, based on my second proposal that includes valid bits within the field.
This proposal adds the following new field:
Bit Number: 19
Structure: u8 known, u8 flags, u8 mcs
Required Alignment: 1The "mcs" field indicates the MCS rate index as in IEEE_802.11n-2009.
The "known" field indicates which flags are known:
0x01: bandwidth0x02: MCS index known (inmcspart of the field)0x04: guard interval0x08: HT format0x10: FEC type0x20: a-MPDU status0x40: a-MPDU beginning/end0x80: reserved
Quoted 8 lines
The
flagsis any combination of the following:0x03: bandwidth - 0: 20, 1: 40, 2: 20L, 3: 20U0x04: short GI0x08: 0: mixed, 1: greenfield0x10: 0: BCC, 1: LDPC0x20: a-MPDU status - 0: not part of an a-MPDU, 1: part of a-MPDU0x40: 0: first frame, 1: last frame0x80: reserved
Suggestion for clarity: name each of the flags in the "flags" field, and in the definition of the "known" field, indicate corresponding flags by name.
How can an application use the first/last-frame information?
Dave
Signature · 2 lines
David Young OJC Technologies [email protected] Urbana, IL * (217) 278-3933
Quoted 20 lines · David Young
Quoted 11 lines
The "known" field indicates which flags are known:
0x01: bandwidth0x02: MCS index known (inmcspart of the field)0x04: guard interval0x08: HT format0x10: FEC type0x20: a-MPDU status0x40: a-MPDU beginning/end0x80: reservedQuoted 8 lines
The
flagsis any combination of the following:0x03: bandwidth - 0: 20, 1: 40, 2: 20L, 3: 20U0x04: short GI0x08: 0: mixed, 1: greenfield0x10: 0: BCC, 1: LDPC0x20: a-MPDU status - 0: not part of an a-MPDU, 1: part of a-MPDU0x40: 0: first frame, 1: last frame0x80: reserved
Quoted 3 lines
Suggestion for clarity: name each of the flags in the "flags" field, and in the definition of the "known" field, indicate corresponding flags by name.
Yes, that'd help, good plan, I'll make some wiki edits and resend.
Quoted 1 line
How can an application use the first/last-frame information?
Well, right now my wireshark patch is simply displaying it, but it could also link up frames of an a-MPDU so you can jump between them, and with this it can know what the framing was. If you just know a frame was part of an aMPDU you won't know which one, this should help.
johannes
Quoted 7 lines · Johannes Berg
Quoted 1 line · David Young
How can an application use the first/last-frame information?
Well, right now my wireshark patch is simply displaying it, but it could also link up frames of an a-MPDU so you can jump between them, and with this it can know what the framing was. If you just know a frame was part of an aMPDU you won't know which one, this should help.
I have my doubts about that. How do you distinguish the case where the NIC gives you the first MPDU of A-MPDU 1 and the last MPDU of A-MPDU 2 from the case where the NIC gives you the first and last MPDU of the same A-MPDU?
Dave
Signature · 2 lines
David Young OJC Technologies [email protected] Urbana, IL * (217) 278-3933
Quoted 9 lines · David Young
Quoted 7 lines · Johannes Berg
Quoted 1 line · David Young
How can an application use the first/last-frame information?
Well, right now my wireshark patch is simply displaying it, but it could also link up frames of an a-MPDU so you can jump between them, and with this it can know what the framing was. If you just know a frame was part of an aMPDU you won't know which one, this should help.
Quoted 4 lines
I have my doubts about that. How do you distinguish the case where the NIC gives you the first MPDU of A-MPDU 1 and the last MPDU of A-MPDU 2 from the case where the NIC gives you the first and last MPDU of the same A-MPDU?
You mean with imperfect capturing? Otherwise you should've seen the last of A-MPDU 1 inbetween that, I'd think. But you're right, doing this perfectly is quite hard, and I don't really have a good use case in mind either. I'm happy to leave it off, at least for now, until somebody can demonstrate a working way to convey this information.
johannes
Quoted 15 lines · Johannes Berg
Quoted 9 lines · David Young
Quoted 7 lines · Johannes Berg
Quoted 1 line · David Young
How can an application use the first/last-frame information?
Well, right now my wireshark patch is simply displaying it, but it could also link up frames of an a-MPDU so you can jump between them, and with this it can know what the framing was. If you just know a frame was part of an aMPDU you won't know which one, this should help.
Quoted 4 lines
I have my doubts about that. How do you distinguish the case where the NIC gives you the first MPDU of A-MPDU 1 and the last MPDU of A-MPDU 2 from the case where the NIC gives you the first and last MPDU of the same A-MPDU?
Quoted 5 lines
You mean with imperfect capturing? Otherwise you should've seen the last of A-MPDU 1 inbetween that, I'd think. But you're right, doing this perfectly is quite hard, and I don't really have a good use case in mind either. I'm happy to leave it off, at least for now, until somebody can demonstrate a working way to convey this information.
I favor leaving it off for now.
Dave
Signature · 2 lines
David Young OJC Technologies [email protected] Urbana, IL * (217) 278-3933
Quoted 1 line · David Young
I favor leaving it off for now.
I was just editing my proposal for that, and it occurred to me that now we have only one a-MPDU bit here in the MCS field, and technically non-MCS frames can also be aggregated, so it never really belonged here anyway.
Therefore, what do you think of these changes:
1) remove the a-MPDU bit from the MCS field completely
2) add a new a-MPDU field with the following definition:
bit number: 20
structure: u8 flags_idx
required alignment: 1
The presence of this field indicates that the frame was received as part of an a-MPDU. The format of the flags_idx field is as follows:
bit 7: index field valid, otherwise the index isn't known bits 6-0: index field -- zero-based index of
this MPDU within the a-MPDU
(technically, only bits 5-0 are required for the index, because it can only go up to 63)
johannes