Fix all the config files alignment issues
[samplevnf.git] / docs / testing / user / userguide / 04-installation.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International
2 .. License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) OPNFV, Intel Corporation and others.
5
6 SampleVNF Installation
7 ======================
8
9 Abstract
10 --------
11
12 This project provides a placeholder for various sample VNF
13 (Virtual Network Function (:term:`VNF`)) development which includes example
14 reference architecture and optimization methods related to VNF/Network service
15 for high performance VNFs.
16 The sample VNFs are Open Source approximations* of Telco grade VNF’s using
17 optimized VNF + NFVi Infrastructure libraries, with Performance Characterization
18 of Sample† Traffic Flows.
19
20 ::
21
22   * Not a commercial product. Encourage the community to contribute and close the feature gaps.
23   † No Vendor/Proprietary Workloads
24
25 SampleVNF supports installation directly in Ubuntu. The installation procedure
26 are detailed in the sections below.
27
28 The steps needed to run SampleVNF are:
29   1) Install and Build SampleVNF.
30   2) Deploy the VNF on the target and modify the config based on the Network under test
31   3) Run the traffic generator to generate the traffic.
32
33 Prerequisites
34 -------------
35
36 Supported Test setup
37 ^^^^^^^^^^^^^^^^^^^^^
38 The device under test (DUT) consists of a system following;
39   * A single or dual processor and PCH chip, except for System on Chip (SoC) cases
40   * DRAM memory size and frequency (normally single DIMM per channel)
41   * Specific Intel Network Interface Cards (NICs)
42   * BIOS settings noting those that updated from the basic settings
43   * DPDK build configuration settings, and commands used for tests
44 Connected to the DUT is an IXIA* or Software Traffic generator like pktgen or TRex,
45 simulation platform to generate packet traffic to the DUT ports and
46 determine the throughput/latency at the tester side.
47
48 Below are the supported/tested (:term:`VNF`) deployment type.
49
50 .. image:: images/deploy_type.png
51    :width: 800px
52    :alt: SampleVNF supported topology
53
54 Hardware & Software Ingredients
55 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56
57 SUT requirements:
58
59 ::
60
61    +-----------+------------------+
62    | Item      | Description      |
63    +-----------+------------------+
64    | Memory    | Min 20GB         |
65    +-----------+------------------+
66    | NICs      | 2 x 10G          |
67    +-----------+------------------+
68    | OS        | Ubuntu 16.04 LTS |
69    +-----------+------------------+
70    | kernel    |  4.4.0-34-generic|
71    +-----------+------------------+
72    | DPDK      | 17.02            |
73    +-----------+------------------+
74
75 Boot and BIOS settings:
76
77 ::
78
79    +------------------+---------------------------------------------------+
80    | Boot settings    | default_hugepagesz=1G hugepagesz=1G hugepages=16  |
81    |                  | hugepagesz=2M hugepages=2048 isolcpus=1-11,22-33  |
82    |                  | nohz_full=1-11,22-33 rcu_nocbs=1-11,22-33         |
83    |                  | Note: nohz_full and rcu_nocbs is to disable Linux*|
84    |                  | kernel interrupts, and it’s import                |
85    +------------------+---------------------------------------------------+
86    |BIOS              | CPU Power and Performance Policy <Performance>    |
87    |                  | CPU C-state Disabled                              |
88    |                  | CPU P-state Disabled                              |
89    |                  | Enhanced Intel® Speedstep® Tech Disabled          |
90    |                  | Hyper-Threading Technology (If supported) Enable  |
91    |                  | Virtualization Techology Enable                   |
92    |                  | Coherency Enable                                  |
93    |                  | Turbo Boost Disabled                              |
94    +------------------+---------------------------------------------------+
95
96 Network Topology for testing VNFs
97 ---------------------------------
98 The ethernet cables should be connected between traffic generator and the VNF server (BM,
99 SRIOV or OVS) setup based on the test profile.
100
101 The connectivity could be
102
103 1) Single port pair : One pair ports used for traffic
104
105 ::
106
107      e.g. Single port pair link0 and link1 of VNF are used
108      TG:port 0 <------> VNF:Port 0
109      TG:port 1 <------> VNF:Port 1
110
111      For correalted traffic, use below configuration
112      TG_1:port 0 <------> VNF:Port 0
113                         VNF:Port 1 <------> TG_2:port 0 (UDP Replay)
114      (TG_2(UDP_Replay) reflects all the traffic on the given port)
115
116 2) Multi port pair :  More than one pair of traffic
117
118 ::
119
120      e.g. Two port pair link 0, link1, link2 and link3 of VNF are used
121      TG:port 0 <------> VNF:Port 0
122      TG:port 1 <------> VNF:Port 1
123      TG:port 2 <------> VNF:Port 2
124      TG:port 3 <------> VNF:Port 3
125
126      For correalted traffic, use below configuration
127      TG_1:port 0 <------> VNF:Port 0
128                           VNF:Port 1 <------> TG_2:port 0 (UDP Replay)
129      TG_1:port 1 <------> VNF:Port 2
130                           VNF:Port 3 <------> TG_2:port 1 (UDP Replay)
131      (TG_2(UDP_Replay) reflects all the traffic on the given port)
132
133 * Bare-Metal
134    Refer: http://fast.dpdk.org/doc/pdf-guides/ to setup the DUT for VNF to run
135
136 * Standalone Virtualization - PHY-VM-PHY
137    * SRIOV
138      Refer below link to setup sriov
139      https://software.intel.com/en-us/articles/using-sr-iov-to-share-an-ethernet-port-among-multiple-vms
140
141  * OVS_DPDK
142      Refer below link to setup ovs-dpdk
143      http://docs.openvswitch.org/en/latest/intro/install/general/
144      http://docs.openvswitch.org/en/latest/intro/install/dpdk/
145
146  * Openstack
147      Use any OPNFV installer to deploy the openstack.
148
149
150 Build VNFs on the DUT:
151 ----------------------
152
153 1) Clone sampleVNF project repository  - git clone https://git.opnfv.org/samplevnf
154
155 Auto Build - Using script to build VNFs
156 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157      * Interactive options:
158        ::
159
160          ./tools/vnf_build.sh -i
161          Follow the steps in the screen from option [1] –> [10] and
162          select option [9] to build the vnfs.
163          It will automatically download selected DPDK version and any
164          required patches and will setup everything and build VNFs.
165
166          Options [8], If RestAPI feature is needed install 'civetweb'
167
168          Following are the options for setup:
169          ----------------------------------------------------------
170          Step 1: Environment setup.
171          ----------------------------------------------------------
172          [1] Check OS and network connection
173          [2] Select DPDK RTE version
174
175          ----------------------------------------------------------
176          Step 2: Download and Install
177          ----------------------------------------------------------
178          [3] Agree to download
179          [4] Download packages
180          [5] Download DPDK zip
181          [6] Build and Install DPDK
182          [7] Setup hugepages
183          [8] Download and Build civetweb
184
185          ----------------------------------------------------------
186          Step 3: Build VNFs
187          ----------------------------------------------------------
188          [9] Build all VNFs (vACL, vCGNAPT, vFW, UDP_Replay, DPPD-PROX)
189
190          [10] Exit Script
191
192      * non-Interactive options:
193        ::
194          ./tools/vnf_build.sh -s -d=<dpdk version eg 17.02>
195
196 Manual Build
197 ^^^^^^^^^^^^
198
199    ::
200
201       1. Download DPDK supported version from dpdk.org
202          * http://dpdk.org/browse/dpdk/snapshot/dpdk-$DPDK_RTE_VER.zip
203          * unzip dpdk-$DPDK_RTE_VER.zip and apply dpdk patches only in case of 16.04 (Not required for other DPDK versions)
204          * cd dpdk
205          * make config T=x86_64-native-linuxapp-gcc O=x86_64-native-linuxapp-gcc
206          * cd x86_64-native-linuxapp-gcc
207          * make -j
208       2. Add this to Go to /etc/default/grub configuration file to setup hugepages.
209          * Append “default_hugepagesz=1G hugepagesz=1G hugepages=8 hugepagesz=2M hugepages=2048” to the GRUB_CMDLINE_LINUX entry.
210       3. Setup Environment Variable
211          * export RTE_SDK=<samplevnf>/dpdk
212          * export RTE_TARGET=x86_64-native-linuxapp-gcc
213          * export VNF_CORE=<samplevnf> or using ./tools/setenv.sh
214       4. Build SampleVNFs e.g, vACL
215          * cd <samplevnf>/VNFs/vACL
216          * make clean
217          * make
218          * The vACL executable will be created at the following location
219            <samplevnf>/VNFs/vACL/build/vACL
220
221 2) Standalone virtualization/Openstack:
222
223    Build VM image from script in  yardstick
224    ::
225      1) git clone https://git.opnfv.org/samplevnf
226      2) cd samplevnf and run
227         ./tools/samplevnf-img-dpdk-samplevnf-modify tools/ubuntu-server-cloudimg-samplevnf-modify.sh
228         Image available in: /tmp/workspace/samplevnf/xenial-server-cloudimg-amd64-disk1.img
229
230 To run VNFs. Please refer chapter `05-How_to_run_SampleVNFs.rst`