Table of Contents
Setting
Setting up subnets for balancing
Balancing applies only to IP addresses belonging to the AS defined as local in asnum.dscp.
- Define an autonomous system with IP addresses that are used by subscribers:
vi aslocal.txt 10.0.0.0/8 64511 172.16.0.0/12 64511 192.168.0.0/16 64511 cat aslocal.txt | as2bin /etc/dpi/aslocal.bin
- Mark a given autonomous system as local:
vi my_as_dscp.txt 64511 local 10415 local cat my_as_dscp.txt | as2dscp /etc/dpi/asnum.dscp
You can use either a custom AS or a public AS as the AS.
Read more at the link - A reload must be performed to apply the parameters:
service fastdpi reload
Setting /etc/dpi/fastdpi.conf
- Define the input and output interfaces in the configuration file.
The input interfaces to which the traffic mirror is fed are specified in thein_devparameter, and the output interfaces are specified inout_dev.
Interfaces do not form pairs and species constructs are allowed:in_dev=05-00.0:05-00.1:05-00.2:05-00.3:0b-00.0:0b-00.1:0b-00.2:0b-00.3 out_dev=08-00.0:08-00.1:08-00.2:08-00.3
Or
in_dev=05-00.0 out_dev=out_dev=08-00.0:08-00.1:08-00.2:08-00.3
- Enable balancing mode in the
enable_l2_lbparameter, where:0— deactivate balancing;1— activate balancing.
- Determine by what value to initialize the hash table in the
lb_hash_out_dev_typeparameter, where:0— use the internal index of the output interface;1— use the interface name from [in|out]_dev.
- Select an engine to handle thread dispatchers in the
dpdk_engineparameter, where:0— read/write default engine, one dispatcher for everything;1— read/write engine with two dispatcher threads: a dispatcher for each direction;2— Read/write engine with RSS support: for each direction,dpdk_rssdispatchers are created (defaultdpdk_rss=2), so total number of dispatchers = 2 *dpdk_rss— to work with in_dev, and a separate dispatcher to work with out_dev.
When the parameter value is 2, themqrx_lb_engineengine is activated. The principle of operation is the same as in the usual modedpdk_engine=2, only rss is enabled on in_dev, and only one rx queue is created on out_dev.
Learn more about thedpdk_engineparameter by clicking here.
- The
lb_hash_typeparameter is used to select the hashing algorithm. Currently, the maglev algorithm is supported (parameter value0) — an algorithm with a fixed-size hash table. The hash for load balancing is calculated as follows:- if both src and dst IPs are local, the hash is calculated based on these two addresses;
- if only the src IP is local, the hash is calculated based on the src IP;
- if only the dst IP is local, the hash is calculated based on the dst IP;
- otherwise, the hash is calculated based on src and dst IPs.
The calculated hash value is then used to determine the output interface by finding the index of the hash table cell that contains the interface index from the array of output interfaces.
Was this information helpful?