Docs: Review and update the docs for E-release
[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 2) Multi port pair :  More than one pair of traffic
112
113 ::
114
115      e.g. Two port pair link 0, link1, link2 and link3 of VNF are used
116      TG:port 0 <------> VNF:Port 0
117      TG:port 1 <------> VNF:Port 1
118      TG:port 2 <------> VNF:Port 2
119      TG:port 3 <------> VNF:Port 3
120
121      For correalted traffic, use below configuration
122      TG_1:port 0 <------> VNF:Port 0
123                         VNF:Port 1 <------> TG_2:port 0 (UDP Replay)
124      (TG_2(UDP_Replay) reflects all the traffic on the given port)
125
126 * Bare-Metal
127    Refer: http://fast.dpdk.org/doc/pdf-guides/ to setup the DUT for VNF to run
128
129 * Standalone Virtualization - PHY-VM-PHY
130    * SRIOV
131      Refer below link to setup sriov
132      https://software.intel.com/en-us/articles/using-sr-iov-to-share-an-ethernet-port-among-multiple-vms
133
134  * OVS_DPDK
135      Refer below link to setup ovs-dpdk
136      http://docs.openvswitch.org/en/latest/intro/install/general/
137      http://docs.openvswitch.org/en/latest/intro/install/dpdk/
138
139  * Openstack
140      Use any OPNFV installer to deploy the openstack.
141
142
143 Build VNFs on the DUT:
144 ----------------------
145
146 1) Clone sampleVNF project repository  - git clone https://git.opnfv.org/samplevnf
147
148 Auto Build - Using script to build VNFs
149 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150      * Interactive options:
151
152        ::
153
154          ./tools/vnf_build.sh -i
155          Follow the steps in the screen from option [1] –> [9] and
156          select option [8] to build the vnfs.
157          It will automatically download selected DPDK version and any
158          required patches and will setup everything and build VNFs.
159
160          Following are the options for setup:
161          ----------------------------------------------------------
162          Step 1: Environment setup.
163          ----------------------------------------------------------
164          [1] Check OS and network connection
165          [2] Select DPDK RTE version
166
167          ----------------------------------------------------------
168          Step 2: Download and Install
169          ----------------------------------------------------------
170          [3] Agree to download
171          [4] Download packages
172          [5] Download DPDK zip
173          [6] Build and Install DPDK
174          [7] Setup hugepages
175
176          ----------------------------------------------------------
177          Step 3: Build VNFs
178          ----------------------------------------------------------
179          [8] Build all VNFs (vACL, vCGNAPT, vFW, UDP_Replay, DPPD-PROX)
180
181          [9] Exit Script
182      * non-Interactive options:
183
184        ::
185
186          ./tools/vnf_build.sh -s -d=<dpdk version eg 17.02>
187
188 Manual Build
189 ^^^^^^^^^^^^
190
191    ::
192
193       1. Download DPDK supported version from dpdk.org
194         http://dpdk.org/browse/dpdk/snapshot/dpdk-$DPDK_RTE_VER.zip
195         unzip dpdk-$DPDK_RTE_VER.zip and apply dpdk patches only in case of 16.04 (Not required for other DPDK versions)
196         cd dpdk
197         make config T=x86_64-native-linuxapp-gcc O=x86_64-native-linuxapp-gcc
198         cd x86_64-native-linuxapp-gcc
199         make -j
200       2. Setup huge pages
201         For 1G/2M hugepage sizes, for example 1G pages, the size must be specified
202         explicitly and can also be optionally set as the default hugepage size
203         for the system. For example, to reserve 8G of hugepage memory in the form
204         of eight 1G pages, the following options should be passed to the
205         kernel: * default_hugepagesz=1G hugepagesz=1G hugepages=8 hugepagesz=2M hugepages=2048
206       3. Add this to Go to /etc/default/grub configuration file.
207         Append “default_hugepagesz=1G hugepagesz=1G hugepages=8 hugepagesz=2M hugepages=2048”to the GRUB_CMDLINE_LINUX entry.
208       4. Setup Environment Variable
209         export RTE_SDK=<samplevnf>/dpdk
210         export RTE_TARGET=x86_64-native-linuxapp-gcc
211         export VNF_CORE=<samplevnf>
212         or using ./tools/setenv.sh
213       5. Build vACL VNFs
214         cd <samplevnf>/VNFs/vACL
215         make clean
216         make
217         The vACL executable will be created at the following location
218         <samplevnf>/VNFs/vACL/build/vACL
219
220 2) Standalone virtualization/Openstack:
221
222    Build VM image from script in  yardstick
223
224    ::
225
226      1) git clone https://git.opnfv.org/yardstick
227      2) cd yardstick and run
228         ./tools/yardstick-img-modify tools/ubuntu-server-cloudimg-samplevnf-modify.sh
229
230 To run VNFs. Please refer chapter `05-How_to_run_SampleVNFs.rst`