WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2015-Jan-13 15:34:26

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Packet detection problem in 802.11 reference design

Hey,

I have three questions about packet detection:
1) Is auto-correlation used in packet detection to decide whether a packet is a Wi-Fi packet or not?
2) How does CCA decide whether a packet is Wi-Fi or non-Wi-Fi packet in your design? How should I modify the CCA power level threshold (used to indicate whether channel is busy or not)?
3) If there is non-Wi-Fi interference, is it possible that I could record the power level of interference detected by PHY layer?

Thanks for your answer in advance.

Offline

 

#2 2015-Jan-13 15:50:37

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Packet detection problem in 802.11 reference design

1) Is auto-correlation used in packet detection to decide whether a packet is a Wi-Fi packet or not?
2) How does CCA decide whether a packet is Wi-Fi or non-Wi-Fi packet in your design? How should I modify the CCA power level threshold (used to indicate whether channel is busy or not)?

The first stage of packet detection uses an auto-correlator with period 16 samples. This correlator asserts on the short symbols (STS) of the 802.11 preamble. Given the short correlation window and low threshold (to avoid false negatives) the probability of a false positive detection is non-zero.

Following assertion of the auto-correlation pkt detector the Rx PHY enables a 64-point complex cross correlator matched to the preamble LTS. This correlator asserts when two sequential 64-sample LTS are observed in the incoming samples. If the correlation succeeds the Rx PHY pipeline is enabled (i.e. samples start feeding the FFT). If no valid correlation occurs the PHY resets and waits for a new pkt detection event. The probability of a false positive here is very small. The probability of a false negative is non-zero, resulting from low SNR or interference.

3) If there is non-Wi-Fi interference, is it possible that I could record the power level of interference detected by PHY layer?

This would require customizing the Rx PHY hardware. In the current design the PHY operates autonomously, waiting for pkt detection events and evaluating LTS correlation values. The PHY only notifies the MAC software when a valid 802.11 PHY header (SIGNAL field) is received. If a pkt det event does not lead to a valid SIGNAL field, the PHY will reset and continue searching, all without recording details of the event or notifying the MAC software.

To record interference levels you would need to devise a scheme to identify the events of interest (increase in RSSI? Rx pkt errors at high SNR?), then record the RSSI values during those events for later analysis. For real-time operation this observe/record system would need to be in the FPGA logic.

One option here that might help- the WARPLab Reference Design could be used to observe all activity in the band of interest. The current WARPLab design (7.4) is limited to 800usec per capture. We're almost ready with an updated design (7.5) that will extend this to 3+ seconds per capture. A Rx-only WARPLab node could be co-located with 802.11 nodes to record all activity for offline analysis.

Offline

 

#3 2015-Jan-13 16:51:09

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Packet detection problem in 802.11 reference design

Another idea on your question (3) is that you could modify the 802.11 Reference Design to log the RSSI just prior to a reception in addition to the RSSI of every reception that is already included in the receive logs. Those "early" RSSI measures would be asymmetrically sampled (i.e. whenever you actually received something), but that might be enough to make some conclusions on ambient interference levels. Also, the ratio of the two RSSI values would let you pretty directly calculate the SINR of every reception. Adding the pre-packet RSSI would require a hardware change to the Sysgen cores, but it would be straightforward.

Offline

 

#4 2015-Jan-14 09:50:04

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Re: Packet detection problem in 802.11 reference design

Thanks for you guys quick response.

I am not familiar with how CCA decides to use threshold -62dBm or -82dBm(according to 802.11 standard) to indicate channel busy, so I could not figure out the clear process of how CCA works from your response. Also I did not find good material from internet by myself.
Since it is pretty important to me, is it possible that you could explain more clear about the process? Or could you show me any material for how it works?

Also, could you give me some hints on how to change the CCA threshold(-62dBm or -82dBm) in 802.11 reference design?

Really appreciate for your response.

Offline

 

#5 2015-Jan-14 10:15:45

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Packet detection problem in 802.11 reference design

Sorry, I missed that part of your first post.

Our design asserts CCA.BUSY when:
(a) The NAV counter is non-zero (implemented in the wlan_mac_dcf_hw core);
(b) The PHY Tx is currently active; or
(c) The PHY Rx asserts its CCA.BUSY output:
  (c.1) The PHY Rx has detected a preamble and is attempting to decode a SIGNAL field;
  (c.2) The PHY Rx has detected a valid SIGNAL field and is processing a full packet Rx; or
  (c.3) The PHY Rx detects energy above a programmed threshold

