Содержание

Configuring on-stick and LAG/LACP

Configuring on-stick

[FastDPI 12+]

On-stick allows you to save on physical hardware. FastDPI usually works with bridges, bridging two physical ports (devices). For an on-stick device the physical port is one, on which fastDPI itself creates virtual ports - on the subscriber side (subs) and internet side (inet).

Each op-stick port is described in a specific way: first the base physical port is described using dpdk_device, then the virtual ports based on the base port are described.
Description of the base devices:

dpdk_device=port1:pci:04:00.0
dpdk_device=port2:pci:04:00.1

Description of on-stick based on devices port:

onstick_device {
    base=port1
    filter=<subs side filter expression>
    subs=subs1
    inet=inet1
}
onstick_device {
    base=port2
    filter=<subs side filter expression>
    subs=subs2
    inet=inet2
}

where:
base — base device
filter — boolean expression to determine the direction of the packet (filter). If this expression returns true, the packet is from the subs side, otherwise it is from the inet side
subs — the name of the device on the subs side.
inet — the name of the device on the inet side.

Setting Bridges.

Basic port type devices CANNOT be included in any bridges
in_dev=subs1:subs2
out_dev=inet1:inet2

Wherever you need to specify a device, you should use virtual devices (in this example, subs1, subs2 and inet1, inet2). The basic on-stick devices port1 and port2 is specified only when describing the on-stick device and nowhere else.

In the on-stick port description, the most important part is the filter clause to determine the direction of the packet (subs → inet or inet → subs). Packet direction is an important attribute of a packet in fastDPI on which processing depends. filter specifies a boolean expression over the L2 properties of the packet. If this expression returns true, the packet is on the subs side, otherwise it is on the inet side (uplink, internet).

The basis of a filter expression are terms that are combined into a logical expression using the logical operators & (AND) and | (OR), the parentheses ( and '), and the negation '!. The & operator is higher priority than |; by analogy with arithmetic expressions, we can think of & as multiplication and | as addition, which is the basis for placing parentheses.

Terms specify elementary expressions over L2 properties of a packet. The following terms exist (case is important):

Examples (recall that filter specifies an expression for the subs side):

A formal description of the grammar of the filter expression:

filter ::= and | and ‘|’ filter
and    ::= mult | mult ‘&’ and
mult   ::= ‘!’ mult | term |(‘ filter ‘)’
term   ::= vlan | qinq | pppoe | smac | dmac
 
vlan   ::= ‘vlan’ | ‘vlan’ ‘(‘ list_int ‘)’
qinq   ::= ‘qinq’
pppoe  ::= ‘pppoe’
smac   ::= ‘smac’ ‘(‘ mac_address ‘)’
dmac   ::= ‘dmac’ ‘(‘ mac_address ‘)’
mac_address ::= xx:xx:xx:xx:xx:xx

LAG/LACP port aggregation

Port aggregation by SSG is supported for the following modes in-line и on-stick.

LACP port aggregation

lacp=0

Allowable values of the lacp parameter:

The aggregation traces the traffic balancing.

Configuring LAG

LAGs can include either regular ports or on-stick ports, no mixing is allowed. LAG on on-stick is organized on the base (physical) port. LAG is implemented in fastDPI at logical level: there is no single bond device, inside fastDPI work is done with ports as before.

The maximum number of ports in a LAG is 12.

3 different configurations are possible:

Requirements for devices included in a LAG:

Currently, LAGs are configured in fastdpi.conf without the ability to be applied on the fly, i.e. a fastDPI restart is required when the LAG configuration is changed.

LAG Description:
Each LAG requires a separate lag section. Only physical interfaces can be included in a LAG; mixing physical and logical interfaces is not allowed.

lag {
    name=
 
    device=
    device=
 
    system_id=
    priority=
    short_timeout=
}

where:
name - optional name of the LAG, used for log output.
device - lists all physical interfaces included in the LAG. The LAG must contain at least 2 devices.
system_id - MAC address is the system_id of this LAG. If not specified, "arp_mac" is used.
priority - system priority for this LAG, number in the range 1 - 65535, default is 32768.
short_timeout - short (off) or long (on) LACP timeout.

Applying balancing to outgoing LAG traffic

The type of the applied balancing algorithm is specified by the lag.balance_algo parameter:

Additional hash configuration parameters in the lag section: hash_seed, hash_offset, hash_bits
How many significant bits we take from the 64-bit hash during balancing. The balancing algorithm in the general case looks like this:

Only basic on-stick devices must be specified in the LAG description. Mixing on-stick and conventional devices in one LAG is not allowed.
During aggregation, a traffic balancing trace is traced.

Example of on-stick + LACP configuration for two physical interfaces

In this scenario, subscriber traffic in VLANs 101, 102, and QinQ
dpdk_device=port1:pci:86:00.0
dpdk_device=port2:pci:86:00.1
 
lag {
    name=LACP
    device=86:00.1
    device=86:00.0
    lacp=1
    system_id=6c:b3:11:60:fa:66
    priority=32768
    balance_algo=0
}
 
onstick_device {
    base=port1
    filter=vlan(101,102) | qinq
    subs=subs1
    inet=inet1
}
 
onstick_device {
    base=port2
    filter=vlan(101,102) | qinq
    subs=subs2
    inet=inet2
}
 
in_dev=subs1:subs2
out_dev=inet1:inet2