-
Notifications
You must be signed in to change notification settings - Fork 707
VPP HostStack VCL
VPP Comms Library (VCL) is meant to simplify application integration with VPP by offering APIs that are similar to but not POSIX compliant. Applications are not enforced to use VCL and, in fact, if more fine grained control is required, it's recommended that applications use the "raw" session layer apis. Nonetheless, it should be noted that such a choice come with significant overhead as apps need to handle session layer APIs, message queues, threading and the reimplementation of the async comms mechanisms (e.g., epoll).
VCL manages the interaction with the session layer, abstracts session to integer session handles, exposes its own async communication functions and it supports multi-worker applications. Notably, applications need to explicitly register their workers with VCL and they must ensure that sessions are never shared between multiple workers, i.e., VCL data structures are not thread safe.
If applications cannot be changed to avoid sharing sessions between multiple workers, or if they cannot be changed to explicitly register their workers, then they can use another shim layer built on top of VCL called VLS (VCL Locked Sessions). As the name suggests, VLS ensures through locking that only one of the application’s workers can interact at one time with a VCL session and in situations when the application has multiple threads that only one of those threads can interact with VCL.
Finally, for situations when an application cannot be changed, or changing it is too difficult, integration with VPP might be doable via LDP. LDP leverages LD_PRELOAD to intercept syscalls that are supposed to go into the kernel and reinjects them into VLS. It should however be noted that LDP is not expected to always work. Statically linked apps cannot be supported and most probably LDP does not support all the combinations of syscalls and options for syscalls combined with threading and forking app behavior.
For VCL and LDP examples see the tutorials section.
VCL tries to initialize by reading the configuration in the file pointed to by the VCL_CONFIG environment variable, or if that is not configured, by reading /etc/vpp/vcl.conf. If no file is found, VCL will fail to initialize.
Parameters that can be configured through the configuration file include:
| Parameter | Description |
|---|---|
heapsize <nn bytes> |
Size of heap used by VCL for the application (one or multiple workers). |
max-workers <nn> |
Max number of workers to be pre-allocated for the application. |
api-socket-name <filename> |
Path to binary api socket file. On vpp side, this is configured via socksvr {socket-name <path>} in startup.conf. |
app-socket-api <filename> |
Path to app socket api socket file. To enable the api in vpp see [[session layer config |
segment-size <nn bytes> |
Size of first shared memory segment requested from VPP |
add-segment-size <nn bytes> |
Size of additional shared memory segments to be added by VPP |
rx-fifo-size <nn bytes> |
Rx fifo size in bytes |
tx-fifo-size <nn bytes> |
Tx fifo size in bytes |
event-queue-size <nn> |
Length requested for message queue from VPP to VCL |
app-scope-local |
Request local scope for app |
app-scope-global |
Request global scope for app |
use-mq-eventfd |
Request use of eventfd, as opposed to mutex/condvar, message queue notifications |
namespace-id <string> |
ID for namespace that is requested (binary api only) |
namespace-secret <nn> |
Secret for namespace that is requested (binary api only) |
Note that only one of the two attachment options, i.e., binary api or the app socket api, can be used at one time. Moreover, if the session layer is configured to use the app socket api, it will take precedence over the binary api and all apps must be configured to use it.
- VPP 2022 Make Test Use Case Poll
- VPP-AArch64
- VPP-ABF
- VPP Alternative Builds
- VPP API Concepts
- VPP API Versioning
- VPP-ApiChangeProcess
- VPP-ArtifactVersioning
- VPP-BIER
- VPP-Bihash
- VPP-BugReports
- VPP Build System Deep Dive
- VPP Build, Install, And Test Images
- VPP-BuildArtifactRetentionPolicy
- VPP-c2cpel
- VPP Code Walkthrough VoD
- VPP Code Walkthrough VoD Topic Index
- VPP Code Walkthrough VoDs
- VPP-CodeStyleConventions
- VPP-CodingTips
- VPP Command Line Arguments
- VPP Command Line Interface CLI Guide
- VPP-CommitMessages
- VPP-Committers-SMEs
- VPP-CommitterTasks-ApiFreeze
- VPP CommitterTasks Compare API Changes
- VPP-CommitterTasks-CutPointRelease
- VPP-CommitterTasks-CutRelease
- VPP-CommitterTasks-FinalReleaseCandidate
- VPP-CommitterTasks-PullThrottleBranch
- VPP-CommitterTasks-ReleasePlan
- VPP Configuration Tool
- VPP Configure An LW46 MAP E Terminator
- VPP Configure VPP As A Router Between Namespaces
- VPP Configure VPP TAP Interfaces For Container Routing
- VPP-CoreFileMismatch
- VPP-cpel
- VPP-cpeldump
- VPP-CurrentData
- VPP-DHCPKit
- VPP-DHCPv6
- VPP-DistributedOwnership
- VPP-Documentation
- VPP DPOs And Feature Arcs
- VPP EC2 Instance With SRIOV
- VPP-elog
- VPP-FAQ
- VPP Feature Arcs
- VPP-Features
- VPP-Features-IPv6
- VPP-FIB
- VPP-g2
- VPP Getting VPP 16.06
- VPP Getting VPP Release Binaries
- VPP-HA
- VPP-HostStack
- VPP-HostStack-BuiltinEchoClientServer
- VPP-HostStack-EchoClientServer
- VPP-HostStack-ExternalEchoClientServer
- VPP HostStack Hs Test
- VPP-HostStack-LDP-iperf
- VPP-HostStack-LDP-nginx
- VPP-HostStack-LDP-sshd
- VPP-HostStack-nginx
- VPP-HostStack-SessionLayerArchitecture
- VPP-HostStack-TestHttpServer
- VPP-HostStack-TestProxy
- VPP-HostStack-TLS
- VPP-HostStack-VCL
- VPP-HostStack-VclEchoClientServer
- VPP-Hotplug
- VPP How To Add A Tunnel Encapsulation
- VPP How To Build The Sample Plugin
- VPP How To Connect A PCI Interface To VPP
- VPP How To Create A VPP Binary Control Plane API
- VPP How To Deploy VPP In EC2 Instance And Use It To Connect Two Different VPCs
- VPP How To Optimize Performance %28System Tuning%29
- VPP How To Use The API Trace Tools
- VPP How To Use The C API
- VPP How To Use The Packet Generator And Packet Tracer
- VPP-Howtos
- VPP-index
- VPP Installing VPP Binaries From Packages
- VPP Interconnecting vRouters With VPP
- VPP Introduction To IP Adjacency
- VPP Introduction To N Tuple Classifiers
- VPP IP Adjacency Introduction
- VPP-IPFIX
- VPP-IPSec
- VPP IPSec And IKEv2
- VPP IPv6 SR VIRL Topology File
- VPP Java API
- VPP Java API Plugin Support
- VPP Jira Workflow
- VPP-Macswapplugin
- VPP-MakeTestFramework
- VPP-Meeting
- VPP-MFIB
- VPP Missing Prefetches
- VPP Modifying The Packet Processing Directed Graph
- VPP MPLS FIB
- VPP-NAT
- VPP Nataas Test
- VPP-OVN
- VPP Per Feature Notes
- VPP Performance Analysis Tools
- VPP-perftop
- VPP Progressive VPP Tutorial
- VPP Project Meeting Minutes
- VPP Pulling, Building, Running, Hacking And Pushing VPP Code
- VPP Pure L3 Between Namespaces With 32s
- VPP Pure L3 Container Networking
- VPP Pushing And Testing A Tag
- VPP Python API
- VPP-PythonVersionPolicy
- VPP-QuickTrexSetup
- VPP Random Hints And Kinks For KVM Usage
- VPP Release Plans Release Plan 16.09
- VPP Release Plans Release Plan 17.01
- VPP Release Plans Release Plan 17.04
- VPP Release Plans Release Plan 17.07
- VPP Release Plans Release Plan 17.10
- VPP Release Plans Release Plan 18.01
- VPP Release Plans Release Plan 18.04
- VPP Release Plans Release Plan 18.07
- VPP Release Plans Release Plan 18.10
- VPP Release Plans Release Plan 19.01
- VPP Release Plans Release Plan 19.04
- VPP Release Plans Release Plan 19.08
- VPP Release Plans Release Plan 20.01
- VPP Release Plans Release Plan 20.05
- VPP Release Plans Release Plan 20.09
- VPP Release Plans Release Plan 21.01
- VPP Release Plans Release Plan 21.06
- VPP Release Plans Release Plan 21.10
- VPP Release Plans Release Plan 22.02
- VPP Release Plans Release Plan 22.06
- VPP Release Plans Release Plan 22.10
- VPP Release Plans Release Plan 23.02
- VPP Release Plans Release Plan 23.06
- VPP Release Plans Release Plan 23.10
- VPP Release Plans Release Plan 24.02
- VPP Release Plans Release Plan 24.06
- VPP Release Plans Release Plan 24.10
- VPP Release Plans Release Plan 25.02
- VPP Release Plans Release Plan 25.06
- VPP Release Plans Release Plan 25.10
- VPP Release Plans Release Plan 26.02
- VPP Release Plans Release Plan 26.06
- VPP-RM
- VPP-SecurityGroups
- VPP Segment Routing For IPv6
- VPP Segment Routing For MPLS
- VPP Setting Up Your Dev Environment
- VPP-SNAT
- VPP Software Architecture
- VPP STN Testing
- VPP The VPP API
- VPP Training Events
- VPP-Troubleshooting
- VPP-Troubleshooting-BuildIssues
- VPP-Troubleshooting-Vagrant
- VPP Tutorial DPDK And MacSwap
- VPP Tutorial Routing And Switching
- VPP-Tutorials
- VPP Use VPP To Chain VMs Using Vhost User Interface
- VPP Use VPP To Connect VMs Using Vhost User Interface
- VPP Using mTCP User Mode TCP Stack With VPP
- VPP Using VPP As A VXLAN Tunnel Terminator
- VPP Using VPP In A Multi Thread Model
- VPP-VOM
- VPP VPP BFD Nexus
- VPP VPP Home Gateway
- VPP VPP WIKI DEPRECATED CONTENT
- VPP-VPPCommunicationsLibrary
- VPP-VPPConfig
- VPP What Is ODP4VPP
- VPP What Is VPP
- VPP Working Environments
- VPP Working With The 16.06 Throttle Branch