WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2009-Mar-20 04:18:41

domenique
Member
Registered: 2009-Jan-07
Posts: 47

Parameters

Hi,

I'm wondering about some parameters in the current ref. Design.

a) What is function mimo_ofdmRx_setPktDetDly() used for? A variable pktDly is set to 58, but the function uses a hard coded value of 50 in the warpphy.c? Are 50usec or 50 samples meant, and why is a delay used / necessary?

b) The DIFS period is set by the function ofdm_pktDetector_mimo_WriteReg_csma_difsPeriod() to 1000. This corresponds to 1000samples / 40Msamples/s = 25usec. As DIFS = SIFS + 2*slotTime, this corresponds to a SIFS of only 7usec with a slotTime of 9usec. Is there any reason for this choice? Does it make sense to increase the DIFS period to the standard of 34usec (1360 samples) ?
In the csmaMac ACKs are send immediately after the data packet reception, but they should be send after a SIFS. Is this not done for convenience, or is there any reason?
When including additional waiting times, like a SIFS before sending an ACK, is it preferable using a timer for this purpose or just a usleep()?

c) The contention window has a range from CWmin = 7 to CWmax = 511 time slots. The function randNum(N) generates a random value between [0, 2^N -1] according to the description. But as I understand the function it returns values between [0, 2^(N+3) -1], and therefore for N = 0 [0, CWmin=7] and for N >5 [0, CWmax=511]. I this right? I think in the standard the values are CWmin = 31 and CWmax = 1023. Why have these values been choosen, and does it make sense to increase the values to the standard values? Is anything to be said against it?

Last edited by domenique (2009-Mar-20 06:03:30)

Offline

 

#2 2009-Mar-21 12:46:59

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

Re: Parameters

a) This is a "magic" number of sorts. It controls how long the PHY waits after receiving a packet detection event before it begins searching for correlation peaks indicating the arrival of the preamble's long training symbols. The peak search always lasts 254 samples (i.e. if peaks are detected, the rest of the Rx PHY is enabled; if not, the detection is declared false and everything is reset), so this parameter can be used to extend/shorten the time the PHY uses to decide whether a detection event is valid.

b) We borrowed some names from the 802.11 MAC specification, but we do not intend to mimic its behavior exactly. CSMAMAC sends an ACK as quickly as possible; the current DATA->ACK delay is due to processing delay in the Rx and Tx PHY.

c) Good question, and I have no idea. I'll let Chris (he wrote the code) chime in.

Offline

 

#3 2009-Mar-21 17:45:01

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

Re: Parameters

c) The code from here generates uniform values between [0,2^(N+4)-1]. I went ahead and verified this by compiling and running the following code directly on my computer:

Code:

#include <stdio.h>

int main(){
        printf("----Test----\r\n");
        printf("0xFFFFFFFF  >> (32-(0+4)): %d\r\n",(0xFFFFFFFF>>(32-(0+4))));
        printf("0xFFFFFFFF  >> (32-(6+4)): %d\r\n",(0xFFFFFFFF>>(32-(6+4))));
        return 0;
}

Thus, it shows the minimum contention window and then the maximum contention window. It prints:

Code:

----Test----
0xFFFFFFFF  >> (32-(0+4)): 15
0xFFFFFFFF  >> (32-(6+4)): 1023

CWmin = 15 and CWmax = 1023. I believe that 802.11a specifies a minimum contention window of only 15 whereas 802.11b specifies 31.

Offline

 

#4 2009-Mar-22 07:04:14

domenique
Member
Registered: 2009-Jan-07
Posts: 47

Re: Parameters

Thanks, for the answers.

The rand() function returns random values between 0 and the value specified by RAND_MAX in the stdlib.h. In all stdlib.h files I found on my computer RAND_MAX is set to 0x7fff. Therefore I don't really understand how the shift opperation can work in this context. Maybe its just accidentally but I'm not getting any value greater than 7 for N=0 and no value greater 511 for N>5 in the randNum(N) function.
Wouldn't it be better to use the modulo operator, even if it will be slower, to get values in the desired range? Something like:

if(N<6) return ((unsigned int) rand()) % ((32* (2^N) -1);
else return ((unsigned int) rand() % 1023;

Offline

 

#5 2009-Mar-22 10:20:12

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

Re: Parameters

You're totally right. I just checked, and RAND_MAX is indeed 0x7fffffff even for the ppc405 in the FPGA. You can find the definition at [your xilinx directory]/EDK/gnu/powerpc-eabi/[your computer's OS]/powerpc-eabi/include/sys/config.h

Your I think your code would work, but all we need to do is modify the existing code to bit-shift right be one less bit, or

Code:

unsigned int randNum(unsigned int N){	       
	        if(N<6) return ((unsigned int) rand()) >> (32-(N+5));
	        else return ((unsigned int) rand()) >> (32-(11));	       
}

I'll make sure the changes get pushed into the upcoming Reference Design 12, but in the meantime you can just change it locally. Thanks for finding that!

Offline

 

Board footer