network receivetransmit code mitigates costly memory operations by

Network receivetransmit code mitigates costly memory

This preview shows page 6 - 8 out of 18 pages.

network receive/transmit code-path [ 35 ]– [ 37 ] mitigates costly memory operations by mapping DMA regions into user-space memory and passing only lightweight packet descriptors between the kernel and the application; such descriptors may contain a pointer to the packet buffer plus some additional metadata. Memory management, i.e., the allocation of new packet buffers or the freeing of unused ones, may also be a source of significant overhead. To avoid memory management in the fast packet processing path, modern network stacks typically
Image of page 6

Subscribe to view the full document.

7 use pre-allocated packet buffers. A set of memory pools is created during startup and this memory area is never freed: such mempools are usually organized into ring buffers where packets are written to, and read from, in a sequential fashion. Mempools are usually allocated from hugepages whose size typically ranges from 2 MB to 1 GB to prevent misses in the Translation Lookaside Buffer (TLB). Care must be taken, however, to place mempools to the Non-Uniform Memory Access (NUMA) node where the majority of memory accesses will be made during runtime, otherwise performance may incurr the penalty of accessing faraway memory across NUMA nodes. Network programmers should also take care of adopting cache-friendly data structures: for instance hash-table buckets should always be sufficiently aligned to cache lines and should occupy as few cache lines as possible in order to maximize CPU cache hit rate, and compressed data structures may be used to reduce the overall memory footprint of performance- sensitive data [ 38 ]. Finally, prefetching data ahead of time from main memory may substantially contribute to increased performance, by avoiding CPU stalls (i.e., that the execution of CPU instructions is blocked due to memory access). Compute batching is a technique that can be used to enhance the CPU pipeline performance [ 34 ], [ 39 ]. Traditional network engines typically process network traffic on a per-packet basis: network functions in the processing path are sequentially applied to a packet until the final forwarding decision is made. With compute batching, the notion of I/O batching is extended to VNF processing, in that network functions are implemented from the outset to work on entire bursts of packets rather than on a single packet. Similarly to I/O batching, compute- batching helps mitigating the overhead of invoking VNFs (e.g., context switches and stack initialization) as well as providing additional computational benefits. First, compute batching optimizes the use of the first-level CPU instruction cache: when a packet batch enters a network function, the corresponding code is fetched into the L1 instruction cache upon processing the first packet, and the instruction cache remains warm during processing the rest of the packet burst.
Image of page 7
Image of page 8
  • Spring '16

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes