open-sdr / openwifi-hw

open-source IEEE 802.11 WiFi baseband FPGA (chip) design: FPGA, hardware
GNU Affero General Public License v3.0
675 stars 233 forks source link

question #89

Closed huaxueyong closed 1 year ago

huaxueyong commented 1 year ago

Hello Dr. Jiao! I am learning about your openwifi project. When I saw the csma module, I found that the backoff time directly began to decrease without waiting for DIFS. Is this in conflict with the violation?Thank you for taking time out of your busy schedule to check this message.

JiaoXianjun commented 1 year ago

Can you give me the example code lines?

huaxueyong commented 1 year ago

https://github.com/open-sdr/openwifi-hw/blob/master/ip/xpu/src/csma_ca.v line 409-471

huaxueyong commented 1 year ago

I looked at 80211-2016 Figure 10-15—Backoff procedure.

JiaoXianjun commented 1 year ago

Can you explain a bit more by an example of state transition chain?

huaxueyong commented 1 year ago

backoff

JiaoXianjun commented 1 year ago

I don't understand why you make the conclusion that we don't have DIFS. Can you give me an example by describing a state transition chain?

huaxueyong commented 1 year ago

You only wait for one DIFS before setting the backoff time, but according to 802.11, backoff time still has to wait for one DIFS between stopping and running.

JiaoXianjun commented 1 year ago

You are right. What you are saying actually is the after frame DIFS. We don't have that. That is one deviation from the standard.

To reduce FPGA logic resources occupancy, openwifi only has one CSMA/CA engine (serve all queues) and only start CSMA/CA engine if there is a packet waiting for transmission in a queue. For the DIFS in between stop and running (station B in your case), because there is no packet waiting for transmission, the CSMA/CA even doesn't run, so there is no DIFS in our implementation.

huaxueyong commented 1 year ago

Thank you for your earnest answer to my question, but I think station B is waiting for sending packets, otherwise it would not set backoff time.

huaxueyong commented 1 year ago

The stations in the figure represent different devices, not different queues under the same device.

huaxueyong commented 1 year ago

For example, if two devices AB want to send data, they will both set backoff time(bt). Assuming that A preempts the channel first, then B_bt will stop and will not run until A's operation is completed and a DIFS is over.

JiaoXianjun commented 1 year ago

Yes you are right. Each time when we resume from the stopped backoff, we should do DIFS. But now we don't have that.