Commit 1dec9dd9 authored by Melissa Elkadi's avatar Melissa Elkadi

First attempt at receiving MIB and SIB in SA mode

parent 73327968
......@@ -205,7 +205,7 @@ gNBs =
////////// AMF parameters:
amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
amf_ip_address = ( { ipv4 = "192.168.61.195";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -215,10 +215,10 @@ gNBs =
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
GNB_INTERFACE_NAME_FOR_NGU = "eth0";
GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
GNB_INTERFACE_NAME_FOR_NG_AMF = "lo:";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "127.0.0.2";
GNB_INTERFACE_NAME_FOR_NGU = "lo:";
GNB_IPV4_ADDRESS_FOR_NGU = "127.0.0.2";
GNB_PORT_FOR_NGU = 2152; # Spec 2152
};
......@@ -226,14 +226,18 @@ gNBs =
);
MACRLCs = (
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 150;
ulsch_max_slots_inactivity = 10;
}
{
num_cc = 1;
local_s_if_name = "lo:";
remote_s_address = "127.0.0.1"; // pnf addr [!]
local_s_address = "127.0.0.2"; // vnf addr
local_s_portc = 50601; // vnf p5 port
remote_s_portc = 50600; // pnf p5 port [!]
local_s_portd = 50611; // vnf p7 port [!]
remote_s_portd = 50610; // pnf p7 port [!]
tr_s_preference = "nfapi";
tr_n_preference = "local_RRC";
}
);
L1s = (
......
......@@ -426,7 +426,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_W(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'W', __VA_ARGS__); while (0)
# define LOG_A(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'A', __VA_ARGS__); while (0) /* logs intended for analysis */
# define LOG_I(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'I', __VA_ARGS__); while (0)
# define LOG_D(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0)
# define LOG_D(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0)
# define LOG_T(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'T', __VA_ARGS__); while (0)
# define LOG_M(FILE, VECTOR, DATA, LEN, DEC, FORMAT) ((void) 0)
......
......@@ -314,13 +314,15 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
{
LOG_E(NR_MAC, "[%d %d] No corresponding tx_data_request for given dl_tti_request sfn/slot\n",
NFAPI_SFNSLOT2SFN(dl_tti_sfn_slot), NFAPI_SFNSLOT2SLOT(dl_tti_sfn_slot));
save_nr_measurement_info(dl_tti_request);
if (get_softmodem_params()->nsa)
save_nr_measurement_info(dl_tti_request);
free(dl_tti_request);
dl_tti_request = NULL;
}
else if (dl_tti_request->dl_tti_request_body.nPDUs > 0 && tx_data_request->Number_of_PDUs > 0)
{
save_nr_measurement_info(dl_tti_request);
if (get_softmodem_params()->nsa)
save_nr_measurement_info(dl_tti_request);
check_and_process_dci(dl_tti_request, tx_data_request, NULL, NULL);
}
else
......@@ -432,9 +434,15 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
module_id_t mod_id = 0;
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
if (mac->scc == NULL)
if (mac->scc == NULL || mac->scc_SIB == NULL) //Melissa TODO this isnt correct
{
LOG_D(MAC, "mac->scc == NULL!\n");
if (get_softmodem_params()->sa && get_softmodem_params()->emulate_l2)
{
LOG_D(NR_MAC, "We haven't gotten MIB or SIB yet. Lets see if we received it\n");
nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment);
process_queued_nr_nfapi_msgs(mac, sfn_slot);
}
LOG_D(MAC, "mac->scc == NULL or mac->scc_SIB == NULL!\n");
continue;
}
......
......@@ -493,7 +493,10 @@ int main( int argc, char **argv ) {
exit(-1);
}
if (!get_softmodem_params()->nsa) {
if (get_softmodem_params()->emulate_l2)
start_oai_nrue_threads();
if (!get_softmodem_params()->nsa && !get_softmodem_params()->emulate_l2) {
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
PHY_vars_UE_g[0][CC_id] = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
UE[CC_id] = PHY_vars_UE_g[0][CC_id];
......
......@@ -89,6 +89,7 @@ extern void init_NR_UE(int, char*);
extern void init_NR_UE_threads(int);
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
extern void start_oai_nrue_threads(void);
void *UE_thread(void *arg);
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id, uint8_t abstraction_flag);
void init_nrUE_standalone_thread(int ue_idx);
......
......@@ -98,6 +98,7 @@ extern "C"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
#define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR\n"
#define CONFIG_L2_EMULATOR "Run in L2 emulated mode (disable PHY layer)\n"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */
......@@ -125,6 +126,7 @@ extern "C"
#define NSA softmodem_params.nsa
#define NODE_NUMBER softmodem_params.node_number
#define NON_STOP softmodem_params.non_stop
#define EMULATE_L2 softmodem_params.emulate_l2
#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
......@@ -163,6 +165,7 @@ extern int usrp_tx_thread;
{"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \
{"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \
{"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \
{"emulate-l2", CONFIG_L2_EMULATOR, PARAMFLAG_BOOL, iptr:&EMULATE_L2, defintval:0, TYPE_INT, 0}, \
}
#define CONFIG_HLP_NSA "Enable NSA mode \n"
......@@ -258,6 +261,7 @@ typedef struct {
int nsa;
uint16_t node_number;
int non_stop;
int emulate_l2;
} softmodem_params_t;
extern uint64_t get_softmodem_optmask(void);
......
......@@ -550,7 +550,7 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format];
if ((dci->rnti != mac->crnti) && (dci->rnti != mac->ra.ra_rnti)) {
if ((dci->rnti != mac->crnti) && (dci->rnti != mac->ra.ra_rnti) && (dci->rnti != 0xffff)) {
LOG_D(MAC,"We skip for the received dci indication rnti %4x != mac->crnti %4x frame slot %4d.%2d RA state %d\n",
dci->rnti, mac->crnti, frame, slot, mac->ra.ra_state);
return 0;
......@@ -2512,7 +2512,8 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
N_RB_UL = NRRIV2BW(mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
}
LOG_D(MAC,"nr_extract_dci_info : dci_pdu %lx, size %d\n",*dci_pdu,dci_size);
LOG_D(MAC,"nr_extract_dci_info : dci_pdu %lx, size %d, rnti_type %d, dci_format %d\n",
*dci_pdu, dci_size, rnti_type, dci_format);
switch(dci_format) {
case NR_DL_DCI_FORMAT_1_0:
......@@ -2568,7 +2569,7 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
dci_pdu_rel15 = &mac->def_dci_pdu_rel15[NR_UL_DCI_FORMAT_0_0];
return 2+nr_extract_dci_info(mac, NR_UL_DCI_FORMAT_0_0, dci_size, rnti, dci_pdu, dci_pdu_rel15);
}
#ifdef DEBUG_EXTRACT_DCI
#if 1
LOG_D(MAC,"Format indicator %d (%d bits) N_RB_BWP %d => %d (0x%lx)\n",dci_pdu_rel15->format_indicator,1,N_RB,dci_size-pos,*dci_pdu);
#endif
......
......@@ -887,8 +887,10 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
nr_scheduled_response_t scheduled_response;
nr_dcireq_t dcireq;
LOG_D(MAC,"Melissa we got herre %s():%d\n", __FUNCTION__, __LINE__);
if(mac->cg != NULL){ // we have a cg
LOG_D(MAC,"Melissa we got herre %s():%d\n", __FUNCTION__, __LINE__);
dcireq.module_id = mod_id;
dcireq.gNB_index = gNB_index;
dcireq.cc_id = cc_id;
......
......@@ -396,8 +396,9 @@ uint32_t schedule_control_sib1(module_id_t module_id,
rbSize, nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3;
} while (TBS < gNB_mac->sched_ctrlCommon->num_total_bytes);
AssertFatal(TBS>=gNB_mac->sched_ctrlCommon->num_total_bytes,"Couldn't allocate enough resources for %d bytes in SIB1 PDSCH\n",
gNB_mac->sched_ctrlCommon->num_total_bytes);
AssertFatal(TBS>=gNB_mac->sched_ctrlCommon->num_total_bytes,
"Couldn't allocate (TBS = %d) enough resources for %d bytes in SIB1 PDSCH\n",
TBS, gNB_mac->sched_ctrlCommon->num_total_bytes);
gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize = rbSize;
gNB_mac->sched_ctrlCommon->sched_pdsch.rbStart = 0;
......
......@@ -271,6 +271,7 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_
{
nfapi_nr_dl_dci_pdu_t *dci_pdu_list = &pdu_list->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[j];
if ((dci_pdu_list->RNTI != mac->crnti) &&
(dci_pdu_list->RNTI != 0xffff) &&
((dci_pdu_list->RNTI != mac->ra.ra_rnti) || mac->ra.RA_RAPID_found))
{
LOG_D(NR_MAC, "We are filtering PDCCH DCI pdu because RNTI doesnt match!\n");
......@@ -341,7 +342,12 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi
for (int i = 0; i < num_pdus; i++)
{
nfapi_nr_pdu_t *pdu_list = &tx_data_request->pdu_list[i];
if(mac->ra.ra_state <= WAIT_RAR)
if (dl_info->dci_ind->number_of_dcis > 0 && dl_info->dci_ind->dci_list[i].rnti == 0xffff) //Melissa this is bad find a better way
{
fill_rx_ind(pdu_list, rx_ind, pdu_idx, FAPI_NR_RX_PDU_TYPE_SIB);
pdu_idx++;
}
else if(mac->ra.ra_state <= WAIT_RAR)
{
fill_rx_ind(pdu_list, rx_ind, pdu_idx, FAPI_NR_RX_PDU_TYPE_RAR);
pdu_idx++;
......@@ -548,7 +554,7 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request,
int slot = 0;
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
if (mac->scc == NULL)
if (mac->scc == NULL) //Melissa, if we comment this out, we see the SIB!
{
return;
}
......@@ -734,10 +740,11 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea
ul_tti_request->SFN, ul_tti_request->Slot);
if (nr_uci_ind_queue.num_items > 0) //TODO: In the future UL_TTIs can be for ULSCH and SRS.
{
LOG_I(NR_MAC, "Melissa, we added UL_TTI_REQ to queue for sfn slot %d %d\n",
LOG_D(NR_MAC, "We added UL_TTI_REQ to queue for sfn slot %d %d\n",
ul_tti_request->SFN, ul_tti_request->Slot);
if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request))
{
LOG_D(NR_PHY, "put_queue failed for nr_ul_tti_req_queue.\n");
reset_queue(&nr_ul_tti_req_queue);
if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request))
{
......@@ -754,10 +761,11 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea
mitigate proxy timing issues. */
else if (nr_uci_ind_queue.num_items == 0)
{
LOG_I(NR_MAC, "Melissa, we added UL_TTI_REQ to queue for sfn slot %d %d\n",
LOG_D(NR_MAC, "We added UL_TTI_REQ to wait queue for sfn slot %d %d\n",
ul_tti_request->SFN, ul_tti_request->Slot);
if (!put_queue(&nr_wait_ul_tti_req_queue, ul_tti_request))
{
LOG_D(NR_PHY, "put_queue failed for nr_wait_ul_tti_req_queue.\n");
reset_queue(&nr_wait_ul_tti_req_queue);
if (!put_queue(&nr_wait_ul_tti_req_queue, ul_tti_request))
{
......
......@@ -214,16 +214,19 @@ void rrc_gNB_generate_SgNBAdditionRequestAcknowledge(
static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) {
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type) || get_softmodem_params()->emulate_l2) {
rrc->carrier.MIB = (uint8_t *) malloc16(4);
rrc->carrier.sizeof_MIB = do_MIB_NR(rrc,0);
}
if((get_softmodem_params()->sa) && ( (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)))) {
rrc->carrier.sizeof_SIB1 = do_SIB1_NR(&rrc->carrier,configuration);
if(get_softmodem_params()->sa &&
((NODE_IS_DU(rrc->node_type) ||
NODE_IS_MONOLITHIC(rrc->node_type) ||
get_softmodem_params()->emulate_l2))) {
rrc->carrier.sizeof_SIB1 = do_SIB1_NR(&rrc->carrier, configuration);
}
if (!NODE_IS_DU(rrc->node_type)) {
else if (!NODE_IS_DU(rrc->node_type)) {
rrc->carrier.SIB23 = (uint8_t *) malloc16(100);
AssertFatal(rrc->carrier.SIB23 != NULL, "cannot allocate memory for SIB");
rrc->carrier.sizeof_SIB23 = do_SIB23_NR(&rrc->carrier, configuration);
......@@ -233,7 +236,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
LOG_I(NR_RRC,"Done init_NR_SI\n");
if (NODE_IS_MONOLITHIC(rrc->node_type)){
if (NODE_IS_MONOLITHIC(rrc->node_type) || get_softmodem_params()->emulate_l2){
rrc_mac_config_req_gNB(rrc->module_id,
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
......
......@@ -201,8 +201,6 @@ extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * con
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
static void start_oai_nrue_threads(void);
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const module_id_t module_id,
const uint8_t *buffer,
......@@ -2767,7 +2765,8 @@ void *recv_msgs_from_lte_ue(void *args_p)
}
return NULL;
}
static void start_oai_nrue_threads()
void start_oai_nrue_threads()
{
init_queue(&nr_rach_ind_queue);
init_queue(&nr_rx_ind_queue);
......
......@@ -169,6 +169,8 @@ void init_connections_with_lte_ue(void);
void nsa_sendmsg_to_lte_ue(const void *message, size_t msg_len, MessagesIds msg_type);
void start_oai_nrue_threads(void);
/**\brief RRC UE generate RRCSetupRequest message.
\param module_id module id
\param gNB_index gNB index */
......
......@@ -205,7 +205,7 @@ gNBs =
////////// MME parameters:
amf_ip_address = ( { ipv4 = "192.168.70.132";
amf_ip_address = ( { ipv4 = "192.168.16.195";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -215,10 +215,10 @@ gNBs =
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
GNB_INTERFACE_NAME_FOR_NG_AMF = "lo:";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "127.0.0.2";
GNB_INTERFACE_NAME_FOR_NGU = "lo:";
GNB_IPV4_ADDRESS_FOR_NGU = "127.0.0.2";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
......@@ -226,26 +226,20 @@ gNBs =
);
MACRLCs = (
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
ulsch_max_slots_inactivity = 10;
pusch_TargetSNRx10 = 150;
pucch_TargetSNRx10 = 200;
}
{
num_cc = 1;
local_s_if_name = "lo:";
remote_s_address = "127.0.0.1"; // pnf addr [!]
local_s_address = "127.0.0.2"; // vnf addr
local_s_portc = 50601; // vnf p5 port
remote_s_portc = 50600; // pnf p5 port [!]
local_s_portd = 50611; // vnf p7 port [!]
remote_s_portd = 50610; // pnf p7 port [!]
tr_s_preference = "nfapi";
tr_n_preference = "local_RRC";
}
);
L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
pusch_proc_threads = 8;
prach_dtx_threshold = 120;
pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
RUs = (
{
......@@ -273,14 +267,6 @@ THREAD_STRUCT = (
}
);
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
security = {
# preferred ciphering algorithms
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment