DPVS

DPVS is a high performance Layer-4 load balancer based on DPDK. It’s derived from Linux LVS and its modification alibaba/LVS.

the name DPVS comes from “DPDK-LVS”.

Different techniques are applied for high performance:

  • Kernel by-pass (user space implementation)
  • Share-nothing, per-CPU for key data (Lockless)
  • RX Steering and CPU affinity (avoid context switch)
  • Batching TX/RX
  • Zero Copy (avoid packet copy and syscalls).
  • Polling instead of interrupt.
  • lockless message for high performance ICP.
  • other techs enhanced by DPDK

Major features of DPVS including:

  • L4 Load Balancer, including FNAT, DR mode, etc.
  • Different schedule algorithm like RR, WLC, WRR, etc.
  • User-space Lite IP stack(IPv4, Routing, ARP, ICMP …) .
  • SNAT mode for Internet access from internal network.
  • Support KNI.VLAN.Bonding for different IDC environment.
  • Security aspect, support TCP syn-proxy.Conn-Limit.black-list
  • QoS: Traffic Control (Ongoing)

DPVS feature modules are illustrated as following picture.

Quick Start

Clone DPVS

$ git clone https://github.com/iqiyi/dpvs.git
$ cd dpvsCopy the code

Well, let’s start from DPDK then.

Build DPVS

It’s simple, just set RTE_SDK and build it.

$ cdDPDK - stable - 16.07.2 / $export RTE_SDK=$PWD
$ cd <path-of-dpvs>

$ make # or "make -j40" to speed up.
$ make installCopy the code

may need install dependencies, like openssl and popt.

Output files are installed to dpvs/bin.

$ ls bin/
dpip  dpvs  ipvsadm  keepalivedCopy the code

  • dpvs is the main program.
  • dpip is the tool to set IP address, route, vlan, neigh etc.
  • ipvsadm and keepalived come from LVS, both are modified.

Test Full-NAT Load Balancer

The test topology looks like,

Set VIP and Local IP (LIP, needed by Full-NAT mode) on DPVS. Let’s put commands into setup.sh. You do some check by ./ipvsadm -ln, ./dpip addr show.

Sh VIP=192.168.100.100 LIP=192.168.100.200 RS=192.168.100.2./dpip addr add${VIP}/24 dev dpdk0
./ipvsadm -A -t ${VIP}:80 -s rr
./ipvsadm -a -t ${VIP}:80 -r ${RS} -b

./ipvsadm --add-laddr -z ${LIP}-t 192.168.100.100:80 -f dpdk0 $$./setup.shCopy the code

Access VIP from Client, it looks good!

Client $curl 192.168.100.100 Your IP :port: 192.168.100.3:56890Copy the code

Performance Test

Our test shows the forwarding speed (pps) of DPVS is several times than LVS and as good as Google’s Maglev.

License

Pls see the License file.

Contact Us

DPVS is developing by iQiYi QLB team since Arpil 2016 and now open-sourced. It’s already widely used in iQiYi IDC for L4 load balancer and SNAT clusters, and we plan to replace all our LVS clusters with DPVS. We are very happy that more people can get involved in this project. Welcome to try, report issues and submit pull requests. And pls feel free to contact us through Github or Email.