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

Hello,Dr.jiao. I have a question about the contention window of the csma code. I know that the traditional backoff window CWmin for CSMA/CA is 16, but the random number generation section in the csma_ca code starts from 2. How is this section defined? Or that I misunderstand the meaning of the source code? #90

Closed
liulangkk opened this issue Apr 1, 2023 · 4 comments

Comments

@liulangkk
Copy link

  1. Could you send email to xianjun.jiao@ugent.be to introduce your self?

  2. Our image is used directly or you build your own image?

  3. What is your own modification?

  4. Versions: OS, Vivado, openwifi/openwifi-hw repo branch and commit revision

  5. Board/hardware type

  6. WiFi channel number

  7. Steps to reproduce the issue, and the related error message, screenshot, etc

  8. Describe your debug efforts by Linux native tools, such as tcpdump and "cat /proc/interrupts"

  9. Describe your debug efforts by: https://github.com/open-sdr/openwifi/blob/master/doc/README.md#Debug-methods

  10. Any other thing we need to know for helping you better?

@JiaoXianjun
Copy link
Member

Can you elaborate in more detailed style? Such as which line of code in which kind of state transition in CSMA/CA part?

@liulangkk
Copy link
Author

https://github.com/open-sdr/openwifi-hw/blob/master/ip/xpu/src/csma_ca.v
line239-279 is random number generator. In my view I know that it corresponds to the different stage of the backoff.
According to the cw_exp module, it can be seen that based on the retransmission trigger, the cw_exp+1 operation will be executed, which corresponds to the random number generation part in csma_ca. According to the CSMA/CA protocol (as described in most publicly available sources), the minimum contention window is randomly selected from within 16. My question is regarding the random number generation code in which, when cw_exp_used is set to 1, 2, or 3, the corresponding random number ranges are 2, 4, and 8, respectively. This may differ slightly from what I understand about the protocol, or this design may have a specific purpose, or perhaps I have misunderstood something.

@HavingaThijs
Copy link
Collaborator

That part ensures that every possible value of the CW exponential can be used. While CWmin for the normal Distributed Coordination Function (DCF) is 15 (2^4-1), for Enhanced Distributed Channel Access (EDCA) it depends on the QoS type and may be lower than 15.
CWmin and CWmax are decided by Linux’ mac80211 or it can be overwritten by register 19 of the xpu (see https://github.com/open-sdr/openwifi/blob/master/doc/README.md#get-and-set-a-register-of-a-module).

@liulangkk
Copy link
Author

Thank you for your patient answer! This answer helps me a lot understand the meaning of the csma/ca code.

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

No branches or pull requests

3 participants