-
Notifications
You must be signed in to change notification settings - Fork 708
VPP Using_mTCP_user_mode_TCP_stack_with_VPP
This example shows how to configure and run sample client/server applications using user mode mTCP in 2 linux namespaces (or containers) which communicate through VPP via netmap virtual interfaces.
In this setup we use 2 different namespaces called vpp1 and vpp2 and two sample applications epserver and epwget available with mTCP.
NETMAP
Download the sources from the upstream repository using following command:
git clone [email protected]:vpp-dev/netmap.git OR https://github.com/vpp-dev/netmap/archive/master.zip
Enter LINUX directory and configure netmap. To compile only NETMAP/VALE (using unmodified drivers):
./configure --no-drivers
make
make apps
sudo insmod netmap.ko
To verify that netmap module is loaded, Use the following command which should show (Module-name , Size and Used by):
lsmod | grep netmap
VPP
We assume that you are already running vpp. If it is not the case, please follow the following link to build, install and test VPP:
https://wiki.fd.io/view/VPP/Build,_install,_and_test_images
mTCP
Download the sources using following command:
git clone [email protected]:vpp-dev/mtcp.git OR https://github.com/vpp-dev/mtcp/archive/master.zip
Enter mtcp root directory and configure mtcp. To compile for netmap module:
./configure --enable-netmap
make
Namespaces
Create namespaces, using the following commands:
sudo ip netns add vpp1
sudo ip netns add vpp2
sudo ip netns show
vpp1
vpp2
VPP
Run VPP/VPP-lite and create netmap interfaces using the VPP debug Command-line Interface (CLI):
create netmap name vale00:vpp1 hw-addr 02:FE:3F:34:15:9B pipe master
create netmap name vale00:vpp2 hw-addr 02:FE:75:C5:43:66 pipe master
set int state netmap-vale00:vpp2 up
set int state netmap-vale00:vpp1 up
set int l2 xcon netmap-vale00:vpp1 netmap-vale00:vpp2
set int l2 xcon netmap-vale00:vpp2 netmap-vale00:vpp1
To verify that interfaces have been created and up, use the following command:
vpp# show int
Name Idx State Counter Count
local0 0 down
netmap-vale00:vpp1 5 up
netmap-vale00:vpp2 6 up
pg/stream-0 1 down
pg/stream-1 2 down
pg/stream-2 3 down
pg/stream-3 4 down
mTCP
In /apps/example/, you can change the epserver.conf file and epwget.conf.
example epserver.conf file:
# module
io = netmap
# Port
port vale00:vpp1}0
# Hw addr of port
hw_addr = 02:fe:3f:34:15:9b
# Ip addr of port
ip_addr = 10.0.42.3
# Netmask of port
netmask = 255.255.255.0
# Maximum concurrency per core
max_concurrency = 10000
# Maximum number of socket buffers per core
max_num_buffers = 10000
# Receive buffer size of sockets
rcvbuf = 16384
# Send buffer size of sockets
sndbuf = 16384
# TCP timeout seconds
tcp_timeout = 30
# TCP timewait seconds
tcp_timewait = 0
# Interface to print stats
stat_print = vale00:vpp1}0
example epwget.conf file
# module
io = netmap
# Port
port vale00:vpp2}0
# Hw addr of port
hw_addr = 02:fe:75:c5:43:66
# Ip addr of port
ip_addr = 10.0.42.2
# Netmask of port
netmask = 255.255.255.0
# Maximum concurrency per core
max_concurrency = 10000
# Maximum number of socket buffers per core
max_num_buffers = 10000
# Receive buffer size of sockets
rcvbuf = 16384
# Send buffer size of sockets
sndbuf = 8192
# TCP timeout seconds
tcp_timeout = 30
# TCP timewait seconds
tcp_timewait = 0
# Interface to print stats
stat_print = vale00:vpp2}0
Enter to /apps/example/, and create a new directory using the following command:
mkdir www
cd www/
nano index.html
Write something in the file, save and close it.
Enter to /apps/example/ and use the following command to start the http server:
sudo ip netns exec vpp1 ./epserver -p www/ -f epserver.conf -c 1 -N 1
On another terminal, Enter to /apps/example/ and use the following command to start the epwget client:
sudo ip netns exec vpp2 ./epwget 10.0.42.3/index.html 1 -N 1 -s 2 -o output.txt
In VPP CLI, use the command show int:
vpp# show int
Name Idx State Counter Count
local0 0 down
netmap-vale00:vpp1 5 up rx packets 501
rx bytes 48460
tx packets 601
tx bytes 51860
netmap-vale00:vpp2 6 up rx packets 601
rx bytes 51860
tx packets 501
tx bytes 48460
pg/stream-0 1 down
pg/stream-1 2 down
pg/stream-2 3 down
pg/stream-3 4 down
You can also use the command cat to see the http response output:
cat output.txt.0
HTTP/1.1 200 OK
- 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