WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2017-Jan-22 08:41:21

marco
Member
Registered: 2016-Nov-06
Posts: 21

Measuring network delay (RTT) using WLAN Exp framework

Hello,

I am currently working with 802.11 reference design. There are many examples how to measure throughput using WLAN experiments framework. However, is there a way or an example how to measure network delay (RTT) between two nodes vs. time? Moreover, can the LTG traffic generator generates TCP traffic? Indeed, I need to generate a TCP traffic for my experiments? Thanks.

Offline

 

#2 2017-Jan-23 09:36:16

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

Re: Measuring network delay (RTT) using WLAN Exp framework

marco wrote:

There are many examples how to measure throughput using WLAN experiments framework. However, is there a way or an example how to measure network delay (RTT) between two nodes vs. time?

Using the wlan_exp event log you should be able to calculate what you need. Every transmission is timestamped in the TX_LOW event entry with a "timestamp" field representing the MAC time (in microseconds) at the start of the transmission. The same goes for the RX_OFDM event entries on the receive side. Using these you should be able to measure RTT for packets that you identify in the log.

marco wrote:

Moreover, can the LTG traffic generator generates TCP traffic? Indeed, I need to generate a TCP traffic for my experiments?

No, the TCP is not supported by the LTG framework. If you need to use TCP, your best bet is to use Ethernet bridging through the Eth A port. You can start a TCP connection between laptops connected to WARP kits. Note: You can still use the wlan_exp logging framework even if you aren't using LTGs. So the above discussion about timestamps still applied.

Offline

 

#3 2017-Jan-24 02:37:36

marco
Member
Registered: 2016-Nov-06
Posts: 21

Re: Measuring network delay (RTT) using WLAN Exp framework

Many thanks. Can you provide me an example or documentation how to use the wlan_exp logging framework without using LTGs?

Offline

 

#4 2017-Jan-24 08:05:21

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

Re: Measuring network delay (RTT) using WLAN Exp framework

LTGs and logging are independent features of the 802.11 ref design. You can disable LTGs in any of our logging examples by removing the 'node.ltg_...' method calls.

Offline

 

#5 2017-Jan-24 11:11:38

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

Re: Measuring network delay (RTT) using WLAN Exp framework

Murphpo's right -- any use of the log is independent of `node.ltg_...` calls. Our Continuous Log Capture Example is a good reference for this. It continually pulls the Tx/Rx log events from an AP node without any LTGs. That's the script that I use before every release to generate the "ap_one_node_capture.hdf5" sample data. That sample data is a TCP speedtest from my iPhone connected to our AP design.

Offline

 

#6 2017-Jan-26 07:53:51

marco
Member
Registered: 2016-Nov-06
Posts: 21

Re: Measuring network delay (RTT) using WLAN Exp framework

Thank you for your clarification. Something still not clear in my mind. If we aim to measure the delay (RTT), Every transmission is timestamped in the TX_LOW event entry at the start of the transmission and we have the same for the RX_OFDM event entries on the receive side. But, how we can know that the timestamp in the receive side correspond for the same transmitted packet? Another issue, if we take the difference between the RX_OFDM timestamp and the TX_LOW  timestamp, this is only one-way delay and not the round trip delay.

Considering the use of TCP protocol, if possible can you provide me with the name of any software traffic generator that is suitable for use with WARP boards and can generate different traffic patterns and send them with TCP protocol using WARP devices?

Thanks.

Offline

 

#7 2017-Jan-26 09:58:39

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

Re: Measuring network delay (RTT) using WLAN Exp framework

You'll need to be more specific about what you're trying to measure.

Do you want the round trip time for a DATA-ACK exchange? You can compute this from one node's log file, by comparing the TX_START of the DATA and RX_START of the ACK. You can align the DATA Tx and ACK Rx entries by filtering the Tx entries for the RECEIVED_RESPONSE flag. If a TX_LOW has RECEIVED_RESPONSE=1, there must be a corresponding RX_OFDM entry for the response (ACK).

However this measurement will be (mostly) deterministic, composed of:
Waveform Tx time - depends on the packet length and Tx rate
Propagation time - depends on node separation
SIFS duration - Fixed at 16 usec
Propagation time
RX_START delay - Fixed at ~25 usec

You can pre-compute every part of this RTT time except the propagation time. But the propagation time will be small relative to the other components. And given the best-case temporal resolution of 1 sample period (50 nsec for 20 MHz bandwidth waveforms) and the speed of light (~1 ft / nsec), the propagation time is usually negligible in this RTT calculation.

Considering the use of TCP protocol, if possible can you provide me with the name of any software traffic generator that is suitable for use with WARP boards and can generate different traffic patterns and send them with TCP protocol using WARP devices?

