Commit 8da86738 authored by dukl's avatar dukl

stateless support

parent b2a7610d
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
AMF =
{
INSTANCE_ID = 10; # 0 is the default
PID_DIRECTORY = "/var/run"; # /var/run is the default
AMF_NAME = "OAI-AMF";
RELATIVE_CAPACITY = 30;
# Display statistics about whole system (in seconds)
STATISTICS_TIMER_INTERVAL = 20; # YOUR CONFIG HERE
AMF_ID_REGION = 11000;
CORE_CONFIGURATION:
{
EMERGENCY_SUPPORT = "false";
};
GUAMI:
{
MCC = "460"; MNC = "99"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "1" # YOUR GUAMI CONFIG HERE
}
SERVED_GUAMI_LIST = (
{MCC = "460"; MNC = "99"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "0"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
#{MCC = "110"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
);
PLMN_SUPPORT_LIST = (
{
MCC = "460"; MNC = "99"; TAC = 100; # YOUR PLMN CONFIG HERE
SLICE_SUPPORT_LIST = (
{SST = "1"; SD = "none"} # YOUR NSSAI CONFIG HERE
# {SST = "1"; SD = "12"} # YOUR NSSAI CONFIG HERE
)
}
);
INTERFACES:
{
# AMF binded interface for N1/N2 interface (NGAP)
NGAP_AMF:
{
INTERFACE_NAME = "ens34"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 9999; # YOUR NETWORK CONFIG HERE
PPID = 60; # YOUR NETWORK CONFIG HERE
};
# AMF binded interface for Nausf interface
NAUSF:
{
INTERFACE_NAME = "ens18"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "10.103.239.53/16";
PORT = 8383; # YOUR NETWORK CONFIG HERE
};
NRF :
{
IPV4_ADDRESS = "10.103.239.54"; # YOUR NRF CONFIG HERE
PORT = 80; # YOUR NRF CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
};
SUPPORT_FEATURES:
{
# STRING, {"yes", "no"},
NF_REGISTRATION = "yes"; # Set to yes if AMF resgisters to an NRF
SMF_SELECTION = "no"; # Set to yes to enable SMF discovery and selection
EXTERNAL_AUSF = "yes"; # Set to yes if AMF works with an external AUSF
EXTERNAL_UDM = "no"; # Set to yes if AMF works with an external UDM
};
# AMF binded interface for N11
N11:
{
INTERFACE_NAME = "ens19"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 8282; # YOUR NETWORK CONFIG HERE
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "10.103.239.53"; PORT = "8889"; VERSION = "v2"; SELECTED = "true"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 2; IPV4_ADDRESS = "192.168.122.2"; PORT = "80"; VERSION = "v1"; SELECTED = "false"} # YOUR SMF CONFIG HERE
);
};
};
AUTHENTICATION:
{
## MySQL mandatory options
MYSQL_server = "127.0.0.1"; # MySQL Server address
MYSQL_user = "witcomm"; # Database server login
MYSQL_pass = "123456"; # Database server password
MYSQL_db = "witcomm"; # Your database name
## OP
OPERATOR_key = "63bfa50ee6523365ff14c1f45f88737d"; # OP key matching your database
RANDOM = "true";
};
NAS:
{
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA1" , "NIA1" , "NIA1" ];
ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "NEA0" , "NEA1" , "NEA2" ];
};
};
MODULES =
{
NGAP_MESSAGE = (
{MSG_NAME = "NGSetupRequest"; ProcedureCode = 21; TypeOfMessage = "initialMessage"}
);
};
......@@ -28,7 +28,9 @@ AMF =
RELATIVE_CAPACITY = 30;
# Display statistics about whole system (in seconds)
STATISTICS_TIMER_INTERVAL = 20; # YOUR CONFIG HERE
STATISTICS_TIMER_INTERVAL = 4; # YOUR CONFIG HERE
AMF_ID_REGION = 4000;
CORE_CONFIGURATION:
{
......@@ -70,7 +72,7 @@ AMF =
NAUSF:
{
INTERFACE_NAME = "ens18"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
IPV4_ADDRESS = "10.103.239.53/16";
PORT = 8383; # YOUR NETWORK CONFIG HERE
};
......@@ -84,19 +86,19 @@ AMF =
{
# STRING, {"yes", "no"},
NF_REGISTRATION = "yes"; # Set to yes if AMF resgisters to an NRF
SMF_SELECTION = "yes"; # Set to yes to enable SMF discovery and selection
SMF_SELECTION = "no"; # Set to yes to enable SMF discovery and selection
EXTERNAL_AUSF = "yes"; # Set to yes if AMF works with an external AUSF
EXTERNAL_UDM = "no"; # Set to yes if AMF works with an external UDM
};
# AMF binded interface for N11
N11:
{
INTERFACE_NAME = "ens19"; # YOUR NETWORK CONFIG HERE
INTERFACE_NAME = "ens18"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 8283; # YOUR NETWORK CONFIG HERE
PORT = 8282; # YOUR NETWORK CONFIG HERE
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "10.103.239.53"; PORT = "8889"; VERSION = "v2"; SELECTED = "false"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "10.103.239.53"; PORT = "8889"; VERSION = "v2"; SELECTED = "true"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 2; IPV4_ADDRESS = "192.168.122.2"; PORT = "80"; VERSION = "v1"; SELECTED = "false"} # YOUR SMF CONFIG HERE
);
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -45,7 +45,7 @@
#include "SmContextCreateData.h"
#include "mime_parser.hpp"
#include "ue_context.hpp"
#include <sys/time.h>
extern "C" {
#include "dynamic_memory_check.h"
}
......@@ -65,6 +65,8 @@ extern amf_n1* amf_n1_inst;
extern amf_n2* amf_n2_inst;
extern amf_app* amf_app_inst;
extern statistics stacs;
extern std::vector<long> delay_nudsf;
extern std::vector<long> amf_capability;
extern void msg_str_2_msg_hex(std::string msg, bstring& b);
extern void convert_string_2_hex(std::string& input, std::string& output);
......@@ -108,6 +110,7 @@ void amf_n11_task(void*) {
do {
std::shared_ptr<itti_msg> shared_msg = itti_inst->receive_msg(task_id);
auto* msg = shared_msg.get();
struct timeval tv1; struct timezone tz1; gettimeofday(&tv1,&tz1); long t1 = tv1.tv_sec*1000000 +tv1.tv_usec;
switch (msg->msg_type) {
case SMF_SERVICES_CONSUMER: {
Logger::amf_n11().info("Running SMF_SERVICES_CONSUMER");
......@@ -148,6 +151,8 @@ void amf_n11_task(void*) {
"Receive unknown message type %d", msg->msg_type);
}
}
struct timeval tv2; struct timezone tz2; gettimeofday(&tv2,&tz2); long t2 = tv2.tv_sec*1000000 +tv2.tv_usec;
//long one_time = t2 - t1; amf_capability.push_back(one_time);
} while (true);
}
......@@ -193,7 +198,10 @@ void amf_n11::handle_itti_message(
}
else{
Logger::amf_n2().debug("udsf_response: %s", udsf_response.dump().c_str());
struct timeval tv1; struct timezone tz1; gettimeofday(&tv1,&tz1); long start = tv1.tv_sec*1000000 +tv1.tv_usec;
nc.get()->nas_context_from_json(udsf_response);
struct timeval tv2; struct timezone tz2; gettimeofday(&tv2,&tz2); long end = tv2.tv_sec*1000000 +tv2.tv_usec;
long one_time = end - start; //delay_nudsf.push_back(one_time);
}
std::string supi ="imsi-" + nc.get()->imsi ;
Logger::amf_n11().debug(
......@@ -209,7 +217,10 @@ return ;
}
else{
Logger::amf_n2().debug("udsf_response: %s", udsf_response.dump().c_str());
struct timeval tv1; struct timezone tz1; gettimeofday(&tv1,&tz1); long start = tv1.tv_sec*1000000 +tv1.tv_usec;
psc.get()->pdu_session_context_from_json(udsf_response);
struct timeval tv2; struct timezone tz2; gettimeofday(&tv2,&tz2); long end = tv2.tv_sec*1000000 +tv2.tv_usec;
long one_time = end - start; //delay_nudsf.push_back(one_time);
}
// std::shared_ptr<nas_context> nc = std::shared_ptr<nas_context>(new nas_context());
......@@ -263,7 +274,10 @@ return ;
smf_addr = psc->smf_addr;
std::string smf_ip_addr, remote_uri;
std::shared_ptr<pdu_session_context> context = std::shared_ptr<pdu_session_context>(new pdu_session_context());
struct timeval tv1; struct timezone tz1; gettimeofday(&tv1,&tz1); long start = tv1.tv_sec*1000000 +tv1.tv_usec;
context.get()->pdu_session_context_from_json(udsf_response);
struct timeval tv2; struct timezone tz2; gettimeofday(&tv2,&tz2); long end = tv2.tv_sec*1000000 +tv2.tv_usec;
long one_time = end - start; //delay_nudsf.push_back(one_time);
//context = supi_to_pdu_ctx(supi);
// remove http port from the URI if existed
std::size_t found_port = smf_addr.find(":");
......@@ -322,7 +336,10 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
else{
Logger::amf_n2().debug("udsf_response: %s", udsf_response.dump().c_str());
psc = std::shared_ptr<pdu_session_context>(new pdu_session_context());
struct timeval tv1; struct timezone tz1; gettimeofday(&tv1,&tz1); long start = tv1.tv_sec*1000000 +tv1.tv_usec;
psc.get()->pdu_session_context_from_json(udsf_response);
struct timeval tv2; struct timezone tz2; gettimeofday(&tv2,&tz2); long end = tv2.tv_sec*1000000 +tv2.tv_usec;
long one_time = end - start; //delay_nudsf.push_back(one_time);
if(psc.get()->isn2sm_avaliable==false)
{
psc = std::shared_ptr<pdu_session_context>(new pdu_session_context());
......@@ -539,7 +556,7 @@ void amf_n11::handle_pdu_session_initial_request(
// TODO: Remove hardcoded values
std::string remote_uri =
smf_addr + ":8889/nsmf-pdusession/v2/sm-contexts";
smf_addr + "/nsmf-pdusession/v2/sm-contexts";
nlohmann::json pdu_session_establishment_request;
pdu_session_establishment_request["supi"] = supi.c_str();
pdu_session_establishment_request["pei"] = "imei-200000000000001";
......@@ -591,7 +608,10 @@ void amf_n11::handle_itti_message(
}
else{
Logger::amf_n2().debug("udsf_response: %s", udsf_response.dump().c_str());
struct timeval tv1; struct timezone tz1; gettimeofday(&tv1,&tz1); long start = tv1.tv_sec*1000000 +tv1.tv_usec;
psc.get()->pdu_session_context_from_json(udsf_response);
struct timeval tv2; struct timezone tz2; gettimeofday(&tv2,&tz2); long end = tv2.tv_sec*1000000 +tv2.tv_usec;
long one_time = end - start; //delay_nudsf.push_back(one_time);
//psc = std::shared_ptr<pdu_session_context>(psc1);
}
//***************************stateless
......@@ -705,7 +725,10 @@ void amf_n11::curl_http_client(
Logger::amf_n2().debug("udsf_response: %s", udsf_response.dump().c_str());
//psc1->pdu_session_context_from_json(udsf_response);
//psc = std::shared_ptr<pdu_session_context>(psc1);
struct timeval tv1; struct timezone tz1; gettimeofday(&tv1,&tz1); long start = tv1.tv_sec*1000000 +tv1.tv_usec;
psc.get()->pdu_session_context_from_json(udsf_response);
struct timeval tv2; struct timezone tz2; gettimeofday(&tv2,&tz2); long end = tv2.tv_sec*1000000 +tv2.tv_usec;
long one_time = end - start; //delay_nudsf.push_back(one_time);
//***************************stateless
// if (is_supi_to_pdu_ctx(supi)) {
......
This diff is collapsed.
......@@ -124,7 +124,8 @@ class itti_task_ctxt {
};
class itti_mw {
private:
//private:
public:
itti_task_ctxt* itti_task_ctxts[TASK_MAX];
/*
......
......@@ -40,6 +40,7 @@
#include "amf_module_from_config.hpp"
#include "amf_statistics.hpp"
#include <fstream>
#include <string>
#include <cstring>
#include "normalizer.hh"
......@@ -57,6 +58,10 @@ amf_modules modules;
itti_mw* itti_inst = nullptr;
amf_app* amf_app_inst = nullptr;
statistics stacs;
std::vector<long> delay_nudsf;
std::vector<long> delay_processing;
ofstream timeline;
//------------------------------------------------------------------------------
int main(int argc, char** argv) {
......@@ -67,6 +72,8 @@ int main(int argc, char** argv) {
return 1;
}
//timeline.open("stacs.log", ios::app);
Logger::init("AMF", Options::getlogStdout(), Options::getlogRotFilelog());
Logger::amf_app().startup("Options parsed!");
......
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