WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2014-Oct-23 08:31:12

Tomi
Member
Registered: 2014-Oct-17
Posts: 58

wlan_mac_low_dcf and wlan_mac_low_nomac

(1) What is the difference between wlan_mac_low_dcf and wlan_mac_low_nomac?
    Today I applied STA.elf for CPU high and DCF.elf for CUP low, then I get following log entries:
     4,169 of Type TX
     5,507 of Type TX_LOW
     5,507 of Type TX_LOW_LTG
    However, when applied STA.elf for CPU high and NOMAC.elf for CUP low, the entries are:
     5,726 of Type TX
         0 of Type TX_LOW
         0 of Type TX_LOW_LTG
    It seems no TX_LOW and TX_LOW_LTG are created in NOMAC mode. As TX_LOW and TX_LOW_LTG records the actual PHY transmission, does it mean there is no actual PHY transmission when using NOMAC?

(2) In wlan_mac_low_dcf > wlan_mac_dcf.c
    There is a parameter mpdu_info->params.mac.num_tx_max, this indicates the maximum number of transmission attempts (including first transmission). I can find the corresponding typedef struct in wlan_mac_misc_util.h, however, I cannot its exact value in all the .h/.c files of wlan_mac_low_dcf. Where can I find the exact value of num_tx_max? I want to change its value.

Thanks.

Last edited by Tomi (2014-Oct-23 08:31:22)

Offline

 

#2 2014-Oct-23 09:22:27

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

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

(1) Thanks for finding this. This is a bug in the .96 Reference Design that will be fixed in the next release. Thankfully, it is a one line change to wlan_mac_nomac.c to fix this, so you don't need to wait for the next release. Specifically, in frame_transmit, add the following line of code anywhere in the top of that function after "mpdu_info" is assigned (e.g. Line 187):

Code:

mpdu_info->num_tx = 1;

With NOMAC, every MPDU transmission for CPU_HIGH results in exactly 1 low transmission. In the DCF, this value can be between 1 and 7 if the frame required retransmissions. By neglecting to set this to 1 in NOMAC, the existing code incorrectly informed CPU_HIGH that this MPDU transmissions took 0 transmissions. While clearly bogus, CPU_HIGH dutifully used this value to construct 0 TX_LOW log entries. Your packets were being transmitted, its just that the TX_LOW log entries were not created.

(2) num_tx_max is set by CPU_HIGH for each MPDU that it wants to transmit. For example, for a multicast transmission like a beacon, the num_tx_max is set to 1. For unicast transmissions, this value is typically set to 7. For example, the AP sets the default values for various transmissions parameters here. The #define for MAX_NUM_TX is set here.

Offline

 

#3 2014-Oct-23 09:52:26

Tomi
Member
Registered: 2014-Oct-17
Posts: 58

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

Thanks for your information. Now I added the code into fram_transmit and got TX_LOW and TX_LOW_LTG entries.

I think the difference between wlan_mac_low_dcf and wlan_mac_low_nomac is:
> there is no backoff mechanism in wlan_mac_low_nomac
> there is no re-transmission mechanism in wlan_mac_low_nomac
> there is no ACK mechanism in wlan_mac_low_nomac
Is my understanding correct?

So if there are two NOMAC stations, they will transmit the packet when they get one from the upper layer. Their packets may collide in the air.

How the transmission time is decided in NOMAC, as there is no SIFS, DIFS and contention window?

Thanks.

Last edited by Tomi (2014-Oct-23 09:52:42)

Offline

 

#4 2014-Oct-23 10:01:01

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

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

So if there are two NOMAC stations, they will transmit the packet when they get one from the upper layer. Their packets may collide in the air.

How the transmission time is decided in NOMAC, as there is no SIFS, DIFS and contention window?

The nomac code literally implements no medium access control - packets are transmitted once, immediately when they are received from the upper layer. This is not a good MAC design. As you note it will frequently cause collisions which, since there are no re-transmissions, means lots of lost packets. We built nomac as an example project to demonstrate the minimum code to interact with the the upper-level MACs and the Tx/Rx PHYs. Nomac is a great starting point for custom MAC implementations; it is not a good MAC design on its own.

Offline

 

#5 2014-Oct-23 10:20:56

Tomi
Member
Registered: 2014-Oct-17
Posts: 58

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

Thanks for your reply. I want to make two nodes STA1 and STA2 always transmit simultaneously, e.g. I wanna two nodes' packets always collide. For this purpose, I think NOMAC is better than DCF, because I can implement custom MAC on it.

I analyzed the PHY transmission time of each NOMAC STA, and found that usually the Tx time difference between two packets are 680ns, but sometimes it may be a larger value, for example 2580ns or 1814ns. I think this is due to the STA NOMAC doesn't receive a packet from the upper layer timely. I applied "sta1_ltg_id = n_sta_1.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 1400, 0, 0), auto_start=True)" to make sure a fully backlogged (0 usec between new pkts) traffic, then how this could happen? I thought in this situation, the Tx timestamp diff for all the packets should be the same.

