add U-plane TEID trace log

This commit is contained in:
Sukchan Lee 2018-02-01 14:07:01 +09:00
parent c3afd65ff3
commit b040214364
14 changed files with 89 additions and 40 deletions

View File

@ -1472,6 +1472,8 @@ status_t mme_context_setup_trace_module()
d_trace_level(&_s1ap_sm, s1ap);
extern int _s1ap_build;
d_trace_level(&_s1ap_build, s1ap);
extern int _s1ap_conv;
d_trace_level(&_s1ap_conv, s1ap);
extern int _s1ap_handler;
d_trace_level(&_s1ap_handler, s1ap);
extern int _s1ap_sctp;

View File

@ -249,6 +249,8 @@ status_t mme_s11_build_modify_bearer_request(pkbuf_t **pkbuf,
d_trace(3, "[MME] Modifty Bearer Request\n");
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
mme_ue->mme_s11_teid, mme_ue->sgw_s11_teid);
d_trace(5, " ENB_S1U_TEID[%d] SGW_S1U_TEID[%d]\n",
bearer->enb_s1u_teid, bearer->sgw_s1u_teid);
memset(&gtp_message, 0, sizeof(gtp_message_t));

View File

@ -75,9 +75,6 @@ void mme_s11_handle_create_session_response(
sgw_s11_teid = rsp->sender_f_teid_for_control_plane.data;
mme_ue->sgw_s11_teid = ntohl(sgw_s11_teid->teid);
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
mme_ue->mme_s11_teid, mme_ue->sgw_s11_teid);
memcpy(&pdn->paa, rsp->pdn_address_allocation.data,
rsp->pdn_address_allocation.len);
@ -90,6 +87,12 @@ void mme_s11_handle_create_session_response(
/* Data Plane(UL) : SGW-S1U */
sgw_s1u_teid = rsp->bearer_contexts_created.s1_u_enodeb_f_teid.data;
bearer->sgw_s1u_teid = ntohl(sgw_s1u_teid->teid);
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
mme_ue->mme_s11_teid, mme_ue->sgw_s11_teid);
d_trace(5, " ENB_S1U_TEID[%d] SGW_S1U_TEID[%d]\n",
bearer->enb_s1u_teid, bearer->sgw_s1u_teid);
rv = gtp_f_teid_to_ip(sgw_s1u_teid, &bearer->sgw_s1u_ip);
d_assert(rv == CORE_OK, return,);

View File

