a663134cd46943fc71ac15f1881203bb367978b3
[vpp.git] / docs / gettingstarted / developers / softwarearchitecture.md
1 Software Architecture
2 =====================
3
4 The fd.io vpp implementation is a third-generation vector packet
5 processing implementation specifically related to US Patent 7,961,636,
6 as well as earlier work. Note that the Apache-2 license specifically
7 grants non-exclusive patent licenses; we mention this patent as a point
8 of historical interest.
9
10 For performance, the vpp dataplane consists of a directed graph of
11 forwarding nodes which process multiple packets per invocation. This
12 schema enables a variety of micro-processor optimizations: pipelining
13 and prefetching to cover dependent read latency, inherent I-cache phase
14 behavior, vector instructions. Aside from hardware input and hardware
15 output nodes, the entire forwarding graph is portable code.
16
17 Depending on the scenario at hand, we often spin up multiple worker
18 threads which process ingress-hashes packets from multiple queues using
19 identical forwarding graph replicas.
20
21 VPP Layers - Implementation Taxonomy
22 ------------------------------------
23
24 ![image](/_images/VPP_Layering.png)
25
26 -   VPP Infra - the VPP infrastructure layer, which contains the core
27     library source code. This layer performs memory functions, works
28     with vectors and rings, performs key lookups in hash tables, and
29     works with timers for dispatching graph nodes.
30 -   VLIB - the vector processing library. The vlib layer also handles
31     various application management functions: buffer, memory and graph
32     node management, maintaining and exporting counters, thread
33     management, packet tracing. Vlib implements the debug CLI (command
34     line interface).
35 -   VNET - works with VPP\'s networking interface (layers 2, 3, and 4)
36     performs session and traffic management, and works with devices and
37     the data control plane.
38 -   Plugins - Contains an increasingly rich set of data-plane plugins,
39     as noted in the above diagram.
40 -   VPP - the container application linked against all of the above.
41
42 It's important to understand each of these layers in a certain amount of
43 detail. Much of the implementation is best dealt with at the API level
44 and otherwise left alone.