index,Tx timestamp,Tx timestamp diff
0,      2114454,            680
1,      2115134,            2580   
2,      2117714,            680   
3,      2118394,            681   
4,      2119075,            680   
5,      2119755,            680   
6,      2120435,            680   
7,      2121115,            680   
8,      2121795,            681   
9,      2122476,            680   
10,    2123156,             680   
11,    2123836,             680   
12,    2124516,             680   
13,    2125196,             681   
14,    2125877,             1814

Last edited by Tomi (2014-Oct-23 10:22:28)

Offline

 

#6 2014-Oct-23 11:19:16

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

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

The minimum inter-transmission time will be determined by the actual duration of the transmission plus the processing overhead in CPU high and low. For a 1400 byte LTG payload the over-the-air MPDU will be 1428 bytes long (24 byte MAC header, 8 byte LLC header, 12 byte LTG header, 1380 byte random payload, 4 byte FCS). The Tx duration for a given payload depends on the PHY rate; see IEEE 802.11-2012 section 18.4.3 or calc_tx_time() in wlan_exp.log.util.

Also, keep in mind that the PHY is half-duplex. Transmissions defer to incoming receptions, even in nomac. If your node is receiving packets the inter-Tx-time will reflect the time the node spent receiving and processing Rx packets.

Offline

 

#7 2014-Oct-23 21:09:35

Tomi
Member
Registered: 2014-Oct-17
Posts: 58

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

Thanks for your reply.

(1) I checked the TX and RX activities of each STAs:
STA1
index         Timestamp   Pkt_length   Pkt_type    timestamp diff
1    TX        2155250      1400         LTG             Tx9-Tx1=6945
2    RX         2156975      1400         LTG        Rx3-Rx2=680
3    RX        2157655      1400         LTG        Rx4-Rx3=680
4    RX        2158335      1400         LTG        Rx5-Rx4=681
5    RX        2159016      1400         LTG        Rx6-Rx5=680
6    RX        2159696      1400         LTG        Rx7-Rx6=680
7    RX        2160376      1400         LTG        Rx8-Rx7=680
8    RX        2161056      1400         LTG           
9    TX        2162195      1400         LTG        Tx3-Tx2=733
10    TX        2162928      1400         LTG        Tx4-Tx3=709
11    TX        2163637      1400         LTG        Tx5-Tx4=716
12    TX        2164353      1400          LTG

For STA1, it seems that the transmission is postponed due to continuous Rx. AP generates and transmits some LTG traffic continuously, without giving any transmission chance to the STA.

STA2
index         Timestamp   Pkt_length   Pkt_type    Tx timestamp diff
1    RX      2150421            1400            LTG        Rx9-Rx1=11803
2    TX      2156950         1400         LTG           Tx2-Tx1=680
3    TX        2157630       1400          LTG          Tx3-Tx2=681
4       TX        2158311       1400         LTG          Tx4-Tx3=680
5       TX        2158991       1400         LTG          Tx5-Tx4=680
6       TX        2159671       1400         LTG          Tx6-Tx5=680
7       TX        2160351       1400         LTG          Tx7-Tx6=680
8       TX        2161031       1400         LTG          Tx8-Tx7=23226
9    RX        2162224    1400            LTG
10    TX        2184257    1400            LTG

For STA2, it seems that the STAs generates and transmits some LTG traffic continuously, without giving any transmission chance to the AP.

As you mentioned, NOMAC PHY is half-duplex. I think the Tx/Rx activities should be "Tx Rx Tx Rx Tx Rx Tx Rx...", rather than "Rx Rx Rx Rx Rx Rx Tx"  or "Rx Tx Tx Tx Tx Tx Tx". How could current situation happen?

(2) I applied
>n_sta_1.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 1400, 0, 0), auto_start=True)
>n_sta_2.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 1400, 0, 0), auto_start=True)
to define to LTG payload of STA1/2.
n_ap.wlan_mac_address here means the destination MAC address. I checked the RX_OFDM entry, and found that the LTG payload of AP is also 1400.

Then I changed the above sentences to >n_sta_1.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 100, 0, 0), auto_start=True)
>n_sta_2.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 100, 0, 0), auto_start=True)
Then the LTG payload of STA1/2 is changed to 100.
However, the LTG payload of AP is also changed to 100.

It seems that n_sta_1.ltg_configure(wlan_exp_ltg.FlowConfigCBR()) function will not only change the LTG payload of STA, but also the one of AP. I thought it will only change the LTG payload of STA. If we want to change the LTG payload of AP, we should use n_ap.ltg_configure(wlan_exp_ltg.FlowConfigCBR()) function. I'm a little bit confused.