@ -200,7 +200,8 @@ status_t s1ap_build_initial_context_setup_request(
e_rab->e_RAB_ID = bearer->ebi;
e_rab->e_RABlevelQoSParameters.qCI = bearer->qos.qci;
d_trace(5, " EBI[%d] QCI[%d]\n", bearer->ebi, bearer->qos.qci);
d_trace(5, " EBI[%d] QCI[%d] SGW-S1U-TEID[%d]\n",
bearer->ebi, bearer->qos.qci, bearer->sgw_s1u_teid);
e_rab->e_RABlevelQoSParameters.allocationRetentionPriority.
priorityLevel = bearer->qos.arp.priority_level;
@ -385,6 +386,7 @@ status_t s1ap_build_e_rab_setup_request(
&bearer->sgw_s1u_ip, &e_rab->transportLayerAddress);
d_assert(rv == CORE_OK, return CORE_ERROR,);
s1ap_uint32_to_OCTET_STRING(bearer->sgw_s1u_teid, &e_rab->gTP_TEID);
d_trace(5, " SGW-S1U-TEID[%d]\n", bearer->sgw_s1u_teid);
nasPdu = &e_rab->nAS_PDU;
nasPdu->size = esmbuf->len;
@ -803,6 +805,7 @@ status_t s1ap_build_handover_command(pkbuf_t **s1apbuf, enb_ue_t *source_ue)
core_calloc(1, sizeof(S1ap_GTP_TEID_t));
s1ap_uint32_to_OCTET_STRING(
bearer->sgw_dl_teid, e_rab->dL_gTP_TEID);
d_trace(5, " SGW-DL-TEID[%d]\n", bearer->sgw_dl_teid);
}
if (MME_HAVE_SGW_UL_INDIRECT_TUNNEL(bearer))
@ -818,6 +821,7 @@ status_t s1ap_build_handover_command(pkbuf_t **s1apbuf, enb_ue_t *source_ue)
core_calloc(1, sizeof(S1ap_GTP_TEID_t));
s1ap_uint32_to_OCTET_STRING(
bearer->sgw_ul_teid, e_rab->uL_S1ap_GTP_TEID);
d_trace(5, " SGW-UL-TEID[%d]\n", bearer->sgw_dl_teid);
}
if (MME_HAVE_SGW_DL_INDIRECT_TUNNEL(bearer) ||
@ -974,6 +978,7 @@ status_t s1ap_build_handover_request(
&bearer->sgw_s1u_ip, &e_rab->transportLayerAddress);
d_assert(rv == CORE_OK, return CORE_ERROR,);
s1ap_uint32_to_OCTET_STRING(bearer->sgw_s1u_teid, &e_rab->gTP_TEID);
d_trace(5, " SGW-S1U-TEID[%d]\n", bearer->sgw_s1u_teid);
ASN_SEQUENCE_ADD(&ies->e_RABToBeSetupListHOReq, e_rab);

View File

@ -1,6 +1,7 @@
#define TRACE_MODULE _s1ap_conv
#include "core_debug.h"
#include "core_network.h"
#include "3gpp_types.h"
#include "s1ap_conv.h"
@ -111,6 +112,8 @@ void s1ap_ENB_ID_to_uint32(S1ap_ENB_ID_t *eNB_ID, c_uint32_t *uint32)
status_t s1ap_BIT_STRING_to_ip(BIT_STRING_t *bit_string, ip_t *ip)
{
char buf[CORE_ADDRSTRLEN], buf2[CORE_ADDRSTRLEN];
d_assert(bit_string, return CORE_ERROR,);
d_assert(ip, return CORE_ERROR,);
@ -120,16 +123,20 @@ status_t s1ap_BIT_STRING_to_ip(BIT_STRING_t *bit_string, ip_t *ip)
ip->ipv6 = 1;
memcpy(&ip->both.addr, bit_string->buf, IPV4_LEN);
memcpy(&ip->both.addr6, bit_string->buf+IPV4_LEN, IPV6_LEN);
d_trace(5, " IPv4[%s] IPv6[%s]\n",
INET_NTOP(&ip->both.addr, buf), INET6_NTOP(&ip->both.addr6, buf2));
}
else if (bit_string->size == IPV4_LEN)
{
ip->ipv4 = 1;
memcpy(&ip->addr, bit_string->buf, IPV4_LEN);
d_trace(5, " IPv4[%s]\n", INET_NTOP(&ip->addr, buf));
}
else if (bit_string->size == IPV6_LEN)
{
ip->ipv6 = 1;
memcpy(&ip->addr6, bit_string->buf, IPV6_LEN);
d_trace(5, " IPv6[%s]\n", INET_NTOP(&ip->addr6, buf));
}
else
d_assert(0, return CORE_ERROR, "Invalid Length(%d)", bit_string->size);
@ -140,6 +147,8 @@ status_t s1ap_BIT_STRING_to_ip(BIT_STRING_t *bit_string, ip_t *ip)
}
status_t s1ap_ip_to_BIT_STRING(ip_t *ip, BIT_STRING_t *bit_string)
{
char buf[CORE_ADDRSTRLEN], buf2[CORE_ADDRSTRLEN];
d_assert(ip, return CORE_ERROR,);
d_assert(bit_string, return CORE_ERROR,);
@ -149,18 +158,22 @@ status_t s1ap_ip_to_BIT_STRING(ip_t *ip, BIT_STRING_t *bit_string)
bit_string->buf = core_calloc(bit_string->size, sizeof(c_uint8_t));
memcpy(bit_string->buf, &ip->both.addr, IPV4_LEN);
memcpy(bit_string->buf+IPV4_LEN, &ip->both.addr6, IPV6_LEN);
d_trace(5, " IPv4[%s] IPv6[%s]\n",
INET_NTOP(&ip->both.addr, buf), INET6_NTOP(&ip->both.addr6, buf2));
}
else if (ip->ipv4)
{
bit_string->size = IPV4_LEN;
bit_string->buf = core_calloc(bit_string->size, sizeof(c_uint8_t));
memcpy(bit_string->buf, &ip->addr, IPV4_LEN);
d_trace(5, " IPv4[%s]\n", INET_NTOP(&ip->addr, buf));
}
else if (ip->ipv6)
{
bit_string->size = IPV6_LEN;
bit_string->buf = core_calloc(bit_string->size, sizeof(c_uint8_t));
memcpy(bit_string->buf, &ip->addr6, IPV6_LEN);
d_trace(5, " IPv6[%s]\n", INET_NTOP(&ip->addr6, buf));
}
else
d_assert(0, return CORE_ERROR,);

