Analysis of VPP (Vector Packet Processing)

Introduction to VPP

  • VPP (Vector Packet Processing) is an extensible open source framework under Cisco that provides easy-to-use, high-quality switching and routing functions
  • Features : high performance, running on ordinary cpu.
  • Advantages : high performance, mature technology, modularity, flexibility, rich feature set.
  • Can allow anyone to insert new nodes without changing the kernel code.

Modularity, flexibility, extensibility

  • The VPP construction is based on the "packet processing graph", which means that new nodes can be "inserted", and it becomes easy to expand, and some specific functions can be customized.
  • How plugins work : At runtime, the VPP platform grabs all available packets from the RX rings to form a packet vector, building a packet processing graph (including plugins). And graph nodes are loosely coupled, making new plugins easy to use and easy to combine with existing graph nodes.

    Innovation in packet processing

  • Packet processing is changed from processing one by one to processing a batch of packets (vector packets)

VPP usage

  • You can build a plugin independently on the VPP source tree.
  • VPP can be used to build various packet processing applications, which can be based on load balancing, firewall, etc., such as adding load balancing to vSwitch.
  • The VPP engine runs in pure user space, and you don't need source code to extend the engine's functionality.
  • New custom graph node
  • Reorganize graph nodes
  • New low-level APIs

traditional method

  • The so-called VPP vector packet processing is relative to the traditional scalar packet processing. The traditional message processing method is also the logical way of thinking commonly used by humans, that is: the messages are processed in the order of arrival, the first message is processed, the second is processed, and so on; A callsB calls C….return return return, the function will be called frequently nested, and eventually return.
  • In short, traditional packet processing processes incoming packets one by one without classifying them.
  • It can be seen that the traditional scalar packet processing has the following defects:
  1. I-cache jitter (cache time limitation and space limitation characteristics)

  2. I-cache misses

  3. Apart from expanding the cache, there are no changes.

VPP method

  • In short, vector packet processing adopts the idea of ​​"classification", which divides a batch of packets into one category, which is represented by a graph node. Processed by class, if the cache hits, all the packets in this batch are hit; otherwise, none of the packets are hit. When it misses, the traditional n packets miss n times to n packets miss 1 time.
  • VPP combines a batch of packets received by the underlying hardware queue Rx ring into a Packet Vector or a group of packets, and realizes the processing flow with the help of the Packet Processing graph. The graph node decomposes the whole process into one by one successively connected service nodes. This group of packets (packet vector) is processed by the task of the first graph node node, which in turn is processed by the task of the second graph node node, and so on,
  • Since the first packet-1 in the vector packet is warmed up for the I-cache, the processing performance of the remaining packets in the vector packet can directly reach the limit, and the fixed overhead of missing I-cache is amortized to the entire vector During processing, the processing overhead of a single packet is significantly reduced.
    It can be seen that vector message processing solves the main performance defects of scalar processing, and has the following advantages:
  1. Alleviate the I-cache thrashing problem
  2. Prefetching of vector packets alleviates the problem of read delay, high performance and more stability
Why is it called a vector pack?
  • This approach solves the problem related to stack depth/D cache misses on stack addresses. It improves "circuit time". A "circuit" is a loop that grabs all available packets from the device's RX ring, forms a "frame" (vector) consisting of the packet indices in RX order, runs the packets through the directed graph nodes, and returns to the RX ring. As packet processing continues, the circuit time reaches a steady balance based on the load provided.

rich features

  • VPP can be applied to

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324837987&siteId=291194637