F1AP and E1AP interface changes for QoS

- Implement: Extend the F1 encoding and decoding with Qos
- Implement: E1 decoding for QoS
- Fix: Modify the UE_MODIFICATION_REQUEST_MSG towards DU to contain QoS info based on E1AP context response
- Fix: Modify the E1AP and F1AP message structures
- Fill the Qos configuration to send to MAC
This commit is contained in:
Sriharsha Korada
2023-11-30 17:41:12 +01:00
parent 6debc5dd21
commit ed29252c6d
12 changed files with 441 additions and 120 deletions
+74 -55
View File
@@ -41,27 +41,28 @@
#include <openair3/ocp-gtpu/gtp_itf.h>
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
static void setQos(F1AP_NonDynamic5QIDescriptor_t *toFill) {
asn1cCalloc(toFill, tmp);
static void setQos(F1AP_NonDynamic5QIDescriptor_t **toFill)
{
asn1cCalloc(*toFill, tmp);
/* fiveQI */
tmp->fiveQI = 1L;
/* OPTIONAL */
/* qoSPriorityLevel */
if (0) {
asn1cCallocOne(toFill->qoSPriorityLevel, 1L);
asn1cCallocOne((*toFill)->qoSPriorityLevel, 1L);
}
/* OPTIONAL */
/* averagingWindow */
if (0) {
asn1cCallocOne(toFill->averagingWindow, 1L);
asn1cCallocOne((*toFill)->averagingWindow, 1L);
}
/* OPTIONAL */
/* maxDataBurstVolume */
if (0) {
asn1cCallocOne(toFill->maxDataBurstVolume, 1L);
asn1cCallocOne((*toFill)->maxDataBurstVolume, 1L);
}
}
@@ -271,8 +272,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie12);
ie12->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List;
ie12->criticality = F1AP_Criticality_reject;
ie12->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List;
LOG_I(F1AP, "Length of drbs_to_be_setup: %d \n", f1ap_ue_context_setup_req->drbs_to_be_setup_length);
ie12->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List;
for (int i = 0; i < f1ap_ue_context_setup_req->drbs_to_be_setup_length; i++) {
//
@@ -329,7 +329,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
if (some_decide_qoS_characteristics) {
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
setQos(DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI);
setQos(&DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI);
} else {
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
asn1cCalloc(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI, tmp);
@@ -429,7 +429,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
if (some_decide_qoS_characteristics) {
QosParams->present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
setQos(QosParams->choice.non_Dynamic_5QI);
setQos(&QosParams->choice.non_Dynamic_5QI);
} else {
QosParams->present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
asn1cCalloc(QosParams->choice.dynamic_5QI, tmp);
@@ -1227,6 +1227,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_conte
else{
/* 12.1.2 DRB_Information */
f1ap_drb_information_t *drb_info_in = &f1ap_ue_context_modification_req->drbs_to_be_setup->drb_info;
drbs_toBeSetupMod_item->qoSInformation.present = F1AP_QoSInformation_PR_choice_extension;
F1AP_QoSInformation_ExtIEs_t *ie = (F1AP_QoSInformation_ExtIEs_t *)calloc(1, sizeof(*ie));
ie->id = F1AP_ProtocolIE_ID_id_DRB_Information;
@@ -1237,48 +1238,56 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_conte
/* 12.1.2.1 dRB_QoS */
{
/* qoS_Characteristics */
f1ap_qos_flow_level_qos_parameters_t *drb_qos_in = &drb_info_in->drb_qos;
{
int some_decide_qoS_characteristics = 0; // BK: Need Check
int some_decide_qoS_characteristics = drb_qos_in->qos_characteristics.qos_type;
if (some_decide_qoS_characteristics) {
f1ap_qos_characteristics_t *drb_qos_char_in = &drb_qos_in->qos_characteristics;
if (some_decide_qoS_characteristics == non_dynamic) {
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
setQos(DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI);
asn1cCalloc(DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI, tmp);
/* 5QI */
tmp->fiveQI = drb_qos_char_in->non_dynamic.fiveqi;
} else {
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
asn1cCalloc(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI, tmp);
/* qoSPriorityLevel */
tmp->qoSPriorityLevel = 1L;
/* packetDelayBudget */
tmp->packetDelayBudget = 1L;
/* packetErrorRate */
tmp->packetErrorRate.pER_Scalar = 1L;
tmp->packetErrorRate.pER_Exponent = 6L;
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
asn1cCalloc(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI, tmp);
/* qoSPriorityLevel */
tmp->qoSPriorityLevel = drb_qos_char_in->dynamic.qos_priority_level;
/* packetDelayBudget */
tmp->packetDelayBudget = drb_qos_char_in->dynamic.packet_delay_budget;
/* packetErrorRate */
tmp->packetErrorRate.pER_Scalar = drb_qos_char_in->dynamic.packet_error_rate.per_scalar;
tmp->packetErrorRate.pER_Exponent = drb_qos_char_in->dynamic.packet_error_rate.per_scalar;
/* OPTIONAL */
/* delayCritical */
if (0) {
asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical, 1L);
}
/* OPTIONAL */
/* delayCritical */
if (0) {
asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical, 1L);
}
/* OPTIONAL */
/* averagingWindow */
if (0) {
asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow, 1L);
}
/* OPTIONAL */
/* averagingWindow */
if (0) {
asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow, 1L);
}
/* OPTIONAL */
/* maxDataBurstVolume */
if (0) {
asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume, 1L);
}
} // if some_decide_qoS_characteristics
/* OPTIONAL */
/* maxDataBurstVolume */
if (0) {
asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume, 1L);
}
} // if some_decide_qoS_characteristics
} // qoS_Characteristics
/* nGRANallocationRetentionPriority */
{
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_shall_not_trigger_pre_emption; // enum
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.priorityLevel =
drb_qos_in->alloc_reten_priority.priority_level;
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionCapability =
drb_qos_in->alloc_reten_priority.preemption_capability;
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionVulnerability =
drb_qos_in->alloc_reten_priority.preemption_vulnerability;
} // nGRANallocationRetentionPriority
/* OPTIONAL */
@@ -1327,33 +1336,40 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_conte
F1AP_NotificationControl_active); // enum
}
/* 12.1.2.4 flows_Mapped_To_DRB_List */ // BK: need verifiy
for (int k = 0; k < 1; k ++) {
/* 12.1.2.4 flows_Mapped_To_DRB_List */
for (int k = 0; k < drb_info_in->flows_to_be_setup_length; k++) {
asn1cSequenceAdd(DRB_Information->flows_Mapped_To_DRB_List.list,
F1AP_Flows_Mapped_To_DRB_Item_t, flows_mapped_to_drb_item);
f1ap_flows_mapped_to_drb_t *qos_flow_in = drb_info_in->flows_mapped_to_drb + k;
/* qoSFlowIndicator */
flows_mapped_to_drb_item->qoSFlowIdentifier = 1L;
flows_mapped_to_drb_item->qoSFlowIdentifier = qos_flow_in->qfi;
/* qoSFlowLevelQoSParameters */
{
f1ap_qos_flow_level_qos_parameters_t *flow_qos_params_in = &qos_flow_in->qos_params;
/* qoS_Characteristics */
{
int some_decide_qoS_characteristics = 0; // BK: Need Check
F1AP_QoS_Characteristics_t *QosParams=&flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.qoS_Characteristics;
int some_decide_qoS_characteristics = flow_qos_params_in->qos_characteristics.qos_type;
F1AP_QoS_Characteristics_t *QosParams = &flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.qoS_Characteristics;
f1ap_qos_characteristics_t *flow_qos_char_in = &flow_qos_params_in->qos_characteristics;
if (some_decide_qoS_characteristics) {
if (some_decide_qoS_characteristics == non_dynamic) {
QosParams->present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
setQos(QosParams->choice.non_Dynamic_5QI);
asn1cCalloc(QosParams->choice.non_Dynamic_5QI, tmp);
/* 5QI */
tmp->fiveQI = flow_qos_char_in->non_dynamic.fiveqi;
} else {
QosParams->present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
asn1cCalloc(QosParams->choice.dynamic_5QI, tmp);
/* qoSPriorityLevel */
tmp->qoSPriorityLevel = 1L;
tmp->qoSPriorityLevel = flow_qos_char_in->dynamic.qos_priority_level;
/* packetDelayBudget */
tmp->packetDelayBudget = 1L;
tmp->packetDelayBudget = flow_qos_char_in->dynamic.packet_delay_budget;
/* packetErrorRate */
tmp->packetErrorRate.pER_Scalar = 1L;
tmp->packetErrorRate.pER_Exponent = 6L;
tmp->packetErrorRate.pER_Scalar = flow_qos_char_in->dynamic.packet_error_rate.per_scalar;
tmp->packetErrorRate.pER_Exponent = flow_qos_char_in->dynamic.packet_error_rate.per_exponent;
/* OPTIONAL */
/* delayCritical */
@@ -1380,9 +1396,12 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_conte
} // qoS_Characteristics
/* nGRANallocationRetentionPriority */
{
flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_shall_not_trigger_pre_emption; // enum
flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.priorityLevel =
flow_qos_params_in->alloc_reten_priority.priority_level;
flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.pre_emptionCapability =
flow_qos_params_in->alloc_reten_priority.preemption_capability;
flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.pre_emptionVulnerability =
flow_qos_params_in->alloc_reten_priority.preemption_vulnerability;
} // nGRANallocationRetentionPriority
/* OPTIONAL */
+92 -4
View File
@@ -893,11 +893,99 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t
(F1AP_QoSInformation_ExtIEs_t *)drbs_tobesetupmod_item_p->qoSInformation.choice.choice_extension;
if (ie->id == F1AP_ProtocolIE_ID_id_DRB_Information && ie->criticality == F1AP_Criticality_reject
&& ie->value.present == F1AP_QoSInformation_ExtIEs__value_PR_DRB_Information) {
F1AP_DRB_Information_t *DRB_Information = &ie->value.choice.DRB_Information;
F1AP_DRB_Information_t *dRB_Info = &ie->value.choice.DRB_Information;
f1ap_drb_information_t *drb_info = &f1ap_ue_context_modification_req->drbs_to_be_setup->drb_info;
/* 12.1.2.1 dRB_QoS */
{
/* QoS-Flow-Level-QoS-Parameters */
f1ap_qos_flow_level_qos_parameters_t *drb_qos = &drb_info->drb_qos;
F1AP_QoSFlowLevelQoSParameters_t *dRB_QoS = &dRB_Info->dRB_QoS;
{
/* QoS Characteristics*/
f1ap_qos_characteristics_t *drb_qos_char = &drb_qos->qos_characteristics;
F1AP_QoS_Characteristics_t *dRB_QoS_Char = &dRB_QoS->qoS_Characteristics;
if (dRB_QoS_Char->present == F1AP_QoS_Characteristics_PR_non_Dynamic_5QI) {
drb_qos_char->qos_type = non_dynamic;
drb_qos_char->non_dynamic.fiveqi = dRB_QoS_Char->choice.non_Dynamic_5QI->fiveQI;
drb_qos_char->non_dynamic.qos_priority_level = (dRB_QoS_Char->choice.non_Dynamic_5QI->qoSPriorityLevel != NULL)
? *dRB_QoS_Char->choice.non_Dynamic_5QI->qoSPriorityLevel
: -1;
} else {
drb_qos_char->qos_type = dynamic;
drb_qos_char->dynamic.fiveqi =
(dRB_QoS_Char->choice.dynamic_5QI->fiveQI != NULL) ? *dRB_QoS_Char->choice.dynamic_5QI->fiveQI : -1;
drb_qos_char->dynamic.qos_priority_level = dRB_QoS_Char->choice.dynamic_5QI->qoSPriorityLevel;
drb_qos_char->dynamic.packet_delay_budget = dRB_QoS_Char->choice.dynamic_5QI->packetDelayBudget;
drb_qos_char->dynamic.packet_error_rate.per_scalar = dRB_QoS_Char->choice.dynamic_5QI->packetErrorRate.pER_Scalar;
drb_qos_char->dynamic.packet_error_rate.per_exponent =
dRB_QoS_Char->choice.dynamic_5QI->packetErrorRate.pER_Exponent;
}
}
/* nGRANallocationRetentionPriority */
drb_qos->alloc_reten_priority.priority_level = dRB_QoS->nGRANallocationRetentionPriority.priorityLevel;
drb_qos->alloc_reten_priority.preemption_vulnerability =
dRB_QoS->nGRANallocationRetentionPriority.pre_emptionVulnerability;
drb_qos->alloc_reten_priority.preemption_capability =
dRB_QoS->nGRANallocationRetentionPriority.pre_emptionVulnerability;
} // dRB_QoS
// 12.1.2.4 flows_Mapped_To_DRB_List
drb_info->flows_to_be_setup_length = dRB_Info->flows_Mapped_To_DRB_List.list.count;
drb_info->flows_mapped_to_drb = calloc(drb_info->flows_to_be_setup_length, sizeof(f1ap_flows_mapped_to_drb_t));
AssertFatal(drb_info->flows_mapped_to_drb, "could not allocate memory for drb_p->drb_info.flows_mapped_to_drb\n");
for (int k = 0; k < drb_p->drb_info.flows_to_be_setup_length; k++) {
f1ap_flows_mapped_to_drb_t *flows_mapped_to_drb = drb_info->flows_mapped_to_drb + k;
F1AP_Flows_Mapped_To_DRB_Item_t *flows_Mapped_To_Drb = dRB_Info->flows_Mapped_To_DRB_List.list.array[0] + k;
flows_mapped_to_drb->qfi = flows_Mapped_To_Drb->qoSFlowIdentifier;
/* QoS-Flow-Level-QoS-Parameters */
{
f1ap_qos_flow_level_qos_parameters_t *flow_qos = &flows_mapped_to_drb->qos_params;
F1AP_QoSFlowLevelQoSParameters_t *Flow_QoS = &flows_Mapped_To_Drb->qoSFlowLevelQoSParameters;
/* QoS Characteristics*/
{
f1ap_qos_characteristics_t *flow_qos_char = &flow_qos->qos_characteristics;
F1AP_QoS_Characteristics_t *Flow_QoS_Char = &Flow_QoS->qoS_Characteristics;
if (Flow_QoS_Char->present == F1AP_QoS_Characteristics_PR_non_Dynamic_5QI) {
flow_qos_char->qos_type = non_dynamic;
flow_qos_char->non_dynamic.fiveqi = Flow_QoS_Char->choice.non_Dynamic_5QI->fiveQI;
flow_qos_char->non_dynamic.qos_priority_level =
(Flow_QoS_Char->choice.non_Dynamic_5QI->qoSPriorityLevel != NULL)
? *Flow_QoS_Char->choice.non_Dynamic_5QI->qoSPriorityLevel
: -1;
} else {
flow_qos_char->qos_type = dynamic;
flow_qos_char->dynamic.fiveqi =
(Flow_QoS_Char->choice.dynamic_5QI->fiveQI != NULL) ? *Flow_QoS_Char->choice.dynamic_5QI->fiveQI : -1;
flow_qos_char->dynamic.qos_priority_level = Flow_QoS_Char->choice.dynamic_5QI->qoSPriorityLevel;
flow_qos_char->dynamic.packet_delay_budget = Flow_QoS_Char->choice.dynamic_5QI->packetDelayBudget;
flow_qos_char->dynamic.packet_error_rate.per_scalar =
Flow_QoS_Char->choice.dynamic_5QI->packetErrorRate.pER_Scalar;
flow_qos_char->dynamic.packet_error_rate.per_exponent =
Flow_QoS_Char->choice.dynamic_5QI->packetErrorRate.pER_Exponent;
}
}
/* nGRANallocationRetentionPriority */
flow_qos->alloc_reten_priority.priority_level = Flow_QoS->nGRANallocationRetentionPriority.priorityLevel;
flow_qos->alloc_reten_priority.preemption_vulnerability =
Flow_QoS->nGRANallocationRetentionPriority.pre_emptionVulnerability;
flow_qos->alloc_reten_priority.preemption_capability =
Flow_QoS->nGRANallocationRetentionPriority.pre_emptionVulnerability;
}
}
/* S-NSSAI */
OCTET_STRING_TO_INT8(&DRB_Information->sNSSAI.sST, drb_p->nssai.sst);
if (DRB_Information->sNSSAI.sD != NULL)
memcpy((uint8_t *)&drb_p->nssai.sd, DRB_Information->sNSSAI.sD->buf, 3);
OCTET_STRING_TO_INT8(&dRB_Info->sNSSAI.sST, drb_p->nssai.sst);
if (dRB_Info->sNSSAI.sD != NULL)
memcpy((uint8_t *)&drb_p->nssai.sd, dRB_Info->sNSSAI.sD->buf, 3);
else
drb_p->nssai.sd = 0xffffff;
}