Convert Figma logo to code with AI

FDio logovpp

Mirror of VPP code base hosted at git.fd.io

1,236
619
1,236
25

Top Related Projects

3,536

Open vSwitch

3,266

Data Plane Development Kit

3,198

The FRRouting Protocol Suite

Quick Overview

VPP (Vector Packet Processing) is an open-source, high-performance packet processing framework developed by FD.io (Fast Data - Input/Output). It provides a flexible and extensible platform for building network functions, including routers, switches, and network appliances, with a focus on performance and scalability.

Pros

  • High performance: VPP utilizes vector processing techniques to achieve exceptional packet processing speeds
  • Extensibility: Supports plugins and custom extensions for adding new features and protocols
  • Hardware acceleration: Can leverage hardware offloading capabilities for improved performance
  • Multi-platform support: Runs on various architectures, including x86, ARM, and PowerPC

Cons

  • Steep learning curve: Requires in-depth knowledge of networking concepts and C programming
  • Limited documentation: Some areas of the project may lack comprehensive documentation
  • Complex configuration: Setting up and configuring VPP can be challenging for beginners
  • Resource-intensive: May require significant system resources for optimal performance

Code Examples

  1. Creating a simple VPP plugin:
#include <vnet/vnet.h>
#include <vnet/plugin/plugin.h>

static clib_error_t *
my_init (vlib_main_t * vm)
{
  return 0;
}

VLIB_INIT_FUNCTION (my_init);

VNET_PLUGIN_REGISTER () = {
    .version = VPP_BUILD_VER,
    .description = "My Custom Plugin",
};
  1. Registering a new CLI command:
static clib_error_t *
my_command_fn (vlib_main_t * vm,
               unformat_input_t * input,
               vlib_cli_command_t * cmd)
{
  vlib_cli_output (vm, "Hello from my custom command!");
  return 0;
}

VLIB_CLI_COMMAND (my_command, static) = {
  .path = "my custom command",
  .short_help = "Executes my custom command",
  .function = my_command_fn,
};
  1. Adding a new graph node:
VLIB_REGISTER_NODE (my_node) = {
  .name = "my-node",
  .vector_size = sizeof (u32),
  .format_trace = format_my_trace,
  .type = VLIB_NODE_TYPE_INTERNAL,
  .n_errors = ARRAY_LEN(my_error_strings),
  .error_strings = my_error_strings,
  .n_next_nodes = MY_N_NEXT,
  .next_nodes = {
    [MY_NEXT_DROP] = "error-drop",
  },
};

Getting Started

To get started with VPP:

  1. Clone the repository:

    git clone https://github.com/FDio/vpp.git
    
  2. Install dependencies:

    cd vpp
    make install-dep
    
  3. Build VPP:

    make build
    
  4. Install VPP:

    make install
    
  5. Start VPP:

    sudo vpp
    

For more detailed instructions and configuration options, refer to the official VPP documentation.

Competitor Comparisons

3,536

Open vSwitch

Pros of OVS

  • Mature and widely adopted in cloud environments
  • Extensive feature set for network virtualization
  • Strong integration with OpenStack and other cloud platforms

Cons of OVS

  • Lower performance compared to VPP, especially for high-speed networking
  • More complex configuration and management
  • Less suitable for edge and telco use cases

Code Comparison

VPP (DPDK-based fast-path processing):

VLIB_NODE_FN (dpdk_input_node) (vlib_main_t * vm,
                                vlib_node_runtime_t * node,
                                vlib_frame_t * frame)
{
  dpdk_main_t *dm = &dpdk_main;
  uword n_rx_packets = 0;
  // ... (packet processing logic)
}

OVS (Datapath implementation):

static int
ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
{
    struct nlattr **a = info->attrs;
    struct ovs_vport_cmd_info cmd_info;
    struct vport *vport;
    // ... (vport creation logic)
}

The code snippets showcase different approaches to packet processing and virtual port management in VPP and OVS, respectively. VPP focuses on high-performance packet processing using DPDK, while OVS implements a more flexible datapath for various networking scenarios.

3,266

Data Plane Development Kit

Pros of DPDK

  • Lower-level library offering more fine-grained control over packet processing
  • Wider hardware support and compatibility
  • More mature project with extensive documentation and community support

Cons of DPDK

  • Requires more manual configuration and setup
  • Steeper learning curve for developers
  • Less out-of-the-box functionality compared to VPP

Code Comparison

DPDK example (packet reception):

struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
unsigned int nb_rx = rte_eth_rx_burst(port_id, 0, pkts_burst, MAX_PKT_BURST);

