Week2 Flashcards
What does VNF stands for?
Virtual Network Functions
What does DPDK stands for?
Data Plane Development Kit
Why should network functions be implemented in user-space on top of hypervisor?
Primarily, because we want the network functions to be portable, and thus not tied down to any particular operating system.
What is a packet’s 5-tuple?
src IP, dst IP, src PORT, dst PORT, Protocol
What are the overheads that the Linux kernel imposes on packet processing by network functions?
- One interrupt for each incoming packet.
- Dynamic memory allocation (packet buffer) on a per packet basis.
- Interrupt service time.
- Context switch to kernel and then to the application implementing the NF.
- Copying packets multiple times: from DNA buffer to kernel buffer, from kernel buffer to user-space application buffer.
What are the common features of techniques that bypass the kernel for receiving/transmitting packets?
- Rely on polling to read packets instead of interrupts.
- Pre-allocate buffers for packets (rather than allocating on the flight).
- Zero-copy packet processing - NIC uses DMA to write packet into pre-allocated application buffers (directly, bypassing the kernel buffers).
- Process packets in batches (as opposed to individually).
What are the basic steps of packet processing in Linux?
- NIC uses DMA to write incoming packet to a receive ring buffer allocated to the NIC.
- NIC generates an interrupt which is delivered to the OS by the CPU.
- OS handles the interrupt, allocates kernel buffer and copies DMA’d packet into the kernel buffer for IP and TCP processing.
- After protocol processing, packet payload is copied to application buffer (user-space) for processing by the application.
When DPDK was developed and by whom?
DPDK was developed by Intel in 2010.
*Now it is an open source project under Linux Foundation.
What does DPDK provides?
It provides libraries to accelerate packet processing.
In particular, user-space packet processing to avoid overheads of Linux Kernel.
*It target wide variety of CPU architectures so portability is not a problem.
What is a NIC ring buffer?
Being used to implement NIC queues. In the ring there is:
- Write pointer, which advances when NIC receives. local to the NIC (only the NIC can modify this pointer)
- Read pointer, which advances when CPU reads packets. local to the application.
Each slot in the ring buffer hold a “descriptor” for a packet:
- Descriptor contains a pointer to the actual packet data (and other metadata) - there are pre-allocated buffers for storing those packages.
- Actual packet is stored in another buffer data structure
What are the functions of DPDK’s NIC driver that reside in the kernel?
The component of DPDK in the kernel is called UIO driver. It used for initialization of users-pace packet processing.
*needed to initialize the NIC to DMA to appropriate memory locations. Setup memort mapping for configuration registers on the NIC (PCI configuration space, updating those registers is then done in userspace)
Why is using Hugepages (e.g., 2MB pages) more efficient than regular page sizes (4 KB)?
Work with fewer pages => Fewer TLB (translation look aside buffer) misses => improved performance
What considerations should an NF developer take into account when working with modern commodity servers?
- Can match increasing capacities of NICs via multi-core processing (of the packet)
- When using NUMA servers - make sure you use your local RAM and not remote RAMs, because it is much more efficient.
Describe the NIC Ring Buffer process.
- Upon packet arrival, NIC populates the next vacant slot with packet’s descriptor.
- If no vacant descriptor slots in ring buffer, NIC drops packets (high level entities in the entire protocol stack will deal with retransmissions if necessary)
- CPU core running NF polls ring for unread slots.
- When new descriptor are found:
- CPU reads the packet data for those descriptors.
- Returns packets to application
4, No need for locking: producer and consumer are decoupled in ring buffer
What are the two possible DPDK application models?
- Run to completion model
2. Pipelined model