Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add TNGF #563

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@
[submodule "chf"]
path = NFs/chf
url = https://github.com/free5gc/chf.git
[submodule "NFs/tngf"]
path = NFs/tngf
url = https://github.com/free5gc/tngf.git
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ C_BUILD_PATH = build
ROOT_PATH = $(shell pwd)

NF = $(GO_NF)
GO_NF = amf ausf nrf nssf pcf smf udm udr n3iwf upf chf
GO_NF = amf ausf nrf nssf pcf smf udm udr n3iwf upf chf tngf

WEBCONSOLE = webconsole

Expand Down
1 change: 1 addition & 0 deletions NFs/tngf
Submodule tngf added at 2ef231
66 changes: 66 additions & 0 deletions config/tngfcfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
info:
version: 1.0.3
description: TNGF initial local configuration

configuration:
TNGFInformation:
GlobalTNGFID: # ID used to globally identify an TNGF
PLMNID: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>
MCC: 208 # Mobile Country Code (3 digits string, digit: 0~9)
MNC: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
TNGFID: 135 # ID used to identify an TNGF in PLMN (uinteger, range: 0~65535)
Name: free5GC_TNGF # The name of this TNGF
SupportedTAList: # Tracking Area supported by this TNGF
- TAC: 000001 # Tracking Area Code (3 bytes hex string, range: 000000~FFFFFF)
BroadcastPLMNList: # Refer to TS 38.413
- PLMNID: # Public Land Mobile Network ID
MCC: 208 # Mobile Country Code (3 digits string, digit: 0~9)
MNC: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
TAISliceSupportList: # Network Slice supported in this TAI
- SNSSAI: # Single Network Slice Selection Assistance Information
SST: 1 # Slice/Service Type (1 byte hex string, range: 0~F)
SD: 010203 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
- SNSSAI: # Single Network Slice Selection Assistance Information
SST: 1 # Slice/Service Type (1 byte hex string, range: 0~F)
SD: 112233 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)

AMFSCTPAddresses: # the IP list of N2 interfaces (SCTP) on AMF when using NGAP
- IP:
- 127.0.0.18
Port: 38412
NASTCPPort: 20000 # TCP port which the NAS listens on

# --- Bind Interfaces ---
# IKEBindAddress: 127.0.0.21 # IP address of Nwu interface (IKE) on this TNGF
IKEBindAddress: 192.168.1.245 #192.168.202.103 # IP address of Nwu interface (IKE) on this TNGF
RadiusBindAddress: 192.168.1.245 #192.168.137.103 # IP address of Nwu interface (IKE) on this TNGF
IPSecInterfaceAddress: 10.0.0.1 # IP address of IPSec virtual interface (IPsec tunnel enpoint on this TNGF)
IPSecTunnelAddress: 10.0.0.1 # Tunnel IP address of XFRM interface on this TNGF
UEIPAddressRange: 10.0.0.0/24 # IP address allocated to UE in IPSec tunnel
XFRMInterfaceName: xfrmi # Prefix of XFRM interface name created by TNGF
XFRMInterfaceID: 1 # XFRM interface if_id for IPSec routing (Any value except to 0, default value is 7 if not defined)

#GTPBindAddress: 10.200.200.2 # IP address of N3 interface (GTP) on this TNGF
GTPBindAddress: 127.0.0.33 # IP address of N3 interface (GTP) on this TNGF

FQDN: tngf.free5gc.org # FQDN of this TNGF

# --- Security ---
PrivateKey: cert/n3iwf.key # Private key file path
CertificateAuthority: cert/n3iwf.pem # Certificate Authority (CA) file path
Certificate: cert/n3iwf.pem # Certificate file path
RadiusSecret: nems@704

# the kind of log output
# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic
# ReportCaller: enable the caller report or not, value: true or false
logger:
TNGF: # The default log level is DEBUG to print SA keys. Please change it to INFO when deployed.
debugLevel: info
ReportCaller: false
NGAP:
debugLevel: info
ReportCaller: false
Aper:
debugLevel: info
ReportCaller: false
2 changes: 1 addition & 1 deletion force_kill.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

NF_LIST="nrf amf smf udr pcf udm nssf ausf n3iwf upf chf"
NF_LIST="nrf amf smf udr pcf udm nssf ausf n3iwf tngf upf chf"

for NF in ${NF_LIST}; do
sudo killall -9 ${NF}
Expand Down
14 changes: 13 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ LOG_NAME="free5gc.log"
TODAY=$(date +"%Y%m%d_%H%M%S")
PCAP_MODE=0
N3IWF_ENABLE=0
TNGF_ENABLE=0

PID_LIST=()
echo $$ > run.pid
Expand Down Expand Up @@ -32,6 +33,9 @@ if [ $# -ne 0 ]; then
-n3iwf)
N3IWF_ENABLE=1
;;
-tngf)
TNGF_ENABLE=1
;;
esac
shift
done
Expand All @@ -42,7 +46,7 @@ function terminate()
rm run.pid
sudo rm -f /tmp/config.json # CHF ChargingGatway FTP config
echo "Receive SIGINT, terminating..."
if [ $N3IWF_ENABLE -ne 0 ]; then
if [ $N3IWF_ENABLE -ne 0 ] || [ $TNGF_ENABLE -ne 0 ]; then
sudo ip xfrm state > ${LOG_PATH}NWu_SA_state.log
sudo ip xfrm state flush
sudo ip xfrm policy flush
Expand Down Expand Up @@ -131,5 +135,13 @@ if [ $N3IWF_ENABLE -ne 0 ]; then
PID_LIST+=($SUDO_N3IWF_PID $N3IWF_PID)
fi

if [ $TNGF_ENABLE -ne 0 ]; then
sudo ./bin/tngf -c ./config/tngfcfg.yaml -l ${LOG_PATH}tngf.log -lc ${LOG_PATH}${LOG_NAME} &
SUDO_TNGF_PID=$!
sleep 1
TNGF_PID=$(pgrep -P $SUDO_TNGF_PID)
PID_LIST+=($SUDO_TNGF_PID $TNGF_PID)
fi

wait ${PID_LIST}
exit 0
Loading