Receiving packets – Teledyne LeCroy Automation API for IBTrainer Software Ver.2.0 User Manual
Page 13

Packet Handling Concept
Programming the IBTrainer
CATC IBTrainer InfiniBand Exerciser API Reference
1-3
struct within the generator. The generator provides the method
PacketInit()
for that purpose.
Having created an InfiniBand packet (or a raw packet), you can send it
out in one of two ways:
• Direct send
Using the method PacketSend(), you can directly pass an object of the
type IGCPacket (or derived from IGCPacket) to the generator class
which then immediately sends out the packet.
• Memory based packet send
Using the method TransmitProg(), you can program up to 512 Kbytes
for the IB
Trainer
and up to 2048 Kbytes of packets in the transmit
memory. Use the call TransmitRun()to start the transfer. You can
repeat the programmed packet sequence if required.
By mixing these two methods you can create different test scenarios.
For example, you can flood the network with a large amount of low
priority packets and then insert high priority packets once in a while to
check that all participating switches and routers are capable of
handling the priorities correctly.
The IGCPacket object can be used several times and can even be sent out
from different generators. Using the method AppendBuffer() and
NewPacket()
a packet can be transformed into a byte stream or vice
versa.
Receiving Packets
The IB
Trainer
generator receives packets in two different ways. They
represent default behavior:
• MAD packets (SMD) are stored in an extra FIFO that is exclusively
reserved for this type of packet.
• Standard InfiniBand packets are stored in the receive memory.
Depending on the mode of the generator, the hardware either
controls the incoming packets via flow control packets or takes all
packets without checking if they have been picked up by the software
(data sink mode).