Difference between revisions of "VPP/Using mTCP user mode TCP stack with VPP"
Line 32: | Line 32: | ||
'''VPP''' | '''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: | |
+ | <pre> | ||
+ | https://wiki.fd.io/view/VPP/Build,_install,_and_test_images | ||
</pre> | </pre> | ||
Line 45: | Line 47: | ||
https://github.com/vpp-dev/mtcp/archive/master.zip | https://github.com/vpp-dev/mtcp/archive/master.zip | ||
− | Enter mtcp directory and configure mtcp. To compile for netmap module: | + | Enter mtcp root directory and configure mtcp. To compile for netmap module: |
<pre> | <pre> | ||
./configure --enable-netmap | ./configure --enable-netmap | ||
</pre> | </pre> | ||
− | + | Enter to <mtcp-ROOT>/mtcp/src/ directory and run the following command: | |
<pre> | <pre> | ||
make | make | ||
</pre> | </pre> | ||
− | + | Enter into <mtcp-ROOT>/apps/example/ directory and run the following command: | |
<pre> | <pre> | ||
make | make | ||
Line 64: | Line 66: | ||
'''VPP''' | '''VPP''' | ||
− | Run VPP/VPP-lite and create netmap interfaces using | + | Run VPP/VPP-lite and create netmap interfaces using the VPP debug Command-line Interface (CLI): |
<pre> | <pre> | ||
create netmap name vale00:vpp1 hw-addr 02:FE:3F:34:15:9B pipe master | create netmap name vale00:vpp1 hw-addr 02:FE:3F:34:15:9B pipe master | ||
Line 77: | Line 79: | ||
=== Modify Config Files === | === Modify Config Files === | ||
− | In mTCP/apps/example/, you can change the epserver.conf file and epwget.conf. | + | In <mTCP-ROOT>/apps/example/, you can change the epserver.conf file and epwget.conf. |
− | example epserver.conf file: | + | example '''epserver.conf''' file: |
<pre> | <pre> | ||
# module | # module | ||
Line 118: | Line 120: | ||
</pre> | </pre> | ||
− | example epwget.conf file | + | example '''epwget.conf''' file |
<pre> | <pre> | ||
# module | # module |
Revision as of 12:12, 8 June 2016
NOTE: This page is under construction.
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.
Setup
NETMAP
Download the sources from the upstream repository using following command:
git clone git@github.com: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 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 git@github.com: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
Enter to <mtcp-ROOT>/mtcp/src/ directory and run the following command:
make
Enter into <mtcp-ROOT>/apps/example/ directory and run the following command:
make
Configure Interfaces
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
Modify Config Files
In <mTCP-ROOT>/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
Test
Using the VPP debug Command-line Interface (CLI) we can verify interface statistics.
Use the VPP CLI command
:
Use the command show interface
:
Use the command
: