USRP Software Radio

cancel
Showing results for 
Search instead for 
Did you mean: 

packet sizes are different for TX and RX modes

Hi,

We have 2 set of USRPs. One set works in TX mode and other one in RX mode. Wireshark is used to trace the Ethernet frames in both sides. The size of the packets in TX and RX sides are different:

 

for USRP in TX mode:
frame length is 1514, IP packet is 1500, UDP packet size is 1480 and data length is 1472 bytes.

while in RX mode:
frame length is 1506, IP packet is 1492, UDP packet size is 1472 and data length is 1464 bytes.

 

Because USRP uses UDP, so how we can distinguish and map related packets in TX and RX sides. I was wondering to use "data" itself as identifier, but the packet size in TX and RX sides are different So how I can map the related packets.

 

Best regards,

Hossein Jafari

0 Kudos
Message 1 of 13
(5,032 Views)

Hi Hossein,

 

For this, you are speaking of the UDP packet used to communicate between the host and the USRP, correct?

 

What is your overall goal? What information are you trying to send between these two devices?

 

Cheers,

Michael

Michael Bilyk
Former NI Software Engineer (IT)
0 Kudos
Message 2 of 13
(4,980 Views)

Hi Michael,

 

Yes, I am using wireshark to capture UDP packets between host-USRP(TX) and host-USRP(RX).

My goal is to measure the delay for each packets send through USRP(TX) and received by USRP(RX).

I tried to send different types of data include text and video.

My question is: How can I map between packets in TX and RX side, then I can subtract their related time to calculate the delay.

 

Best regards,

Hossein Jafari

0 Kudos
Message 3 of 13
(4,978 Views)

Hi Hossein,

 

So I understand this correctly, are you trying to calculate the loopback time of sending a message from the host, through the USRP front end and back up to the host?

 

And the issue that you are specifically having is that you are unable to correlate the messages you are sending to the messages you are receiving, correct?

 

What programming language are you using to control the USRPs? What will you be using this loopback time information for?

 

Cheers,

Michael

Michael Bilyk
Former NI Software Engineer (IT)
0 Kudos
Message 4 of 13
(4,952 Views)
Hi Michael,
 
This is the setup I used:
host1------(Ethernet link)------USRP1(TX) ................(air interface)...............USRP2(RX)---------(Ethernet link)-------(host2)
 
Although actually I want to measure somehow the loopback time. But loopback does not work here.
I try to send packets from host1 to host2 and that packets can not come back to host1. So USRP can not use loopback, because like "ping" command that uses ICMP does not work here (USRP uses just UDP). So I try to send data from host1 and receive by host2. Then calculate the difference between received and send packets.
 
Yes, you are right, I do not know how to correlate packets in TX and RX sides (host1 and host2). Because USRP transport packets in UDP format so I imagine that the only identifier that I can use to correlate between packets is the packet payload (data).Then I do not know how to map packets in TX and RX sides.
 
I use both gnuradio-USRP and NI-USRP (LabVIEW). I used examples of TX and RX vi's and trying to capture packets in wireshark for both transmitter and receiver sides (in host1 and host2). For example in LabVIEW I used "niUSRP EX Rx Continuous Async.vi" and "niUSRP EX Tx Continuous Async.vi". Even I tried several other vi's for transmitting text and video.
 
I just want to measure the delay time for the packets goes from host1 to host2.
 
Best regards,
Hossein Jafari
0 Kudos
Message 5 of 13
(4,945 Views)

With whatever information you are sending, you should be able to correspond that data on the receive end pretty easily. If I send a unique string of bits, I should be able to get those bits on the other side. I think the issue you are probably running into is ensuring that you can attach a specific time to a specific sample. It is difficult to measure the trip time if you can't determine when you sent the information. Is this accurate to your issue?

 

What if you literally encode the time you are sending the data as the message and read it back on the receive side. If you encode a timestamp into the message you are sending, you could make a comparison against the receive time of the USRP.

 

You will have to make clever use of the niUSRP Set Time.vi to match up your two USRPs.

 

Unfortunately, you will have to use software timing for all of this, which will make it less accurate.

 

Let me ask you this. If you get this information about the trip time, what will you do with it?

 

Cheers,

Michael

Michael Bilyk
Former NI Software Engineer (IT)
0 Kudos
Message 6 of 13
(4,926 Views)

Hi Michael,

 

Thank you so much for your support.

Actually, in my setup, for all packets in both host1 and host2 (TX and RX side) I have the time information. suppose I am sending text like "hi, how are you?" in TX side (host1) and it receive by RX side(host2). Then based on wireshark traces in both sides how can I correlate packets related to this message. If I can map these packets in both sides, then I can just use Packet1TimeRX - Packet2TimeTX for all related packets to calculate delay from TX to RX.

just I do not know how correlate them.

 

Encoding the time as a message and sending it can be a good solution, but again how in the receiver side I can correlate it to the packet I send form TX side.

I prefer to send some other data like video/text and use wireshark times in both TX and RX side.

 

I will try to play with niUSRP Set Time.vi .

 

my goal is analyzing delay in the network by measuring delay from TX to RX (host1 to host2).

 

Best regards,

Hossein Jafari

0 Kudos
Message 7 of 13
(4,908 Views)

Hi Hossein,

 

I think the challenge here is with using wireshark to look at packets of the ethernet connection. The communication between the USRP and the host computer is not going to be just the data you're trying to send. The driver on your host computer interprets the information you're trying to send and then tells the USRP to send out that information. On the receive side, the USRP gets some information and gives it to the driver to be interpreted. It could be that the driver interprets transmit and receive data in different ways so the USRP on the transmit side is seeing a different packet than the USRP on the receive side. 

 

In addition, if you're sending IQ data from one USRP to another, there will be some signal degradation along the way. You won't be able to get the exact same RF waveform on the receive side simply because of signal degradation. 

 

To add on to the question Michael posed, can you explain a little more about why you're trying to find the delay in this network? Are you trying to synchronize the 2 USRP's and that's why you're worried about delay? If we can find out more about why you care about this delay, we may be able to address the root issue rather than just trying to find a workaround for this wireshark issue. 

James F.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 13
(4,875 Views)

Hi James,

 

Yes, you are totally right. My biggest problem is :

Based on wireshark trace how to map between packets from TX and RX side. 

 

As you mentioned, I can see different kind of packets with different length some for control and some for the data that I send. But I filter the ones related for data based on their length. And also since my TX and RX USRP set are near together with good LOS (line of sight), so I can transmit text between them correctly.

 

I could not find any clear guide/document for the "Ethernet frame format" between USRP and host. If you have some, I would appreciate if you could share it.

 

I am interested to measuring delay for different scenario. (such as putting several switches between host and USRP).

 

Best regards,

Hossein Jafari

0 Kudos
Message 9 of 13
(4,873 Views)

Hi James,

 

To measure the delay or round-trip time (RTT), because USRP just use UDP packet then the "ping" command does not work here (I can not ping from host1 to host2). So I am trying to use the data that send from host1 and receive by host2 as an identifier. Then calculate the difference between received and send packets. Can you suggest other solution?

 

Best regards,

Hossein Jafari

0 Kudos
Message 10 of 13
(4,869 Views)