Week2 Flashcards

1
Q

What does VNF stands for?

A

Virtual Network Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does DPDK stands for?

A

Data Plane Development Kit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why should network functions be implemented in user-space on top of hypervisor?

A

Primarily, because we want the network functions to be portable, and thus not tied down to any particular operating system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a packet’s 5-tuple?

A

src IP, dst IP, src PORT, dst PORT, Protocol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the overheads that the Linux kernel imposes on packet processing by network functions?

A
  1. One interrupt for each incoming packet.
  2. Dynamic memory allocation (packet buffer) on a per packet basis.
  3. Interrupt service time.
  4. Context switch to kernel and then to the application implementing the NF.
  5. Copying packets multiple times: from DNA buffer to kernel buffer, from kernel buffer to user-space application buffer.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the common features of techniques that bypass the kernel for receiving/transmitting packets?

A
  1. Rely on polling to read packets instead of interrupts.
  2. Pre-allocate buffers for packets (rather than allocating on the flight).
  3. Zero-copy packet processing - NIC uses DMA to write packet into pre-allocated application buffers (directly, bypassing the kernel buffers).
  4. Process packets in batches (as opposed to individually).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the basic steps of packet processing in Linux?

A
  1. NIC uses DMA to write incoming packet to a receive ring buffer allocated to the NIC.
  2. NIC generates an interrupt which is delivered to the OS by the CPU.
  3. OS handles the interrupt, allocates kernel buffer and copies DMA’d packet into the kernel buffer for IP and TCP processing.
  4. After protocol processing, packet payload is copied to application buffer (user-space) for processing by the application.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When DPDK was developed and by whom?

A

DPDK was developed by Intel in 2010.

*Now it is an open source project under Linux Foundation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does DPDK provides?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a NIC ring buffer?

A

Being used to implement NIC queues. In the ring there is:

  1. Write pointer, which advances when NIC receives. local to the NIC (only the NIC can modify this pointer)
  2. 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the functions of DPDK’s NIC driver that reside in the kernel?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is using Hugepages (e.g., 2MB pages) more efficient than regular page sizes (4 KB)?

A

Work with fewer pages => Fewer TLB (translation look aside buffer) misses => improved performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What considerations should an NF developer take into account when working with modern commodity servers?

A
  1. Can match increasing capacities of NICs via multi-core processing (of the packet)
  2. When using NUMA servers - make sure you use your local RAM and not remote RAMs, because it is much more efficient.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe the NIC Ring Buffer process.

A
  1. Upon packet arrival, NIC populates the next vacant slot with packet’s descriptor.
    1. 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)
  2. CPU core running NF polls ring for unread slots.
  3. When new descriptor are found:
    1. CPU reads the packet data for those descriptors.
    1. Returns packets to application

4, No need for locking: producer and consumer are decoupled in ring buffer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the two possible DPDK application models?

A
  1. Run to completion model

2. Pipelined model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe the “run-to-completion” model.

A

It is one of two DPDK application models.
polling for incoming packets, processing on packet, and transmission of output packet all done by the same core. Each packet is handled by a unique core.

17
Q

Describe the pipelined model.

A

It is one of two DPDK application models.
Dedicated cores for polling and processing packets.
Inter-core packet transfer using ring buffer.

18
Q

What is a “receive side scaling”

A

It is hardware technology which enables multi-core processing.
It uses hashing to distribute incoming packets (5-tuple identifier) to individual cores.
Each core is assigned a unique ring buffer to poll => different connections get different queues (ring) and different cores.

*State management becomes easy because per-connection state is accessed only by a single core.

19
Q

What does NUMA stands for?

A

NUMA stands for Non-Uniform Memory Architecture