SolarCapture C Bindings User Guide  SF-115721-CD
Issue 1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sc_flow_balancer Node Reference

This node distributes load by spreading packets over its output links while preserving flow affinity.

Detailed Description

This node either forwards or copies packets from its input to its outputs (see copy_mode). It attempts to distribute load evenly over the outputs, whilst also preserving flow affinity. That is, packets from the same flow are directed to the same output, and both directions in a conversation are directed to the same output.

NB. Both directions in a TCP conversation are directed to the same output only if the communicating hosts have different IP addresses. That should always be true unless you are analysing packets on a loopback interface.

The flow key always includes VLAN ID and ether_type. For IPv4 packets it also includes the IP addresses and protocol, and for TCP it includes the port numbers.

The input can be in normal or packed-stream format. When copy_mode=copy, the output is in packed-stream format. When copy_mode=zc the output is normal format.

When mode=round-robin new flows are assigned to each output in round-robin order. When mode=estimate an estimate of the current load experienced by each output is maintained, and new flows are directed to the output with the lowest estimated load.

Arguments

Argument Optional? Default Type Description
copy_mode No SC_PARAM_STR Copy from input to output ('copy') or use zero-copy ('zc').
mode No SC_PARAM_STR Balancing mode; 'estimate' or 'round-robin'.
flow_table_capacity Yes 1024 SC_PARAM_STR Initial capacity of the flow table.
flush_ns Yes 10000000 SC_PARAM_STR Flush timeout when copy_mode=copy.

Output Links

An outgoing link named "input" is treated specially: It receives the input packets when copy_mode=copy.

Exposed Statistics

Statistics exposed by the sc_flow_balancer node.

Name Type Data Type Description
flow_table_capacity uint64_t magnitude Capacity of the flow table.
avg_flow_load uint64_t bandwidth Moving average of the load per flow.
n_flows int magnitude Current number of flows directed to this output.
total_flows uint64_t magnitude Total number of flows directed to this output.
total_work uint64_t magnitude Estimate of total work directed to this output.
load_est_short uint64_t bandwidth Short-term load estimate for this output.
load_est_long uint64_t bandwidth Long-term load estimate for this output.
drops uint64_t pkt_count Number of packets dropped at this output due to running out of buffering.