Fix of compilation issue .[Issue-Id: ODUHIGH- 323]
[o-du/l2.git] / docs / README
1 A. Directory Structure :
2 ------------------------
3 1. l2/build/ : contains files required to compile the code
4    a. common : contains individual module's makefile
5    b. odu    : contains main makefile to generate an executable binary
6    c. scripts: contains scripts for logging
7    d. o1     : contains main makefile to generate an executable binary
8
9 2. l2/docs/  : contains README and other configuration files for building docs
10         
11 3. l2/src/ : contains layer specific source code
12    a. 5gnrmac  : MAC source code
13    b. 5gnrrlc  : RLC source code
14    c. cm       : common, environment and interface files
15    d. cu_stub  : Stub code for CU
16    e. du_app   : DU application and F1 code 
17    f. mt       : wrapper functions over OS
18    g. phy_stub : Stub code for Physical layer
19    h. rlog     : logging module
20    i. o1       : o1 module
21
22
23 B. Pre-requisite for Compilation :
24 ----------------------------------
25 1. Linux 32-bit/64-bit machine
26 2. GCC version 4.6.3 and above
27 3. Install LKSCTP
28    a. On Ubuntu : sudo apt-get install -y libsctp-dev
29    b. On CentOS : sudo yum install -y lksctp-tools-devel
30 4. Install PCAP:
31    a. On ubuntu : sudo apt-get install -y libpcap-dev
32    b. On CentOS : sudo yum install -y libpcap-devel
33
34
35 C. Pre-requisite for running O1 module:
36 ---------------------------------------
37 Install netconf server
38 ----------------------
39
40 1.      Create new netconf user (login with root user and run following command)
41         $adduser --system netconf && \
42         echo "netconf:netconf" | chpasswd
43
44         $mkdir -p /home/netconf/.ssh && \
45         ssh-keygen -A && \
46         ssh-keygen -t dsa -P '' -f /home/netconf/.ssh/id_dsa && \
47         cat /home/netconf/.ssh/id_dsa.pub > /home/netconf/.ssh/authorized_keys
48 2.      Install netconf packages. 
49         $cd l2/build/o1/
50         $chmod +x install_lib.sh
51         $ ./install_lib.sh
52
53 Install the yang module
54 -----------------------
55 1. cd l2/build/o1/yang
56    sysrepoctl -i o-ran-sc-odu-alarm-v1.yang
57    sysrepoctl -i o-ran-sc-odu-interface-v1.yang
58
59
60 D. How to Clean and Build:
61 --------------------------
62 1. Building ODU binary:
63    a. Build folder
64          cd l2/build/odu
65    b. Building ODU binary
66          make odu MACHINE=BIT64 MODE=FDD
67    c. Cleaning ODU binary
68          make clean_odu MACHINE=BIT64 MODE=FDD
69
70 2. Building CU Stub binary:
71    a. Build folder
72          cd l2/build/odu
73    b. Building CU Stub binary
74          make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
75    c. Cleaning CU Stub binary
76          make clean_cu NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
77
78 3. Building RIC Stub binary:
79    a. Build folder
80          cd l2/build/odu
81    b. Building RIC Stub binary
82          make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
83    c. Cleaning RIC Stub binary
84          make clean_ric NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
85
86 4. Cleaning ODU, CU Stub and RIC Stub:
87       make clean_all
88
89 5. Building ODU binary with O1 interface enabled:
90    a. Build folder
91          cd l2/build/odu
92    b. Building ODU with O1 module enabled:
93          make odu MACHINE=BIT64 MODE=FDD O1_ENABLE=YES
94    c. Cleaning ODU binary
95          make clean_odu MACHINE=BIT64 MODE=FDD
96
97    d. Build folder
98          cd l2/build/o1
99    e. Building O1 binary
100          make o1 MACHINE=BIT64
101    f. Cleaning O1 binary
102          make clean_o1 
103
104
105 E. How to execute:
106 ------------------
107 1. Assign virtual IP addresses as follows:
108    a. ifconfig <interface name>:ODU "192.168.130.81"
109    b. ifconfig <interface name>:CU_STUB "192.168.130.82"
110    c. ifconfig <interface name>:RIC_STUB "192.168.130.80"
111
112 2. Execute O1 (only if O-DU is built with O1 interface enabled):
113    a. O1 execution folder:
114         cd l2/build/o1/bin/o1
115    b. Run O1 binary:
116         ./o1
117
118 3. Execute CU Stub:
119    a. CU execution folder:
120         cd l2/bin/cu_stub
121    b. Run CU Stub binary:
122         ./cu_stub
123
124 4. Execute RIC Stub:
125    a. RIC execution folder:
126         cd l2/bin/ric_stub
127    b. Run RIC Stub binary:
128         ./ric_stub
129
130 5. Execute DU:
131    a. DU execution folder:
132         cd l2/bin/odu
133    b. Run ODU binary:
134         ./odu
135
136 PS: CU stub and RIC stub must be run (in no particular sequence) before ODU
137     If O1 module is enabled it must be run before ODU
138
139 F. How to test with Intel L1:
140 -----------------------------
141
142 I. Compilation
143    1. Build ODU :
144       a. Create folder l2/src/wls_lib. Copy wls_lib.h from <intel_directory>/phy/wls_lib/ to l2/src/wls_lib.
145       b. Create folder l2/src/dpdk_lib. Copy following files from <intel_directory>/dpdk-19.11/x86_64-native-linuxapp-gcc/include/ to l2/sr        c/dpdk_lib.
146                 rte_branch_prediction.h
147                 rte_common.h
148                 rte_config.h
149                 rte_dev.h
150                 rte_log.h
151                 rte_pci_dev_feature_defs.h
152                 rte_bus.h
153                 rte_compat.h
154                 rte_debug.h
155                 rte_eal.h
156                 rte_os.h
157                 rte_per_lcore.h
158       c. Build folder
159                 cd l2/build/odu
160       d. Build ODU Binary:
161                 make odu PHY=INTEL_L1 PHY_MODE=TIMER MACHINE=BIT64 MODE=FDD
162
163    2. Build CU Stub and RIC Stub:
164       a. Execute steps in sections D.2 and D.3.
165
166 II. Execution
167     1. Execute L1:
168        a. Setup environment:
169                 cd <intel_directory>/phy/
170                 source ./setupenv.sh
171        b. Run L1 binary :
172                 cd <intel_directory>/FlexRAN/l1/bin/nr5g/gnb/l1
173                 To run in timer mode : ./l1.sh -e
174                 L1 is up when console prints follow:
175
176                    Non BBU threads in application
177                    ===========================================================================================================
178                    nr5g_gnb_phy2mac_api_proc_stats_thread: [PID:   8659] binding on [CPU  0] [PRIO:  0] [POLICY:  1]
179                    wls_rx_handler (non-rt):                [PID:   8663] binding on [CPU  0]
180                    ===========================================================================================================
181                  
182                    PHY>welcome to application console
183
184     2. Execute FAPI Translator:
185        a. Setup environment:
186                 cd <intel_directory>/phy/
187                 source ./setupenv.sh
188        b. Run FAPI translator binary:
189                 cd <intel_directory>/phy/fapi_5g/bin/
190                 ./oran_5g_fapi --cfg=oran_5g_fapi.cfg
191
192     3. Execute CU Stub and RIC Stub:
193        a. Run steps in sections E.1-E.3
194
195     4. Execute DU:
196        a. DU execution folder
197                 cd l2/bin/odu
198        b. Export WLS library path
199                 export LD_LIBRARY_PATH=<intel_directory>/phy/wls_lib/lib:$LD_LIBRARY_PATH
200        c. Run ODU binary
201                 ./odu
202
203
204 G. How to execute the Health Check : get alarm-list
205 ----------------------------------------------------
206    
207    Steps:
208
209    1. Start Netconf netopeer client 
210    
211    2. Connect to the server with 
212
213         user: netconf
214         pwd:  netconf
215
216    3. Send a Netconf get request for alarms xpath
217
218    Here are the steps as executed in the terminal 
219
220        netopeer2-cli
221        > connect --login netconf
222        Interactive SSH Authentication
223        Type your password:
224        Password:
225        > get --filter-xpath /o-ran-sc-odu-alarm-v1:odu/alarms
226        DATA
227        <odu xmlns="urn:o-ran:odu:alarm:1.0">
228          <alarms>
229            <alarm>
230              <alarm-id>1009</alarm-id>
231              <alarm-text>cell id  [1] is up</alarm-text>
232              <severity>2</severity>
233              <status>Active</status>
234              <additional-info>cell UP</additional-info>
235            </alarm>
236          </alarms>
237        </odu>
238
239    The XML output is a list of active alarms in the O-DU High system.
240