The 3-way OR for conditions [a,b,c] is in 'wlan_mac_dcf_hw/CCA'.

The 3-way OR for condition (c) is in 'wlan_phy_rx_pmd/Sync & Antenna Sel/PHY CCA/'

The energy detection for (c.3) uses the radio's RSSI signal to estimate the current Rx energy level. The threshold to assert BUSY is configurable from software via the wlan_phy_rx_set_cca_thresh() macro. The default value is set in wlan_phy_util.c :: wlan_phy_init() to approx -62dBm. You can disable physical carrier sensing by setting the threshold to its max (PHY_RX_RSSI_SUM_LEN*1023). We wrote an app note app note that demonstrates the impact of this in the presence of real interference.

Offline

 

#6 2015-Jan-14 15:51:59

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Re: Packet detection problem in 802.11 reference design

Thanks for your explanation. It is really helpful.

Offline

 

#7 2015-Jan-14 15:56:15

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Packet detection problem in 802.11 reference design

Quick follow up -- we just released the Mango 802.11 Reference Design v1.2. One of the changes makes (c.3) that murphpo mentioned easier to configure.

Previously, this value was a hardcoded 10-bit number that acted as a threshold on RSSI. In the current release wlan_phy_util.c :: wlan_phy_init() calls a new function wlan_mac_low_rx_power_to_rssi() with an explicit Rx Power argument in dBm (e.g. wlan_mac_low_rx_power_to_rssi(-62)). You can change the CCA sensitivity by adjusting that number.

Offline

 

#8 2015-Jan-19 08:16:34

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Re: Packet detection problem in 802.11 reference design

Hey,

We would like to examine the Carrier Sense mechanism (c.1 and c.2) of WiFi. We would like to know is it possible for WiFi TX to identify non-WiFi signals (other OFDM signals) as Wi-Fi signals, and thus trigger CCA busy and doesn't transmit.
We tried your suggestions, and we have four more questions.

1) If we disable physical carrier sensing by your method, does it have any impact on  (c.1) or (c.2)?(or it only changes the -62dBm programmed threshold?) We would like to disable the effect from c.3.
2) Is it possible that we can measure the number of packets that WARP actually sends out? (no matter this packet is being acked or not)
3) In our scenario, non-Wi-Fi interference source continually transmits with interference power less than -62dBm. I found that when the bandwidth of interference signal(with constant Power spectral density) is small, Wi-Fi throughput decreases. We found that it is because WARP as WiFi Tx does not transmit. We assume it is because WARP finds channel is busy. Since the interference power is less than -62dBm, we assume (c.1) or (c.2) is triggered. Is it possible that non-Wi-Fi signal always triggers (c.1) or (c.2)? And do you have any suggestions why different bandwidth of interference signal have different impact on Wi-Fi physical  channel sensing mechanism?
4) Is it possible that the signal energy can affect the correctness of packet detection? For example, the correlation mechanism will have higher false positive probability when the signal energy is smaller?

Appreciate for any suggestions. Thanks.

Last edited by Yb2015 (2015-Jan-19 10:42:52)

Offline

 

#9 2015-Jan-19 10:32:13

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Packet detection problem in 802.11 reference design

1) If I disable physical carrier sensing by your method, does it have any impact on  (c.1) or (c.2)?(or it only changes the -62dBm programmed threshold?)

No- the wlan_phy_rx_set_cca_thresh() method only affects the RSSI threshold condition (c.3 above)

2) Is it possible that you could share the material of how energy detection based on RSSI is implemented in WARP?

The MAX2829 transceiver (the baseband<->RF chip) has an analog RSSI output. The RSSI voltage is proportional to instantaneous Rx power on a dB scale. The WARP v3 hardware samples the RSSI signal with a 10-bit ADC clocked at 10MHz. The 802.11 Rx PHY implements physical CCA by taking a running sum (i.e. averaging without division) of the digital RSSI samples, then compares the running sum to a fixed threshold.

3) In my scenario, non-Wi-Fi interference source always transmits with interference power less than -62dBm. I found that when the bandwidth of interference signal(with constant Power spectral density) is small, Wi-Fi throughput decreases. The reason is that WARP as Tx does not transmit. I assume it is because WARP assumes channel is busy

