summaryrefslogtreecommitdiffstats
path: root/kud/tests/vIPSec/pktgen
diff options
context:
space:
mode:
authorRuoyu Ying <ruoyu.ying@intel.com>2019-12-25 01:33:06 +0800
committerRuoyu Ying <ruoyu.ying@intel.com>2020-01-08 23:33:56 +0800
commit4341b41f3f949119b9106a58b243f42b50119b82 (patch)
tree609897297257881318a0bf79714bbe33959774c7 /kud/tests/vIPSec/pktgen
parent20b0ff063a92e6d4a5ecaf621e527c09ff1e5515 (diff)
Add execution script for vIPSec in k8s
Add execution scripts for each component in vIPSec to make it work for k8s. These scripts are going to be used along with the helm chart named 'vipsec' inside the demo folder. It aims to construct the vIPSec use case to set up a secure tunnel between peers and improve its performance along with hardware acceleration technologies such as SRIOV and QAT. Issue-ID: MULTICLOUD-969 Change-Id: I261272439b264db4d70cf8d5d2958a891c351b61 Signed-off-by: Ruoyu Ying <ruoyu.ying@intel.com>
Diffstat (limited to 'kud/tests/vIPSec/pktgen')
-rwxr-xr-xkud/tests/vIPSec/pktgen77
1 files changed, 77 insertions, 0 deletions
diff --git a/kud/tests/vIPSec/pktgen b/kud/tests/vIPSec/pktgen
new file mode 100755
index 00000000..14d7e6ca
--- /dev/null
+++ b/kud/tests/vIPSec/pktgen
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+# COPYRIGHT NOTICE STARTS HERE
+#
+# Copyright 2019 Intel Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# COPYRIGHT NOTICE ENDS HERE
+
+# This script prepares the runtime environment
+# for running vIPSec shell scripts on Ubuntu18.04
+
+set -o nounset
+set -o pipefail
+set -o xtrace
+set -o errexit
+
+
+DPDK_DIR=$PWD/dpdk
+Pktgen_Dir=$PWD/pktgen-dpdk
+
+function setup_dependencies {
+ sudo apt-get update
+ git clone http://dpdk.org/git/dpdk
+ git clone http://dpdk.org/git/apps/pktgen-dpdk
+ KERNEL_VERSION=$(uname -r)
+ echo $KERNEL_VERSION
+ sudo apt-get install -y linux-headers-$KERNEL_VERSION libpcap-dev gcc make libnuma-dev liblua5.3-dev python
+}
+
+function build_dpdk {
+ export RTE_SDK=$DPDK_DIR
+ export RTE_TARGET=x86_64-native-linux-gcc
+ export DESTDIR=$DPDK_DIR
+ cd $RTE_SDK
+ make install T=x86_64-native-linux-gcc
+ echo "DPDK install finished"
+ modprobe uio
+ insmod x86_64-native-linux-gcc/kmod/igb_uio.ko
+ export interface=$(lspci -nn | grep -m1 'Ethernet controller' | cut -d ' ' -f 1)
+ python ./usertools/dpdk-devbind.py -b igb_uio $interface
+}
+
+function build_pktgen {
+ cd $Pktgen_Dir
+ export RTE_SDK=$DPDK_DIR
+ export RTE_TARGET=x86_64-native-linux-gcc
+ make
+}
+
+mkdir /opt/config
+echo "$demo_artifacts_version" > /opt/config/demo_artifacts_version.txt
+echo "$vpg_private_ip_0" > /opt/config/vpg_private_ip0.txt
+echo "$ipsec_a_private_ip_0" > /opt/config/ipsec_a_private_ip0.txt
+echo "$protected_clientA_network_name" > /opt/config/protected_clientA_network_name.txt
+echo "$dcae_collector_ip" > /opt/config/dcae_collector_ip.txt
+echo "$dcae_collector_port" > /opt/config/dcae_collector_port.txt
+echo "$protected_clientA_net_gw" > /opt/config/protected_clientA_net_gw.txt
+echo "$protected_clientA_net_cidr" > /opt/config/protected_clientA_net_cidr.txt
+
+echo 'vm.nr_hugepages = 1024' >> /etc/sysctl.conf
+sysctl -p
+
+setup_dependencies
+build_dpdk
+build_pktgen