VPP example (packet reception):

vlib_frame_t *frame;
u32 n_left_from, *from;
vlib_get_next_frame(vm, node, next_index, to_next, n_left_to_next);

Both DPDK and VPP are powerful networking frameworks, but they serve different purposes. DPDK is a lower-level library focused on efficient packet processing, while VPP provides a more comprehensive networking stack with additional features. DPDK offers more flexibility and hardware support, making it suitable for a wider range of applications. However, VPP provides a higher-level abstraction and more built-in functionality, which can lead to faster development for certain use cases.

3,198

The FRRouting Protocol Suite

Pros of FRRouting

  • More comprehensive routing protocol support, including BGP, OSPF, IS-IS, and RIP
  • Easier integration with existing network infrastructure
  • Better suited for traditional network environments and legacy systems

Cons of FRRouting

  • Lower performance compared to VPP's vector packet processing
  • Less optimized for modern, high-speed networking hardware
  • Limited support for advanced packet processing features

Code Comparison

FRRouting (BGP configuration example):

router bgp 65000
 neighbor 192.168.1.1 remote-as 65001
 network 10.0.0.0/8

VPP (Interface configuration example):

set interface ip address GigabitEthernet0/8/0 192.168.1.1/24
set interface state GigabitEthernet0/8/0 up

FRRouting focuses on routing protocols and network configuration, while VPP emphasizes high-performance packet processing and forwarding. FRRouting is more suitable for traditional networking scenarios, whereas VPP excels in modern, high-speed environments requiring advanced packet manipulation.

FRRouting offers a wider range of routing protocols and easier integration with existing networks. However, VPP provides superior performance and is better optimized for modern hardware. The choice between the two depends on specific use cases and network requirements.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Vector Packet Processing

Introduction

The VPP platform is an extensible framework that provides out-of-the-box production quality switch/router functionality. It is the open source version of Cisco's Vector Packet Processing (VPP) technology: a high performance, packet-processing stack that can run on commodity CPUs.

The benefits of this implementation of VPP are its high performance, proven technology, its modularity and flexibility, and rich feature set.

For more information on VPP and its features please visit the FD.io website and What is VPP? pages.

Changes

Details of the changes leading up to this version of VPP can be found under doc/releasenotes.

Directory layout

Directory nameDescription
build-dataBuild metadata
build-rootBuild output directory
docsSphinx Documentation
dpdkDPDK patches and build infrastructure
extras/libmemifClient library for memif
src/examplesVPP example code
src/pluginsVPP bundled plugins directory
src/svmShared virtual memory allocation library
src/testsStandalone tests (not part of test harness)
src/vatVPP API test program
src/vlibVPP application library
src/vlibapiVPP API library
src/vlibmemoryVPP Memory management
src/vnetVPP networking
src/vppVPP application
src/vpp-apiVPP application API bindings
src/vppinfraVPP core library
src/vpp/apiNot-yet-relocated API bindings
testUnit tests and Python test harness

Getting started

In general anyone interested in building, developing or running VPP should consult the VPP wiki for more complete documentation.

In particular, readers are recommended to take a look at [Pulling, Building, Running, Hacking, Pushing](https://wiki.fd.io/view/VPP/Pulling,_Building,_Run ning,_Hacking_and_Pushing_VPP_Code) which provides extensive step-by-step coverage of the topic.

For the impatient, some salient information is distilled below.

Quick-start: On an existing Linux host

To install system dependencies, build VPP and then install it, simply run the build script. This should be performed a non-privileged user with sudo access from the project base directory:

./extras/vagrant/build.sh

If you want a more fine-grained approach because you intend to do some development work, the Makefile in the root directory of the source tree provides several convenience shortcuts as make targets that may be of interest. To see the available targets run:

make

Quick-start: Vagrant

The directory extras/vagrant contains a VagrantFile and supporting scripts to bootstrap a working VPP inside a Vagrant-managed Virtual Machine. This VM can then be used to test concepts with VPP or as a development platform to extend VPP. Some obvious caveats apply when using a VM for VPP since its performance will never match that of bare metal; if your work is timing or performance sensitive, consider using bare metal in addition or instead of the VM.

For this to work you will need a working installation of Vagrant. Instructions for this can be found [on the Setting up Vagrant wiki page] (https://wiki.fd.io/view/DEV/Setting_Up_Vagrant).

More information

Several modules provide documentation, see @subpage user_doc for more end-user-oriented information. Also see @subpage dev_doc for developer notes.

Visit the VPP wiki for details on more advanced building strategies and other development notes.