---
# System prepended metadata

title: 'Task 3.1 Trace the OAI source code and use figures and flowchart to describe the following questions:'

---

# Task 3.1 Trace the OAI source code and use figures and flowchart to describe the following questions:

When you run OAI CU, it will first stop at ‘Entering ITTI signals handler’ waiting for connection to the OAI DU. This is related to F1 Setup Procedure betwen OAI DU and OAI CU (see this reference 5G(NR)-F1 Setup Procedure). It will wait for F1 Setup Request to be sent from OAI DU.

What function triggers ‘[F1AP] DU Task Received F1AP_SETUP_REQ’?
How does OAI DU generate F1 Setup Request message to be sent?
How does OAI DU sent F1 Setup Request to OAI CU?
How does OAI DU handle F1 Setup Request from OAI CU?

:::success
**References**
 - [How it works!](https://gitlab.flux.utah.edu/powder-mirror/openairinterface5g/-/blob/develop/doc/F1-design.md)
 - [5G(NR)-F1 Setup Procedure](https://www.5gfundamental.com/2021/04/5gnr-f1-setup-procedure.html)
  - [5G Wikipedia](https://wiki.patras5g.eu/radio-equipment/g-node-bs)
 - [Practical an example](https://codeantenna.com/a/UA432o36V7)
:::
# What function triggers ‘[F1AP] DU Task Received F1AP_SETUP_REQ’?

F1AP incoming messages
SCTP tasks sends a ITTI message  SCTP_DATA_IND to the CU task.
A array of functions pointers and the F1AP standard identifier "procedureCode", the CU calls the appropriate function
Hereafter the most significant messages processing

CU_handle_F1_SETUP_REQUEST
Transcodes information to the same message toward RRC (F1AP_SETUP_REQ)

CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER
Transcodes information to the same message toward RRC (NR_RRC_MAC_CCCH_DATA_IND)

CU_handle_UL_RRC_MESSAGE_TRANSFER
Encode and send data to PDCP  (calling pdcp_data_ind ()) for processing UL data.

# How does OAI DU generate F1 Setup Request message to be sent?

The task "gNB app" after rzading the configuration file, sends a first message F1AP_SETUP_REQ to DU task
Using this message, the uniq DU task (Linux Thread) creates a DU instance context memory space, calls SCTP task to create a socket to the CU.

# How does OAI DU sent F1 Setup Request to OAI CU?

The task "gNB app" after rzading the configuration file, sends a first message F1AP_SETUP_REQ to DU task
Using this message, the uniq DU task (Linux Thread) creates a DU instance context memory space, calls SCTP task to create a socket to the CU.
When it receives from the SCTP task the socket creation success, the DU task encodes+sends the F1 setup message to the CU.



