Load Balancing

Reference Documentation

Platform
Intel® PAC
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.8
Napatech Software Suite: Load Balancing

Introduction

Load Balancing

The Napatech SmartNICs can distribute the specified traffic to multiple host buffers based on either a defined hash calculation or round robin. This is achieved by specifying multiple StreamIds in the Assign command, like:

Assign[StreamId=0..3] = All

This will distribute all traffic from all front ports to StreamIds 0, 1, 2 and 3 – with approximately 1/4 to each (based on the defined hash calculation)

This command will also allocate 4 buffers in the onboard buffer memory to buffer data for these 4 streams until DMA'ed to the host system.

Improved Load Balancing

The load balancing feature has now been significantly improved in several areas:

  • Load distribution to external servers
    • Using Local Retransmit with VLAN tags added based on the load distribution method specified (hash or round robin)
  • Unevenly load distribution
  • And any combination of this

Further it is now possible to do load balancing to x parts but only handle a some of these in the server – and only allocate buffer memory for the parts that we want to handle. Thereby not wasting buffer memory for unhandled packets.

To achieve "simple" load balancing as always, the existing NTPL syntax for load balancing, like:

Assign[StreamId=0..3] = All

Is still working.

The following figure shows, at a very high level, how this is implemented in the SmartNIC. It is done by introducing a more advanced load balancer/distribution module that controls the distribution of packets to both streams and local retransmit.

LoadBalancingPicture1.png

To utilize this new advanced load distribution to strams and through Local Retransmit or be able to split unevenly or control the allocation of buffer memory you will need to use a new Action command in combination with the Assign command.

Through the Action command it is possible to control how the split is done. You can define how many parts to split to and how many of these parts that goes to each StreamId and how many parts are local retransmitted and with which VLAN tag and which Tpid. And finally buffer memory is only allocated for the parts which are assigned to a StreamId. It is all controlled by a "table" in the FPGA that holds the information. The table can handle up to 4096 entries – thereby making it possible to split traffic to 4096 VLANs.

The figure below shows how this is done in a very simplistic way that shows how the Action command works with the table.

LoadBalancingPicture2.png

Use cases for load balancing to external devices

The Load distribution to external servers can be used in connection with a VLAN aware switch to do load distribution to other servers with a standard NIC.

LoadBalancingPicture3.png

The same result can be achieved without a VLAN aware switch using a daisy-chained setup. The Napatech SmartNIC can be placed first in the daisy-chain and do the filtering and distribute to x parts – each getting its own VLAN tag and the following NICs in the daisy-chain will then only filter on the VLAN tag.

LoadBalancingPicture4.png

Examples

Let's look at some examples to make it a little easier to understand.

Receive all traffic to 4 streams:

Action[Tag=Ex_Rx4; Width=4] = {Index=0..3; StreamId=0..3}
Assign[Action=Ex_Rx4=] = All

Note: The old syntax "Assign[StreamId=0..3] = All" does the same and is still supported

Distribute all traffic to 4 VLANs (100, 101, 102 of 103) on port 1, is done like:

Action[Tag=Example1; Width=4] = {Index=0..3; DesinationPort=1; VLAN=100..103}
Assign[Action=Example1] = All

Distribute all traffic to 4 hostbuffers, with 50% to StreamId 0, 20% to StreamId 1 and 15% to each of StreamId 2 and 3.

Action[Tag=Example3; Width=20] = {Index=0..9; StreamId=0}, {Index=10..13; StreamId=1}, {Index=14..19; StreamId=2,3}
Assign[Action=Example3] = All

Distribute all traffic to this server and 3 other servers, with 25% to each (on VLAN 101, 102 og 103) and distribute the 25% to this server to 4 Streams:

Action[Tag=Example4; Width=16] = {Index=0..3; StreamId=0..3}, {Index=4..15; DestinationPort=1; VLAN=101..103}
Assign[Action=Example4] = All

Distribute all traffic to 4 streams and at the same time distribute them to 8 VLANs on port 1, used VLAN TPID 0x9100:

Action[Tag=Example5; Width=8; VLANTpid=0x9100] = {Index=0..7; StreamId=0..3}, {Index=0..7; DestinationPort=1; VLAN=101..108}
Assign[Action=Example5] = All

Note: We can support TPID: 0x8100, 0x88A8 and 0x9100 – and 0x8100 is the default if not specified.

Distribute all traffic to 32 parts but only handle the first 16 into 16 streams (only allocating buffer memory for 16 streams):

Action[Tag=Example6; Width=32] = {Index=0..15; StreamId=0..15}
Assign[Action=Example6] = All

Note: This is typically used in connection with Socket Load Balancing (two adapters interconnected with a cable) and the second adapter will then use a similar setup:

Action[Tag=Example7; Width=32] = {Index=16..31; StreamId=0..15}
Assign[Action=Example7] = All

Note: The old syntax "Assign[StreamId=0..32] = All" does the same, BUT if only the first 16 streams are handled, then we waste 50% of the buffer memory for data that is never handled – and reduces the time we can buffer correspondingly.

Retransmit command

Until now it has been possible to specify Local Retransmit, either using the legacy Retransmit command or using the DestinationPort parameter to the Assign command.

Going forward the Retransmit command should be avoided for 4GA as it is deprecated. It is still working but some scenarios with overlapping filter expressions used for Assign and Retransmit will not work anymore. Please convert any Retransmit commands to Assign commands