When you observe lower throughput, are you certain it's due to fewer Tx attempts by the WARP node? How did you verify this vs. lower throughput due to more packet errors at the Rx node?

How are you controlling the observed receive power of your interference at the Rx node?

Is it possible that non-Wi-Fi signal always triggers (c.1) or (c.2)?

It is possible but very unlikely. Condition (c.1) will occur when the Rx signal is periodic in 16 samples, like the STS portion of the 802.11 preamble. Condition (c.2) will only occur after packet detection (c.1) when the Rx PHY successfully decodes a SIGNAL field. The probability of random non-802.11 interference causing false positives here is very small.

Offline

 

#10 2015-Jan-19 11:02:09

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Re: Packet detection problem in 802.11 reference design

Thanks for your really quick reply. We just tried to edit the previous post.

1) We say the lower throughput is because of fewer Tx attempt, because spectrum analyzer showed that there is no Wi-Fi signal can be observed. To further make sure about this condition, could you help us with the 2) question? Since we fixed the Tx power of interference signal, and measure the interference power with spectrum analyzer at Rx node( around -75dBm but not always measure). Therefore, we think the interference power is always less than -62dBm.
2) Is it possible that we can measure the number of packets that WARP actually sends out? (no matter this packet is being acked or not)

Thanks for your suggestions.

Last edited by Yb2015 (2015-Jan-19 11:04:55)

Offline

 

#11 2015-Jan-19 14:12:53

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Packet detection problem in 802.11 reference design

2) Is it possible that we can measure the number of packets that WARP actually sends out? (no matter this packet is being acked or not)

Yes- a major component of the 802.11 Reference Design is the wlan_exp experiments framework. You can use wlan_exp to configure/control your nodes and gather detailed statistics in real-time. The print_node_stats.py and throughput_two_nodes.py scripts would be good starting points.

One way to attribute throughput loss to fewer transmissions would be to retrieve the Tx/Rx stats from your transmitting node and compare the data_num_tx_packets_total and data_num_tx_packets_low values. The data_num_tx_packets_low value increments every time the lower-level MAC transmits, even for re-transmissions. Thus if data_num_tx_packets_low is much larger than data_num_tx_packets_total, there were many failed transmission attempts. However if data_num_tx_packets_total is nearly equal to data_num_tx_packets_total, there were fewer overall transmissions but most were successful.

Offline

 

#12 2015-Jan-20 08:38:28

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Re: Packet detection problem in 802.11 reference design

Thanks for your advice.

In my scenario, I measured experiment results around 20s and I used Iperf to transmit udp packet for 20s with WARP as Wi-Fi Tx.
I saw that data_num_tx_packets_low(e.g. 311) is larger than data_num_tx_packets_total(e.g. 47) in smaller bandwidth of interference case. 
I noticed that data_num_tx_packets_total is also relative small compared with bigger bandwidth of interference case(e.g. 22305) in a fixed experiment time.

In this case, could we say that (c.1) or (c.2) is always triggered by smaller bandwidth of non-Wi-Fi interference signal?

Last edited by Yb2015 (2015-Jan-20 08:38:53)

Offline

 

#13 2015-Jan-20 09:37:30

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Packet detection problem in 802.11 reference design

Even in the absence of CCA of external interference, poor receiver performance will reduce the number of transmissions over a fixed time interval. If the transmitted packets are not ACKed, the transmitter will continue increasing its contention window and backing off more. The numbers your included in your post (311 low transmissions and 47 total high transmissions) is consistent with this. Nearly every packet was retransmitted the full 7 times. This means that the contention window was likely railed at its maximum value of 1023 for the duration of the experiment. You'd expect roughly (CWmax/CWmin = 1023/15= ~68x) the total backoff time in a scenario where no packets are ACKed vs. a scenario where every packet is ACKed. That's a lot of extra idle time and you would see a big difference in the number of transmitted frames. Given this behavior, it isn't fair to conclude that the smaller number of transmissions in the smaller bandwidth interference case must be caused by CCA.

One way to confirm this is to send broadcast or multicast traffic instead of unicast traffic. Broadcast traffic is never ACKed and the contention window is reset to a minimum after each transmission regardless of whether or not a receiver actually successfully decoded the packet. Only in this scenario can you conclude that CCA is the root cause of a fewer number of transmissions. You can do this using the wlan_exp experiments framework by sending an LTG to the FF-FF-FF-FF-FF-FF broadcast address. You could also do it from a computer command line by sending a ping to the broadcast address. You won't be able to measure throughput with the ping, but the statistics you gathered from before should still apply.

