Added details of O1 Module in docs.[Issue-Id: ODUHIGH-256]
[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
58
59 D. How to Clean and Build:
60 --------------------------
61 1. Building ODU binary:
62    a. Build folder
63          cd l2/build/odu
64    b. Building ODU binary
65          make odu MACHINE=BIT64 MODE=FDD
66    c. Cleaning ODU binary
67          make clean_odu MACHINE=BIT64 MODE=FDD
68
69 2. Building CU Stub binary:
70    a. Build folder
71          cd l2/build/odu
72    b. Building CU Stub binary
73          make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
74    c. Cleaning CU Stub binary
75          make clean_cu NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
76
77 3. Building RIC Stub binary:
78    a. Build folder
79          cd l2/build/odu
80    b. Building RIC Stub binary
81          make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
82    c. Cleaning RIC Stub binary
83          make clean_ric NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
84
85 4. Cleaning ODU, CU Stub and RIC Stub:
86       make clean_all
87
88 5. Building ODU binary with O1 interface enabled:
89    a. Build folder
90          cd l2/build/odu
91    b. Building ODU with O1 module enabled:
92          make odu MACHINE=BIT64 MODE=FDD O1_ENABLE=YES
93    c. Cleaning ODU binary
94          make clean_odu MACHINE=BIT64 MODE=FDD
95
96    d. Build folder
97          cd l2/build/o1
98    e. Building O1 binary
99          make o1 MACHINE=BIT64
100    f. Cleaning O1 binary
101          make clean_o1 
102
103
104 E. How to execute:
105 ------------------
106 1. Assign virtual IP addresses as follows:
107    a. ifconfig <interface name>:ODU "192.168.130.81"
108    b. ifconfig <interface name>:CU_STUB "192.168.130.82"
109    c. ifconfig <interface name>:RIC_STUB "192.168.130.80"
110
111 2. Execute O1 (only if O-DU is built with O1 interface enabled):
112    a. O1 execution folder:
113         cd l2/build/o1/bin/o1
114    b. Run O1 binary:
115         ./o1
116
117 3. Execute CU Stub:
118    a. CU execution folder:
119         cd l2/bin/cu_stub
120    b. Run CU Stub binary:
121         ./cu_stub
122
123 4. Execute RIC Stub:
124    a. RIC execution folder:
125         cd l2/bin/ric_stub
126    b. Run RIC Stub binary:
127         ./ric_stub
128
129 5. Execute DU:
130    a. DU execution folder:
131         cd l2/bin/odu
132    b. Run ODU binary:
133         ./odu
134
135 PS: CU stub and RIC stub must be run (in no particular sequence) before ODU
136     If O1 module is enabled it must be run before ODU
137
138 F. How to test with Intel L1:
139 -----------------------------
140
141 I. Compilation
142    1. Build ODU :
143       a. Create folder l2/src/wls_lib. Copy wls_lib.h from <intel_directory>/phy/wls_lib/ to l2/src/wls_lib.
144       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.
145                 rte_branch_prediction.h
146                 rte_common.h
147                 rte_config.h
148                 rte_dev.h
149                 rte_log.h
150                 rte_pci_dev_feature_defs.h
151                 rte_bus.h
152                 rte_compat.h
153                 rte_debug.h
154                 rte_eal.h
155                 rte_os.h
156                 rte_per_lcore.h
157       c. Build folder
158                 cd l2/build/odu
159       d. Build ODU Binary:
160                 make odu PHY=INTEL_L1 PHY_MODE=TIMER MACHINE=BIT64 MODE=FDD
161
162    2. Build CU Stub and RIC Stub:
163       a. Execute steps in sections D.2 and D.3.
164
165 II. Execution
166     1. Execute L1:
167        a. Setup environment:
168                 cd <intel_directory>/phy/
169                 source ./setupenv.sh
170        b. Run L1 binary :
171                 cd <intel_directory>/FlexRAN/l1/bin/nr5g/gnb/l1
172                 To run in timer mode : ./l1.sh -e
173                 L1 is up when console prints follow:
174
175                    Non BBU threads in application
176                    ===========================================================================================================
177                    nr5g_gnb_phy2mac_api_proc_stats_thread: [PID:   8659] binding on [CPU  0] [PRIO:  0] [POLICY:  1]
178                    wls_rx_handler (non-rt):                [PID:   8663] binding on [CPU  0]
179                    ===========================================================================================================
180                  
181                    PHY>welcome to application console
182
183     2. Execute FAPI Translator:
184        a. Setup environment:
185                 cd <intel_directory>/phy/
186                 source ./setupenv.sh
187        b. Run FAPI translator binary:
188                 cd <intel_directory>/phy/fapi_5g/bin/
189                 ./oran_5g_fapi --cfg=oran_5g_fapi.cfg
190
191     3. Execute CU Stub and RIC Stub:
192        a. Run steps in sections E.1-E.3
193
194     4. Execute DU:
195        a. DU execution folder
196                 cd l2/bin/odu
197        b. Export WLS library path
198                 export LD_LIBRARY_PATH=<intel_directory>/phy/wls_lib/lib:$LD_LIBRARY_PATH
199        c. Run ODU binary
200                 ./odu
201
202
203 G. How to execute the Health Check : get alarm-list
204 ----------------------------------------------------
205    
206    Steps:
207
208    1. Start Netconf netopeer client 
209    
210    2. Connect to the server with 
211
212         user: netconf
213         pwd:  netconf
214
215    3. Send a Netconf get request for alarms xpath
216
217    Here are the steps as executed in the terminal 
218
219        netopeer2-cli
220        > connect --login netconf
221        Interactive SSH Authentication
222        Type your password:
223        Password:
224        > get --filter-xpath /o-ran-sc-odu-alarm-v1:odu/alarms
225        DATA
226        <odu xmlns="urn:o-ran:odu:alarm:1.0">
227          <alarms>
228            <alarm>
229              <alarm-id>1009</alarm-id>
230              <alarm-text>cell id  [1] is up</alarm-text>
231              <severity>2</severity>
232              <status>Active</status>
233              <additional-info>cell UP</additional-info>
234            </alarm>
235          </alarms>
236        </odu>
237
238    The XML output is a list of active alarms in the O-DU High system.
239