Commit ca1805fa authored by Melissa Elkadi's avatar Melissa Elkadi

IP ping traffic is working correctly

In this commit we have updated the NRUE
to properly get the RadioBearer info from
the gNB. Because NSA and SA mode both use
this information, we have updated the SA
function previously in place by changing
the name to allow both NSA and SA mode to
use. This commit also updated the NR/LTE UEs
configuration files to with the correct
proxy IP address.
parent 5c49b197
......@@ -21,8 +21,8 @@ L1s = (
num_cc = 1;
tr_n_preference = "nfapi";
local_n_if_name = "ens3";
remote_n_address = "CI_ENB_IP_ADDR";
local_n_address = "CI_UE_IP_ADDR";
remote_n_address = "127.0.0.1";
local_n_address = "127.0.0.1";
local_n_portc = 50600;
remote_n_portc = 50601;
local_n_portd = 50610;
......
......@@ -21,8 +21,8 @@ L1s = (
num_cc = 1;
tr_n_preference = "nfapi";
local_n_if_name = "ens3";
remote_n_address = "CI_ENB_IP_ADDR";
local_n_address = "CI_UE_IP_ADDR";
remote_n_address = "127.0.0.1";
local_n_address = "127.0.0.1";
local_n_portc = 50000;
remote_n_portc = 50001;
local_n_portd = 50010;
......
......@@ -340,8 +340,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
else if (nr_prach == 2)
{
LOG_I(NR_PHY, "In %s: [UE %d] RA completed, setting UE mode to PUSCH\n", __FUNCTION__, mod_id);
if (!IS_SOFTMODEM_NOS1)
nr_DRB_preconfiguration(mac->crnti);
}
else if(nr_prach == 3)
{
......
......@@ -454,22 +454,9 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
if (IS_SOFTMODEM_NOS1 || UE_NAS_USE_TUN) {
LOG_D(PDCP, "IP packet received, to be sent to TUN interface");
/* In 5G there is a new layer called SDAP which adds one byte
to the PDU data. TUN interfaces care about the actual data
we are sending. If we do not remove the instance ID from
the buffer, it will start with 00, and the write will fail
with errno = 22 (EINVAL) */
char *data_buffer = buf;
int size_to_write = size;
if (buf[0] == 0) {
data_buffer = buf + 1;
size_to_write = size - 1;
}
len = write(nas_sock_fd[0], data_buffer, size_to_write);
len = write(nas_sock_fd[0], buf, size);
LOG_D(PDCP, "len = %d bytes to tunnel interface %d\n", len, nas_sock_fd[0]);
if (len != size_to_write) {
if (len != size) {
LOG_E(PDCP, "%s:%d:%s: fatal error %d: %s\n", __FILE__, __LINE__, __FUNCTION__, errno, strerror(errno));
}
}
......@@ -856,7 +843,7 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s,
pdcp_drb = new_nr_pdcp_entity(NR_PDCP_DRB_AM, is_gnb, drb_id,pdusession_id,has_sdap,
has_sdapULheader,has_sdapDLheader,
deliver_sdu_drb, ue, deliver_pdu_drb, ue,
12, t_reordering, discard_timer,
sn_size_dl, t_reordering, discard_timer,
ciphering_algorithm, integrity_algorithm,
ciphering_key, integrity_key);
nr_pdcp_ue_add_drb_pdcp_entity(ue, drb_id, pdcp_drb);
......
......@@ -107,7 +107,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
);
void
nr_sa_rrc_ue_process_radioBearerConfig(
nr_rrc_ue_process_RadioBearerConfig(
const protocol_ctxt_t *const ctxt_pP,
const uint8_t gNB_index,
NR_RadioBearerConfig_t *const radioBearerConfig
......@@ -247,15 +247,6 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
return 0;
}
int8_t nr_rrc_ue_process_RadioBearerConfig(NR_RadioBearerConfig_t *RadioBearerConfig){
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
// Configure PDCP
return 0;
}
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (decoded)
// RRCReconfiguration
int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCReconfiguration_t *rrcReconfiguration){
......@@ -266,7 +257,17 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
if(NR_UE_rrc_inst[module_id].radio_bearer_config == NULL){
NR_UE_rrc_inst[module_id].radio_bearer_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig;
}else{
nr_rrc_ue_process_RadioBearerConfig(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig);
protocol_ctxt_t ctxt;
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_id, ENB_FLAG_YES, mac->crnti, 0, 0, 0);
struct NR_RadioBearerConfig *RadioBearerConfig = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig;
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
LOG_D(NR_RRC, "Calling fill_default_rbconfig_ue at %d with: e_rab_id = %ld, drbID = %ld, cipher_algo = %ld, key = %ld \n",
__LINE__, RadioBearerConfig->drb_ToAddModList->list.array[0]->cnAssociation->choice.eps_BearerIdentity,
RadioBearerConfig->drb_ToAddModList->list.array[0]->drb_Identity,
RadioBearerConfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm,
*RadioBearerConfig->securityConfig->keyToUse);
nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig);
}
}
if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup != NULL){
......@@ -404,7 +405,17 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
SEQUENCE_free( &asn_DEF_NR_RadioBearerConfig, RadioBearerConfig, 1 );
return;
}
nr_rrc_ue_process_RadioBearerConfig(RadioBearerConfig);
protocol_ctxt_t ctxt;
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_id, ENB_FLAG_YES, mac->crnti, 0, 0, 0);
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
LOG_D(NR_RRC, "Calling fill_default_rbconfig_ue at %d with: e_rab_id = %ld, drbID = %ld, cipher_algo = %ld, key = %ld \n",
__LINE__, RadioBearerConfig->drb_ToAddModList->list.array[0]->cnAssociation->choice.eps_BearerIdentity,
RadioBearerConfig->drb_ToAddModList->list.array[0]->drb_Identity,
RadioBearerConfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm,
*RadioBearerConfig->securityConfig->keyToUse);
nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig);
}
break;
......@@ -1466,10 +1477,9 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
ctxt_pP,
gNB_index,
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup);
nr_sa_rrc_ue_process_radioBearerConfig(
ctxt_pP,
gNB_index,
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->radioBearerConfig);
nr_rrc_ue_process_RadioBearerConfig(ctxt_pP,
gNB_index,
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->radioBearerConfig);
nr_rrc_set_state (ctxt_pP->module_id, RRC_STATE_CONNECTED);
nr_rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED);
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].rnti = ctxt_pP->rnti;
......@@ -2032,7 +2042,7 @@ nr_rrc_ue_establish_srb2(
//-----------------------------------------------------------------------------
void
nr_sa_rrc_ue_process_radioBearerConfig(
nr_rrc_ue_process_RadioBearerConfig(
const protocol_ctxt_t *const ctxt_pP,
const uint8_t gNB_index,
NR_RadioBearerConfig_t *const radioBearerConfig
......@@ -2221,7 +2231,7 @@ nr_rrc_ue_establish_srb2(
if (ie->radioBearerConfig != NULL) {
LOG_I(NR_RRC, "radio Bearer Configuration is present\n");
nr_sa_rrc_ue_process_radioBearerConfig(ctxt_pP, gNB_index, ie->radioBearerConfig);
nr_rrc_ue_process_RadioBearerConfig(ctxt_pP, gNB_index, ie->radioBearerConfig);
}
/* Check if there is dedicated NAS information to forward to NAS */
......
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