iperf is a good option. You can run iperf on two PCs connected via the ETH A ports on the WARP v3 802.11 nodes. The 802.11 link will act as a wired-wireless bridge for the PCs.

Offline

 

#8 2017-Jan-27 03:06:47

marco
Member
Registered: 2016-Nov-06
Posts: 21

Re: Measuring network delay (RTT) using WLAN Exp framework

I tried to align the DATA Tx and ACK Rx entries. I don't know why there is a mismatch between the number of DATA Tx and ACK Rx (there is more ACK than DATA Tx). Here is the portion  of the code that I used to do the filtering.

Code:

# Get TX_LOW entry constants
TX_CONSTS = log_util.get_entry_constants('TX_LOW')

# Get RX_OFDM entry constants
RX_CONSTS = log_util.get_entry_constants('RX_OFDM')

# Filtering the Tx entries for the RECEIVED_RESPONSE flag
tx_idx = (((tx['flags'] & TX_CONSTS.flags.RECEIVED_RESPONSE) == 1) &
                  ((tx['pkt_type'] == TX_CONSTS.pkt_type.DATA) | 
                   (tx['pkt_type'] == TX_CONSTS.pkt_type.QOSDATA) |
                   (tx['pkt_type'] == TX_CONSTS.pkt_type.NULLDATA)))
				   

tx_data = tx[tx_idx]

# Filtering the Rx entries for ACK packets

rx_idx      = (((rx['flags'] & RX_CONSTS.flags.DUPLICATE) == 0) &
                   ((rx['flags'] & RX_CONSTS.flags.FCS_GOOD) != 0) & 
                    (rx['pkt_type'] == RX_CONSTS.pkt_type.ACK))
rx_ack = rx[rx_idx]
                     

if (len(tx_data) == 0):
    print("WARNING:  No packets sent.")
	
if (len(rx_ack) == 0):
    print("WARNING:  No ack received.")

# Calculate Round Trip Time
timestamp_data = tx_data['timestamp']
timestamp_ack = rx_ack['timestamp']

data = timestamp_data.astype('int64') / 1.0E6

ack = timestamp_ack.astype('int64') / 1.0E6

delay = data - ack

Offline

 

#9 2017-Jan-27 07:50:37

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

Re: Measuring network delay (RTT) using WLAN Exp framework

One possibility is that the conditions for tx_idx are excluding unicast management packets. These packets will be present in AP Tx log (Probe Response, Association Response etc.) and STA Tx log (Association Request, etc.) if your experiment included the association handshake, and the receiving node will send normal ACKs for these packets. Try removing the 'pkt_type' conditions for 'tx_idx'.

Offline

 

#10 2017-Jan-27 08:26:51

marco
Member
Registered: 2016-Nov-06
Posts: 21

Re: Measuring network delay (RTT) using WLAN Exp framework

I removed the 'pkt_type' conditions for 'tx_idx'. But, still there are more ACKs than Tx. By the way, I used only one log file to measure the RTT.

Offline

 

#11 2017-Jan-27 09:33:36

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

Re: Measuring network delay (RTT) using WLAN Exp framework

The rx_idx definition you are using will include any ACK reception -- even those meant for different devices that are overheard on your channel. Try adding an address check to the definition of rx_idx:

Code:

rx_idx      = ( ((rx['addr1'] == node.wlan_mac_address) ) &
                 (rx['flags'] & RX_CONSTS.flags.FCS_GOOD) != 0) & 
                 (rx['pkt_type'] == RX_CONSTS.pkt_type.ACK) )

where "node" is the node object for whichever kit you read the log from. That will filter out any ACKs that weren't responses to your transmissions.

Another thing to watch out for is the timing on when you pull the log. You could run into an edge condition where the log contains an ACK Rx as its last entry and no corresponding Tx because you read the log before the TX_LOW was written. This is a narrow race, so you probably won't see it. But if it seems that your number of ACK receptions is 1 larger than your number of Tx, this could be the problem. In that case I'd just throw away the last Rx ACK entry since we did not get the corresponding TX_LOW recorded in time.

Offline

 

#12 2017-Jan-27 11:07:54

marco
Member
Registered: 2016-Nov-06
Posts: 21

Re: Measuring network delay (RTT) using WLAN Exp framework

Your tips are working perfectly! Thank you.

Offline

 

#13 2018-Aug-30 14:02:53

TIM
Member
Registered: 2018-Jun-28
Posts: 11

Re: Measuring network delay (RTT) using WLAN Exp framework

murphpo wrote:

LTGs and logging are independent features of the 802.11 ref design. You can disable LTGs in any of our logging examples by removing the 'node.ltg_...' method calls.

I tried this way and removed 'node.ltg', but it did not work.

Code:

node2_txrx_counts_for_node1_start = node1.get_txrx_counts(node2)

# Wait for the TRIAL_TIME
time.sleep(TRIAL_TIME)

# Record the ending Tx/Rx counts
node2_txrx_counts_for_node1_end = node1.get_txrx_counts(node2)

# Compute the throughput

node1_to_node2_num_bits  = float((node2_txrx_counts_for_node1_end['data_num_tx_bytes_success'] - node2_txrx_counts_for_node1_start['data_num_tx_bytes_success']) * 8)
node1_to_node2_time_span = float(node2_txrx_counts_for_node1_end['retrieval_timestamp'] - node2_txrx_counts_for_node1_start['retrieval_timestamp'])
node1_to_node2_xput      = node1_to_node2_num_bits / node1_to_node2_time_span
print("    Node 1 -> Node 2:  Rate = {0:>4.1f} Mbps   Throughput = {1:>5.2f} Mbps".format(rate_info['phy_rate'], node1_to_node2_xput))

node2_txrx_counts_for_node1_start and node2_txrx_counts_for_node1_end are the same as all 0, but node1.get_txrx_counts(node2) has values

I tried iperf to generate traffic, but I could not calculate the throughput of the traffic due to the problem above.
node2_txrx_counts_for_node1_start
{'data_num_rx_bytes': 0,
'data_num_rx_bytes_total': 0,
'data_num_rx_packets': 0,
'data_num_rx_packets_total': 0,
'data_num_tx_attempts': 0,
'data_num_tx_bytes_success': 0,
'data_num_tx_bytes_total': 0,
'data_num_tx_packets_success': 0,
'data_num_tx_packets_total': 0,
'mac_addr': 71297883448266L,
'mgmt_num_rx_bytes': 0,
'mgmt_num_rx_bytes_total': 0,
'mgmt_num_rx_packets': 0,
'mgmt_num_rx_packets_total': 0,
'mgmt_num_tx_attempts': 0,
'mgmt_num_tx_bytes_success': 0,
'mgmt_num_tx_bytes_total': 0,
'mgmt_num_tx_packets_success': 0,
'mgmt_num_tx_packets_total': 0,
'padding': 0,
'retrieval_timestamp': 18523114808L}

node2_txrx_counts_for_node1_end

{'data_num_rx_bytes': 0,
'data_num_rx_bytes_total': 0,
'data_num_rx_packets': 0,
'data_num_rx_packets_total': 0,
'data_num_tx_attempts': 0,
'data_num_tx_bytes_success': 0,
'data_num_tx_bytes_total': 0,
'data_num_tx_packets_success': 0,
'data_num_tx_packets_total': 0,
'mac_addr': 71297883448266L,
'mgmt_num_rx_bytes': 0,
'mgmt_num_rx_bytes_total': 0,
'mgmt_num_rx_packets': 0,
'mgmt_num_rx_packets_total': 0,
'mgmt_num_tx_attempts': 0,
'mgmt_num_tx_bytes_success': 0,
'mgmt_num_tx_bytes_total': 0,
'mgmt_num_tx_packets_success': 0,
'mgmt_num_tx_packets_total': 0,
'padding': 0,
'retrieval_timestamp': 18538128478L}

node1.get_txrx_counts(node2)
{'data_num_rx_bytes': 4734,
'data_num_rx_bytes_total': 4734,
'data_num_rx_packets': 7,
'data_num_rx_packets_total': 7,
'data_num_tx_attempts': 40290,
'data_num_tx_bytes_success': 61700794,
'data_num_tx_bytes_total': 61700794,
'data_num_tx_packets_success': 40225,
'data_num_tx_packets_total': 40225,
'mac_addr': 71297883448266L,
'mgmt_num_rx_bytes': 0,
'mgmt_num_rx_bytes_total': 0,
'mgmt_num_rx_packets': 0,
'mgmt_num_rx_packets_total': 0,
'mgmt_num_tx_attempts': 0,
'mgmt_num_tx_bytes_success': 0,
'mgmt_num_tx_bytes_total': 0,
'mgmt_num_tx_packets_success': 0,
'mgmt_num_tx_packets_total': 0,
'padding': 0,
'retrieval_timestamp': 18914143384L}

Last edited by TIM (2018-Aug-31 06:03:11)

Offline

 

#14 2018-Aug-31 09:17:11

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

Re: Measuring network delay (RTT) using WLAN Exp framework

First - please post new threads for new questions; appending a new question to an old thread clutters the forums.

In your new thread, please provide more details for us to help. What is your experiment setup (2 nodes? running which MAC applications? connected to)? What wlan_exp script did you start with? Did the script work normally without modification? And what changes did you make?

Offline

 

Board footer