Thanks.

Last edited by Tomi (2014-Oct-23 23:01:31)

Offline

 

#8 2014-Oct-24 13:26:13

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

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

As you mentioned, NOMAC PHY is half-duplex. I think the Tx/Rx activities should be "Tx Rx Tx Rx Tx Rx Tx Rx...", rather than "Rx Rx Rx Rx Rx Rx Tx"  or "Rx Tx Tx Tx Tx Tx Tx". How could current situation happen?

Assuring a fair division of Tx and Rx between nodes would require a MAC protocol. Two nomac nodes sending each other fully-backlogged traffic have zero coordination. There will be many collisions at both nodes. On the rare chance that one node begins transmitting slightly before the other, the early Tx might get through. The purpose of a MAC protocol is to coordinate behaviors of multiple nodes all contending for the same medium. The 802.11 DCF is a good MAC protocol. Nomac is a good platform for building your own protocol. But by itself nomac will not do a good job dividing medium time fairly.

Can you clarify- what is your hardware setup? 2 nodes (AP + STA) or 3 nodes (AP + STA1 + STA2)?

(2) I applied
>n_sta_1.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 1400, 0, 0), auto_start=True)
>n_sta_2.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 1400, 0, 0), auto_start=True)
to define to LTG payload of STA1/2.
n_ap.wlan_mac_address here means the destination MAC address. I checked the RX_OFDM entry, and found that the LTG payload of AP is also 1400.

This will start one traffic flows at each STA node, both addressed to the AP node. The AP log will have RX_OFDM entries from STA1 and STA2. The STA logs will both have RX_OFDM entries from the other STA.

Then I changed the above sentences to >n_sta_1.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 100, 0, 0), auto_start=True)
>n_sta_2.ltg_configure(wlan_exp_ltg.FlowConfigCBR(n_ap.wlan_mac_address, 100, 0, 0), auto_start=True)
Then the LTG payload of STA1/2 is changed to 100.
However, the LTG payload of AP is also changed to 100.

Do you mean the AP log showed RX_OFDM entries with length 100? This is what you expect when you change the LTG payload size at the transmitting nodes.

Offline

 

#9 2014-Oct-25 08:01:17

Tomi
Member
Registered: 2014-Oct-17
Posts: 58

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

Thanks for your detailed reply. Your explanation made me understand current testing results.

【Environment】
   WARP STA1 --------> WARP AP <-------- WARP STA2 (STA1/STA2 are using channel 10.
                                                                                  Their TX data are captured by python.)

I changed the two STA's contention window into 0, in order to make them transmit simultaneously within-slot(9μs). The actual testing result is that sometimes they can transmit simultaneously within-slot, sometimes can not.

With you explanation, I analyzed the log data, and found that all the STA can receive each other's packets. If one STA is receiving packets from the other STA, then its transmission action will be postponed by receiving and processing Rx packets. So the two STA cannot always transmit simultaneously.

How can I eliminate the impact of Rx? I want to forbid the STA from receiving each other's packets, e.g. STA will only receive packets from AP.

Thanks.

Last edited by Tomi (2014-Oct-25 08:02:13)

Offline

 

#10 2014-Oct-27 09:17:57

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

Re: wlan_mac_low_dcf and wlan_mac_low_nomac

The only way for you to have the STA receive packets from the AP but not from the other STA is to have them physically hidden from each other (i.e. the classic hidden node problem). You want (1) STA1 be in carrier sensing (CS) range of the AP, (2) STA2 in CS range of the AP, and (3) STA1 and STA2 not in CS range of one another. Those three pieces together are going to create lots of collisions at the AP, which I think is the goal. There are a few ways to do this:

1) If you don't need actual over-the-air effects, you could use RF cabling and an RF power splitter to create the hidden node topology. You could set it up like this appendix to the multi-flow application note. You would want to put additional attenuation on ports 1 and 2 of the splitter and probably remove the attenuation from the S port of the splitter. This would allow both the links to the AP to have the same SNR but would hugely reduce the link power between the two STA devices.

2) If you need over-the-air effects, the best case would be to use a channel emulator. I've used Azimuth's channel emulators pretty extensively during my PhD work. With this, you could not only create a truly hidden system where STA1/STA2 don't see each other, but the links to the AP could have genuine multi-path effects like those that occur over-the-air.

3) If you don't have access to a channel emulator and you do need over-the-air effects, then you'll have to actually go over-the-air and construct the hidden topology. Basically you want a linear topology where STA1 and STA2 are far apart from one another yet close to the AP. Most indoor laboratory environments aren't large enough to be able to get STA1/STA2 far enough apart from one another so they are hidden. In this case, you could lower their transmit powers to effectively increase the pathloss they see. Or you could add an attenuator in-between the radio's SMA port and the antenna. Doing this will also lower Rx sensitivity, however.

Offline

 

Board footer