Added details of O1 Module in docs.[Issue-Id: ODUHIGH-256]
[o-du/l2.git] / docs / user-guide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 User Guide
5 ***********
6
7 This is the user guide for Cherry release of O-DU/l2.
8 Follow installation-guide to get all the dependencies ready.
9
10 .. contents::
11    :depth: 3
12    :local:
13
14
15 A. Execution:
16 -------------
17
18 I. Execution - On locally compiling O-DU High Source Code
19 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
21 1. Assign virtual IP addresses as follows:
22
23    a. ifconfig <interface name>:ODU "192.168.130.81"
24    b. ifconfig <interface name>:CU_STUB "192.168.130.82"
25    c. ifconfig <interface name>:RIC_STUB "192.168.130.80"
26
27 2. Execute O1 (only if O-DU is built with O1 interface enabled):
28
29    a. Navigate to O1 build folder
30
31       - cd <O-DU High Directory>/l2/build/o1
32  
33    b. Create a new netconf user and install the YANG module
34       
35       Switch to root user and run following commands
36       
37       | adduser --system netconf && \\
38       |    echo "netconf:netconf" | chpasswd
39
40       | mkdir -p /home/netconf/.ssh && \\
41       | ssh-keygen -A && \\
42       | ssh-keygen -t dsa -P '' -f /home/netconf/.ssh/id_dsa && \\
43       |    cat /home/netconf/.ssh/id_dsa.pub > /home/netconf/.ssh/authorized_keys
44
45       sysrepoctl -i ./yang/o-ran-sc-odu-alarm-v1.yang
46
47    c. Navigate to O1 execution folder
48
49       - cd <O-DU High Directory>/l2/build/o1/bin/o1
50
51    d. Run O1 binary
52       
53       - ./o1
54
55 3. Execute CU Stub:
56
57    a. Navigate to CU execution folder
58
59       - cd <O-DU High Directory>/l2/bin/cu_stub
60
61    b. Run CU Stub binary
62
63       - ./cu_stub
64
65 4. Execute RIC Stub:
66
67    a. Navigate to RIC execution folder
68
69       - cd <O-DU High Directory>/l2/bin/ric_stub
70
71    b. Run RIC Stub binary
72
73       - ./ric_stub
74
75 5. Execute O-DU High:
76
77    a. Navigate to ODU execution folder
78
79       - cd <O-DU High Directory>/l2/bin/odu
80
81    b. Run ODU binary
82
83       - ./odu
84
85 PS: CU stub and RIC stub must be run (in no particular sequence) before ODU. If O-DU High is built with O1 interface enabled, the O1 binary must be run before all other binaries.
86
87 II. Execution - Using Docker Images
88 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89
90 The call flow between O-DU High and CU Stub can be achieved by executing docker containers.
91
92 - Pull the last built docker images:
93     -   docker pull nexus3.o-ran-sc.org:10004/o-ran-sc/o-du-l2:3.0.1
94     -   docker pull nexus3.o-ran-sc.org:10004/o-ran-sc/o-du-l2-cu-stub:3.0.1
95
96 - Run CU Stub docker:
97     - docker run -it --privileged --net=host --entrypoint bash
98       nexus3.o-ran-sc.org:10004/o-ran-sc/o-du-l2-cu-stub:3.0.1   
99     - ./cu_stub
100
101 - Run ODU docker:
102     - docker run -it --privileged --net=host --entrypoint bash
103       nexus3.o-ran-sc.org:10004/o-ran-sc/o-du-l2:3.0.1   
104     - ./odu
105
106
107 B. Pairwise testing with Intel O-DU Low:
108 -----------------------------------------
109
110 This section describes the changes required in compilation and execution of O-DU High binaries to successfully integrate
111 with Intel O-DU Low in timer mode.
112
113
114 I. Pre-requisites
115 ^^^^^^^^^^^^^^^^^^
116
117    1. Install O-DU High as per installation-guide . 
118
119    2. Clone O-DU Low code in <O-DU Low Directory> from
120
121       a. https://gerrit.o-ran-sc.org/r/admin/repos/o-du/phy and,
122
123       b. https://github.com/intel/FlexRAN
124       
125    3. Install O-DU Low as per https://docs.o-ran-sc.org/projects/o-ran-sc-o-du-phy/en/latest/index.html .
126
127
128 II. Compilation
129 ^^^^^^^^^^^^^^^^
130
131    1. Build ODU :
132
133       a. Create folder <O-DU High Directory>/l2/src/wls_lib. Copy wls_lib.h from <O-DU Low Directory>/phy/wls_lib/ to 
134          <O-DU High Directory>/l2/src/wls_lib.
135
136       b. Create folder <O-DU High Directory>/l2/src/dpdk_lib. Copy following files from
137          <O-DU Low Directory>/dpdk-19.11/x86_64-native-linuxapp-gcc/include/ to <O-DU High Directory>/l2/src/dpdk_lib.
138          
139          - rte_branch_prediction.h
140          - rte_common.h
141          - rte_config.h
142          - rte_dev.h
143          - rte_log.h
144          - rte_pci_dev_feature_defs.h
145          - rte_bus.h
146          - rte_compat.h
147          - rte_debug.h
148          - rte_eal.h
149          - rte_os.h
150          - rte_per_lcore.h
151
152       c. Navigate to build folder
153
154          - cd <O-DU High Directory>/l2/build/odu
155
156       d. Build ODU Binary:
157            
158          - make odu PHY=INTEL_L1 PHY_MODE=TIMER MACHINE=BIT64 MODE=FDD
159
160
161 III. Execution
162 ^^^^^^^^^^^^^^^
163
164    1. Execute O-DU Low:
165
166       a. Setup environment:
167       
168          - cd <O-DU Low Directory>/phy/
169          - source ./setupenv.sh
170
171       b. Run O-DU Low binary :
172       
173          - cd <O-DU Low Directory>/FlexRAN/l1/bin/nr5g/gnb/l1
174          - To run in timer mode : ./l1.sh -e
175          - L1 is up when following prints are seen on console:
176
177                 | Non BBU threads in application
178                 | \==================================================================
179                 | nr5g_gnb_phy2mac_api_proc_stats_thread: [PID: 8659] binding on [CPU 0] [PRIO: 0] [POLICY: 1]
180                 | wls_rx_handler (non-rt):                [PID: 8663] binding on [CPU 0]
181                 | \==================================================================
182           
183                 PHY>welcome to application console
184
185    2. Execute FAPI Translator:
186
187       a. Setup environment:
188    
189          - cd <O-DU Low Directory>/phy/
190          - source ./setupenv.sh
191
192       b. Run FAPI translator binary:
193
194          - cd <O-DU Low Directory>/phy/fapi_5g/bin/
195          - ./oran_5g_fapi --cfg=oran_5g_fapi.cfg
196
197    3. Execute CU Stub and RIC Stub:
198
199       a. Run steps in sections A.I.1 through A.I.3 .
200
201    4. Execute DU:
202    
203       a. DU execution folder
204      
205          - cd <O-DU High Directory>/l2/bin/odu
206       
207       b. Export WLS library path
208
209          - export LD_LIBRARY_PATH=<O-DU Low Directory>/phy/wls_lib/lib:$LD_LIBRARY_PATH
210       
211       c. Run ODU binary
212
213          - ./odu
214
215
216 C. Message Flow:
217 ----------------
218
219 O-DU High opens WLS interface during bring up. Message exchanges can begin once the interface is ready.
220 Following diagram shows P5 messages exchanged with O-DU Low in timer mode.
221
222 .. figure:: O-DU_High_Low_Flow.jpg
223   :width: 600
224   :alt: Figure 7 O-DU High - O-DU Low Message Flow Diagram
225
226   Figure 7 - O-DU High - O-DU Low Message Flow Diagram
227
228 Note: UL IQ-Sample request and response are needed by Intel O-DU Low in timer mode(testing mode) only. Code changes for
229 these are guarded under INTEL_TIMER_MODE flag which can be enabled using compilation option "PHY_MODE=TIMER", as
230 mentioned in section B.I.1.d .
231
232
233 D. Health Check execution: get alarm-list
234 -------------------------------------------
235
236 To execute the get alarm-list flow, following steps are required to be executed:
237
238    1.   Start Netconf netopeer client 
239    
240    2. Connect to the server with 
241
242       | user: netconf
243       | pwd:  netconf
244
245    3. Send a Netconf get request for alarms xpath
246
247 Here are the steps as executed in the terminal 
248
249      |  netopeer2-cli
250      |  > connect --login netconf
251      |  Interactive SSH Authentication
252      |  Type your password:
253      |  Password:
254      |  > get --filter-xpath /o-ran-sc-odu-alarm-v1\:odu/alarms
255      |  DATA
256      |  <odu xmlns=\"urn\:o-ran\:odu\:alarm\:1.0\">
257      |    <alarms>
258      |      <alarm>
259      |        <alarm-id>1009</alarm-id>
260      |        <alarm-text>cell id  [1] is up</alarm-text>
261      |        <severity>2</severity>
262      |        <status>Active</status>
263      |        <additional-info>cell UP</additional-info>
264      |      </alarm>
265      |    </alarms>
266      |  </odu>
267
268 The XML output is a list of active alarms in the O-DU High system.
269
270 Note: Integration with SMO/OAM is not yet done so a Netconf CLI client(netopeer2-cli) is used to connect to the Netconf server and send the get request.