SolarCapture C Bindings User Guide  SF-115721-CD
Draft 2A
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sc_delay_line Node Reference

Node to delay upstream packets by a random time within a given time range.

Detailed Description

Node to delay upstream packets by a random time within a given time range. Randomness is achieved by performing a hash on the destination IP address and can be controlled using the num_lines argument.

If num_lines = 1:

  • usec/msec must be a single value.
  • All packets will be delayed by this amount.

If num_lines > 1:

  • usec/msec must be a range of values <min_delay>-<max_delay>.
  • Non-IP packets are delayed by exactly <min_delay>.
  • IP packets are assigned a line by hashing the destination IP address.
  • For a given line in (0, ..., num_lines-1) the delay is <min_delay> + (<max_delay> - <min_delay>) * (line / num_lines)

Arguments

Argument Optional? Default Type Description
num_lines Yes 1 SC_PARAM_INT Number of lines used in the hash.
usec Yes NULL SC_PARAM_STR Set this to a string of the form "\<min_delay\>[-\<max_delay\>]" to set the delay time of the node in microseconds.
msec Yes NULL SC_PARAM_STR Set this to a string of the form "\<min_delay\>[-\<max_delay\>]" to set the delay time of the node in milliseconds.

Note: One and only one of usec and msec must be set.

Named Input Links

None

Output Links

Link Description
"" All packets are sent down this link.