Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UPF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
OpenXG
OpenXG-UPF
Commits
f9ea9c5d
Commit
f9ea9c5d
authored
May 24, 2022
by
kharade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added files for snap conf, removed unused vars
parent
86e21f2c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
337 additions
and
4 deletions
+337
-4
scripts/entrypoint.sh
scripts/entrypoint.sh
+0
-2
scripts/run_vpp_nrf.sh
scripts/run_vpp_nrf.sh
+86
-0
scripts/snap/init.conf
scripts/snap/init.conf
+34
-0
scripts/snap/run_vpp_nrf.sh
scripts/snap/run_vpp_nrf.sh
+102
-0
scripts/snap/startup_debug.conf
scripts/snap/startup_debug.conf
+30
-0
scripts/snap/upf_default_conf.sh
scripts/snap/upf_default_conf.sh
+43
-0
scripts/snap/upf_profile.json
scripts/snap/upf_profile.json
+40
-0
scripts/upf_conf/upf_profile.json
scripts/upf_conf/upf_profile.json
+2
-2
No files found.
scripts/entrypoint.sh
View file @
f9ea9c5d
...
@@ -44,8 +44,6 @@ BIN_DIR="/openair-upf/bin"
...
@@ -44,8 +44,6 @@ BIN_DIR="/openair-upf/bin"
UUID
=
$(
cat
/proc/sys/kernel/random/uuid
)
UUID
=
$(
cat
/proc/sys/kernel/random/uuid
)
SGI_IPV4
=
$(
ifconfig
$INTERFACE_CORE
|
grep
"inet "
|
awk
'{print $2}'
)
SGI_IPV4
=
$(
ifconfig
$INTERFACE_CORE
|
grep
"inet "
|
awk
'{print $2}'
)
ACCESS_IPV4
=
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
)
CORE_IPV4
=
$(
ifconfig
$INTERFACE_CP
|
grep
"inet "
|
awk
'{print $2}'
)
N3_IPV4_ADDRESS_LOCAL
=
${
N3_IPV4_ADDRESS_LOCAL
:-
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
N3_IPV4_ADDRESS_LOCAL
=
${
N3_IPV4_ADDRESS_LOCAL
:-
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
N4_IPV4_ADDRESS_LOCAL
=
${
N4_IPV4_ADDRESS_LOCAL
:-
$(
ifconfig
$INTERFACE_CP
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
N4_IPV4_ADDRESS_LOCAL
=
${
N4_IPV4_ADDRESS_LOCAL
:-
$(
ifconfig
$INTERFACE_CP
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
...
...
scripts/run_vpp_nrf.sh
0 → 100755
View file @
f9ea9c5d
#!/bin/bash
#"""
#/*
# * 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
# */
#
#/*! \file nrf_client.py
# \author Rohan KHARADE
# \date 2021
# \email: rohan.kharade@openairinterface.org
#*/
#"""
if
[
$(
id
-u
)
-ne
0
]
;
then
exec sudo
-E
"
$0
"
"
$@
"
fi
base
=
$(
dirname
$0
)
APP
=
"
$base
/bin/vpp"
ARGS
=
"-c
$base
/etc/startup_debug.conf"
USAGE
=
"Usage: run.sh [-r] [ debug ]
debug: executes vpp under gdb"
while
getopts
":r"
opt
;
do
case
$opt
in
r
)
APP
=
"
$base
/bin/vpp"
ARGS
=
"-c
$base
/etc/startup.conf"
;;
\?
)
echo
"Invalid option: -
$OPTARG
\n
"
>
&2
echo
"
$USAGE
"
>
&2
exit
1
;;
esac
done
shift
$((
OPTIND-1
))
if
test
-z
"
$1
"
;
then
$APP
$ARGS
&
elif
test
"
$1
"
=
"debug"
;
then
shift
gdb
-ex
'set print pretty on'
-ex
'run'
--args
$APP
$ARGS
$@
else
echo
"
$USAGE
"
>
&2
exit
1
fi
while
:
do
echo
"waiting for vpp-upf service"
RES
=
$(
bin/vppctl sh upf specification release |
awk
{
'print $3'
}
)
echo
$RES
if
[[
$RES
=
~ 16
]]
;
then
echo
"vpp-upf service is running now"
break
fi
sleep
3
done
if
[[
${
REGISTER_NRF
}
==
"yes"
]]
;
then
$base
/bin/nrf_client.sh
fi
sleep
infinity
scripts/snap/init.conf
0 → 100755
View file @
f9ea9c5d
ip
table
add
1
ip
table
add
2
create
host
-
interface
name
@
INTERFACE_CORE
@
set
interface
mtu
1500
host
-@
INTERFACE_CORE
@
set
interface
ip
table
host
-@
INTERFACE_CORE
@
1
set
interface
ip
address
host
-@
INTERFACE_CORE
@ @
INTERFACE_CORE
@/
24
set
interface
state
host
-@
INTERFACE_CORE
@
up
create
host
-
interface
name
@
INTERFACE_CP
@
set
interface
mtu
1500
host
-@
INTERFACE_CP
@
set
interface
ip
table
host
-@
INTERFACE_CP
@
0
set
interface
ip
address
host
-@
INTERFACE_CP
@ @
INTERFACE_CP
@/
24
set
interface
state
host
-@
INTERFACE_CP
@
up
create
host
-
interface
name
@
INTERFACE_ACCESS
@
set
interface
mtu
1500
host
-@
INTERFACE_ACCESS
@
set
interface
ip
table
host
-@
INTERFACE_ACCESS
@
2
set
interface
ip
address
host
-@
INTERFACE_ACCESS
@ @
INTERFACE_ACCESS
@/
24
set
interface
state
host
-@
INTERFACE_ACCESS
@
up
ip
route
add
0
.
0
.
0
.
0
/
0
table
2
via
@
N3_IPV4_ADDRESS_REMOTE
@
host
-
n3
ip
route
add
0
.
0
.
0
.
0
/
0
table
0
via
@
N4_IPV4_ADDRESS_REMOTE
@
host
-
n4
ip
route
add
0
.
0
.
0
.
0
/
0
table
1
via
@
N6_IPV4_ADDRESS_REMOTE
@
host
-
n6
upf
pfcp
endpoint
ip
@
N4_IPV4_ADDRESS_LOCAL
@
vrf
0
upf
node
-
id
fqdn
gw
@
GW_ID
@.
vppupf
.
node
.
5
gcn
.
mnc
@
MNC03
@.
mcc
@
MCC
@.@
REALM
@
upf
nwi
name
@
NWI_N3
@
vrf
2
upf
nwi
name
@
NWI_N6
@
vrf
1
upf
specification
release
16
upf
gtpu
endpoint
ip
@
N3_IPV4_ADDRESS_LOCAL
@
nwi
@
NWI_N3
@
teid
0
x000004d2
/
2
scripts/snap/run_vpp_nrf.sh
0 → 100755
View file @
f9ea9c5d
#!/bin/bash
#"""
#/*
# * 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
# */
#
#/*! \file nrf_client.py
# \author Rohan KHARADE
# \date 2021
# \email: rohan.kharade@openairinterface.org
#*/
#"""
trigger_nf_registration
()
{
UUID
=
9614ea76-2e95-4f01-ad57-e7abbf251820
CONFIG_DIR
=
/openair-upf/etc
NRF_URL
=
$NRF_IP_ADDR
:
$NRF_PORT
/nnrf-nfm/v1/nf-instances/
$UUID
##### Variables #####
DUMP_STATUS_CODE
=
$(
echo
'--write-out %{http_code} --silent --output /dev/null'
)
PATCH_DATA
=
$(
echo
'[{"op":"replace","path":"/nfStatus","value":"REGISTERED"}]'
)
CONTENT_TYPE
=
$(
echo
'Content-Type: application/json'
)
HTTP2
=
--http2-prior-knowledge
UPF_PROFILE
=
$CONFIG_DIR
/upf_profile.json
NF_HEARTBEAT_TIMER
=
10
NF_HEARTBEAT_START
=
5
##### NF Registration #####
echo
"Sending NF Registration Request (HTTP Version
$HTTP_VERSION
)"
if
[[
${
HTTP_VERSION
}
==
2
]]
;
then
response
=
$(
curl
$HTTP2
$DUMP_STATUS_CODE
-X
PUT
$NRF_URL
-d
@
$UPF_PROFILE
-H
"
$CONTENT_TYPE
"
)
else
response
=
$(
curl
$DUMP_STATUS_CODE
-X
PUT
$NRF_URL
-d
@
$UPF_PROFILE
-H
"
$CONTENT_TYPE
"
)
fi
##### NF Heartbeat #####
if
[[
${
response
}
==
201
||
${
response
}
==
200
]]
;
then
echo
-e
"Received NF registration response (HTTP_STATUS_CODE_200/201)
\n
"
sleep
$NF_HEARTBEAT_START
while
true
do
echo
"Sending NF heartbeat request"
if
[[
${
HTTP_VERSION
}
==
2
]]
;
then
response
=
$(
curl
$HTTP2
$DUMP_STATUS_CODE
-X
PATCH
$NRF_URL
-d
$PATCH_DATA
-H
"
$CONTENT_TYPE
"
)
else
response
=
$(
curl
$DUMP_STATUS_CODE
-X
PATCH
$NRF_URL
-d
$PATCH_DATA
-H
"
$CONTENT_TYPE
"
)
fi
if
[[
${
response
}
==
204
]]
;
then
echo
-e
"Received NF heartbeat response (HTTP_STATUS_CODE_204)
\n
"
fi
sleep
$NF_HEARTBEAT_TIMER
done
else
echo
-e
"
\n
NF Registration Procedure Failed ........!!!!"
fi
}
if
[
$(
id
-u
)
-ne
0
]
;
then
exec sudo
-E
"
$0
"
"
$@
"
fi
base
=
$(
dirname
$0
)
APP
=
"
$base
/bin/vpp"
ARGS
=
"-c
$base
/etc/startup_debug.conf"
$APP
$ARGS
&
while
:
do
echo
"waiting for vpp-upf service"
RES
=
$(
bin/vppctl sh upf specification release |
awk
{
'print $3'
}
)
echo
$RES
if
[[
$RES
=
~ 16
]]
;
then
echo
"vpp-upf service is running now"
break
fi
sleep
3
done
if
[[
${
REGISTER_NRF
}
==
"yes"
]]
;
then
trigger_nf_registration
fi
sleep
infinity
scripts/snap/startup_debug.conf
0 → 100755
View file @
f9ea9c5d
unix
{
nodaemon
log
/
tmp
/
vpp
.
log
full
-
coredump
gid
vpp
interactive
cli
-
listen
/
run
/
vpp
/
cli
.
sock
exec
@
INIT_CONF_PATH
@
}
api
-
trace
{
on
}
cpu
{
main
-
core
0
corelist
-
workers
1
}
api
-
segment
{
gid
vpp
}
plugins
{
path
@
VPP_PLUGIN_PATH
@
plugin
dpdk_plugin
.
so
{
disable
}
plugin
gtpu_plugin
.
so
{
disable
}
plugin
upf_plugin
.
so
{
enable
}
}
scripts/snap/upf_default_conf.sh
0 → 100755
View file @
f9ea9c5d
#!/usr/bin/env bash
NWI_N3
=
access.oai.org
NWI_N6
=
core.oai.org
GW_ID
=
1
MNC03
=
95
MCC
=
208
REALM
=
3gppnetwork.org
NETWORK_UE_IP
=
12.2.1.0/24
INIT_CONF_PATH
=
VPP_PLUGIN_PATH
=
/usr/lib/x86_64-linux-gnu/vpp_plugins/
# Ubntu18.04
INTERFACE_ACCESS
=
cn5g-access
# N3
INTERFACE_CORE
=
cn5g-core
# N6
INTERFACE_CP
=
demo-oai
# N4
NSSAI_SD_0
=
123
SST
=
222
DNN
=
default
REGISTER_NRF
=
yes
NRF_IP_ADDR
=
192.168.70.130
NRF_PORT
=
8080
UUID
=
0beafa60-8211-4774-b54f-2a8a35a721fe
#$(cat /proc/sys/kernel/random/uuid)
HTTP_VERSION
=
2
################ Gateway for N3(Gnb), N4(SMF), N6(DN/NAT Gateway) ################
#N3_IPV4_ADDRESS_REMOTE=${N3_IPV4_ADDRESS_REMOTE:-$(ifconfig $INTERFACE_ACCESS | grep "inet " | awk '{print $2}' | cut -d"." -f1-3)".1"}
N3_IPV4_ADDRESS_REMOTE
=
192.168.70.1
#N4_IPV4_ADDRESS_REMOTE=${N4_IPV4_ADDRESS_REMOTE:-$(ifconfig $INTERFACE_CP | grep "inet " | awk '{print $2}' | cut -d"." -f1-3)".1"}
N4_IPV4_ADDRESS_REMOTE
=
192.168.72.1
#N6_IPV4_ADDRESS_REMOTE=${N6_IPV4_ADDRESS_REMOTE:-$(ifconfig $INTERFACE_CORE | grep "inet " | awk '{print $2}' | cut -d"." -f1-3)".1"}
N6_IPV4_ADDRESS_REMOTE
=
192.168.73.135
################ Veth Pair IP in the VPP switch ################
#N3_IPV4_ADDRESS_LOCAL=${N3_IPV4_ADDRESS_LOCAL:-$(ifconfig $INTERFACE_ACCESS | grep "inet " | awk '{print $2}' | cut -d"." -f1-3)".202"}
N3_IPV4_ADDRESS_LOCAL
=
192.168.72.202
#N4_IPV4_ADDRESS_LOCAL=${N4_IPV4_ADDRESS_LOCAL:-$(ifconfig $INTERFACE_CP | grep "inet " | awk '{print $2}' | cut -d"." -f1-3)".202"}
N4_IPV4_ADDRESS_LOCAL
=
192.168.70.202
#N6_IPV4_ADDRESS_LOCAL=${N6_IPV4_ADDRESS_LOCAL:-$(ifconfig $INTERFACE_CORE | grep "inet " | awk '{print $2}' | cut -d"." -f1-3)".202"}
N6_IPV4_ADDRESS_LOCAL
=
192.168.73.202
scripts/snap/upf_profile.json
0 → 100644
View file @
f9ea9c5d
{
"nfInstanceId"
:
"@UUID@"
,
"capacity"
:
100
,
"fqdn"
:
"gw@GW_ID@.vppupf.node.5gcn.mnc@MNC03@.mcc@MCC@.@REALM@"
,
"heartBeatTimer"
:
10
,
"ipv4Addresses"
:
[
"@N4_IPV4_ADDRESS_LOCAL@"
],
"json_data"
:
null
,
"nfInstanceName"
:
"OAI-UPF-VPP"
,
"nfServices"
:
[],
"nfStatus"
:
"REGISTERED"
,
"nfType"
:
"UPF"
,
"priority"
:
1
,
"sNssais"
:
[{
"sd"
:
"@NSSAI_SD_0@"
,
"sst"
:
@SST@
}],
"upfInfo"
:
{
"sNssaiUpfInfoList"
:
[{
"dnnUpfInfoList"
:
[{
"dnn"
:
"@DNN@"
}],
"sNssai"
:
{
"sd"
:
"@NSSAI_SD_0@"
,
"sst"
:
@SST@
}
}],
"interfaceUpfInfoList"
:
[{
"endpointFqdn"
:
"@NWI_N3@"
,
"interfaceType"
:
"N3"
,
"ipv4EndpointAddresses"
:
[
"@N3_IPV4_ADDRESS_LOCAL@"
],
"networkInstance"
:
"@NWI_N3@"
},
{
"endpointFqdn"
:
"@NWI_N6@"
,
"interfaceType"
:
"N6"
,
"ipv4EndpointAddresses"
:
[
"@N6_IPV4_ADDRESS_LOCAL@"
],
"networkInstance"
:
"@NWI_N6@"
}]
}
}
scripts/upf_conf/upf_profile.json
View file @
f9ea9c5d
...
@@ -27,12 +27,12 @@
...
@@ -27,12 +27,12 @@
"interfaceUpfInfoList"
:
[{
"interfaceUpfInfoList"
:
[{
"endpointFqdn"
:
"@NWI_N3@"
,
"endpointFqdn"
:
"@NWI_N3@"
,
"interfaceType"
:
"N3"
,
"interfaceType"
:
"N3"
,
"ipv4EndpointAddresses"
:
[
"@
ACCESS_IPV4
@"
],
"ipv4EndpointAddresses"
:
[
"@
N3_IPV4_ADDRESS_LOCAL
@"
],
"networkInstance"
:
"@NWI_N3@"
"networkInstance"
:
"@NWI_N3@"
},
{
},
{
"endpointFqdn"
:
"@NWI_N6@"
,
"endpointFqdn"
:
"@NWI_N6@"
,
"interfaceType"
:
"N6"
,
"interfaceType"
:
"N6"
,
"ipv4EndpointAddresses"
:
[
"@
SGI_IPV4
@"
],
"ipv4EndpointAddresses"
:
[
"@
N6_IPV4_ADDRESS_LOCAL
@"
],
"networkInstance"
:
"@NWI_N6@"
"networkInstance"
:
"@NWI_N6@"
}]
}]
...
...
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