Difference between revisions of "VPP/Using mTCP user mode TCP stack with VPP"
| Line 1: | Line 1: | ||
| + | '''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.    | 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.    | ||
| Line 4: | Line 6: | ||
=== Setup ===  | === Setup ===  | ||
| + | |||
| + | '''NETMAP'''  | ||
| + | |||
| + | Download the sources from the upstream repository using following commands:  | ||
| + | |||
| + |    git clone git@github.com:luigirizzo/netmap.git  | ||
| + | OR  | ||
| + |    https://github.com/luigirizzo/netmap/archive/master.zip  | ||
| + | |||
| + | |||
| + | Apply the following patch on top of cloned sources:  | ||
| + | |||
| + |    git am 0001-Netmap-Disable-namespaces-for-vale-switch.patch  | ||
| + | OR  | ||
| + |    patch -p1 < 0001-Netmap-Disable-namespaces-for-vale-switch.patch  | ||
| + | |||
| + | Enter LINUX directory and configure netmap.  | ||
| + | To compile only NETMAP/VALE (using unmodified drivers):  | ||
| + | |||
| + | <pre>  | ||
| + | ./configure --no-drivers  | ||
| + | |||
| + | make  | ||
| + | |||
| + | make apps  | ||
| + | |||
| + | sudo insmod netmap.ko  | ||
| + | |||
| + | lsmod | grep netmap  | ||
| + | </pre>  | ||
| + | |||
| + | '''VPP'''  | ||
| + | |||
| + | |||
| + | <pre>  | ||
| + | |||
| + | </pre>  | ||
| + | |||
| + | |||
| + | '''mTCP'''  | ||
<pre>  | <pre>  | ||
| Line 11: | Line 53: | ||
=== Configure Interfaces ===  | === Configure Interfaces ===  | ||
| + | '''VPP'''  | ||
| + | |||
| + | Run VPP/VPP-lite and create netmap interfaces using following commands:  | ||
<pre>  | <pre>  | ||
| + |         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  | ||
</pre>    | </pre>    | ||
Revision as of 16:36, 7 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 commands:
git clone git@github.com:luigirizzo/netmap.git
OR
https://github.com/luigirizzo/netmap/archive/master.zip
Apply the following patch on top of cloned sources:
git am 0001-Netmap-Disable-namespaces-for-vale-switch.patch
OR
patch -p1 < 0001-Netmap-Disable-namespaces-for-vale-switch.patch
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
mTCP
Configure Interfaces
VPP
Run VPP/VPP-lite and create netmap interfaces using following commands:
        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
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  :