NalDataStream 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
It also allows you to display information about all system device queues. This sample uses a default Ethernet type 0x1234 and a default packet size of 1514 bytes (not counting Ethernet FCS). You can run RtssRun NalDataStream.rtss Interface1 /s /c xx:xx:xx:xx:xx:xx
.
Alternatively, you can run two instances of NalDataStream.rtss
simultaneously:
RtssRun NalDataStream.rtss Interface1 /s
RtssRun NalDataStream.rtss Interface1 /c xx:xx:xx:xx:xx:xx
Source Files
File | Description |
---|---|
NalDataStream.h
|
Header file. |
NalDataStream.c
|
Source file. |
NalDataStream.rc
|
Resource file. |
NalDataStream_VS<Visual Studio Version>.vcxproj
|
Project file for supported versions of Visual Studio. |
NalDataStream_VS<Visual Studio Version>.vcxproj.filters
|
Project filters file for supported versions of Visual Studio. |
NalDataStream_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 NalDataStream.rtss
.
Running the Sample
Follow these steps to run the sample using the RtNalIGB driver and send to a peer (destination) MAC address xx:xx:xx:xx:xx:xx at the default burst rate:
- Convert your RtNalIGB supported device to RTX64.
- Open the RTX64 Control Panel and do the following:
- On the Manage interfaces page, add a new interface.
- On the Configure and control the network page, clear selection of these check-boxes:
- Start with Subsystem
- Start with NAL
- Select the Run in verbose mode check box.
- Start or restart the NAL.
- Run the sample with the flag to send packets
RtssRun NalDataStream.rtss Interface1 /c xx:xx:xx:xx:xx:xx
You should see the following once the sample begins:
NalDataStream: Interface1 Link is UP
NalDataStream: Interface1 Transmitted 100000 packets
NalDataStream: Interface1 Transmitted 200000 packets
NalDataStream: Interface1 Transmitted 300000 packets
…
- To stop the sample use Rtsskill
This sample uses the following flags:
/a
displays all queues configured by the NAL on the System
/s
receive data
If the application receives data you should see output:
NalDataStream: Interface1 Received 100000, Length: 1514
/c <MAC_Address>
continuously send to the provided MAC address using the default data rate. This is the destination to which the packets are sent.
/burst <burst count>
modify the number of packets contained in a burst. The default value is 25. For 100MB connections the suggested value is 10.
/i <interval>
modify the interval between burst in MS. The default is 1MS. For 100MB connections the suggested value is 2MS.
/q <queue number>
Sets the queue number. When not specified the default receive queue is used for receive, and queue with the same number for transmit.
/send <count>
sets the number of frames to send before terminating the sample. The default is set to send forever.
/txlen <bytes>
sets the size of transmitted packet in bytes (not counting FCS). Default is 1514.
/rxlen <bytes>
sets the size of the receive buffer in bytes. Default is 1514.
/type <Ethernet type>
sets the Ethernet type in transmit frames to match receive frames. This is a hexadecimal value without leading 0x. Default is 1234.
Examples
In the following examples, the Interface1
device name is used and the peer (destination) MAC address is xx:xx:xx:xx:xx:xx.
- To display all queues configured by NAL in a system, run:
RtssRun NalDataStream.rtss /a
- To receive data, run:
RtssRun NalDataStream.rtss Interface1 /s
- To send data with default data rate sending forever, run:
RtssRun NalDataStream.rtss Interface1 /c xx:xx:xx:xx:xx:xx
- To receive and send data with 10 packets burst, 2 MS between bursts, sending forever, run:
RtssRun NalDataStream.rtss Interface1 /s /c xx:xx:xx:xx:xx:xx /burst 10 /i 2
- To receive and send data with 10 packet burst, 2 MS between bursts, terminating the application after 500000 transmitted frames, run:
RtssRun NalDataStream.rtss Interface1 /s /c xx:xx:xx:xx:xx:xx /burst 10 /i 2 /send 500000
Remarks
This sample prints an incorrect number of missing received packets if the packets are transmitted from multiple sources.
This sample is not supported for the RtVirtualNic driver.
APIs Referenced
RTNal