01-05-2017
03:35 PM
- last edited on
08-08-2025
11:09 AM
by
Content Cleaner
Hello,
I need to measure latency on a communication system that takes UDP packets at its input and transmit those packets (one way communication) using a wireless link.
In order to do so, I wrote a simple LabVIEW VI (UDP Sender.vi) that runs on PXI controller 1 (@192.168.0.1). It simply opens an UDP connexion on a remote port and periodically sends a UDP packet whose payload contains a timestamp (TX Timestamp).as well as additional data (used to make Bit Error Rate measurements).
On a second PXI chassis (@192.168.0.2), I'm running a UDP Receiver that waits for UDP packets, parse the UDP payload to retrieve the "TX timestamp" and compare with its own timestamp (RX Timestamp)
Latency is simply measured and equal to (RX Timestamp - TX Timestamp)...as far as PXI Chassis 1 and PXI Chassis 2 share a common clock, of course.
So far, so good...
After installing a NTP server on one PXI controller so that it can share its time and date settings, I'm able to get some (meaningful) results.
In order to make things even easier, I then decided I could use the 2x Network Interface Cards available on a single PXI controller to run this same test using a single PXI chassis. No more NTP server needed and a much more portable solution...sounds good !
In order to do so, I decided to configure the 1st NIC as 192.168.0.1 and the second NIC as 192.168.0.2 and ran my 'UDP Sender.vi' and 'UDP Receiver.vi' on my PXI controller.
It ran fine...but the difference between "RX Timestamp" and "TX Timestamp" is now equal to 0.
I guess the windows TCP/IP stack is smart enough to realize those 2 NIC's are in the same chassis and decides it would be stupid to actually send the packets so that they go through the whole TX and RX process and routes the data internally (kind of 127.0.0.1) to be more efficient.
It probably makes sense in terms of routing, but I would like to force the UDP packets to go through the 2x NIC's since the equipment I want to characterize is in between those 2 NIC Cards 😉
I've carefully read the following white paper, but my use case is not documented in this document...
I guess there is a Windows trick to force the packets to be actually routed throught the NIC's, but I'm not familiar enough with the TCP/IP stack API to figure out how to do so easily.
I think I could use a Virtual Machine to overcome this problem but would like to keep thinks as simple as possible !
Any tips/help would be greatly appreciated !
Best regards
Gerald