Burst Sending

High throughput sending (aka Burst Sending), is used for load/stress testing.

  • A list of messages which should be sent needs to be passed to the method

Creating a transmission

# Create transmission of 100Mbps for 5 seconds
tr = channel.create_transmit([ethernet_msg], bitrate = 100E6, duration = 5)

# Create transmission with a packet rate of 10000 packet per second
tr = channel.create_transmit([ethernet_msg], packet_rate = 10000)

# Create transmission that uses as much bandwidth as possible
tr = channel.create_transmit([ethernet_msg], max_throughput = True)

# Create transmission where
# duration between m1 and m2 = 50µs
# duration between m2 and m3 = 150µs
# duration between m3 and m1 = 70µs
# repeat 50000 times
# m1.timestamp = 0.000000
# m2.timestamp = 0.000050
# m3.timestamp = 0.000200

m1 = message_builder.create_ethernet_message("channel", "channel")
m2 = message_builder.create_ethernet_message("channel", "channel")
m3 = message_builder.create_ethernet_message("channel", "channel")
tr = channel.create_transmit([m1, m2, m3], repeat=50000, cycle = 0.000270)

Using a transmission

tr = channel.create_transmit(...)

# Start the transmission
tr.start()

# Stop the transmission
tr.stop()

# Wait for transmission to end
# Will wait for ever (or until tr.stop() is called) if no repeat or duration specfied
tr.wait()

Note

To have a valid configuration for transmission, these conditions should be taken into consideration:

  • Hardware constraint: For example USB speed, USB 2.0 ports have a practical speed limit of around 300 Mbps

  • System limitation: the gap between packets should be more than 10µs-20µs.

Example:

  • Message Size = 64B

  • Bitrate = 70Mbps

  • Gap between packets = 64B / 70Mbps = 7.3µs (too small for system to handle)

➥ Either the bit-rate should be reduced or the message size should be scaled up to reach a valid configuration.

Packet Overhead

By default 4 bytes of CRC are added to each packet when applying the bitrate value, In some cases a different value is needed, for example:

  • 24: Include everything including the Ethernet preamble and inter packet gap

  • 12: Include Preamble and CRC only

  • 0: Include only Ethernet data without CRC

  • -12: Don't include Ethernet header (MAC and Ether type)

# We want to use 50% of the bandwidth of a 100Mbps cable
tr = channel.create_transmit([ethernet_msg], bitrate = 50E6, packet_overhead = 24)