Introduction to DPDK (Data Plane Development Kit) for Beginners

This article will provide an insight about DPDK (Data Plane Development Kit). If you are passionate about high performance networking and fast packet processing, this article is for you.

Introduction

DPDK is an open source project under Linux Foundation. Its prime objective is fast packet processing. Before going into the further details of DPDK I would first highlight the problem against which DPDK came into existence as one of the solution.

Problem Statement

In the last two decades, NIC (Network Interface Cards) evolved on the rapid pace. NIC(s) are available in the market with the speed of 1Gbps, 10Gbps and 100Gbps. However, the Linux kernel somehow became the bottleneck in the packet processing pipeline.

Linux kernel uses Interrupt mode packet processing. Lets discuss briefly how Linux kernel receives and process and incoming packet from a NIC.

  1. Packet arrives at NIC. NIC stores the packet in a buffer space. This buffer space is provided by the Kernel.

  2. NIC generates an interrupt to the Kernel.

  3. Kernel will copy the packet from NIC buffer to Kernel buffer.

  4. Kernel will copy the packet from Kernel buffer to user space application buffer and inform the user space application about the packet arrival via API.

  5. User space application will process the packet.

The factors which slows down the packet processing:

  1. Packet is copied multiple times before reaching the user space application.

  2. During the interrupt handling process, context switching occurs from user space to kernel space and vice versa.

Solution

DPDK was mainly developed to solve the problems mentioned above. The idea was to bypass the Linux Kernel and access the NIC directly from user space application. In this way, we can prevent the unnecessary copies of packets and context switches thus improving the performance of packet processing pipeline by many folds.

DPDK uses Poll mode packet processing. Lets discuss briefly how DPDK receives and process and incoming packet from a NIC.

  1. Packet arrives at NIC. NIC stores the packet in a buffer space. This buffer space is provided by user space application via DPDK API.

  2. User space application will be continuously checking the NIC for any incoming packets using DPDK API. This process is called polling.

  3. The DPDK API will provide the packet to the user space application. Hence no additional copies of the packet are created and Kernel is not involved in this process. Thus improving the performance by many times.

Conclusion

DPDK solved the problem we identified with the Kernel i.e. no multiple copies of the packets and no context switches from user space to kernel space and vice versa.

Some other libraries which also solved the same problem besides DPDK are PF_RING and VPP. But DPDK is more popular among them and is widely used now a days. DPDK have a big community. Intel is the main contributor of the DPDK besides other major NIC vendors such as Brocade, Mellanox Technologies etc.

The upcoming articles will explain an in-depth working of DPDK.