WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2016-Feb-22 20:04:47

zhimeng
Member
Registered: 2015-Sep-30
Posts: 47

fpga functions in wlan_mac_dcf.c

HI, we are currently changing the frame_transmit() function in wlan_mac_dcf.c
We want to postpone the transmission of a packet within a fixed timing. For example, a frame can only be transmitted at k*period, where k is an integer.
The current method we are using is to use the wlan_mac_dcf_hw_start_backoff(), to postpone the transmission to the wanted timing position.

We have tested the idea with nomac, the performance is verified using the oscilloscope.
For the mac_dcf, when we don't attach the antennas, the result is right.
When we attach the antennas, the timing is not exactly as we expected.

We think that this is due to the noises in the ISM band, which will freeze the backoff counting timer, according to the standard.

We don't have related experience with the FPGA programming,
and just have some guesses about the wlan_mac_dcf_hw_start_backoff(), but we are not sure.
Does this wlan_mac_dcf_hw_start_backoff() block the frame_transmit(), or it just blocks the related FPGA functions using the Xil_Out32()?
Do you have some suggestions for this purpose?

Offline

 

#2 2016-Feb-23 13:49:11

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

Re: fpga functions in wlan_mac_dcf.c

In the normal DCF the backoff counter decrements only when the medium has been idle for >DIFS. When the medium becomes busy the backoff counter holds its value until the medium is again idle for >DIFS. This is consistent with the behavior you observe, where the actual delay before Tx varies with medium activity.

What is your protocol for timing transmissions in the presence of other medium activity? This will determine the best way to implement your Tx state machine using the existing wlan_mac_hw core.

Offline

 

#3 2016-Feb-23 14:22:17

zhimeng
Member
Registered: 2015-Sep-30
Posts: 47

Re: fpga functions in wlan_mac_dcf.c

Hi.
We want to delay the data packets to be periodic, for some additional information.
For example, the data packets can only be sent at only 100ms, 200ms, 300ms, ....
If a packet comes at 58ms, we hope that we can delay the packet to send this at 100ms.

We want a protocol compliant with the standard. If the channel is busy at 100ms, the packet will be delayed using the standard dcf algorithm.

The current problem is that, the packet now comes at 58ms, and we hope to send at 100ms, if possible.
However we don't know the future condition of the ism band. If we just use the hw_start_backoff() function to delay to 42ms later, the future noises in the channel will further postpone the transmission.

I am not quite sure about the question '
What is your protocol for timing transmissions in the presence of other medium activity?' Could you shed some light onto this?

Offline

 

#4 2016-Feb-23 17:01:07

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

Re: fpga functions in wlan_mac_dcf.c

Rather than use the backoff timer to "schedule" a future transmission, an alternative approach might be to defer submitting new MPDUs to the MAC Config Core until they are in an allowed time window (around 100ms, 200ms, 300ms, etc.).

These two calls actually start the MAC Config Core and will lead to a transmission. You could change that to something like

Code:

while(should_I_transmit() != 1){
    //Continue checking for receptions and do not advance
    //the transmit state until we are allowed to
    wlan_mac_low_poll_frame_rx();
}

// Now we are allowed to transmit

// Submit the MPDU for transmission - this starts the MAC hardware's MPDU Tx state machine
wlan_mac_tx_ctrl_A_start(1);
wlan_mac_tx_ctrl_A_start(0);

You can write the "should_I_transmit()" function to return 1 in windows where transmissions are allowed and return 0 otherwise. The get_system_time_usec() function will be useful in that implementation. It returns a 64-bit count of the number of microseconds that have elapsed since the node is booted.

Offline

 

#5 2016-Feb-23 19:36:05

zhimeng
Member
Registered: 2015-Sep-30
Posts: 47

Re: fpga functions in wlan_mac_dcf.c

This solution is amazing.
You mean that in the frame_transmit() in mac_low_dcf.c
I should have something like this

frame_transmit()
{

    while(The timing is not wanted){
        wlan_mac_low_poll_frame_rx();// to receive the packet, otherwise, some packets might be missing during the consistent polling
                                                         // similar to the while loop in the main() in dcf_low
    }

   // now the timing is good
   wlan_mac_tx_ctrl_A_start(1);
   wlan_mac_tx_ctrl_A_start(0);
}

One more question. I am currently using the reference design 1.0.0 instead of 1.3.0 or 1.4.0
In the warp 1.0.0, I think the wlan_mac_MPDU_tx_start(1) and wlan_mac_MPDU_tx_start(0) have the same goals.
I will try this. If not working well, I will move the code to the later version.

This is really helpful!

Offline

 

#6 2016-Feb-23 20:45:18

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

Re: fpga functions in wlan_mac_dcf.c

You should definitely upgrade to the latest design (currently v1.4). There are *many* performance improvements and bug fixes since v1.0 - see the changelog for details. Chris has a good suggestion of using the System Time to delay a Tx. But we only added System Time in v1.4. This alone is worth the upgrade for your application.

Offline

 

Board footer