View File

@ -330,7 +330,8 @@ void s1ap_handle_initial_context_setup_response(
&e_rab->transportLayerAddress, &bearer->enb_s1u_ip);
d_assert(rv == CORE_OK, return,);
d_trace(5, " EBI[%d]\n", bearer->ebi);
d_trace(5, " EBI[%d] ENB-S1U-TEID[%d]\n",
bearer->ebi, bearer->enb_s1u_teid);
if (FSM_CHECK(&bearer->sm, esm_state_active))
{

View File

@ -59,6 +59,10 @@ void pgw_gx_handle_cca_termination_request(
/* backup sgw_s5c_teid in session context */
sgw_s5c_teid = sess->sgw_s5c_teid;
d_trace(3, "[PGW] Delete Session Response\n");
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
/* Remove a pgw session */
pgw_sess_remove(sess);
@ -67,7 +71,7 @@ void pgw_gx_handle_cca_termination_request(
h.teid = sgw_s5c_teid;
rv = pgw_s5c_build_delete_session_response(
&pkbuf, h.type, sess, gx_message, req);
&pkbuf, h.type, gx_message, req);
d_assert(rv == CORE_OK, return, "S11 build error");
rv = gtp_xact_update_tx(xact, &h, pkbuf);

View File

@ -30,16 +30,18 @@ status_t pgw_s5c_build_create_session_response(
c_uint8_t pco_buf[MAX_PCO_LEN];
c_int16_t pco_len;
d_trace(3, "[PGW] Create Session Response\n");
d_assert(sess, return CORE_ERROR, "Null param");
d_assert(req, return CORE_ERROR, "Null param");
d_trace(3, "[PGW] Create Session Response\n");
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
bearer = pgw_default_bearer_in_sess(sess);
d_assert(bearer, return CORE_ERROR, "Null param");
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
d_trace(5, " SGW_S5U_TEID[%d] PGW_S5U_TEID[%d]\n",
bearer->sgw_s5u_teid, bearer->pgw_s5u_teid);
rsp = &gtp_message.create_session_response;
memset(&gtp_message, 0, sizeof(gtp_message_t));
@ -120,7 +122,7 @@ status_t pgw_s5c_build_create_session_response(
}
status_t pgw_s5c_build_delete_session_response(
pkbuf_t **pkbuf, c_uint8_t type, pgw_sess_t *sess,
pkbuf_t **pkbuf, c_uint8_t type,
gx_message_t *gx_message, gtp_delete_session_request_t *req)
{
status_t rv;
@ -132,14 +134,9 @@ status_t pgw_s5c_build_delete_session_response(
c_uint8_t pco_buf[MAX_PCO_LEN];
c_int16_t pco_len;
d_assert(sess, return CORE_ERROR, "Null param");
d_assert(gx_message, return CORE_ERROR, "Null param");
d_assert(req, return CORE_ERROR, "Null param");
d_trace(3, "[PGW] Delete Session Response\n");
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
/* prepare cause */
memset(&cause, 0, sizeof(cause));
cause.value = GTP_CAUSE_REQUEST_ACCEPTED;

View File

@ -11,7 +11,7 @@ CORE_DECLARE(status_t) pgw_s5c_build_create_session_response(
pkbuf_t **pkbuf, c_uint8_t type, pgw_sess_t *sess,
gx_message_t *gx_message, gtp_create_session_request_t *req);
CORE_DECLARE(status_t) pgw_s5c_build_delete_session_response(
pkbuf_t **pkbuf, c_uint8_t type, pgw_sess_t *sess,
pkbuf_t **pkbuf, c_uint8_t type,
gx_message_t *gx_message, gtp_delete_session_request_t *req);
CORE_DECLARE(status_t) pgw_s5c_build_create_bearer_request(

View File

@ -73,13 +73,16 @@ void pgw_s5c_handle_create_session_request(
d_assert(sgw_s5c_teid, return, "Null param");
sess->sgw_s5c_teid = ntohl(sgw_s5c_teid->teid);
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
/* Control Plane(DL) : SGW-S5U */
sgw_s5u_teid = req->bearer_contexts_to_be_created.s5_s8_u_sgw_f_teid.data;
d_assert(sgw_s5u_teid, return, "Null param");
bearer->sgw_s5u_teid = ntohl(sgw_s5u_teid->teid);
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
d_trace(5, " SGW_S5U_TEID[%d] PGW_S5U_TEID[%d]\n",
bearer->sgw_s5u_teid, bearer->pgw_s5u_teid);
sgw = gtp_find_node(&pgw_self()->sgw_s5u_list, sgw_s5u_teid);
if (!sgw)
{

View File

@ -95,8 +95,7 @@ void pgw_state_operational(fsm_t *s, event_t *e)
{
sess = pgw_sess_find_by_teid(message->h.teid);
}
d_assert(sess,
pkbuf_free(recvbuf); pkbuf_free(copybuf); break,
d_assert(sess, pkbuf_free(recvbuf); pkbuf_free(copybuf); break,
"No Session Context");
rv = gtp_xact_receive(sess->gnode, &message->h, &xact);

View File

@ -471,8 +471,8 @@ status_t sgw_context_setup_trace_module()
d_trace_level(&_sgw_sm, gtpv2);
extern int _sgw_s11_handler;
d_trace_level(&_sgw_s11_handler, gtpv2);
extern int _sgw_s11_handler;
d_trace_level(&_sgw_s11_handler, gtpv2);
extern int _sgw_s5c_handler;
d_trace_level(&_sgw_s5c_handler, gtpv2);
extern int _gtp_node;
d_trace_level(&_gtp_node, gtpv2);

View File

@ -111,6 +111,8 @@ void sgw_s11_handle_create_session_request(
sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
d_trace(5, " SGW_S5U_TEID[%d] PGW_S5U_TEID[%d]\n",
s5u_tunnel->local_teid, s5u_tunnel->remote_teid);
pgw_s5c_teid = req->pgw_s5_s8_address_for_control_plane_or_pmip.data;
d_assert(pgw_s5c_teid, return, "Null param");
@ -189,8 +191,6 @@ CORE_DECLARE(void) sgw_s11_handle_modify_bearer_request(gtp_xact_t *s11_xact,
d_assert(req, return, "Null param");
d_trace(3, "[SGW] Modify Bearer Reqeust\n");
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
if (req->bearer_contexts_to_be_modified.presence == 0)
{
d_error("No Bearer");
@ -234,6 +234,12 @@ CORE_DECLARE(void) sgw_s11_handle_modify_bearer_request(gtp_xact_t *s11_xact,
/* Data Plane(DL) : eNB-S1U */
enb_s1u_teid = req->bearer_contexts_to_be_modified.s1_u_enodeb_f_teid.data;
s1u_tunnel->remote_teid = ntohl(enb_s1u_teid->teid);
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
d_trace(5, " ENB_S1U_TEID[%d] SGW_S1U_TEID[%d]\n",
s1u_tunnel->remote_teid, s1u_tunnel->local_teid);
enb = gtp_find_node(&sgw_self()->enb_s1u_list, enb_s1u_teid);
if (!enb)
{
@ -394,17 +400,22 @@ void sgw_s11_handle_create_bearer_response(gtp_xact_t *s11_xact,
sess = bearer->sess;
d_assert(sess, return, "Null param");
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
/* Set EBI */
bearer->ebi = req->bearer_contexts.eps_bearer_id.u8;
/* Data Plane(DL) : eNB-S1U */
enb_s1u_teid = req->bearer_contexts.s1_u_enodeb_f_teid.data;
s1u_tunnel->remote_teid = ntohl(enb_s1u_teid->teid);
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
d_trace(5, " ENB_S1U_TEID[%d] SGW_S1U_TEID[%d]\n",
s1u_tunnel->remote_teid, s1u_tunnel->local_teid);
d_trace(5, " SGW_S5U_TEID[%d] PGW_S5U_TEID[%d]\n",
s5u_tunnel->local_teid, s5u_tunnel->remote_teid);
enb = gtp_find_node(&sgw_self()->enb_s1u_list, enb_s1u_teid);
if (!enb)
{
@ -778,7 +789,8 @@ void sgw_s11_handle_create_indirect_data_forwarding_tunnel_request(
enb = gtp_find_node(&sgw_self()->enb_s1u_list, req_teid);
if (!enb)
{
enb = gtp_add_node_with_teid(&sgw_self()->enb_s1u_list, req_teid,
enb = gtp_add_node_with_teid(
&sgw_self()->enb_s1u_list, req_teid,
sgw_self()->gtpu_port,
context_self()->parameter.no_ipv4,
context_self()->parameter.no_ipv6,
@ -800,6 +812,9 @@ void sgw_s11_handle_create_indirect_data_forwarding_tunnel_request(
rsp_bearers[i]->s4_u_sgsn_f_teid.presence = 1;
rsp_bearers[i]->s4_u_sgsn_f_teid.data = &rsp_dl_teid[i];
rsp_bearers[i]->s4_u_sgsn_f_teid.len = len;
d_trace(5, " SGW_DL_TEID[%d] ENB_DL_TEID[%d]\n",
tunnel->local_teid, tunnel->remote_teid);
}
if (req_bearers[i]->s12_rnc_f_teid.presence)
@ -838,6 +853,8 @@ void sgw_s11_handle_create_indirect_data_forwarding_tunnel_request(
rsp_bearers[i]->s2b_u_epdg_f_teid_5.presence = 1;
rsp_bearers[i]->s2b_u_epdg_f_teid_5.data = &rsp_ul_teid[i];
rsp_bearers[i]->s2b_u_epdg_f_teid_5.len = len;
d_trace(5, " SGW_UL_TEID[%d] ENB_UL_TEID[%d]\n",
tunnel->local_teid, tunnel->remote_teid);
}
if (req_bearers[i]->s1_u_enodeb_f_teid.presence ||

View File

@ -80,16 +80,21 @@ void sgw_s5c_handle_create_session_response(gtp_xact_t *s5c_xact,
sess->pgw_s5c_teid = ntohl(pgw_s5c_teid->teid);
rsp->pgw_s5_s8__s2a_s2b_f_teid_for_pmip_based_interface_or_for_gtp_based_control_plane_interface.
presence = 0;
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
/* Receive Data Plane(UL) : PGW-S5U */
pgw_s5u_teid = rsp->bearer_contexts_created.s5_s8_u_sgw_f_teid.data;
d_assert(pgw_s5u_teid, return, "Null param");
s5u_tunnel->remote_teid = ntohl(pgw_s5u_teid->teid);
d_trace(5, " MME_S11_TEID[%d] SGW_S11_TEID[%d]\n",
sgw_ue->mme_s11_teid, sgw_ue->sgw_s11_teid);
d_trace(5, " SGW_S5C_TEID[0x%x] PGW_S5C_TEID[0x%x]\n",
sess->sgw_s5c_teid, sess->pgw_s5c_teid);
d_trace(5, " ENB_S1U_TEID[%d] SGW_S1U_TEID[%d]\n",
s1u_tunnel->remote_teid, s1u_tunnel->local_teid);
d_trace(5, " SGW_S5U_TEID[%d] PGW_S5U_TEID[%d]\n",
s5u_tunnel->local_teid, s5u_tunnel->remote_teid);
pgw = gtp_find_node(&sgw_self()->pgw_s5u_list, pgw_s5u_teid);
if (!pgw)
{
@ -418,7 +423,5 @@ void sgw_s5c_handle_delete_bearer_request(gtp_xact_t *s5c_xact,
rv = gtp_xact_commit(s11_xact);
d_assert(rv == CORE_OK, return, "xact_commit error");
d_trace(3, "[SGW] Delete Bearer Request : SGW <-- PGW\n");
}