Subtle point about broadcast traffic: Only the AP and the IBSS projects are capable of sending broadcast traffic in the way we are speaking about it. The STA behavior is unique because every packet it sends is sent as a unicast transmission to the AP. Even if the underlying packet is broadcast, it is sent to the AP as a unicast transmission and the AP repeats it from there. STA devices never directly communicate with other STA devices. All traffic goes through the AP. So, for you experiment, you want the direction of your traffic to be AP->STA or just use two ad hoc IBSS designs.

Offline

 

#14 2015-Jan-21 15:32:56

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Re: Packet detection problem in 802.11 reference design

Really appreciate for your advice.

You are right on the size of contention window. I tested that the contention window size is relative big.
Since I want to use broadcast traffic like you suggested, I sent ping to the broadcast address, but I got a problem to gather the statistics.
Since all the statistics are printed based on station ID(or MAC address) in print_node_stats.py, if I send ping to broadcast address, the data printed corresponding to specific station ID(or MAC address) is not increased because of broadcast packets. Is this correct?
If it is correct, could you give me some hint on how to print data_num_tx_packets_low or data_num_tx_packets_total for broadcast packets?
Thanks.

Offline

 

#15 2015-Jan-21 16:02:56

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Packet detection problem in 802.11 reference design

Ah, that's a good point I hadn't considered. You are right -- the way we built the statistics system is keyed off a station's MAC address. Broadcast frames coming *from* any station on the network will show up in Rx stats. Transmitted broadcast frames that egress from a node don't currently show up in any stats on that node because they aren't tied to any particular station's MAC address. There are two solutions to this problem:

(1) I'd strongly consider moving away from stats-based experiments and over to log-based experiments using the wlan_exp log framework. Every single transmission and every single reception will appear in the logs on the boards, regardless of whether they are unicast or multicast/broadcast. You can build the equivalent Tx and Rx stats directly in Python by simply counting the appropriate log entries. This is really easy to do in Python and our existing examples show how to do this. The log functionality in wlan_exp is the strict superset of the stats functionality. Everything you can do with stats you can do just as easily with the logs. And with logs, you can do much more. I think this is your best bet.

(2) If you do want to continue using stats, you'll need to make some changes to the C project so you can track multicast/broadcast transmissions. Specifically, the mpdu_transmit_done() function is what ultimately updates Tx statistics. Currently, it looks at the RA (addr1) field of the packet that was just sent and then looks for the associated station that it should update the Tx stats for. You'd need to change this behavior so that, in the case of multicast, it updates the Tx stats for a new multicast stats entry in the "statistics_table". I would probably create that multicast stats entry at boot in the main function.

Honestly, I really recommend going with the logs and abandoning the stats. In the short run, those small python changes to count log entries instead of stats are easier than modifying the design to actually keep Tx statistics for multicast packets. In the long run, the logging framework is extremely powerful and you may find that you'll use it anyway. For example, the Tx Low log entries actually contain the specific backoff slot count that every transmission used. So, in addition to counting them to see how many there are, you could explicitly see that each one had a huge backoff slot count, so CCA probably isn't to blame. You also have every timestamp of every transmission. This information is really powerful and is something that stats simply can't tell you.

Offline

 

#16 2015-Jan-25 23:22:28

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Re: Packet detection problem in 802.11 reference design

Really appreciate for your timely and excellent suggestions. Log based experiments is really useful.

For future testing, I also want to disable (c.1) and (c.2)(for disable I mean CCA.Busy will not be triggered by (c.1) and (c.2)). I found the following code:
“//LTS correlation thresholds (low NSR, high SNR)
wlan_phy_rx_lts_corr_thresholds(12500, 12500);
//Configure auto-corr pkt det autoCorr_ofdm_cfg(corr_thresh, energy_thresh, min_dur, post_wait)
wlan_phy_rx_pktDet_autoCorr_ofdm_cfg(200, 9, 4, 0x3F);”

Is it possible that I can disable (c.1) and (c.2) from above code? Or how can I disable (c.1) and (c.2)?
Appreciate for your response.

Last edited by Yb2015 (2015-Jan-26 07:15:29)

Offline

 

