My target is: CANoe hardware can send full busload (1000Mbps) ethernet packet to a specific IP on our board.
I tried to generate EthernetPacket using hardware interface. However, the ethernet packet can not be sent to the specific IP. My board (IP: 192.168.1.6) is not received the the ethernet packet.
This is my hardware setup:
If I select MAC address as destination instead of IP address, I can send 1000Mbps and our board can receive the packet but the packet still lost when speed > 300Mbps. With iperf3 tool we can check the ethernet interface on our board can run full busload. enter image description here
So my issues:
- The ethernet packet can not be sent to a specific IP on our board.
- The packet is lost when the speed > 300Mbps.
This is my code of CANoe:
void StressStart()
{
const int SIZE = 1000;
char gTxBuffer[SIZE];
ethernetPacket gStressTxPacket;
long transmissionRate;
ip_Address sourceAddress, destinationAddress;
char addrStr[20];
long result;
// set Ethernet packet data
gStressTxPacket.msgChannel = 1;
gStressTxPacket.hwPort = lookupEthernetPort ("Bus_Eth1_2::Port3");
//gStressTxPacket.source = EthGetMacAddressAsNumber( "02:84:CF:3B:BE:03" );
//gStressTxPacket.destination = EthGetMacAddressAsNumber( "e6:70:e6:77:b5:42" );
gStressTxPacket.Length = SIZE;
gStressTxPacket.type = 0x0800;
// initialize packet with IPv4 and UDP protocols
gStressTxPacket.udp.Init();
// set IPv4 addresses
gStressTxPacket.ipv4.source.ParseAddress( "192.168.1.10" );
gStressTxPacket.ipv4.destination.ParseAddress ( "192.168.1.6" );
// set UDP ports
gStressTxPacket.udp.source = 3001;
gStressTxPacket.udp.destination = 3002;
for (i = 0; i < SIZE; i++)
{
gTxBuffer[i] = 'a';
}
// set UDP payload
gStressTxPacket.udp.SetData( 0, gTxBuffer, SIZE );
// calculate UDP and IPv4 checksum and send Ethernet packet
gStressTxPacket.CompletePacket();
transmissionRate = 20000;
result = EthStartPacketGenerator( gStressTxPacket, transmissionRate);
if (result != 0) {
write("<%BASE_FILE_NAME%> Can not start generate, error: %d", result);
}
}
Could you check my issues! Thank you very much!
CANoe hardware can send full busload (1000Mbps) ethernet packet to a specific IP on our board.