NalTimeStamping Sample
You can find these sample files at Public Documents\IntervalZero\RTX64 SDK\4.5
.
Description
This sample program uses the NAL API to:
- initialize the application to use the NAL
- query which queues are available from the NAL
- request the use of the first receive and/or transmit queue in the index
- configure the queues
- send and/or receive Ethernet frames
- use the NAL API to read the last timestamp for receive and/or transmit
Source Files
File | Description |
---|---|
NalTimeStamping.h
|
Header file. |
NalTimeStamping.c
|
Source file. |
NalTimeStamping.rc
|
Resource file. |
NalTimeStamping_VS<Visual Studio Version>.vcxproj
|
Project file for supported versions of Visual Studio. |
NalTimeStamping_VS<Visual Studio Version>.vcxproj.filters
|
Project filters file for supported versions of Visual Studio. |
NalTimeStamping_VS<Visual Studio Version>.sln
|
Solution file for supported versions of Visual Studio. |
resource.h
|
Resource header file. |
readme.txt
|
Text file containing a description of the sample and a list of provided files. |
Building the Sample
This sample application requires a supported version of Visual Studio.
- Open the appropriate solution file for your version of Visual Studio.
- Set the configuration to RTSSRelease.
- Build the sample.
You should end up with an RTSS process called NalTimeStamping.rtss
.
Running the Sample
Follow these steps to send to a peer (destination) MAC address xx:xx:xx:xx:xx:xx at the default burst rate:
- Convert your NAL-supported device to RTX64. In this example, we will use a device supported by the RtNalIGB driver.
- In the RTX64 Control Panel, add two new interfaces through the Manage interfaces page:
- Interface1
- Interface2
NOTE: Interface names cannot contain spaces.
- Start the NAL through the Control Panel.
- Run the sample as a sender of data:
RtssRun NalTimeStamping.rtss Interface1 /transmit
- Run the sample as a receiver of data:
RtssRun NalTimeStamping.rtss Interface1 /receive
- Observe the timestamps printed to the RTX64 console window.
- To stop the sample use RtssKill.
This sample uses the following flags:
/transmit <MAC_Address>
transmits packets to the specified MAC address
NOTE: /transmit is not supported for the RtNalIPCH driver.
/q <queue number>
attaches to the specified queue number
/send <packet number>
transmit only the specified number of packets
/receive
receives packets
Examples
In the following examples, the Interface1
device name is used and the peer (destination) MAC address is xx:xx:xx:xx:xx:xx.
- For usage information, run:
RtssRun NalTimeStamping.rtss /?
- To receive data, run:
RtssRun NalTimeStamping.rtss Interface1 /receive
- To transmit packets to a specified MAC address, run:
RtssRun NalTimeStamping.rtss Interface1 /transmit xx:xx:xx:xx:xx:xx
- To transmit 1000000 packets to a specified MAC address, run:
RtssRun NalTimeStamping.rtss Interface1 /transmit xx:xx:xx:xx:xx:xx /send 1000000
Remarks
This sample is not supported for the following drivers:
- RtNalRtl
- RtVirtualNic
To broadcast data, use a MAC address of xx:xx:xx:xx:xx:xx
Packets are sent once every second.
APIs Referenced
RTNal