#17 2015-Jan-26 09:32:06

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Packet detection problem in 802.11 reference design

You can change those macros and effectively prevent the PHY from ever attempting to receive anything. This will disable (c.1) and (c.2), but it will also prevent any receptions. In your experiment, do you need the node to actually receive anything? Or is this node a "deaf" transmit-only node?

Regarding the parameters to those macros,

(1) wlan_phy_rx_lts_corr_thresholds has two arguments that are independently applied depending on what the current RSSI value is. When we built this function we were intuiting that the thresholds may be dependent on what the overall power level is. Upon testing, we learned this feature wasn't necessary and we could keep the same threshold for both regimes. The value itself is 16-bit unsigned integer. You can effectively disable detection of the LTS correlation spikes with an argument of (2^16-1) = 65535. Note: the low and high SNR regimes are defined by the macro call "wlan_phy_rx_lts_corr_config(1023 * PHY_RX_RSSI_SUM_LEN, 350/2);" That's basically defining the "low" SNR regime to be any RSSI in the range [0,1023] (i.e. every possible RSSI value). This makes the second argument to wlan_phy_rx_lts_corr_thresholds irrelevant.

(2) The first argument of wlan_phy_rx_pktDet_autoCorr_ofdm_cfg is a 8-bit correlation threshold and the second argument is a 14-bit minimum energy threshold. Calling "wlan_phy_rx_pktDet_autoCorr_ofdm_cfg(255, 16384, 4, 0x3F);" will disable all packet detection. If you do this, then you don't even have to change the LTS threshold from (1) because the receiver will never get that far.


The above solutions will disable (c.1) and (c.2) at the cost of never being able to receive anything. Disabling (c.1) and (c.2) while still being able to receive is trickier. When the PHY is actively receiving and decoding a frame, the software in CPU_LOW is actively polling the status of the PHY and doing things like creating an ACK packet (if applicable). Specifically, CPU_LOW uses the wlan_mac_dcf_hw_rx_finish macro to wait for the PHY to declare the incoming frame as FCS good or FCS bad. During this time, the node will not transmit a new MPDU from CPU_HIGH regardless of CCA because CPU_LOW is only working on the ongoing reception and not checking the mailbox IPC from CPU_HIGH to see if a new frame should be transmitted. The normal operation of the 802.11 MAC and PHY is half-duplex, so CPU_LOW does not bother dealing with transmissions while receiving. To change this, you'd need to have CPU_LOW alternate between polling the reception status of the PHY and also polling the mailbox from CPU_HIGH to see if there is something new to send. The risk of doing this is that CPU_LOW will have a tougher time hitting the SIFS requirement prior to ACK transmission if it is stuck processing a message from CPU_HIGH at an inopportune time.

Additionally, you have to deal with the case that a transmission is currently backing off while you receive a frame. At the moment, the CCA signal feeding the DCF hardware core is a big OR logic block from all of the CCA sources. Two of these sources are (c.1) and (c.2). You can make a hardware change and add a register to act as a mask to the inputs of this OR block. From software you could then disable (c.1) and (c.2). This would allow the DCF hardware core to completely ignore the ongoing reception and flip the radio into Tx mode and send the packet after the backoff has completed.

I think those are the only two changes you would need to make to disable (c.1) and (c.2) while retaining the ability to receive except for the case where the interruption of a reception with a transmission causing that reception to fail.

Offline

 

#18 2015-Jan-26 09:40:04

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Packet detection problem in 802.11 reference design

Actually, it looks like murphpo already built in the ability to disable (c.1) and (c.2) feeding the DCF core. You don't need to make a hardware change.

Code:

REG_SET_BITS(WLAN_MAC_REG_CONTROL, (WLAN_MAC_CTRL_MASK_CCA_IGNORE_PHY_CS | WLAN_MAC_CTRL_MASK_CCA_IGNORE_TX_BUSY | WLAN_MAC_CTRL_MASK_CCA_IGNORE_NAV) )

Those 3 control bits en/disable the Rx PHY, Tx PHY and NAV from affecting the DCF's notion of "busy". This should cover the case of ignoring CCA from a reception that occurs while a transmission is backing off.

Offline

 

#19 2015-Jan-29 08:14:42

Yb2015
Member
Registered: 2015-Jan-13
Posts: 15

Re: Packet detection problem in 802.11 reference design

Really appreciate for the help from you guys.
Great job!

Offline

 

Board footer