forked from acouzens/open5gs
fix: Change UE Context Request IE handling (#771)
Previously, AMF would sends PDUSessionResourceSetupRequest when the following conditions were met: - gNB didn't send UE Context Request IE of InitialUEMessage - AMF should send SMF generated TRANSFER message(PDU_RES_SETUP_REQ) to the gNB However, in issues #771, the gNB did not accept PDUSessionResourceSetupRequest. Perhaps the gNB engineer thought that if gNB needs to send data traffic to the UE, AMF should send an InitialContextSetupRequest regardless of UE Context Request IE. This is because gNB requires the kgNB security context for data connection. So, in this case, Open5GS-AMF decided to send an InitialContexSetupRequest regardless of whether it received UE Context Request IE of InitialUEMessage.
This commit is contained in:
parent
9eac90252e
commit
776d323a16
|
@ -90,8 +90,31 @@ void nas_5gs_send_registration_accept(amf_ue_t *amf_ue)
|
|||
ran_ue->initial_context_setup_request_sent = true;
|
||||
} else {
|
||||
if (PDU_RES_SETUP_REQ_TRANSFER_NEEDED(amf_ue)) {
|
||||
/*
|
||||
* Previously, AMF would sends PDUSessionResourceSetupRequest
|
||||
* when the following conditions were met:
|
||||
* - gNB didn't send UE Context Request IE of InitialUEMessage
|
||||
* - AMF should send SMF generated TRANSFER message(PDU_RES_SETUP_REQ)
|
||||
* to the gNB
|
||||
*
|
||||
* However, in issues #771, the gNB did not accept
|
||||
* PDUSessionResourceSetupRequest. Perhaps the gNB engineer thought
|
||||
* that if gNB needs to send data traffic to the UE, AMF should send
|
||||
* an InitialContextSetupRequest regardless of UE Context Request IE.
|
||||
* This is because gNB requires the kgNB security context
|
||||
* for data connection.
|
||||
*
|
||||
* So, in this case, Open5GS-AMF decided to send
|
||||
* an InitialContexSetupRequest regardless of
|
||||
* whether it received UE Context Request IE of InitialUEMessage.
|
||||
*/
|
||||
#if WILL_BE_REMOVED
|
||||
ngapbuf = ngap_ue_build_pdu_session_resource_setup_request(
|
||||
amf_ue, gmmbuf);
|
||||
#else
|
||||
ngapbuf = ngap_ue_build_initial_context_setup_request(
|
||||
amf_ue, gmmbuf);
|
||||
#endif
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
|
@ -150,8 +173,31 @@ void nas_5gs_send_service_accept(amf_ue_t *amf_ue)
|
|||
ran_ue->initial_context_setup_request_sent = true;
|
||||
} else {
|
||||
if (PDU_RES_SETUP_REQ_TRANSFER_NEEDED(amf_ue)) {
|
||||
/*
|
||||
* Previously, AMF would sends PDUSessionResourceSetupRequest
|
||||
* when the following conditions were met:
|
||||
* - gNB didn't send UE Context Request IE of InitialUEMessage
|
||||
* - AMF should send SMF generated TRANSFER message(PDU_RES_SETUP_REQ)
|
||||
* to the gNB
|
||||
*
|
||||
* However, in issues #771, the gNB did not accept
|
||||
* PDUSessionResourceSetupRequest. Perhaps the gNB engineer thought
|
||||
* that if gNB needs to send data traffic to the UE, AMF should send
|
||||
* an InitialContextSetupRequest regardless of UE Context Request IE.
|
||||
* This is because gNB requires the kgNB security context
|
||||
* for data connection.
|
||||
*
|
||||
* So, in this case, Open5GS-AMF decided to send
|
||||
* an InitialContexSetupRequest regardless of
|
||||
* whether it received UE Context Request IE of InitialUEMessage.
|
||||
*/
|
||||
#if WILL_BE_REMOVED
|
||||
ngapbuf = ngap_ue_build_pdu_session_resource_setup_request(
|
||||
amf_ue, gmmbuf);
|
||||
#else
|
||||
ngapbuf = ngap_ue_build_initial_context_setup_request(
|
||||
amf_ue, gmmbuf);
|
||||
#endif
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
|
|
|
@ -1153,18 +1153,18 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDUSessionResourceSetupResponse +
|
||||
/* Receive InitialContextSetupRequest +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
|
@ -2825,13 +2825,13 @@ static void registration_ue_context_test4_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
/* Receive InitialContextSetupRequest +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
|
@ -2847,8 +2847,8 @@ static void registration_ue_context_test4_func(abts_case *tc, void *data)
|
|||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
|
@ -509,7 +509,7 @@ static void test2_func(abts_case *tc, void *data)
|
|||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
|
@ -861,7 +861,7 @@ static void test3_func(abts_case *tc, void *data)
|
|||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
|
@ -912,18 +912,18 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
/* Receive InitialContextSetupRequest +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_ue_build_pdu_session_resource_setup_response(test_ue);
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1347,7 +1347,7 @@ static void test4_func(abts_case *tc, void *data)
|
|||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
|
@ -1460,18 +1460,18 @@ static void test4_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
/* Receive InitialContextSetupRequest +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_ue_build_pdu_session_resource_setup_response(test_ue);
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
Loading…
Reference in New Issue