WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2016-Aug-23 02:41:54

loho2027
Member
Registered: 2016-Aug-16
Posts: 45

Calculating throughput using C code in 802.11 Reference Design

Hi,

I would like to calculate the throughput (RX and TX) of an AP and display that throughput data periodically. I am wondering if my current approach is correct or not. I want to do this in the C code in 802.11 Reference Design, rather than using the Python framework.

In 'mpdu_rx_process' function in wlan_mac_ap.c, I take the 'length' parameter and add it to total_length, inside the 'if' clause, condition 'sta_associated'. Then periodically I calculate throughput=length*8/period and reset the total_length to 0.

In another thread in this forum, I saw that I have to account for the headers as well?

I believe that the above approach is for the RX of the AP (which, if I understand correctly, is when a STA uploads data to the AP), but how about the TX(STA downloading data)? If I calculate the packets in the 'ethernet_receive' function is that going to be sufficient? Or would I have to go deeper and modify some TX code?

Regards,
loho2027

Offline

 

#2 2016-Aug-23 09:33:13

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

Re: Calculating throughput using C code in 802.11 Reference Design

I am wondering if my current approach is correct or not. I want to do this in the C code in 802.11 Reference Design, rather than using the Python framework.

I would strongly suggest re-thinking this decision. We designed wlan_exp for exactly these kinds of experiments and are confident that wlan_exp interacts with the node without affecting wireless performance. If you modify the C code to calculate and xil_printf() throughput measurements in the Tx/Rx callbacks it is possible you will *change* the throughput due to the extra time your code takes to calculate/print. Integer division is a slow operation; floating point operations are slower (there's no FPU); printing to the UART is even slower.

In another thread in this forum, I saw that I have to account for the headers as well?

It depends on your definition of throughput. The MAC adds 28 bytes (24 byte header + 4 byte FCS) to every data packet. These bytes are modulated at the same rate as the payload. The PHY adds a preamble (320 samples) and PHY header (3 byte SIGNAL, 2 byte SERVICE). The SIGNAL is always 1/2-rate BPSK; the SERVICE is at the payload rate. You have to decide what you mean by "throughput" - application layer (MAC + PHY are overhead), MAC layer (only PHY overhead) or PHY layer (no overhead - all bits in a waveform count).

I believe that the above approach is for the RX of the AP (which, if I understand correctly, is when a STA uploads data to the AP), but how about the TX(STA downloading data)? If I calculate the packets in the 'ethernet_receive' function is that going to be sufficient? Or would I have to go deeper and modify some TX code?

Throughput should only count successfully delivered packets. A packet received with a good FCS should be counted (unless it was a duplicate reception, depending on your throughput definition). A transmitted packet should only count if it was delivered successfully. You should use the same "good packet" condition at both ends of your link for the throughput calculations to be fair.

Offline

 

#3 2016-Aug-23 18:39:19

loho2027
Member
Registered: 2016-Aug-16
Posts: 45

Re: Calculating throughput using C code in 802.11 Reference Design

Is it possible to access the wlan_exp through the C code? Actually I will not be running xil_printf in my final code, I will be sending the throughput data through the Ethernet port (ETH-A) to a program on another computer.

That is why I don't want to use the Python framework, as it requires ETH-B, and that I will need to display the throughput on a program on another computer.

Any suggestions? Is it possible to do this without changing the actual throughput?

Offline

 

#4 2016-Aug-23 22:44:08

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

Re: Calculating throughput using C code in 802.11 Reference Design

That is why I don't want to use the Python framework, as it requires ETH-B, and that I will need to display the throughput on a program on another computer.

I'm sorry, but I really don't understand the constraints you're describing. The wlan_exp framework in the 802.11 Ref Design is intended for exactly this kind of application. It's good for running an experiment (starting/stopping traffic, retrieving statistics from the nodes, calculating performance metrics) and displaying the results on the PC running the wlan_exp Python script. All of the Python-C interaction happens via the ETH B interface to avoid any interference with the wired-wireless bridge using the ETH A interface. We'd like to understand if this architecture is fundamentally incompatible with your experiment's requirements.

Offline

 

#5 2016-Aug-29 19:15:37

loho2027
Member
Registered: 2016-Aug-16
Posts: 45

Re: Calculating throughput using C code in 802.11 Reference Design

Thanks for your comments.

I think that it's okay to have slightly different throughput, as long as relatively to other configurations in the access point (ie. different frequency channel allocations) I can see how each differs.

Anyway, I've taken the code from station_info_print (wlan_mac_station_info.c) and instead of printing using xil_printf, I generate an Ethernet packet containing the information.

Offline

 

#6 2016-Aug-30 10:42:46

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

Re: Calculating throughput using C code in 802.11 Reference Design

I want to strongly re-iterate what murphpo was saying: what you are describing is exactly the purpose of the wlan_exp framework. Calculating throughput in Python is even the goal of two examples. From there, you can visualize the data however you want. Is this not what you mean by you needing "to display the throughput on a program on another computer"? Once the data is in Python you can package and process it however you want, even outside of Python. Some pretty fancy visualizations have been built on top of wlan_exp (e.g. this and this). Finally, you mentioned that you want to compare your results across different variables like different center frequencies. wlan_exp supports controlling the experiment as well as gathering results from it. You can script the entire experiment without having to manually change certain variables and gather results.

loho2027 wrote:

Anyway, I've taken the code from station_info_print (wlan_mac_station_info.c) and instead of printing using xil_printf, I generate an Ethernet packet containing the information.

The get_bss_members() command already pulls the station_info_t structs for each device that is a member of the BSS over ETH_B. The get_station_info_list() function returns every station_info_t struct that the node currently has, including any "promiscuous" data it has picked up on for neighboring networks.

Offline

 

Board footer