Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-Spgwu-Tiny-Simple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CommunityXG
OpenXG-Spgwu-Tiny-Simple
Commits
3775a9b8
Commit
3775a9b8
authored
Feb 15, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update with UPF info
parent
3ddb01c7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
225 additions
and
7 deletions
+225
-7
etc/spgw_u.conf
etc/spgw_u.conf
+12
-0
etc/spgw_u_eure.conf
etc/spgw_u_eure.conf
+122
-0
src/common/3gpp_29.510.h
src/common/3gpp_29.510.h
+24
-0
src/spgwu/spgwu_config.cpp
src/spgwu/spgwu_config.cpp
+50
-5
src/spgwu/spgwu_config.hpp
src/spgwu/spgwu_config.hpp
+17
-2
No files found.
etc/spgw_u.conf
View file @
3775a9b8
...
...
@@ -107,5 +107,17 @@ SPGW-U =
PORT
= @
NRF_PORT
@;
# YOUR NRF CONFIG HERE (default: 80)
API_VERSION
=
"@NRF_API_VERSION@"
;
# YOUR NRF API VERSION FOR SBI CONFIG HERE
};
UPF_INFO
= (
{
NSSAI_SST
=
222
,
NSSAI_SD
=
"123"
,
DNN
=
"default"
},
{
NSSAI_SST
=
222
;
NSSAI_SD
=
"123"
,
DNN
=
"carrier.com"
}
);
SUPPORT_FEATURES
:
{
# STRING, {"yes", "no"},
REGISTER_NRF
=
"no"
;
# Set to yes if UPF resgisters to an NRF
}
};
etc/spgw_u_eure.conf
0 → 100644
View file @
3775a9b8
################################################################################
# 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
################################################################################
SPGW
-
U
=
{
INSTANCE
=
0
;
# 0 is the default
PID_DIRECTORY
=
"/var/run"
;
# /var/run is the default
#ITTI_TASKS :
#{
#ITTI_TIMER_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 85;
#};
#S1U_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#SX_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#ASYNC_CMD_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#};
INTERFACES
:
{
S1U_S12_S4_UP
:
{
# S-GW binded interface for S1-U communication (GTPV1-U) can be ethernet interface, virtual ethernet interface, we don't advise wireless interfaces
INTERFACE_NAME
=
"enx0050b6f4ba5b"
;
# STRING, interface name, YOUR NETWORK CONFIG HERE
IPV4_ADDRESS
=
"read"
;
# STRING, CIDR or "read to let app read interface configured IP address
#PORT = 2152; # Default is 2152
#SCHED_PARAMS :
#{
#CPU_ID = 2;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 98;
#};
};
SX
:
{
# S/P-GW binded interface for SX communication
INTERFACE_NAME
=
"enx0050b6f4ba5b"
;
# STRING, interface name
IPV4_ADDRESS
=
"read"
;
# STRING, CIDR or "read" to let app read interface configured IP address
#PORT = 8805; # Default is 8805
#SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
SGI
:
{
# No config to set, the software will set the SGi interface to the interface used for the default route.
INTERFACE_NAME
=
"enx0050b6f4ba5b"
;
# STRING, interface name or "default_gateway"
IPV4_ADDRESS
=
"read"
;
# STRING, CIDR or "read" to let app read interface configured IP address
#SCHED_PARAMS :
#{
#CPU_ID = 3;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 98;
#};
};
};
PDN_NETWORK_LIST
= (
{
NETWORK_IPV4
=
"12.1.1.0/24"
;
SNAT
=
"yes"
;}
# SNAT Values in {yes, no}
);
SPGW
-
C_LIST
= (
{
IPV4_ADDRESS
=
"192.168.1.23"
;}
);
NRF
:
{
IPV4_ADDRESS
=
"192.168.1.23"
;
# YOUR NRF CONFIG HERE
PORT
=
8080
;
# YOUR NRF CONFIG HERE (default: 80)
API_VERSION
=
"v1"
;
# YOUR NRF API VERSION FOR SBI CONFIG HERE
};
UPF_INFO
= (
{
NSSAI_SST
=
222
,
NSSAI_SD
=
"123"
,
DNN
=
"default"
},
{
NSSAI_SST
=
222
;
NSSAI_SD
=
"123"
,
DNN
=
"carrier.com"
}
);
SUPPORT_FEATURES
:
{
# STRING, {"yes", "no"},
REGISTER_NRF
=
"no"
;
# Set to yes if UPF resgisters to an NRF
}
};
src/common/3gpp_29.510.h
View file @
3775a9b8
...
...
@@ -58,6 +58,30 @@ typedef struct snssai_upf_info_item_s {
typedef
struct
upf_info_s
{
std
::
vector
<
snssai_upf_info_item_t
>
snssai_upf_info_list
;
void
add_snssai
(
snssai_t
snssai
,
std
::
string
dnn
)
{
bool
found
=
false
;
dnn_upf_info_item_t
dnn_item
=
{};
dnn_item
.
dnn
=
dnn
;
for
(
int
i
=
0
;
i
<
snssai_upf_info_list
.
size
();
i
++
)
{
if
(
snssai_upf_info_list
[
i
].
snssai
==
snssai
)
{
for
(
int
j
=
0
;
j
<
snssai_upf_info_list
[
i
].
dnn_upf_info_list
.
size
();
j
++
)
{
if
(
snssai_upf_info_list
[
i
].
dnn_upf_info_list
[
j
].
dnn
.
compare
(
dnn
)
!=
0
)
{
snssai_upf_info_list
[
i
].
dnn_upf_info_list
.
push_back
(
dnn_item
);
break
;
}
}
found
=
true
;
}
}
if
(
!
found
)
{
snssai_upf_info_item_t
snssai_item
=
{};
snssai_item
.
snssai
=
snssai
;
snssai_item
.
dnn_upf_info_list
.
push_back
(
dnn_item
);
snssai_upf_info_list
.
push_back
(
snssai_item
);
}
}
}
upf_info_t
;
typedef
struct
patch_item_s
{
...
...
src/spgwu/spgwu_config.cpp
View file @
3775a9b8
...
...
@@ -455,13 +455,14 @@ int spgwu_config::load(const string& config_file) {
}
// NRF
const
Setting
&
nrf_cfg
=
spgwu_cfg
[
SPGWU_CONFIG_STRING_NRF
];
const
Setting
&
nrf_cfg
=
spgwu_cfg
[
SPGWU_CONFIG_STRING_NRF
];
struct
in_addr
nrf_ipv4_addr
;
unsigned
int
nrf_port
=
0
;
std
::
string
nrf_api_version
;
string
nrf_address
=
{};
nrf_cfg
.
lookupValue
(
SPGWU_CONFIG_STRING_NRF_IPV4_ADDRESS
,
nrf_address
);
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
nrf_address
).
c_str
(),
nrf_ipv4_addr
,
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
nrf_address
).
c_str
(),
nrf_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR NRF !"
);
nrf_addr
.
ipv4_addr
=
nrf_ipv4_addr
;
if
(
!
(
nrf_cfg
.
lookupValue
(
SPGWU_CONFIG_STRING_NRF_PORT
,
nrf_port
)))
{
...
...
@@ -470,13 +471,44 @@ int spgwu_config::load(const string& config_file) {
}
nrf_addr
.
port
=
nrf_port
;
if
(
!
(
nrf_cfg
.
lookupValue
(
SPGWU_CONFIG_STRING_API_VERSION
,
nrf_api_version
)))
{
if
(
!
(
nrf_cfg
.
lookupValue
(
SPGWU_CONFIG_STRING_API_VERSION
,
nrf_api_version
)))
{
Logger
::
spgwu_app
().
error
(
SPGWU_CONFIG_STRING_API_VERSION
"failed"
);
throw
(
SPGWU_CONFIG_STRING_API_VERSION
"failed"
);
}
nrf_addr
.
api_version
=
nrf_api_version
;
// Support features
const
Setting
&
support_features
=
spgwu_cfg
[
SPGWU_CONFIG_STRING_SUPPORT_FEATURES
];
string
opt
;
support_features
.
lookupValue
(
SPGWU_CONFIG_STRING_SUPPORT_FEATURES_REGISTER_NRF
,
opt
);
if
(
boost
::
iequals
(
opt
,
"yes"
))
{
register_nrf
=
true
;
}
else
{
register_nrf
=
false
;
}
// UPF info
const
Setting
&
upf_info_cfg
=
spgwu_cfg
[
SPGWU_CONFIG_STRING_UPF_INFO
];
count
=
upf_info_cfg
.
getLength
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
const
Setting
&
upf_info_item_cfg
=
upf_info_cfg
[
i
];
unsigned
int
nssai_sst
=
0
;
string
nssai_sd
=
{};
string
dnn
=
{};
upf_info_item_cfg
.
lookupValue
(
SPGWU_CONFIG_STRING_NSSAI_SST
,
nssai_sst
);
upf_info_item_cfg
.
lookupValue
(
SPGWU_CONFIG_STRING_NSSAI_SD
,
nssai_sd
);
upf_info_item_cfg
.
lookupValue
(
SPGWU_CONFIG_STRING_DNN
,
dnn
);
snssai_t
snssai
=
{};
snssai
.
sST
=
nssai_sst
;
snssai
.
sD
=
nssai_sd
;
upf_info
.
add_snssai
(
snssai
,
dnn
);
}
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
spgwu_app
().
error
(
"%s : %s"
,
nfex
.
what
(),
nfex
.
getPath
());
...
...
@@ -592,4 +624,17 @@ void spgwu_config::display() {
}
i
++
;
}
if
(
register_nrf
)
{
if
(
upf_info
.
snssai_upf_info_list
.
size
()
>
0
)
{
Logger
::
spgwu_app
().
debug
(
"
\t
UPF Info:"
);
}
for
(
auto
s
:
upf_info
.
snssai_upf_info_list
)
{
Logger
::
spgwu_app
().
debug
(
"
\t\t
Parameters supported by the UPF:"
);
Logger
::
spgwu_app
().
debug
(
"
\t\t\t
SNSSAI (SST %d, SD %s)"
,
s
.
snssai
.
sST
,
s
.
snssai
.
sD
.
c_str
());
for
(
auto
d
:
s
.
dnn_upf_info_list
)
{
Logger
::
spgwu_app
().
debug
(
"
\t\t\t
DNN %s"
,
d
.
dnn
.
c_str
());
}
}
}
}
src/spgwu/spgwu_config.hpp
View file @
3775a9b8
...
...
@@ -30,6 +30,7 @@
#define FILE_SPGWU_CONFIG_HPP_SEEN
#include "3gpp_29.244.h"
#include "3gpp_29.510.h"
#include "gtpv1u.hpp"
#include "pfcp.hpp"
#include "thread_sched.hpp"
...
...
@@ -74,6 +75,14 @@ namespace spgwu {
#define SPGWU_CONFIG_STRING_SPGWU_APP_SCHED_PARAMS "SPGWU_APP_SCHED_PARAMS"
#define SPGWU_CONFIG_STRING_ASYNC_CMD_SCHED_PARAMS "ASYNC_CMD_SCHED_PARAMS"
#define SPGWU_CONFIG_STRING_SUPPORT_FEATURES "SUPPORT_FEATURES"
#define SPGWU_CONFIG_STRING_SUPPORT_FEATURES_REGISTER_NRF "REGISTER_NRF"
#define SPGWU_CONFIG_STRING_UPF_INFO "UPF_INFO"
#define SPGWU_CONFIG_STRING_NSSAI_SST "NSSAI_SST"
#define SPGWU_CONFIG_STRING_NSSAI_SD "NSSAI_SD"
#define SPGWU_CONFIG_STRING_DNN "DNN"
#define SPGW_ABORT_ON_ERROR true
#define SPGW_WARN_ON_ERROR false
...
...
@@ -128,6 +137,9 @@ class spgwu_config {
std
::
vector
<
pdn_cfg_t
>
pdns
;
std
::
vector
<
pfcp
::
node_id_t
>
spgwcs
;
bool
register_nrf
;
upf_info_t
upf_info
;
struct
{
struct
in_addr
ipv4_addr
;
unsigned
int
port
;
...
...
@@ -163,6 +175,9 @@ class spgwu_config {
nrf_addr
.
ipv4_addr
.
s_addr
=
INADDR_ANY
;
nrf_addr
.
port
=
80
;
nrf_addr
.
api_version
=
"v1"
;
register_nrf
=
false
;
upf_info
=
{};
};
void
lock
()
{
m_rw_lock
.
lock
();
};
void
unlock
()
{
m_rw_lock
.
unlock
();
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment