Difference between revisions of "VPP Sandbox/turbotap"
Line 6: | Line 6: | ||
Tap interfaces are virtual network devices in Linux Kernel. Legacy tap interfaces provide mechanism to write down user space application to send/receive packets to/from tap interfaces. VPP implements tap interfaces driver ''tapcli'' and provides tap interfaces at host side to communicate with host kernel stack or with applications running on host or for containerized applications. VPP uses tap interfaces to connect with legacy applications that use host APIs or system calls. Tapcli driver implements one system call per packet which results in huge performance issue due to context switching. | Tap interfaces are virtual network devices in Linux Kernel. Legacy tap interfaces provide mechanism to write down user space application to send/receive packets to/from tap interfaces. VPP implements tap interfaces driver ''tapcli'' and provides tap interfaces at host side to communicate with host kernel stack or with applications running on host or for containerized applications. VPP uses tap interfaces to connect with legacy applications that use host APIs or system calls. Tapcli driver implements one system call per packet which results in huge performance issue due to context switching. | ||
− | '''Turbotap''' driver is an experimental work and a replacement for ''tapcli'' driver in VPP | + | '''Turbotap''' driver is an experimental work and a replacement for ''tapcli'' driver in VPP. It uses tap interfaces using socket API system calls '''sendmmsg''' or '''recvmmsg''' that allows to send/receive multiple packets using one single system call. Hence save the time for '''context switching''' between userspace and kernel space. |
The linux kernel doesn't support socket API for tap interfaces. Therefore, a separate turbotap 'LINUX KERNEL MODULE' has been implemented to support send and receive socket system calls. | The linux kernel doesn't support socket API for tap interfaces. Therefore, a separate turbotap 'LINUX KERNEL MODULE' has been implemented to support send and receive socket system calls. | ||
+ | |||
+ | Currently the turbotap driver plugin uses socket API system calls. Most of the code is borrowed from tapcli driver in VPP. One can extend it to multi-queue driver. | ||
== Build and Install == | == Build and Install == | ||
− | The turbotap driver is implemented as a plugin to send/receive packets from kernel tap interfaces. | + | The turbotap driver is implemented as a plugin to send/receive packets from kernel tap interfaces. Before using it, you must BUILD and INSTALL '''turbotap kernel module'''. Then you must build plugin and put it in VPPs runtime plugin directory. The plugin depends on vpp. This wiki assumes familiarity with the build environment for both projects. |
Build vpp and turbotap both at once by creating symbolic links in the top level vpp directory to the turbotap directory as well as symbolic links to the respective .mk files in 'build-data/packages'. | Build vpp and turbotap both at once by creating symbolic links in the top level vpp directory to the turbotap directory as well as symbolic links to the respective .mk files in 'build-data/packages'. | ||
− | + | $ cd /git/vpp | |
− | $ cd /git/vpp | + | $ ln -sf /git/vppsb/turbotap |
− | $ ln -sf /git/vppsb/turbotap | + | $ ln -sf ../../turbotap/turbotap.mk build-data/packages/ |
− | $ ln -sf ../../turbotap/turbotap.mk build-data/packages/ | + | |
− | + | ||
Now build everything and create a link to the plugin in vpp's plugin path. | Now build everything and create a link to the plugin in vpp's plugin path. | ||
− | + | $ cd build-root | |
− | $ cd build-root | + | $ ./bootstrap.sh |
− | $ ./bootstrap.sh | + | $ make V=0 PLATFORM=vpp TAG=vpp_debug turbotap-install |
− | $ make V=0 PLATFORM=vpp TAG=vpp_debug turbotap-install | + | $ ln -sf /git/vpp/build-root/install-vpp_debug-native/router/lib64/turbotap.so.0.0.0 \ |
− | $ ln -sf /git/vpp/build-root/install-vpp_debug-native/router/lib64/turbotap.so.0.0.0 \ | + | /usr/lib/vpp_plugins/ |
− | + | ||
Once VPP is running and the plugin is loaded, turbotap interfaces can be created or deleted. | Once VPP is running and the plugin is loaded, turbotap interfaces can be created or deleted. | ||
− | + | $ vppctl turbotap connect turbotap0 | |
− | $ vppctl turbotap connect turbotap0 | + | |
− | + | ||
− | + | ||
The host operating system should see a turbotap named 'turbotap0'. | The host operating system should see a turbotap named 'turbotap0'. | ||
− | + | $ vppctl turbotap delete turbotap0 | |
− | + | ||
+ | To delete the turbotap interfaces. | ||
== References == | == References == | ||
− | + | * TUN/TAP: https://www.kernel.org/doc/Documentation/networking/tuntap.txt | |
− | + | * '''sendmmsg''' system call: http://linux.die.net/man/2/sendmmsg | |
− | + | * '''recvmmsg''' system call: http://linux.die.net/man/2/recvmmsg | |
− | + | * Vector Packet Processing (VPP): https://wiki.fd.io/view/VPP | |
+ | * Turbotap kernel module: https://github.com/vpp-dev/turbotap |
Revision as of 13:15, 10 August 2016
Hello Turbotap!!!
Abstract
The objective of this project is to continue to build out better integration with host operating system and for providing a basis to enable completely or partially unmodified applications to take advantage of a fast datapath.
Introduction
Tap interfaces are virtual network devices in Linux Kernel. Legacy tap interfaces provide mechanism to write down user space application to send/receive packets to/from tap interfaces. VPP implements tap interfaces driver tapcli and provides tap interfaces at host side to communicate with host kernel stack or with applications running on host or for containerized applications. VPP uses tap interfaces to connect with legacy applications that use host APIs or system calls. Tapcli driver implements one system call per packet which results in huge performance issue due to context switching.
Turbotap driver is an experimental work and a replacement for tapcli driver in VPP. It uses tap interfaces using socket API system calls sendmmsg or recvmmsg that allows to send/receive multiple packets using one single system call. Hence save the time for context switching between userspace and kernel space.
The linux kernel doesn't support socket API for tap interfaces. Therefore, a separate turbotap 'LINUX KERNEL MODULE' has been implemented to support send and receive socket system calls.
Currently the turbotap driver plugin uses socket API system calls. Most of the code is borrowed from tapcli driver in VPP. One can extend it to multi-queue driver.
Build and Install
The turbotap driver is implemented as a plugin to send/receive packets from kernel tap interfaces. Before using it, you must BUILD and INSTALL turbotap kernel module. Then you must build plugin and put it in VPPs runtime plugin directory. The plugin depends on vpp. This wiki assumes familiarity with the build environment for both projects.
Build vpp and turbotap both at once by creating symbolic links in the top level vpp directory to the turbotap directory as well as symbolic links to the respective .mk files in 'build-data/packages'.
$ cd /git/vpp $ ln -sf /git/vppsb/turbotap $ ln -sf ../../turbotap/turbotap.mk build-data/packages/
Now build everything and create a link to the plugin in vpp's plugin path.
$ cd build-root $ ./bootstrap.sh $ make V=0 PLATFORM=vpp TAG=vpp_debug turbotap-install $ ln -sf /git/vpp/build-root/install-vpp_debug-native/router/lib64/turbotap.so.0.0.0 \ /usr/lib/vpp_plugins/
Once VPP is running and the plugin is loaded, turbotap interfaces can be created or deleted.
$ vppctl turbotap connect turbotap0
The host operating system should see a turbotap named 'turbotap0'.
$ vppctl turbotap delete turbotap0
To delete the turbotap interfaces.
References
- TUN/TAP: https://www.kernel.org/doc/Documentation/networking/tuntap.txt
- sendmmsg system call: http://linux.die.net/man/2/sendmmsg
- recvmmsg system call: http://linux.die.net/man/2/recvmmsg
- Vector Packet Processing (VPP): https://wiki.fd.io/view/VPP
- Turbotap kernel module: https://github.com/vpp-dev/turbotap