WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2015-Mar-16 02:51:26

RAJA
Member
Registered: 2014-Aug-25
Posts: 24

Backoff Algorithm

Hi,

I am new with the board and I am trying to update different backoff algorithms on the 802.11 Reference Design through Xiling to test their performance, but on the wlan_mac_low.c I found just this related with backoff: @brief Force reset backoff counter in MAC hardware.

Could someone help me with some lights on how to modify the backoff algorithm?

Thanks,
RAJA

Offline

 

#2 2015-Mar-16 08:40:34

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

Re: Backoff Algorithm

The MAC is split between software and hardware. Many elements of the DCF state machine, like the backoff algorithm, require very precise timing. These precise-timing events can't be implemented fully in C on the MicroBlaze. Instead, these behaviors are implemented as a dedicated peripheral core. The implementation is in Xilinx System Generator, so you can open the design and modify it according to your needs.

Everything that isn't as time critical is implemented in software. The DCF implementation is located here.

I'd recommend starting with the DCF code first since it reads pretty intuitively and will better line up with your understanding of the DCF algorithm. Whenever the code calls a macro that maps to a register in the MAC hardware core, you can open that design and see what the hardware is doing.

Offline

 

#3 2015-Mar-17 01:41:12

RAJA
Member
Registered: 2014-Aug-25
Posts: 24

Re: Backoff Algorithm

Thanks

Offline

 

#4 2015-Apr-24 01:52:41

RAJA
Member
Registered: 2014-Aug-25
Posts: 24

Re: Backoff Algorithm

Hi,

thank you for the information that you gave me, it was really helpful. However, I am still struggle with understanding how exactly you set the range of the cw.

I have gone through the wlan_mac_dcf.c and I can't understand this function:

wlan_mac_low_get_cw_exp_min(); and wlan_mac_low_get_cw_exp_max();

Which I think is the function that controls the CW range, where are them?

In addition, at the moment of generate the random value, does the parameter cw_exp contains the present value of the cw?  where is it set?


1140                n_slots = ((unsigned int)rand() >> (32-(cw_exp+1)));


Thanks,

Offline

 

#5 2015-Apr-24 10:09:06

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

Re: Backoff Algorithm

The wlan_mac_low_get_cw_exp_min() and wlan_mac_low_get_cw_exp_max() functions are just getters for variables in the MAC Low Framework called cw_exp_min and cw_exp_max. These values default to 4 and 10 respectively (i.e. [0,15] and [0,1023] contention windows), but can be overwritten via wlan_exp with the set_cw_exp_min and set_cw_exp_max commands.

Yes, cw_exp represents the current contention window. cw_exp is a global variable in the DCF code. The update_cw() function modifies it.

Offline

 

#6 2015-Apr-26 01:43:46

RAJA
Member
Registered: 2014-Aug-25
Posts: 24

Re: Backoff Algorithm

Hi,

I tried running those commands on the python shell, but it did not recognize them.  Should I initialize something particular before running that command, or it is enough to see the environment described in the Experiment Framework Setup?

Offline

 

#7 2015-Apr-26 13:13:59

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

Re: Backoff Algorithm

wlan_mac_low_get_cw_exp_min() and wlan_mac_low_get_cw_exp_max() are functions in the C code for MAC low. They are not part of the wlan_exp Python package.
Edit: See Erik's post below for the corresponding wlan_exp node commands.

Offline

 

#8 2015-Apr-27 08:57:16

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Backoff Algorithm

The set_cw_exp_min() and set_cw_exp_max() functions are node commands so you must have an initialized node object:  node.set_cw_exp_min(4)   or   node.set_cw_exp_max(10) 

Use the interactive node example to initialize the node if you just want to try out the commands.  If you still cannot get the commands to work, then please make sure you are using the latest version of the reference design.

Offline

 

#9 2015-Apr-28 20:56:21

RAJA
Member
Registered: 2014-Aug-25
Posts: 24

Re: Backoff Algorithm

Thanks

Offline

 

#10 2015-Apr-28 21:05:05

RAJA
Member
Registered: 2014-Aug-25
Posts: 24

Re: Backoff Algorithm

Hi,

I want to test the impact of changing the contention window range, so I would like to know which is the bandwidth of the nodes in order to saturated it and make the CW range grow.

I also wanted to record the collisions, it is any log entry which can provide this inf, I could not find any.

I highly appreciate your help.

Offline

 

#11 2015-Apr-28 23:33:29

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

Re: Backoff Algorithm

I want to test the impact of changing the contention window range, so I would like to know which is the bandwidth of the nodes in order to saturated it and make the CW range grow.

You can saturate a link with a fully-backlogged local-traffic generator with the experiments framework. Thethroughput example uses this approach to measure the MAC/PHY throughput of a link.

I also wanted to record the collisions, it is any log entry which can provide this inf, I could not find any.

No. The node does not know when a packet loss is due to a collision. You can infer a collision in post processing of logs by looking for overlapping transmissions from multiple nodes.

Offline

 

#12 2015-Apr-29 03:14:09

RAJA
Member
Registered: 2014-Aug-25
Posts: 24

Re: Backoff Algorithm

Hi,

I updated the .bin file on the SD card with the one provided in the Bitstream_Reference for the latest referent design (v1.2.0).  However, I get this message when I use the wlan_exp framework:

WLAN Exp Version Mismatch:
    During initialization 'None' returned version 1.0.0     Current wlan_exp package version: 1.2.0 WARNING: WLAN Exp Version Mismat
ch:
    During initialization 'None' returned version 1.0.0     Current wlan_exp package version: 1.2.0  (newer)
        (C:\RAJA\Mango_802.11_RefDes_v1.2.0\Python_Reference\wlan_exp\version.pyc)

Please update the C code on the node to the proper WLAN Exp version.

Does this mean that I updated wrongly the SD card?

Thanks.

Offline

 

#13 2015-Apr-29 08:58:53

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

Re: Backoff Algorithm

Your FPGA configuration and wlan_exp installations must be the same version. We include matching versions of the .bit/bin files and Pyhon_Reference folders in every reference design release.

Offline

 

#14 2015-Apr-29 09:08:02

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Backoff Algorithm

Yes, this means that the code on the SD card is version 1.0.0 while the WLAN Exp version is 1.2.0.

You can always check the UART output which will print the WLAN Exp version:

Code:

WARPNet v2.1.0 WLAN EXP v1.2.0 (compiled Jan 14 2015 11:09:39)

Offline

 

Board footer