Merge "new review to be raise"
[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 CU Stub:
28
29    a. Navigate to CU execution folder
30
31       - cd <O-DU High Directory>/l2/bin/cu_stub
32
33    b. Run CU Stub binary
34
35       - ./cu_stub
36
37 3. Execute RIC Stub:
38
39    a. Navigate to RIC execution folder
40
41       - cd <O-DU High Directory>/l2/bin/ric_stub
42
43    b. Run RIC Stub binary
44
45       - ./ric_stub
46
47 4. Execute O-DU High:
48
49    a. Navigate to ODU execution folder
50
51       - cd <O-DU High Directory>/l2/bin/odu
52
53    b. Run ODU binary
54
55       - ./odu
56
57 PS: CU stub and RIC stub must be run (in no particular sequence) before ODU
58
59 II. Execution - Using Docker Images
60 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61
62 The call flow between O-DU High and CU Stub can be achieved by executing docker containers.
63
64 - Pull the last built docker images:
65     -   docker pull nexus3.o-ran-sc.org:10004/o-ran-sc/o-du-l2:3.0.1
66     -   docker pull nexus3.o-ran-sc.org:10004/o-ran-sc/o-du-l2-cu-stub:3.0.1
67
68 - Run CU Stub docker:
69     - docker run -it --privileged --net=host --entrypoint bash
70       nexus3.o-ran-sc.org:10004/o-ran-sc/o-du-l2-cu-stub:3.0.1   
71     - ./cu_stub
72
73 - Run ODU docker:
74     - docker run -it --privileged --net=host --entrypoint bash
75       nexus3.o-ran-sc.org:10004/o-ran-sc/o-du-l2:3.0.1   
76     - ./odu
77
78
79 B. Pairwise testing with Intel O-DU Low:
80 -----------------------------------------
81
82 This section describes the changes required in compilation and execution of O-DU High binaries to successfully integrate
83 with Intel O-DU Low in timer mode.
84
85
86 I. Pre-requisites
87 ^^^^^^^^^^^^^^^^^^
88
89    1. Install O-DU High as per installation-guide . 
90
91    2. Clone O-DU Low code in <O-DU Low Directory> from
92
93       a. https://gerrit.o-ran-sc.org/r/admin/repos/o-du/phy and,
94
95       b. https://github.com/intel/FlexRAN
96       
97    3. Install O-DU Low as per https://docs.o-ran-sc.org/projects/o-ran-sc-o-du-phy/en/latest/index.html .
98
99
100 II. Compilation
101 ^^^^^^^^^^^^^^^^
102
103    1. Build ODU :
104
105       a. Create folder <O-DU High Directory>/l2/src/wls_lib. Copy wls_lib.h from <O-DU Low Directory>/phy/wls_lib/ to 
106          <O-DU High Directory>/l2/src/wls_lib.
107
108       b. Create folder <O-DU High Directory>/l2/src/dpdk_lib. Copy following files from
109          <O-DU Low Directory>/dpdk-19.11/x86_64-native-linuxapp-gcc/include/ to <O-DU High Directory>/l2/src/dpdk_lib.
110          
111          - rte_branch_prediction.h
112          - rte_common.h
113          - rte_config.h
114          - rte_dev.h
115          - rte_log.h
116          - rte_pci_dev_feature_defs.h
117          - rte_bus.h
118          - rte_compat.h
119          - rte_debug.h
120          - rte_eal.h
121          - rte_os.h
122          - rte_per_lcore.h
123
124       c. Navigate to build folder
125
126          - cd <O-DU High Directory>/l2/build/odu
127
128       d. Build ODU Binary:
129            
130          - make odu PHY=INTEL_L1 PHY_MODE=TIMER MACHINE=BIT64 MODE=FDD
131
132
133 III. Execution
134 ^^^^^^^^^^^^^^^
135
136    1. Execute O-DU Low:
137
138       a. Setup environment:
139       
140          - cd <O-DU Low Directory>/phy/
141          - source ./setupenv.sh
142
143       b. Run O-DU Low binary :
144       
145          - cd <O-DU Low Directory>/FlexRAN/l1/bin/nr5g/gnb/l1
146          - To run in timer mode : ./l1.sh -e
147          - L1 is up when following prints are seen on console:
148
149                 | Non BBU threads in application
150                 | \==================================================================
151                 | nr5g_gnb_phy2mac_api_proc_stats_thread: [PID: 8659] binding on [CPU 0] [PRIO: 0] [POLICY: 1]
152                 | wls_rx_handler (non-rt):                [PID: 8663] binding on [CPU 0]
153                 | \==================================================================
154           
155                 PHY>welcome to application console
156
157    2. Execute FAPI Translator:
158
159       a. Setup environment:
160    
161          - cd <O-DU Low Directory>/phy/
162          - source ./setupenv.sh
163
164       b. Run FAPI translator binary:
165
166          - cd <O-DU Low Directory>/phy/fapi_5g/bin/
167          - ./oran_5g_fapi --cfg=oran_5g_fapi.cfg
168
169    3. Execute CU Stub and RIC Stub:
170
171       a. Run steps in sections A.I.1 through A.I.3 .
172
173    4. Execute DU:
174    
175       a. DU execution folder
176      
177          - cd <O-DU High Directory>/l2/bin/odu
178       
179       b. Export WLS library path
180
181          - export LD_LIBRARY_PATH=<O-DU Low Directory>/phy/wls_lib/lib:$LD_LIBRARY_PATH
182       
183       c. Run ODU binary
184
185          - ./odu
186
187
188 C. Message Flow:
189 ----------------
190
191 O-DU High opens WLS interface during bring up. Message exchanges can begin once the interface is ready.
192 Following diagram shows P5 messages exchanged with O-DU Low in timer mode.
193
194 .. figure:: O-DU_High_Low_Flow.jpg
195   :width: 600
196   :alt: Figure 1 O-DU High - O-DU Low Message Flow Diagram
197
198   Figure 5 - O-DU High - O-DU Low Message Flow Diagram
199
200 Note: UL IQ-Sample request and response are needed by Intel O-DU Low in timer mode(testing mode) only. Code changes for
201 these are guarded under INTEL_TIMER_MODE flag which can be enabled using compilation option "PHY_MODE=TIMER", as
202 mentioned in section B.I.1.d .