apply configuration related to MAX number
This commit is contained in:
parent
ca742661f6
commit
0ff388fb19
|
@ -35,44 +35,28 @@ extern "C" {
|
|||
#define SCTP_X2AP_PPID 27
|
||||
#define SCTP_SGSAP_PPID 0
|
||||
|
||||
#define MAX_NUM_OF_SGW 32
|
||||
#define MAX_NUM_OF_PGW 32
|
||||
#define MAX_NUM_OF_VLR 32
|
||||
|
||||
#define MAX_NUM_OF_ENB 128
|
||||
#define MAX_NUM_OF_UE 128
|
||||
#define MAX_NUM_OF_SESS 4
|
||||
#define MAX_NUM_OF_BEARER 4
|
||||
#define MAX_NUM_OF_TUNNEL 3 /* Num of Tunnel per Bearer */
|
||||
#define MAX_NUM_OF_PF 16 /* Num of Packet Filter per Bearer */
|
||||
|
||||
#define MAX_POOL_OF_UE (MAX_NUM_OF_ENB * MAX_NUM_OF_UE)
|
||||
#define MAX_POOL_OF_SESS (MAX_POOL_OF_UE * MAX_NUM_OF_SESS)
|
||||
#define MAX_POOL_OF_BEARER (MAX_POOL_OF_SESS * MAX_NUM_OF_BEARER)
|
||||
#define MAX_POOL_OF_TUNNEL (MAX_POOL_OF_BEARER * MAX_NUM_OF_TUNNEL)
|
||||
#define MAX_POOL_OF_PF (MAX_POOL_OF_BEARER * MAX_NUM_OF_PF)
|
||||
#define MAX_POOL_OF_DIAMETER_SESS (MAX_POOL_OF_UE * MAX_NUM_OF_SESS)
|
||||
#define MAX_NUM_OF_PDN 4
|
||||
|
||||
#define MAX_NUM_OF_HOSTNAME 16
|
||||
#define MAX_NUM_OF_PCC_RULE 8
|
||||
#define MAX_NUM_OF_FLOW 8 /* Num of Flow per PCC Rule */
|
||||
#define MAX_NUM_OF_PACKET_FILTER 16 /* Num of Packet Filter per Bearer */
|
||||
|
||||
#define MAX_SDU_LEN 8192
|
||||
#define PLMN_ID_LEN 3
|
||||
#define MAX_SDU_LEN 8192
|
||||
#define PLMN_ID_LEN 3
|
||||
|
||||
#define BCD_TO_BUFFER_LEN(x) (((x)+1)/2)
|
||||
#define MAX_IMSI_BCD_LEN 15
|
||||
#define MAX_IMSI_LEN BCD_TO_BUFFER_LEN(MAX_IMSI_BCD_LEN)
|
||||
#define BCD_TO_BUFFER_LEN(x) (((x)+1)/2)
|
||||
#define MAX_IMSI_BCD_LEN 15
|
||||
#define MAX_IMSI_LEN BCD_TO_BUFFER_LEN(MAX_IMSI_BCD_LEN)
|
||||
|
||||
#define RAND_LEN 16
|
||||
#define AUTN_LEN 16
|
||||
#define AUTS_LEN 14
|
||||
#define MAX_RES_LEN 16
|
||||
#define RAND_LEN 16
|
||||
#define AUTN_LEN 16
|
||||
#define AUTS_LEN 14
|
||||
#define MAX_RES_LEN 16
|
||||
|
||||
#define MAX_APN_LEN 100
|
||||
#define MAX_PCO_LEN 251
|
||||
#define MAX_FILEPATH_LEN 256
|
||||
#define MAX_APN_LEN 100
|
||||
#define MAX_PCO_LEN 251
|
||||
#define MAX_FILEPATH_LEN 256
|
||||
|
||||
#define NEXT_ID(__id, __min, __max) \
|
||||
((__id) = ((__id) == (__max) ? (__min) : ((__id) + 1)))
|
||||
|
|
|
@ -29,11 +29,11 @@ extern "C" {
|
|||
#include "base/types.h"
|
||||
|
||||
typedef struct _e_utran_vector_t {
|
||||
uint8_t xres[MAX_RES_LEN];
|
||||
uint8_t xres_len;
|
||||
uint8_t kasme[OGS_SHA256_DIGEST_SIZE];
|
||||
uint8_t rand[RAND_LEN];
|
||||
uint8_t autn[AUTN_LEN];
|
||||
uint8_t xres[MAX_RES_LEN];
|
||||
uint8_t xres_len;
|
||||
uint8_t kasme[OGS_SHA256_DIGEST_SIZE];
|
||||
uint8_t rand[RAND_LEN];
|
||||
uint8_t autn[AUTN_LEN];
|
||||
} e_utran_vector_t;
|
||||
|
||||
typedef struct _s6a_aia_message_t {
|
||||
|
@ -48,34 +48,34 @@ typedef struct _s6a_subscription_data_t {
|
|||
#define HSS_ACCESS_RESTRICTION_WB_E_UTRAN_NOT_ALLOWED (1<<4)
|
||||
#define HSS_ACCESS_RESTRICTION_HO_TO_NON_3GPP_ACCESS_NOT_ALLOWED (1<<5)
|
||||
#define HSS_ACCESS_RESTRICTION_NB_IOT_NOT_ALLOWED (1<<6)
|
||||
uint32_t access_restriction_data;
|
||||
uint32_t access_restriction_data;
|
||||
#define HSS_SUBSCRIBER_STATUS_SERVICE_GRANTED 0
|
||||
#define HSS_SUBSCRIBER_STATUS_OPERATOR_DETERMINED_BARRING 1
|
||||
uint32_t subscriber_status;
|
||||
uint32_t subscriber_status;
|
||||
#define HSS_NETWORK_ACCESS_MODE_PACKET_AND_CIRCUIT 0
|
||||
#define HSS_NETWORK_ACCESS_MODE_RESERVED 1
|
||||
#define HSS_NETWORK_ACCESS_MODE_ONLY_PACKET 2
|
||||
uint32_t network_access_mode;
|
||||
uint32_t network_access_mode;
|
||||
|
||||
bitrate_t ambr; /* UE-AMBR */
|
||||
uint32_t subscribed_rau_tau_timer; /* unit : minutes */
|
||||
uint32_t subscribed_rau_tau_timer; /* unit : minutes */
|
||||
|
||||
uint32_t context_identifier; /* default APN */
|
||||
pdn_t pdn[MAX_NUM_OF_SESS];
|
||||
uint32_t context_identifier; /* default APN */
|
||||
pdn_t pdn[MAX_NUM_OF_PDN];
|
||||
int num_of_pdn;
|
||||
} s6a_subscription_data_t;
|
||||
|
||||
typedef struct _s6a_ula_message_t {
|
||||
#define S6A_ULA_FLAGS_SEPARATION_INDICATION (0)
|
||||
#define S6A_ULA_FLAGS_MME_REGISTERED_FOR_SMS (1)
|
||||
uint32_t ula_flags;
|
||||
uint32_t ula_flags;
|
||||
s6a_subscription_data_t subscription_data;
|
||||
} s6a_ula_message_t;
|
||||
|
||||
typedef struct _s6a_message_t {
|
||||
#define S6A_CMD_CODE_UPDATE_LOCATION 316
|
||||
#define S6A_CMD_CODE_AUTHENTICATION_INFORMATION 318
|
||||
uint16_t cmd_code;
|
||||
uint16_t cmd_code;
|
||||
|
||||
/* Experimental Result Code */
|
||||
#define S6A_DIAMETER_AUTHENTICATION_DATA_UNAVAILABLE 4181
|
||||
|
@ -85,7 +85,7 @@ typedef struct _s6a_message_t {
|
|||
#define S6A_DIAMETER_ERROR_RAT_NOT_ALLOWED 5421
|
||||
#define S6A_DIAMETER_ERROR_EQUIPMENT_UNKNOWN 5422
|
||||
#define S6A_DIAMETER_ERROR_UNKOWN_SERVING_NODE 5423
|
||||
uint32_t result_code;
|
||||
uint32_t result_code;
|
||||
|
||||
s6a_aia_message_t aia_message;
|
||||
s6a_ula_message_t ula_message;
|
||||
|
|
|
@ -151,22 +151,30 @@ static int context_prepare()
|
|||
#define USRSCTP_LOCAL_UDP_PORT 9899
|
||||
self.config.usrsctp.udp_port = USRSCTP_LOCAL_UDP_PORT;
|
||||
|
||||
#define MAX_NUM_OF_ENB 32 /* Num of eNodeB per MME */
|
||||
#define MAX_NUM_OF_SGW 32 /* Num of SGW per MME */
|
||||
#define MAX_NUM_OF_PGW 32 /* Num of PGW per MME */
|
||||
#define MAX_NUM_OF_VLR 32 /* Num of VLR per MME */
|
||||
#define MAX_NUM_OF_ENB 16 /* Num of eNodeB per MME */
|
||||
#define MAX_NUM_OF_UE 128 /* Num of UE per eNodeB */
|
||||
#define MAX_NUM_OF_SESS 4 /* Num of APN(Session) per UE */
|
||||
#define MAX_NUM_OF_BEARER 4 /* Num of Bearer per APN(Session) */
|
||||
#define MAX_NUM_OF_TUNNEL 3 /* Num of Tunnel per Bearer */
|
||||
#define MAX_NUM_OF_PF 16 /* Num of Packet Filter per Bearer */
|
||||
#define MAX_NUM_OF_PACKET_BUFFER 512 /* Num of Buffer when S1-U Deactivated */
|
||||
#define MAX_NUM_OF_PACKET_POOL 131072 /* Num of 8192-packet pool in SGW */
|
||||
#define MAX_NUM_OF_PACKET_BUFFER 64 /* Num of Buffer when S1-U Deactivated */
|
||||
self.config.max.sgw = MAX_NUM_OF_SGW;
|
||||
self.config.max.pgw = MAX_NUM_OF_PGW;
|
||||
self.config.max.vlr = MAX_NUM_OF_VLR;
|
||||
self.config.max.enb = MAX_NUM_OF_ENB;
|
||||
self.config.max.ue = MAX_NUM_OF_UE;
|
||||
self.config.max.sess = MAX_NUM_OF_SESS;
|
||||
self.config.max.bearer = MAX_NUM_OF_BEARER;
|
||||
self.config.max.tunnel = MAX_NUM_OF_TUNNEL;
|
||||
self.config.max.pf = MAX_NUM_OF_PF;
|
||||
|
||||
self.config.max.packet.buffer = MAX_NUM_OF_PACKET_BUFFER;
|
||||
self.config.max.packet.pool = MAX_NUM_OF_PACKET_POOL;
|
||||
self.config.max.packet.pool =
|
||||
self.config.max.enb * self.config.max.ue *
|
||||
self.config.max.packet.buffer;
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -185,7 +193,6 @@ static int context_validation()
|
|||
self.pool.bearer = self.pool.sess * self.config.max.bearer;
|
||||
self.pool.tunnel = self.pool.bearer * self.config.max.tunnel;
|
||||
self.pool.pf = self.pool.bearer * self.config.max.pf;
|
||||
self.pool.diameter_sess = self.pool.ue * self.config.max.sess;
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -325,20 +332,30 @@ int context_parse_config()
|
|||
const char *v = ogs_yaml_iter_value(&max_iter);
|
||||
if (v) self.config.max.pf = atoi(v);
|
||||
} else if (!strcmp(max_key, "packet")) {
|
||||
const char *buffer = NULL;
|
||||
const char *pool = NULL;
|
||||
ogs_yaml_iter_t packet_iter;
|
||||
ogs_yaml_iter_recurse(&max_iter, &packet_iter);
|
||||
while (ogs_yaml_iter_next(&packet_iter)) {
|
||||
const char *packet_key = ogs_yaml_iter_key(&packet_iter);
|
||||
ogs_assert(packet_key);
|
||||
if (!strcmp(packet_key, "buffer")) {
|
||||
const char *v = ogs_yaml_iter_value(&packet_iter);
|
||||
if (v) self.config.max.packet.buffer = atoi(v);
|
||||
buffer = ogs_yaml_iter_value(&packet_iter);
|
||||
} else if (!strcmp(packet_key, "pool")) {
|
||||
const char *v = ogs_yaml_iter_value(&packet_iter);
|
||||
if (v) self.config.max.packet.pool = atoi(v);
|
||||
pool = ogs_yaml_iter_value(&packet_iter);
|
||||
} else
|
||||
ogs_warn("unknown key `%s`", packet_key);
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
self.config.max.packet.buffer = atoi(buffer);
|
||||
self.config.max.packet.pool =
|
||||
self.config.max.enb * self.config.max.ue *
|
||||
self.config.max.packet.buffer;
|
||||
}
|
||||
if (pool) {
|
||||
self.config.max.packet.pool = atoi(pool);
|
||||
}
|
||||
} else
|
||||
ogs_warn("unknown key `%s`", max_key);
|
||||
}
|
||||
|
|
|
@ -59,6 +59,9 @@ typedef struct _config_t {
|
|||
} usrsctp;
|
||||
|
||||
struct {
|
||||
int sgw;
|
||||
int pgw;
|
||||
int vlr;
|
||||
int enb;
|
||||
int ue;
|
||||
int sess;
|
||||
|
@ -96,7 +99,6 @@ typedef struct _context_t {
|
|||
int bearer;
|
||||
int tunnel;
|
||||
int pf;
|
||||
int diameter_sess;
|
||||
} pool;
|
||||
|
||||
} context_t;
|
||||
|
|
|
@ -610,7 +610,7 @@ int hss_db_subscription_data(
|
|||
|
||||
ogs_assert(child1_key);
|
||||
pdn_index = atoi(child1_key);
|
||||
ogs_assert(pdn_index < MAX_NUM_OF_SESS);
|
||||
ogs_assert(pdn_index < MAX_NUM_OF_PDN);
|
||||
|
||||
pdn = &subscription_data->pdn[pdn_index];
|
||||
|
||||
|
|
|
@ -64,17 +64,17 @@ void mme_context_init()
|
|||
ogs_list_init(&self.pgw_list);
|
||||
ogs_list_init(&self.vlr_list);
|
||||
|
||||
ogs_pool_init(&mme_sgw_pool, MAX_NUM_OF_SGW);
|
||||
ogs_pool_init(&mme_pgw_pool, MAX_NUM_OF_PGW);
|
||||
ogs_pool_init(&mme_vlr_pool, MAX_NUM_OF_VLR);
|
||||
ogs_pool_init(&mme_sgw_pool, context_self()->config.max.sgw);
|
||||
ogs_pool_init(&mme_pgw_pool, context_self()->config.max.pgw);
|
||||
ogs_pool_init(&mme_vlr_pool, context_self()->config.max.vlr);
|
||||
|
||||
ogs_pool_init(&mme_enb_pool, MAX_NUM_OF_ENB);
|
||||
ogs_pool_init(&mme_enb_pool, context_self()->config.max.enb);
|
||||
|
||||
ogs_pool_init(&mme_ue_pool, MAX_POOL_OF_UE);
|
||||
ogs_pool_init(&enb_ue_pool, MAX_POOL_OF_UE);
|
||||
ogs_pool_init(&mme_sess_pool, MAX_POOL_OF_SESS);
|
||||
ogs_pool_init(&mme_bearer_pool, MAX_POOL_OF_BEARER);
|
||||
ogs_pool_init(&self.m_tmsi, MAX_POOL_OF_UE);
|
||||
ogs_pool_init(&mme_ue_pool, context_self()->pool.ue);
|
||||
ogs_pool_init(&enb_ue_pool, context_self()->pool.ue);
|
||||
ogs_pool_init(&mme_sess_pool, context_self()->pool.sess);
|
||||
ogs_pool_init(&mme_bearer_pool, context_self()->pool.bearer);
|
||||
ogs_pool_init(&self.m_tmsi, context_self()->pool.ue);
|
||||
|
||||
self.enb_sock_hash = ogs_hash_make();
|
||||
self.enb_addr_hash = ogs_hash_make();
|
||||
|
@ -1871,7 +1871,7 @@ mme_ue_t* mme_ue_add(enb_ue_t *enb_ue)
|
|||
|
||||
mme_ue->mme_s11_teid = ogs_pool_index(&mme_ue_pool, mme_ue);
|
||||
ogs_assert(mme_ue->mme_s11_teid > 0 &&
|
||||
mme_ue->mme_s11_teid <= MAX_POOL_OF_UE);
|
||||
mme_ue->mme_s11_teid <= context_self()->pool.ue);
|
||||
|
||||
/*
|
||||
* SCTP output stream identification
|
||||
|
@ -2730,7 +2730,7 @@ int mme_m_tmsi_pool_generate()
|
|||
int index = 0;
|
||||
|
||||
ogs_trace("M-TMSI Pool try to generate...");
|
||||
for (i = 0; index < MAX_POOL_OF_UE; i++) {
|
||||
for (i = 0; index < context_self()->pool.ue; i++) {
|
||||
mme_m_tmsi_t *m_tmsi = NULL;
|
||||
int conflict = 0;
|
||||
|
||||
|
|
|
@ -54,10 +54,10 @@ void pgw_context_init()
|
|||
ogs_list_init(&self.subnet_list);
|
||||
ogs_pool_init(&pgw_subnet_pool, MAX_NUM_OF_SUBNET);
|
||||
|
||||
ogs_pool_init(&pgw_sess_pool, MAX_POOL_OF_SESS);
|
||||
ogs_pool_init(&pgw_bearer_pool, MAX_POOL_OF_BEARER);
|
||||
ogs_pool_init(&pgw_sess_pool, context_self()->pool.sess);
|
||||
ogs_pool_init(&pgw_bearer_pool, context_self()->pool.bearer);
|
||||
|
||||
ogs_pool_init(&pgw_pf_pool, MAX_POOL_OF_PF);
|
||||
ogs_pool_init(&pgw_pf_pool, context_self()->pool.pf);
|
||||
|
||||
self.sess_hash = ogs_hash_make();
|
||||
|
||||
|
@ -718,7 +718,7 @@ pgw_sess_t *pgw_sess_add(
|
|||
ogs_pool_alloc(&pgw_sess_pool, &sess);
|
||||
ogs_assert(sess);
|
||||
sess->index = ogs_pool_index(&pgw_sess_pool, sess);
|
||||
ogs_assert(sess->index > 0 && sess->index <= MAX_POOL_OF_SESS);
|
||||
ogs_assert(sess->index > 0 && sess->index <= context_self()->pool.sess);
|
||||
|
||||
sess->gnode = NULL;
|
||||
|
||||
|
@ -937,7 +937,8 @@ pgw_bearer_t* pgw_bearer_add(pgw_sess_t *sess)
|
|||
ogs_pool_alloc(&pgw_bearer_pool, &bearer);
|
||||
ogs_assert(bearer);
|
||||
bearer->index = ogs_pool_index(&pgw_bearer_pool, bearer);
|
||||
ogs_assert(bearer->index > 0 && bearer->index <= MAX_POOL_OF_BEARER);
|
||||
ogs_assert(bearer->index > 0 && bearer->index <=
|
||||
context_self()->pool.bearer);
|
||||
|
||||
bearer->name = NULL;
|
||||
|
||||
|
@ -1182,7 +1183,7 @@ int pgw_ue_pool_generate()
|
|||
broadcast[j] = subnet->sub.sub[j] + ~subnet->sub.mask[j];
|
||||
}
|
||||
|
||||
for (j = 0; j < mask_count && index < MAX_POOL_OF_SESS; j++) {
|
||||
for (j = 0; j < mask_count && index < context_self()->pool.sess; j++) {
|
||||
pgw_ue_ip_t *ue_ip = NULL;
|
||||
int maxbytes = 0;
|
||||
int lastindex = 0;
|
||||
|
@ -1384,7 +1385,7 @@ pgw_subnet_t *pgw_subnet_add(
|
|||
subnet->family = subnet->gw.family;
|
||||
subnet->prefixlen = atoi(mask_or_numbits);
|
||||
|
||||
ogs_pool_init(&subnet->pool, MAX_POOL_OF_SESS);
|
||||
ogs_pool_init(&subnet->pool, context_self()->pool.sess);
|
||||
|
||||
ogs_list_add(&self.subnet_list, subnet);
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@ void sgw_context_init()
|
|||
ogs_list_init(&self.enb_s1u_list);
|
||||
ogs_list_init(&self.pgw_s5u_list);
|
||||
|
||||
ogs_pool_init(&sgw_ue_pool, MAX_POOL_OF_UE);
|
||||
ogs_pool_init(&sgw_sess_pool, MAX_POOL_OF_SESS);
|
||||
ogs_pool_init(&sgw_bearer_pool, MAX_POOL_OF_BEARER);
|
||||
ogs_pool_init(&sgw_tunnel_pool, MAX_POOL_OF_TUNNEL);
|
||||
ogs_pool_init(&sgw_ue_pool, context_self()->pool.ue);
|
||||
ogs_pool_init(&sgw_sess_pool, context_self()->pool.sess);
|
||||
ogs_pool_init(&sgw_bearer_pool, context_self()->pool.bearer);
|
||||
ogs_pool_init(&sgw_tunnel_pool, context_self()->pool.tunnel);
|
||||
|
||||
self.imsi_ue_hash = ogs_hash_make();
|
||||
|
||||
|
@ -453,7 +453,7 @@ sgw_ue_t *sgw_ue_add(uint8_t *imsi, int imsi_len)
|
|||
|
||||
sgw_ue->sgw_s11_teid = ogs_pool_index(&sgw_ue_pool, sgw_ue);
|
||||
ogs_assert(sgw_ue->sgw_s11_teid > 0 &&
|
||||
sgw_ue->sgw_s11_teid <= MAX_POOL_OF_UE);
|
||||
sgw_ue->sgw_s11_teid <= context_self()->pool.ue);
|
||||
|
||||
/* Set IMSI */
|
||||
sgw_ue->imsi_len = imsi_len;
|
||||
|
@ -752,7 +752,7 @@ sgw_tunnel_t* sgw_tunnel_add(sgw_bearer_t *bearer, uint8_t interface_type)
|
|||
tunnel->interface_type = interface_type;
|
||||
tunnel->local_teid = ogs_pool_index(&sgw_tunnel_pool, tunnel);
|
||||
ogs_assert(tunnel->local_teid > 0 &&
|
||||
tunnel->local_teid <= MAX_POOL_OF_TUNNEL);
|
||||
tunnel->local_teid <= context_self()->pool.tunnel);
|
||||
|
||||
tunnel->bearer = bearer;
|
||||
tunnel->gnode = NULL;
|
||||
|
|
|
@ -63,10 +63,16 @@ sctp:
|
|||
#
|
||||
# max:
|
||||
#
|
||||
# o Maximum Number of SGW per MME
|
||||
# sgw: 32
|
||||
# o Maximum Number of PGW per MME
|
||||
# pgw: 32
|
||||
# o Maximum Number of VLR per MME
|
||||
# vlr: 32
|
||||
# o Maximum Number of eNodeB per MME
|
||||
# enb: 128
|
||||
# enb: 16
|
||||
# o Maximum Number of UE per eNodeB
|
||||
# ue: 32
|
||||
# ue: 128
|
||||
# o Maximum Number of APN(Session) per UE
|
||||
# sess: 4
|
||||
# o Maximum Number of Bearer per APN(Session)
|
||||
|
@ -79,9 +85,11 @@ sctp:
|
|||
# o Memory of Packet Buffering
|
||||
# packet:
|
||||
# - Maximum Number of Buffer when S1-U Deactivated
|
||||
# buffer: 512
|
||||
# buffer: 64
|
||||
# - Maximum Number of packet(SDU size = 8Kbytes) pool in SGW
|
||||
# pool: 131092
|
||||
# Default(131072) : ue(16) x enb(128) x buffer(64)
|
||||
# Memory Usage : 131072 * 8Kbytes = 1Gbytes
|
||||
# pool: 131072
|
||||
max:
|
||||
|
||||
mme:
|
||||
|
|
Loading…
Reference in New Issue