NalDataStream Sample

Description

This sample program uses the NAL API to:

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 11:22:33:44:55:66.

Alternatively, you can run two instances of NalDataStream.rtss simultaneously:

RtssRun NalDataStream.rtss Interface1 /s

RtssRun NalDataStream.rtss Interface1 /c 11:22:33:44:55:66

Source Files

File Description
NalDataStream.h Header file
NalDataStream.c Source file
NalDataStream.rc Resource file
NalDataStream.vcxproj Project file for Visual Studio 2015
NalDataStream.vcxproj.filters Project filters file for Visual Studio 2015
NalDataStream.sln Solution file for Visual Studio 2015
resource.h Resource header file
readme.txt README file

Building the Sample

This sample application requires Visual Studio 2015.

  1. Open the Project NalDataStream.vcxproj in Visual Studio 2015
  2. If you are planning to run the sample with the RtNalI10GB driver, you will need to modify the sample to not discard initial receive packets. To do this:
  3. Open the header file NalDataStream.h.
  4. Un-comment the following line:

//#define DISCARD_INITIAL_RECEIVE

NOTE: If you do not perform the above steps, you will receive stale data at the beginning of the sample.

  1. Set the configuration to RTSSRelease.
  2. 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 11:22:33:44:55:66 at the default burst rate:

  1. Convert your RtNalIGB supported device to RTX64.
  2. Use RtNalConfig.exe to create at least one interface.

RtNalConfig.exe /interface Interface1 /create RtNalIGB.rtdll ( location )

NOTE: Interface names cannot contain spaces.

  1. Start the NAL:

Rtssrun Rtx64Nal.rtss

  1. Run the sample with the flag to send packets

RtssRun NalDataStream.rtss Interface1 /c 11:22:33:44:55:66

 

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

  1. 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.

/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.

/tx-tsc 1

enables transmit timestamps.

/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 11:22:33:44:55:66.

RtssRun NalDataStream.rtss /a

RtssRun NalDataStream.rtss Interface1 /s

RtssRun NalDataStream.rtss Interface1 /c 11:22:33:44:55:66

RtssRun NalDataStream.rtss Interface1 /s /c 11:22:33:44:55:66 /burst 10 /i 2

RtssRun NalDataStream.rtss Interface1 /s /c 11:22:33:44:55:66 /burst 10 /i 2 /send 500000

RtssRun NalDataStream.rtss Interface1 /c 11:22:33:44:55:66 /burst 1 /i 1000 /tx-tsc 1

NOTE: This example sends 1 packet per second. By default, the receiving side displays packets at the rate of 100,000. To see receiving packets from this example, you need to modify NalDataStream.c and build the sample.

Remarks

This sample prints an incorrect number of missing received packets if the packets are transmitted from multiple sources.

APIs Referenced

See Also

These functions are used by applications.

These functions are used by device drivers.