Commit e5b66cb0 authored by Lionel Gauthier's avatar Lionel Gauthier

Rework of GTPU in kernel (now use UDP socket, kthread for rx),

No need for GTPURH kernel module (work done in GTPUAH, will change module name later).
still classification with iptables mark, conntrack.
Tested with EPC local to eNB, test with remote EPC after this commit.

Added srb1 parameters in enb config file,

Correction of mscgen traces

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7413 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4bd766cc
......@@ -215,35 +215,12 @@ function main()
$SUDO rm -f /usr/etc/freeDiameter/epc* 2>&1
$SUDO rm -f $OPENAIR_DIR/targets/bin/xt_GTPU*.ko 2>&1
(cd $OPENAIRCN_DIR/GTPV1-U/GTPUAH && $SUDO make clean)
(cd $OPENAIRCN_DIR/GTPV1-U/GTPURH && $SUDO make clean)
$SUDO rm -f $OPENAIRCN_DIR/GTPV1-U/GTPUAH/Bin/* 2>&1
$SUDO rm -f /lib/xtables/libxt_GTPU*.so 2>&1
mkdir -m 777 -p -v build
fi
##############################################################################
# Compile kernel modules
##############################################################################
# NO CMAKE FOR THAT, THIS CODE CAN DISAPEAR
#cd $OPENAIRCN_DIR/GTPV1-U/GTPUAH;
#make
#if [ $? -ne 0 ]; then
# echo_error "Build GTPUAH module failed, exiting"
# return 1
#else
# $SUDO cp -pfv ./Bin/libxt_*.so /lib/xtables
# $SUDO cp -pfv ./Bin/*.ko $OPENAIR_TARGETS/bin
#fi
#cd $OPENAIRCN_DIR/GTPV1-U/GTPURH;
#make
#if [ $? -ne 0 ]; then
# echo_error "Build GTPURH module failed, exiting"
# return 1
#else
# $SUDO cp -pfv ./Bin/libxt_*.so /lib/xtables
# $SUDO cp -pfv ./Bin/*.ko $OPENAIR_TARGETS/bin
#fi
......@@ -272,20 +249,13 @@ function main()
compilations \
epc_build_oai xt_GTPUAH_lib \
libxt_GTPUAH_lib.so $dbin
compilations \
epc_build_oai xt_GTPURH_lib \
libxt_GTPURH_lib.so $dbin
compilations \
epc_build_oai xt_GTPURH \
CMakeFiles/xt_GTPURH/xt_GTPURH.ko $dbin
compilations \
epc_build_oai xt_GTPUAH \
CMakeFiles/xt_GTPUAH/xt_GTPUAH.ko $dbin
echo_info "Copying iptables libraries into system directory: /lib/xtables"
if [ -f $dbin/libxt_GTPURH_lib.so ] ; then
$SUDO rm -f /lib/xtables/libxt_GTPURH.so /lib/xtables/libxt_GTPUAH.so
$SUDO ln -s $dbin/libxt_GTPURH_lib.so /lib/xtables/libxt_GTPURH.so
if [ -f $dbin/libxt_GTPUAH_lib.so ] ; then
$SUDO rm -f /lib/xtables/libxt_GTPUAH.so
$SUDO ln -s $dbin/libxt_GTPUAH_lib.so /lib/xtables/libxt_GTPUAH.so
else
echo_fatal "not installed GTP-U iptables: binaries not found"
......
......@@ -92,7 +92,6 @@ S-GW :
SGW_IPV4_ADDRESS_FOR_S11 = "0.0.0.0/24";
SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP = "eth2";
SGW_INTERFACE_MTU_FOR_S1U_S12_S4_UP = 1564
SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP = "192.168.27.101/24";
# TODO PORT NUMBER
......@@ -115,7 +114,7 @@ P-GW =
PGW_IPV4_ADDRESS_FOR_S5_S8 = "0.0.0.0/24";
PGW_INTERFACE_NAME_FOR_SGI = "eth0";
PGW_IPV4_ADDRESS_FOR_SGI = "192.168.12.101/24";
PGW_IPV4_ADDRESS_FOR_SGI = "192.168.12.213/24";
# Option available only if GTPU in kernel configured
PGW_MASQUERADE_SGI = "yes";
};
......
......@@ -62,7 +62,7 @@ MME :
# max values = 999.999:65535
# maximum of 32 values, comma separated
PLMN = (
{MCC="208" ; MNC="92"; TAC = "1"; }
{MCC="208" ; MNC="93"; TAC = "1"; }
);
};
......@@ -91,9 +91,8 @@ S-GW :
SGW_INTERFACE_NAME_FOR_S11 = "none";
SGW_IPV4_ADDRESS_FOR_S11 = "0.0.0.0/24";
SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP = "tun3";
SGW_INTERFACE_MTU_FOR_S1U_S12_S4_UP = 1564
SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP = "192.188.3.3/24";
SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP = "lo";
SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP = "127.0.0.1/24";
# TODO PORT NUMBER
SGW_IPV4_PORT_FOR_S1U_S12_S4_UP = 2152;
......
......@@ -201,7 +201,7 @@ function main()
if [ $run_mscgen -eq 1 ]; then
cd $MSC_DIR
last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN
sync
last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
......
......@@ -257,7 +257,7 @@ function main()
if [ $run_mscgen -eq 1 ]; then
cd $MSC_DIR
last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN
sync
last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
......
This diff is collapsed.
......@@ -15,6 +15,8 @@
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/in.h>
#include <linux/icmp.h>
#include <linux/if_ether.h>
#include <linux/route.h>
#include <net/checksum.h>
......@@ -33,6 +35,7 @@
#endif
//#define TRACE_IN_KERN_LOG 1
#define TRACE_ICMP_IN_KERN_LOG 1
#if defined(TRACE_IN_KERN_LOG)
#define PR_INFO(fORMAT, aRGS...) pr_info(fORMAT, ##aRGS)
......@@ -105,11 +108,33 @@ struct gtpuhdr {
u_int32_t tunid;
};
//-----------------------------------------------------------------------------
static char*
_gtpurh_icmph_type_2_string(uint8_t typeP)
//-----------------------------------------------------------------------------
{
switch (typeP) {
case ICMP_ECHOREPLY:return "ECHOREPLY";break;
case ICMP_DEST_UNREACH:return "DEST_UNREACH";break;
case ICMP_SOURCE_QUENCH:return "SOURCE_QUENCH";break;
case ICMP_REDIRECT:return "REDIRECT";break;
case ICMP_ECHO:return "ECHO";break;
case ICMP_TIME_EXCEEDED:return "TIME_EXCEEDED";break;
case ICMP_PARAMETERPROB:return "PARAMETERPROB";break;
case ICMP_TIMESTAMP:return "TIMESTAMP";break;
case ICMP_TIMESTAMPREPLY:return "TIMESTAMPREPLY";break;
case ICMP_INFO_REQUEST:return "INFO_REQUEST";break;
case ICMP_INFO_REPLY:return "INFO_REPLY";break;
case ICMP_ADDRESS:return "ADDRESS";break;
case ICMP_ADDRESSREPLY:return "ADDRESSREPLY";break;
default:return "TYPE?";
}
}
//-----------------------------------------------------------------------------
static char*
_gtpurh_nf_inet_hook_2_string(int nf_inet_hookP)
//-----------------------------------------------------------------------------
{
//-----------------------------------------------------------------------------
switch (nf_inet_hookP) {
case NF_INET_PRE_ROUTING:
return "NF_INET_PRE_ROUTING";
......@@ -290,6 +315,9 @@ _gtpurh_tg4_rem(struct sk_buff *orig_skb_pP, const struct xt_action_param *par_p
#if defined(NEW_SKB)
struct sk_buff *new_skb_p = NULL;
struct iphdr *new_ip_p = NULL;
#endif
#if defined(TRACE_ICMP_IN_KERN_LOG)
struct icmphdr *icmph_p = NULL;
#endif
uint16_t gtp_payload_size = 0;
......@@ -487,6 +515,20 @@ _gtpurh_tg4_rem(struct sk_buff *orig_skb_pP, const struct xt_action_param *par_p
(new_skb_p->dev == NULL) ? "NULL" : new_skb_p->dev->name,
NIPADDR(new_ip_p->saddr),
NIPADDR(new_ip_p->daddr));*/
#if defined(TRACE_ICMP_IN_KERN_LOG)
if (new_ip_p->protocol == IPPROTO_ICMP) {
icmph_p = (struct icmphdr*)((uint8_t*)new_ip_p + (new_ip_p->ihl << 2));
if ((icmph_p->type == ICMP_ECHOREPLY) || (icmph_p->type == ICMP_ECHO)) {
pr_info("GTPURH: %s/%s ICMP src %u.%u.%u.%u dst %u.%u.%u.%u %s id %04X seq %u\n",
_gtpurh_nf_inet_hook_2_string(par_pP->hooknum),gtpurh_tg_reg[0].table,
NIPADDR(new_ip_p->saddr),
NIPADDR(new_ip_p->daddr),
_gtpurh_icmph_type_2_string(icmph_p->type),
ntohs(icmph_p->un.echo.id),
ntohs(icmph_p->un.echo.sequence));
}
}
#endif
ip_local_out(new_skb_p);
return NF_DROP;
free_skb:
......
......@@ -231,6 +231,11 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
UDP_INIT(message_p).address = inet_ntoa(addr);
LOG_D(GTPU, "Tx UDP_INIT IP addr %s\n", UDP_INIT(message_p).address);
MSC_LOG_EVENT(
MSC_GTPU_ENB,
"0 UDP bind %s:%u",
UDP_INIT(message_p).address,
UDP_INIT(message_p).port);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
}
......@@ -333,8 +338,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
MSC_LOG_TX_MESSAGE(
MSC_GTPU_ENB,
MSC_PDCP_ENB,
NULL,
0,
NULL,0,
MSC_AS_TIME_FMT" DATA-REQ rb %u size %u",
0,0,
(gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4,
......
......@@ -649,7 +649,7 @@ int emm_proc_authentication(void *ctx, unsigned int ueid, int ksi,
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REQ ue id %u (authentication)", ueid);
"0 EMMREG_COMMON_PROC_REQ ue id %06x (authentication)", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REQ;
......@@ -756,7 +756,7 @@ int emm_proc_authentication_complete(unsigned int ueid, int emm_cause,
*/
MSC_LOG_EVENT(
MSC_NAS_EMM_MME,
"SQN SYNCH_FAILURE ue id %u", ueid);
"SQN SYNCH_FAILURE ue id %06x", ueid);
LOG_TRACE(DEBUG, "EMM-PROC - USIM has detected a mismatch in SQN Ask for a new vector");
nas_itti_auth_info_req(ueid, emm_ctx->imsi, 0, res->value);
......@@ -779,7 +779,7 @@ int emm_proc_authentication_complete(unsigned int ueid, int emm_cause,
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u", ueid);
"0 EMMREG_COMMON_PROC_REJ ue id %06x", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
......@@ -795,7 +795,7 @@ int emm_proc_authentication_complete(unsigned int ueid, int emm_cause,
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_CNF ue id %u", ueid);
"0 EMMREG_COMMON_PROC_CNF ue id %06x", ueid);
LOG_TRACE(DEBUG, "EMM-PROC - Notify EMM that the authentication procedure successfully completed");
emm_sap.primitive = EMMREG_COMMON_PROC_CNF;
......@@ -1448,7 +1448,7 @@ int _authentication_request(authentication_data_t *data)
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_SECURITY_REQ ue id %u", data->ueid);
"0 EMMAS_SECURITY_REQ ue id %06x", data->ueid);
rc = emm_sap_send(&emm_sap);
......
......@@ -553,7 +553,7 @@ int emm_proc_detach_request(unsigned int ueid, emm_proc_detach_type_t type,
MSC_NAS_EMM_MME,
MSC_NAS_ESM_MME,
NULL,0,
"0 ESM_EPS_BEARER_CONTEXT_DEACTIVATE_REQ ue id %u", ueid);
"0 ESM_EPS_BEARER_CONTEXT_DEACTIVATE_REQ ue id %06x", ueid);
esm_sap_t esm_sap;
esm_sap.primitive = ESM_EPS_BEARER_CONTEXT_DEACTIVATE_REQ;
esm_sap.ueid = ueid;
......@@ -570,7 +570,7 @@ int emm_proc_detach_request(unsigned int ueid, emm_proc_detach_type_t type,
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_DETACH_REQ ue id %u", ueid);
"0 EMMREG_DETACH_REQ ue id %06x", ueid);
emm_sap.primitive = EMMREG_DETACH_REQ;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......
......@@ -331,7 +331,7 @@ int emm_proc_identification(unsigned int ueid,
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REQ ue id %u (identification)", ueid);
"0 EMMREG_COMMON_PROC_REQ ue id %06x (identification)", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REQ;
......@@ -444,7 +444,7 @@ int emm_proc_identification_complete(unsigned int ueid, const imsi_t *imsi,
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_CNF ue id %u", ueid);
"0 EMMREG_COMMON_PROC_CNF ue id %06x", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_CNF;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -459,7 +459,7 @@ int emm_proc_identification_complete(unsigned int ueid, const imsi_t *imsi,
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u", ueid);
"0 EMMREG_COMMON_PROC_REJ ue id %06x", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -568,7 +568,7 @@ int _identification_request(identification_data_t *data)
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_SECURITY_REQ ue id %u", data->ueid);
"0 EMMAS_SECURITY_REQ ue id %06x", data->ueid);
emm_sap.primitive = EMMAS_SECURITY_REQ;
emm_sap.u.emm_as.u.security.guti = NULL;
......@@ -657,7 +657,7 @@ static int _identification_abort(void *args)
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u", ueid);
"0 EMMREG_COMMON_PROC_REJ ue id %06x", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
......
......@@ -587,7 +587,7 @@ int emm_proc_security_mode_control(unsigned int ueid, int ksi,
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REQ ue id %u (security mode control)", ueid);
"0 EMMREG_COMMON_PROC_REQ ue id %06x (security mode control)", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REQ;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -666,7 +666,7 @@ int emm_proc_security_mode_complete(unsigned int ueid)
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_CNF ue id %u (security mode complete)", ueid);
"0 EMMREG_COMMON_PROC_CNF ue id %06x (security mode complete)", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_CNF;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......@@ -680,7 +680,7 @@ int emm_proc_security_mode_complete(unsigned int ueid)
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u (security mode complete)", ueid);
"0 EMMREG_COMMON_PROC_REJ ue id %06x (security mode complete)", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......@@ -770,7 +770,7 @@ int emm_proc_security_mode_reject(unsigned int ueid)
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u (security mode reject)", ueid);
"0 EMMREG_COMMON_PROC_REJ ue id %06x (security mode reject)", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -1116,7 +1116,7 @@ int _security_request(security_data_t *data, int is_new)
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_SECURITY_REQ ue id %u", data->ueid);
"0 EMMAS_SECURITY_REQ ue id %06x", data->ueid);
rc = emm_sap_send(&emm_sap);
if (rc != RETURNerror) {
......@@ -1182,7 +1182,7 @@ static int _security_abort(void *args)
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u (security abort)", data->ueid);
"0 EMMREG_COMMON_PROC_REJ ue id %06x (security abort)", data->ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
......
......@@ -2011,7 +2011,7 @@ static int _emm_as_security_rej(const emm_as_security_t *msg,
if (msg->guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send AUTHENTICATION_REJECT to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send AUTHENTICATION_REJECT to ue id %u ", as_msg->UEid);
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send AUTHENTICATION_REJECT to ue id %x ", as_msg->UEid);
}
size = emm_send_authentication_reject(
&emm_msg->authentication_reject);
......@@ -2037,10 +2037,16 @@ static int _emm_as_security_rej(const emm_as_security_t *msg,
if (emm_ctx) {
emm_security_context = emm_ctx->security;
if (emm_security_context) {
nas_msg.header.sequence_number = emm_security_context->dl_count.seq_num;
LOG_TRACE(DEBUG,
"Set nas_msg.header.sequence_number -> %u",
nas_msg.header.sequence_number);
} else {
LOG_TRACE(DEBUG,
"No security context, not set nas_msg.header.sequence_number -> %u",
nas_msg.header.sequence_number);
}
}
/* Encode the NAS security message */
......@@ -2227,7 +2233,7 @@ static int _emm_as_establish_rej(const emm_as_establish_t *msg,
if (msg->UEid.guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send ATTACH_REJECT to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send ATTACH_REJECT to ue id %u ", as_msg->UEid);
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send ATTACH_REJECT to ue id 0x%06"PRIX32" ", as_msg->UEid);
}
size = emm_send_attach_reject(msg, &emm_msg->attach_reject);
break;
......@@ -2236,7 +2242,7 @@ static int _emm_as_establish_rej(const emm_as_establish_t *msg,
if (msg->UEid.guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send TRACKING_AREA_UPDATE_REJECT to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send TRACKING_AREA_UPDATE_REJECT to ue id %u ", as_msg->UEid);
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send TRACKING_AREA_UPDATE_REJECT to ue id 0x%06"PRIX32" ", as_msg->UEid);
}
size = emm_send_tracking_area_update_reject(msg,
&emm_msg->tracking_area_update_reject);
......
......@@ -955,7 +955,7 @@ int s1ap_handle_sctp_deconnection(uint32_t assoc_id)
}
MSC_LOG_EVENT(
MSC_S1AP_MME,
"Event SCTP_CLOSE_ASSOCIATION assoc_id: %d",
"0 Event SCTP_CLOSE_ASSOCIATION assoc_id: %d",
assoc_id);
STAILQ_FOREACH(ue_ref, &eNB_association->ue_list_head, ue_entries) {
......@@ -1038,7 +1038,7 @@ int s1ap_handle_new_association(sctp_new_peer_t *sctp_new_peer_p)
eNB_association->next_sctp_stream = 1;
MSC_LOG_EVENT(
MSC_S1AP_MME,
"Event SCTP_NEW_ASSOCIATION assoc_id: %d",
"0 Event SCTP_NEW_ASSOCIATION assoc_id: %d",
eNB_association->sctp_assoc_id);
return 0;
......
......@@ -756,9 +756,9 @@ sgw_lite_handle_sgi_endpoint_updated(
//if ((resp_pP->eps_bearer_id == 5) && (spgw_config.pgw_config.pgw_masquerade_SGI == 0)) {
if (resp_pP->eps_bearer_id == 5) {
ret = snprintf(cmd,
256,
"iptables -t mangle -I %s -d %u.%u.%u.%u -m mark --mark 0 -j GTPUAH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action add",
(spgw_config.sgw_config.local_to_eNB) ? "FORWARD":"POSTROUTING",
256, // mangle -I
"iptables -t mangle -A %s -d %u.%u.%u.%u -m mark --mark 0 -j GTPUAH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action add",
(spgw_config.sgw_config.local_to_eNB) ? "FORWARD":"FORWARD", // test
eps_bearer_entry_p->paa.ipv4_address[0],
eps_bearer_entry_p->paa.ipv4_address[1],
eps_bearer_entry_p->paa.ipv4_address[2],
......@@ -789,7 +789,7 @@ sgw_lite_handle_sgi_endpoint_updated(
ret = snprintf(cmd,
256,
"iptables -t mangle -I %s -d %u.%u.%u.%u -m mark --mark %u -j GTPUAH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action add",
(spgw_config.sgw_config.local_to_eNB) ? "FORWARD":"POSTROUTING",
(spgw_config.sgw_config.local_to_eNB) ? "FORWARD":"FORWARD", // test
eps_bearer_entry_p->paa.ipv4_address[0],
eps_bearer_entry_p->paa.ipv4_address[1],
eps_bearer_entry_p->paa.ipv4_address[2],
......@@ -819,40 +819,6 @@ sgw_lite_handle_sgi_endpoint_updated(
SPGW_APP_ERROR("ERROR in setting up downlink TUNNEL\n");
}
if (iptable_uplink_remove_gtpu == FALSE) {
ret = snprintf(cmd,
256,
"iptables -t raw -I %s -s %u.%u.%u.%u -d %u.%u.%u.%u -p udp --dport 2152 -j GTPURH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action remove",
(spgw_config.sgw_config.local_to_eNB) ? "OUTPUT":"PREROUTING",
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[0],
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[1],
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[2],
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[3],
sgw_app.sgw_ip_address_for_S1u_S12_S4_up & 0x000000FF,
(sgw_app.sgw_ip_address_for_S1u_S12_S4_up & 0x0000FF00) >> 8,
(sgw_app.sgw_ip_address_for_S1u_S12_S4_up & 0x00FF0000) >> 16,
(sgw_app.sgw_ip_address_for_S1u_S12_S4_up & 0xFF000000) >> 24,
sgw_app.sgw_ip_address_for_S1u_S12_S4_up & 0x000000FF,
(sgw_app.sgw_ip_address_for_S1u_S12_S4_up & 0x0000FF00) >> 8,
(sgw_app.sgw_ip_address_for_S1u_S12_S4_up & 0x00FF0000) >> 16,
(sgw_app.sgw_ip_address_for_S1u_S12_S4_up & 0xFF000000) >> 24,
eps_bearer_entry_p->s_gw_teid_for_S1u_S12_S4_up,
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[0],
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[1],
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[2],
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[3],
eps_bearer_entry_p->enb_teid_for_S1u);
if ((ret < 0) || (ret > 256)) {
SPGW_APP_ERROR("ERROR in preparing uplink tunnel, tune string length\n");
exit (-1);
}
ret = spgw_system(cmd, SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
iptable_uplink_remove_gtpu = TRUE;
}
#endif
}
MSC_LOG_TX_MESSAGE(
......
This diff is collapsed.
......@@ -47,7 +47,6 @@
#define SGW_CONFIG_STRING_SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP "SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP"
#define SGW_CONFIG_STRING_SGW_PORT_FOR_S1U_S12_S4_UP "SGW_IPV4_PORT_FOR_S1U_S12_S4_UP"
#define SGW_CONFIG_STRING_SGW_INTERFACE_NAME_FOR_S5_S8_UP "SGW_INTERFACE_NAME_FOR_S5_S8_UP"
#define SGW_CONFIG_STRING_SGW_INTERFACE_MTU_FOR_S1U_S12_S4_UP "SGW_INTERFACE_MTU_FOR_S1U_S12_S4_UP"
#define SGW_CONFIG_STRING_SGW_IPV4_ADDRESS_FOR_S5_S8_UP "SGW_IPV4_ADDRESS_FOR_S5_S8_UP"
#define SGW_CONFIG_STRING_SGW_INTERFACE_NAME_FOR_S11 "SGW_INTERFACE_NAME_FOR_S11"
#define SGW_CONFIG_STRING_SGW_IPV4_ADDRESS_FOR_S11 "SGW_IPV4_ADDRESS_FOR_S11"
......@@ -95,7 +94,6 @@ typedef struct sgw_config_s {
uint32_t sgw_ipv4_address_for_S11;
int sgw_ip_netmask_for_S11;
} ipv4;
int sgw_interface_mtu_for_S1u_S12_S4_up;
int sgw_udp_port_for_S1u_S12_S4_up;
uint8_t sgw_drop_uplink_traffic;
......
......@@ -148,12 +148,12 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) {
MSC_LOG_EVENT(MSC_PHY_ENB, "Failed add ue %"PRIx16" (ENOMEM)", rnti);
MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed add ue %"PRIx16" (ENOMEM)", rnti);
LOG_E(PHY,"Can't add UE, not enough memory allocated\n");
return(-1);
} else {
if (phy_vars_eNB->eNB_UE_stats[i].crnti==0) {
MSC_LOG_EVENT(MSC_PHY_ENB, "Add ue %"PRIx16" ", rnti);
MSC_LOG_EVENT(MSC_PHY_ENB, "0 Add ue %"PRIx16" ", rnti);
LOG_I(PHY,"UE_id %d associated with rnti %x\n",i, rnti);
phy_vars_eNB->dlsch_eNB[i][0]->rnti = rnti;
phy_vars_eNB->ulsch_eNB[i]->rnti = rnti;
......@@ -176,12 +176,12 @@ int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) {
MSC_LOG_EVENT(MSC_PHY_ENB, "Failed remove ue %"PRIx16" (ENOMEM)", rnti);
MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti);
LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
return(-1);
} else {
if (phy_vars_eNB->eNB_UE_stats[i].crnti==rnti) {
MSC_LOG_EVENT(MSC_PHY_ENB, "Removed ue %"PRIx16" ", rnti);
MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rnti);
//msg("[PHY] UE_id %d\n",i);
clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0], abstraction_flag);
clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i],abstraction_flag);
......@@ -193,7 +193,7 @@ int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction
}
}
MSC_LOG_EVENT(MSC_PHY_ENB, "Failed remove ue %"PRIx16" (not found)", rnti);
MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rnti);
return(-1);
}
......@@ -2788,7 +2788,7 @@ void process_HARQ_feedback(uint8_t UE_id,
LOG_W(PHY,"[eNB %d][PDSCH %x/%d] DLSCH retransmissions exhausted, dropping packet\n",phy_vars_eNB->Mod_id,
dlsch->rnti,dl_harq_pid[m]);
#endif
MSC_LOG_EVENT(MSC_PHY_ENB, "HARQ DLSCH Failed RNTI %"PRIx16" round %u",
MSC_LOG_EVENT(MSC_PHY_ENB, "0 HARQ DLSCH Failed RNTI %"PRIx16" round %u",
dlsch->rnti,
dlsch_harq_proc->round);
......@@ -3094,7 +3094,7 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
0,subframe,0);
#endif
} else {
MSC_LOG_EVENT(MSC_PHY_ENB, "RA Failed add user, too many");
MSC_LOG_EVENT(MSC_PHY_ENB, "0 RA Failed add user, too many");
LOG_I(PHY,"[eNB %d][RAPROC] frame %d, subframe %d: Unable to add user, max user count reached\n",
phy_vars_eNB->Mod_id,frame, subframe);
}
......
This diff is collapsed.
......@@ -176,6 +176,12 @@ typedef struct Enb_properties_s {
long ue_TimersAndConstants_n311[1+MAX_NUM_CCs];
long srb1_timer_poll_retransmit;
long srb1_timer_reordering;
long srb1_timer_status_prohibit;
long srb1_poll_pdu;
long srb1_poll_byte;
long srb1_max_retx_threshold;
/* Nb of MME to connect to */
uint8_t nb_mme;
/* List of MME to connect to */
......
......@@ -629,6 +629,13 @@ pdcp_data_ind(
#endif
//rrc_lite_data_ind(module_id, //Modified MW - L2 Interface
MSC_LOG_TX_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_NO)? MSC_PDCP_UE:MSC_PDCP_ENB,
(ctxt_pP->enb_flag == ENB_FLAG_NO)? MSC_RRC_UE:MSC_RRC_ENB,
NULL,0,
PROTOCOL_PDCP_CTXT_FMT" DATA-IND len %u",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len);
pdcp_rrc_data_ind(ctxt_pP,
rb_id,
sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len,
......@@ -753,6 +760,14 @@ pdcp_data_ind(
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
MSC_LOG_TX_MESSAGE(
MSC_PDCP_ENB,
MSC_GTPU_ENB,
NULL,0,
"0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
ctxt_pP->rnti,
rb_id + 4,
sdu_buffer_sizeP - payload_offset);
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
......@@ -1564,14 +1579,14 @@ pdcp_config_set_security(
pdcp_pP->security_activated = 1;
MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
" Set security ciph %X integ %x UE %"PRIx16" ",
"0 Set security ciph %X integ %x UE %"PRIx16" ",
pdcp_pP->cipheringAlgorithm,
pdcp_pP->integrityProtAlgorithm,
ctxt_pP->rnti);
} else {
MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
" Set security failed UE %"PRIx16" ",
"0 Set security failed UE %"PRIx16" ",
ctxt_pP->rnti);
LOG_E(PDCP,PROTOCOL_PDCP_CTXT_FMT" bad security mode %d",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
......
......@@ -104,13 +104,13 @@
if (pmtl_rc != 0){\
if (pmtl_rc == EBUSY) {\
MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
PROTOCOL_RLC_AM_MSC_FMT" Warning try lock %s busy",\
"0 "PROTOCOL_RLC_AM_MSC_FMT" Warning try lock %s busy",\
PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\
#mUTEX);\
pthread_mutex_lock(mUTEX);\
} else {\
MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
PROTOCOL_RLC_AM_MSC_FMT" Error try lock %s %d",\
"0 "PROTOCOL_RLC_AM_MSC_FMT" Error try lock %s %d",\
PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\
#mUTEX, pmtl_rc);\
}\
......
......@@ -94,13 +94,13 @@
if (pmtl_rc != 0){\
if (pmtl_rc == EBUSY) {\
MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
PROTOCOL_RLC_UM_MSC_FMT" Warning try lock %s busy",\
"0 "PROTOCOL_RLC_UM_MSC_FMT" Warning try lock %s busy",\
PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\
#mUTEX);\
pthread_mutex_lock(mUTEX);\
} else {\
MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
PROTOCOL_RLC_UM_MSC_FMT" Error try lock %s %d",\
"0 "PROTOCOL_RLC_UM_MSC_FMT" Error try lock %s %d",\
PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\
#mUTEX, pmtl_rc);\
}\
......
......@@ -89,6 +89,7 @@
#include "MeasObjectToAddModList.h"
#include "ReportConfigToAddModList.h"
#include "MeasIdToAddModList.h"
#include "enb_config.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
......@@ -108,6 +109,7 @@ int errno;
//#define XER_PRINT
extern Enb_properties_array_t enb_properties;
typedef struct xer_sprint_string_s {
char *string;
size_t string_size;
......@@ -1433,12 +1435,12 @@ do_RRCConnectionSetup(
SRB1_rlc_config->present = SRB_ToAddMod__rlc_Config_PR_explicitValue;
SRB1_rlc_config->choice.explicitValue.present=RLC_Config_PR_am;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = T_PollRetransmit_ms80;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = PollPDU_p4;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = PollByte_kBinfinity;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = UL_AM_RLC__maxRetxThreshold_t8;
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = T_Reordering_ms35;
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = T_StatusProhibit_ms0;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_poll_retransmit;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = enb_properties.properties[ctxt_pP->module_id]->srb1_poll_pdu;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = enb_properties.properties[ctxt_pP->module_id]->srb1_poll_byte;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = enb_properties.properties[ctxt_pP->module_id]->srb1_max_retx_threshold;
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_reordering;
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_status_prohibit;
SRB1_lchan_config = CALLOC(1,sizeof(*SRB1_lchan_config));
SRB1_config->logicalChannelConfig = SRB1_lchan_config;
......
......@@ -186,7 +186,7 @@ void rrc_eNB_remove_ue_context(
MSC_LOG_EVENT(
MSC_RRC_ENB,
"Removed UE %x",
"0 Removed UE %"PRIx16" ",
ue_context_pP->ue_context.rnti);
rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_pP);
......
......@@ -102,6 +102,27 @@ eNBs =
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.13.11";
......
......@@ -103,6 +103,26 @@ eNBs =
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.188.2.2";
ipv6 = "192:168:30::17";
......
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