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