Added user-guide.rst and api-docs.rst
[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 .. (c) <optionally add copywriters name>
4
5
6 User Guide
7 ==========
8
9 This is the user guide for Cherry release of O-DU/l2.
10
11 .. contents::
12    :depth: 3
13    :local:
14
15 A. Compilation:
16 ---------------
17
18 1. Build O-DU High:
19
20    a. Build folder
21
22       - cd <rsys_directory>/l2/build/odu
23
24    b. Build O-DU High binary
25    
26       - make odu MACHINE=BIT64 MODE=FDD
27
28    c. Clean O-DU High binary
29
30       - make clean_odu MACHINE=BIT64 MODE=FDD
31
32 2. Build CU Stub :
33
34    a. Build folder
35    
36       - cd <rsys_directory>/l2/build/odu
37
38    b. Build CU Stub binary
39    
40       - make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
41
42    c. Clean CU Stub binary
43    
44       - make clean_cu NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
45
46 3. Build RIC Stub :
47
48    a. Build folder
49    
50       - cd <rsys_directory>/l2/build/odu
51
52    b. Build RIC Stub binary
53    
54       - make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
55
56    c. Clean RIC Stub binary
57    
58       - make clean_ric NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
59
60 4. Clean ODU, CU Stub and RIC Stub together
61
62    a. make clean_all
63
64
65 B. Execution:
66 -------------
67
68 1. Assign virtual IP addresses as follows:
69
70    a. ifconfig <interface name>:ODU "192.168.130.81"
71    b. ifconfig <interface name>:CU_STUB "192.168.130.82"
72    c. ifconfig <interface name>:RIC_STUB "192.168.130.80"
73
74 2. Execute CU Stub:
75
76    a. CU execution folder
77
78       - cd <rsys_directory>/l2/bin/cu_stub
79
80    b. Run CU Stub binary
81
82       - ./cu_stub
83
84 3. Execute RIC Stub:
85
86    a. RIC execution folder
87
88       - cd <rsys_directory>/l2/bin/ric_stub
89
90    b. Run RIC Stub binary
91
92       - ./ric_stub
93
94 4. Execute DU:
95
96    a. DU execution folder
97
98       - cd <rsys_directory>/l2/bin/odu
99
100    b. Run ODU binary
101
102       - ./odu
103
104 PS: CU stub and RIC stub must be run (in no particular sequence) before ODU
105
106
107 C. Testing with Intel O-DU Low:
108 -------------------------------
109
110 I. Compilation
111 ^^^^^^^^^^^^^^
112
113    1. Build ODU :
114
115       a. Create folder <rsys_directory>/l2/src/wls_lib. Copy wls_lib.h from <intel_directory>/phy/wls_lib/ to 
116          <rsys_directory>/l2/src/wls_lib.
117
118       b. Create folder <rsys_directory>/l2/src/dpdk_lib. Copy following files from
119          <intel_directory>/dpdk-19.11/x86_64-native-linuxapp-gcc/include/ to <rsys_directory>/l2/src/dpdk_lib.
120          
121          - rte_branch_prediction.h
122          - rte_common.h
123          - rte_config.h
124          - rte_dev.h
125          - rte_log.h
126          - rte_pci_dev_feature_defs.h
127          - rte_bus.h
128          - rte_compat.h
129          - rte_debug.h
130          - rte_eal.h
131          - rte_os.h
132          - rte_per_lcore.h
133
134       c. Build folder
135
136          - cd <rsys_directory>/l2/build/odu
137
138       d. Build ODU Binary:
139            
140          - make odu PHY=INTEL_L1 PHY_MODE=TIMER MACHINE=BIT64 MODE=FDD
141
142    2. Build CU Stub and RIC Stub:
143
144       a. Execute steps in sections A.2 and A.3. 
145
146 II. Execution
147 ^^^^^^^^^^^^^
148
149    1. Execute O-DU Low:
150
151       a. Setup environment:
152       
153          - cd <intel_directory>/phy/
154          - source ./setupenv.sh
155
156       b. Run O-DU Low binary :
157       
158          - cd <intel_directory>/FlexRAN/l1/bin/nr5g/gnb/l1
159          - To run in timer mode : ./l1.sh -e
160          - L1 is up when following prints are seen on console:
161
162                 | Non BBU threads in application
163                 | \==================================================================
164                 | nr5g_gnb_phy2mac_api_proc_stats_thread: [PID: 8659] binding on [CPU 0] [PRIO: 0] [POLICY: 1]
165                 | wls_rx_handler (non-rt):                [PID: 8663] binding on [CPU 0]
166                 | \==================================================================
167           
168                 PHY>welcome to application console
169
170    2. Execute FAPI Translator:
171
172       a. Setup environment:
173    
174          - cd <intel_directory>/phy/
175          - source ./setupenv.sh
176
177       b. Run FAPI translator binary:
178
179          - cd <intel_directory>/phy/fapi_5g/bin/
180          - ./oran_5g_fapi --cfg=oran_5g_fapi.cfg
181
182    3. Execute CU Stub and RIC Stub:
183
184       a. Run steps in sections B.1-B.3.
185
186    4. Execute DU:
187    
188       a. DU execution folder
189      
190          - cd <rsys_directory>/l2/bin/odu
191       
192       b. Export WLS library path
193
194          - export LD_LIBRARY_PATH=<intel_directory>/phy/wls_lib/lib:$LD_LIBRARY_PATH
195       
196       c. Run ODU binary
197
198          - ./odu
199
200
201 D. Message Flow:
202 ----------------
203
204 O-DU High opens WLS interface during bring up. Message exchanges can begin once the interface is ready.
205 Following diagram shows P5 messages exchange with O-DU Low in timer mode.
206
207 .. figure:: L1-L2_Message_Flow.jpg
208   :width: 600
209   :alt: Figure 1 O-DU High - O-DU Low Message Flow Diagram
210
211   Figure 1 - O-DU High - O-DU Low Message Flow Diagram
212
213 Note: UL IQ-Sample request and response are needed by Intel O-DU Low in timer mode(testing mode) only. Code changes for
214 these are guarded under INTEL_TIMER_MODE flag which can be enabled using compilation option "PHY_MODE=TIMER", as mention
215 in section C.I.1.d .