Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse BSS Load Information Elements #64

Merged
merged 8 commits into from
May 21, 2024

Conversation

lukas-mbag
Copy link
Contributor

@lukas-mbag lukas-mbag commented Dec 1, 2023

This change extends the parsing of the Information Elements to include the QBSS-Load Element

  • BSS-Load parameters are included in a custom struct (with proper String() Method)
  • Supports both Versions (same as Wireshark) - See func decodeBSSLoad(b []byte) (*BSSLoad, error)
  • Includes the Following Parameters of the QBSS-Load:
    • Station Count
    • Channel Utilization
    • Available Admission Capacity

Additionally the output of a failed test in TestIntegrationLinuxConcurrent has been extended.

The program was tested solely for our own use cases, which might differ from yours.
Especially I only tested in WLAN-Networks with QBBS Load Version 2 (Wireshark calls this "802.11e CCA Version").

Lukas Raffelt < lukas.raffelt@mercedes-benz.com > on behalf of Mercedes-Benz Tech Innovation GmbH, Provider Information

Licensed under MIT

@lukas-mbag lukas-mbag marked this pull request as ready for review December 1, 2023 14:34
@lukas-mbag
Copy link
Contributor Author

Hey @SuperQ and @mdlayher ,
did you have any chance to look at this merge-request?
Since this is my first contribution to this project, is there anything I am missing or can improve?

Or am I just too impatient? ;)

Cheers Lukas

@SuperQ SuperQ requested a review from mdlayher December 10, 2023 13:50
@SuperQ
Copy link
Collaborator

SuperQ commented Dec 10, 2023

One nice thing to do would be to squash your commits into logical changes. Rather than have a bunch of "Fix typo" changes.

@lukas-mbag
Copy link
Contributor Author

Shall I do this right now (and invalidate the checks and so ...)? Or more as a general advice for my next pull request?

@SuperQ
Copy link
Collaborator

SuperQ commented Dec 11, 2023

Yes, you can rebase/sqaush/change whenever you feel like.

Copy link
Collaborator

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits, but otherwise LGTM.

wifi.go Outdated Show resolved Hide resolved
wifi.go Outdated Show resolved Hide resolved
@@ -544,3 +551,26 @@ func decodeSSID(b []byte) string {

return buf.String()
}

// decodeBSSLoad Decodes the BSSLoad IE. Supports Version 1 and Version 2
// values according to https://raw.githubusercontent.com/wireshark/wireshark/master/epan/dissectors/packet-ieee80211.c
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any documentation other than wireshark source code for these formats? Linking to a > 2MiB source file isn't my preference.

Copy link
Contributor Author

@lukas-mbag lukas-mbag Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation in iw scan command is comparable in size.

See Line 1640ff in scan.c and Line 1826

But I will do another search for better references.

Edit: Links that do not point to a rolling master branch but to a fixed release Line 1634ff in scan.c of release v5.19

Copy link
Contributor Author

@lukas-mbag lukas-mbag Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also checked the IEEE Std 802.11-2020 as a primary source. That document is approx 4000 pages long, The relevant definition of the BSS Load Information Element can be found in chapter 9.4.2.27.

I will add the reference to the primary source and change the descriptions to closer match the language in the primary source to reduce any confusion.

What do you think about that solution?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

client_linux_integration_test.go Show resolved Hide resolved
@lukas-mbag
Copy link
Contributor Author

Thanks for the input.

I will work on the suggestions later today and squash the commits to more sensible commits.

@lukas-mbag lukas-mbag force-pushed the feat-QBSSLoad-IEs branch 2 times, most recently from c7633dd to 4ac0888 Compare December 11, 2023 17:29
@lukas-mbag lukas-mbag changed the title Parse QBSS Load Information Elements Parse BSS Load Information Elements Feb 7, 2024
lukas-mbag and others added 6 commits February 7, 2024 15:05
make following IE Parameters availiable:
* StationCount
* ChannelUtilization
* AvailableAdmissionCapacity

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>

more docs for BSS Load elements

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>

more docs for BSS Load elements

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>

add Parsing

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>
Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>
Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>

restructure to sub-Element

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>

skip malformed IE if decodeBSSLoad returns error

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>
Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>

reset integration test to default parameters

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

fix typo

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>

expand documentation

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>
Includes references to the IEEE 802.11 Chapter that defines the Information Element

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>
@lukas-mbag
Copy link
Contributor Author

rebased on the current master.

Anything missing for a successful merge?

@lukas-mbag
Copy link
Contributor Author

lukas-mbag commented May 16, 2024

Hey @SuperQ any chance for the merge request to do through soon? Or do we still wait for the review from @mdlayher?

@mdlayher
Copy link
Owner

I'll leave it up to @SuperQ, I have not been actively participating in this library for some time.

Copy link
Collaborator

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nits.

client_linux.go Outdated Show resolved Hide resolved
wifi.go Outdated Show resolved Hide resolved
wifi.go Outdated Show resolved Hide resolved
Co-authored-by: Ben Kochie <superq@gmail.com>
@lukas-mbag
Copy link
Contributor Author

Applied all suggestions, thanks for the feedback!

@lukas-mbag lukas-mbag requested a review from SuperQ May 21, 2024 08:52
Copy link
Collaborator

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the other issues similar to my suggestions? There are other Go doc issues.

@lukas-mbag
Copy link
Contributor Author

lukas-mbag commented May 21, 2024

ah, sorry I thought everything was in the suggestions, will do it now

formated Godocs of types BSS and BSSLoad

Signed-off-by: Lukas Raffelt <lukas.raffelt@mercedes-benz.com>
@lukas-mbag
Copy link
Contributor Author

I have formatted the go Doc comments in my new Type BSSLoad similar to the suggested changes. I also harmonized the doc strings in type BSS.

Copy link
Collaborator

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! Fixing the doc strings helps a bunch.

@SuperQ SuperQ merged commit e031f90 into mdlayher:main May 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants