Light Stack

Light is a compatible, high-performance and scalable user-level network stack.

Compile and Run Light

(1) Git clone the codes;

git clone git@github.com:Light-network-stack/Light.git

(2) Configure the IP address of Light in file stack_and_service/service/dpdk_ip_stack_config.txt;

(3) Deactivate the NIC that DPDK uses later:

sudo ifconfig <NIC_name> down

(4) Configure DPDK:

sudo $LIGHT_SOURCE_PATH/Light/dpdk-17.02/usertools/dpdk-setup.sh

Choose these steps in sequence:

[13] x86_64-native-linuxapp-gcc

[16] Insert IGB UIO Module

[19] Setup hugepage mapping for non-NUMA systems

The size of each hugepage memory is 2MB. We need 4096 pieces.

[22] Bind Ethernet device to IGB UIO Module

You can see all NICs. Please input the NIC name (e.g. ens3f0) or NIC address (e.g. 04:00.0) to bind it to the DPDK driver.

Note: 1) deactivate the NIC before binding; 2) ifconfig will not show the NIC after it is bound to DPDK driver.

[33] Exit Script

(5) Compile DPDK and Light, and set up environment variables:

sudo ./build_dev.sh

(6) Run Light stack processes:

sudo su
export LIGHT_SOURCE_PATH=<path_to_Light>

6.1) Method 1:

Main stack process (front end):

sudo ./startFirstCore.sh <total_stack_core_num>

Other stack processes (back end):

sudo ./startOtherCores.sh <total_stack_core_num>

6.2) Method 2 (only for two cores):

Main stack process (front end):

sudo ./startFirstCore.sh 2

Other stack processes (front end):

sudo ./startSecondCores.sh 2

6.3) Method 3:

Automatically run all Light processes on the backend. The process startup interval is 10s.

sudo ./start.sh <total_stack_core_num>

(7) Kill all Light stack processes, Nginx processes and resource monitor process:

sudo ./stop_all.sh