diff --git a/.env b/.env index fa8e31e..2687078 100644 --- a/.env +++ b/.env @@ -110,3 +110,6 @@ SMSC_IP=172.22.0.33 # SRSLTE UE SRS_UE_IP=172.22.0.34 + +# SCP +SCP_IP=172.22.0.30 diff --git a/amf/amf.yaml b/amf/amf.yaml index 6f95568..f4a100b 100644 --- a/amf/amf.yaml +++ b/amf/amf.yaml @@ -34,8 +34,8 @@ amf: full: Open5GS amf_name: open5gs-amf0 -nrf: +scp: sbi: - addr: - - NRF_IP + - SCP_IP port: 7777 diff --git a/amf/amf_init.sh b/amf/amf_init.sh index 8fac47a..2242d7e 100755 --- a/amf/amf_init.sh +++ b/amf/amf_init.sh @@ -28,7 +28,7 @@ cp /mnt/amf/amf.yaml install/etc/open5gs sed -i 's|AMF_IP|'$AMF_IP'|g' install/etc/open5gs/amf.yaml -sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/amf.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/amf.yaml sed -i 's|MNC|'$MNC'|g' install/etc/open5gs/amf.yaml sed -i 's|MCC|'$MCC'|g' install/etc/open5gs/amf.yaml diff --git a/ausf/ausf.yaml b/ausf/ausf.yaml index c8b977b..18d964e 100644 --- a/ausf/ausf.yaml +++ b/ausf/ausf.yaml @@ -8,8 +8,8 @@ ausf: - addr: AUSF_IP port: 7777 -nrf: +scp: sbi: - addr: - - NRF_IP + - SCP_IP port: 7777 diff --git a/ausf/ausf_init.sh b/ausf/ausf_init.sh index 7880973..8991a66 100755 --- a/ausf/ausf_init.sh +++ b/ausf/ausf_init.sh @@ -28,7 +28,7 @@ cp /mnt/ausf/ausf.yaml install/etc/open5gs sed -i 's|AUSF_IP|'$AUSF_IP'|g' install/etc/open5gs/ausf.yaml -sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/ausf.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/ausf.yaml # Sync docker time #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/base/Dockerfile b/base/Dockerfile index f66c9e6..2c5a558 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -64,7 +64,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && apt-get install # Get open5gs code and install RUN git clone --recursive https://github.com/open5gs/open5gs && cd open5gs && \ - git checkout tags/v2.4.11 && meson build --prefix=`pwd`/install && \ + git checkout main && meson build --prefix=`pwd`/install && \ ninja -C build && cd build && ninja install && \ mkdir -p /open5gs/install/include diff --git a/base/open5gs_init.sh b/base/open5gs_init.sh index cebe85b..dea728c 100755 --- a/base/open5gs_init.sh +++ b/base/open5gs_init.sh @@ -52,6 +52,10 @@ elif [[ "$COMPONENT_NAME" =~ ^(nrf-[[:digit:]]+$) ]]; then echo "Deploying component: '$COMPONENT_NAME'" /mnt/nrf/nrf_init.sh && \ cd install/bin && ./open5gs-nrfd +elif [[ "$COMPONENT_NAME" =~ ^(scp-[[:digit:]]+$) ]]; then + echo "Deploying component: '$COMPONENT_NAME'" + /mnt/scp/scp_init.sh && \ + cd install/bin && ./open5gs-scpd elif [[ "$COMPONENT_NAME" =~ ^(nssf-[[:digit:]]+$) ]]; then echo "Deploying component: '$COMPONENT_NAME'" /mnt/nssf/nssf_init.sh && \ diff --git a/bsf/bsf.yaml b/bsf/bsf.yaml index c00cb96..01b36c1 100644 --- a/bsf/bsf.yaml +++ b/bsf/bsf.yaml @@ -10,8 +10,8 @@ bsf: - addr: BSF_IP port: 7777 -nrf: +scp: sbi: - addr: - - NRF_IP + - SCP_IP port: 7777 diff --git a/bsf/bsf_init.sh b/bsf/bsf_init.sh index 4ae5961..cc62274 100755 --- a/bsf/bsf_init.sh +++ b/bsf/bsf_init.sh @@ -30,7 +30,7 @@ export DB_URI="mongodb://${MONGO_IP}/open5gs" cp /mnt/bsf/bsf.yaml install/etc/open5gs sed -i 's|BSF_IP|'$BSF_IP'|g' install/etc/open5gs/bsf.yaml -sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/bsf.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/bsf.yaml sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/bsf.yaml # Sync docker time diff --git a/docker-compose.yaml b/docker-compose.yaml index e245225..8bd6dc9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -54,10 +54,28 @@ services: networks: default: ipv4_address: ${NRF_IP} + scp: + image: docker_open5gs + container_name: scp + env_file: + - .env + environment: + - COMPONENT_NAME=scp-1 + volumes: + - ./scp:/mnt/scp + - ./log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${SCP_IP} ausf: image: docker_open5gs depends_on: - nrf + - scp container_name: ausf env_file: - .env @@ -77,6 +95,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: udr env_file: @@ -97,6 +116,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp container_name: udm env_file: - .env @@ -116,6 +136,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: pcf env_file: @@ -136,6 +157,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: bsf env_file: @@ -156,6 +178,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: nssf env_file: @@ -244,6 +267,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp container_name: smf env_file: - .env @@ -271,6 +295,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - smf container_name: upf env_file: @@ -302,6 +327,7 @@ services: - smf - upf - nrf + - scp - ausf - udm - udr diff --git a/nrf/nrf.yaml b/nrf/nrf.yaml index 91df28c..aa07dbe 100644 --- a/nrf/nrf.yaml +++ b/nrf/nrf.yaml @@ -8,3 +8,9 @@ nrf: addr: - NRF_IP port: 7777 + +scp: + sbi: + addr: + - SCP_IP + port: 7777 diff --git a/nrf/nrf_init.sh b/nrf/nrf_init.sh index 184256c..62fecaa 100755 --- a/nrf/nrf_init.sh +++ b/nrf/nrf_init.sh @@ -28,6 +28,7 @@ cp /mnt/nrf/nrf.yaml install/etc/open5gs sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/nrf.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/nrf.yaml # Sync docker time #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/nsa-deploy.yaml b/nsa-deploy.yaml index 1c2b115..362e75e 100644 --- a/nsa-deploy.yaml +++ b/nsa-deploy.yaml @@ -54,6 +54,23 @@ services: networks: default: ipv4_address: ${NRF_IP} + scp: + image: docker_open5gs + container_name: scp + env_file: + - .env + environment: + - COMPONENT_NAME=scp-1 + volumes: + - ./scp:/mnt/scp + - ./log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${SCP_IP} ausf: image: docker_open5gs depends_on: @@ -77,6 +94,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: udr env_file: @@ -97,6 +115,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp container_name: udm env_file: - .env @@ -116,6 +135,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: pcf env_file: @@ -136,6 +156,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: bsf env_file: @@ -156,6 +177,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: nssf env_file: @@ -244,6 +266,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp container_name: smf env_file: - .env @@ -271,6 +294,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - smf container_name: upf env_file: @@ -302,6 +326,7 @@ services: - smf - upf - nrf + - scp - ausf - udm - udr diff --git a/nssf/nssf.yaml b/nssf/nssf.yaml index d417dd9..0a4edb1 100644 --- a/nssf/nssf.yaml +++ b/nssf/nssf.yaml @@ -13,8 +13,8 @@ nssf: s_nssai: sst: 1 -nrf: +scp: sbi: - addr: - - NRF_IP + - SCP_IP port: 7777 diff --git a/nssf/nssf_init.sh b/nssf/nssf_init.sh index b6b48d9..1e54f62 100755 --- a/nssf/nssf_init.sh +++ b/nssf/nssf_init.sh @@ -29,6 +29,7 @@ cp /mnt/nssf/nssf.yaml install/etc/open5gs sed -i 's|NSSF_IP|'$NSSF_IP'|g' install/etc/open5gs/nssf.yaml sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/nssf.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/nssf.yaml # Sync docker time #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/pcf/pcf.yaml b/pcf/pcf.yaml index f1d7320..b67249f 100644 --- a/pcf/pcf.yaml +++ b/pcf/pcf.yaml @@ -10,8 +10,8 @@ pcf: - addr: PCF_IP port: 7777 -nrf: +scp: sbi: - addr: - - NRF_IP + - SCP_IP port: 7777 diff --git a/pcf/pcf_init.sh b/pcf/pcf_init.sh index fdd6458..2fd8f3b 100755 --- a/pcf/pcf_init.sh +++ b/pcf/pcf_init.sh @@ -30,7 +30,7 @@ export DB_URI="mongodb://${MONGO_IP}/open5gs" cp /mnt/pcf/pcf.yaml install/etc/open5gs sed -i 's|PCF_IP|'$PCF_IP'|g' install/etc/open5gs/pcf.yaml -sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/pcf.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/pcf.yaml sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/pcf.yaml # Sync docker time diff --git a/sa-deploy.yaml b/sa-deploy.yaml index 77d5cb9..0837299 100644 --- a/sa-deploy.yaml +++ b/sa-deploy.yaml @@ -54,10 +54,28 @@ services: networks: default: ipv4_address: ${NRF_IP} + scp: + image: docker_open5gs + container_name: scp + env_file: + - .env + environment: + - COMPONENT_NAME=scp-1 + volumes: + - ./scp:/mnt/scp + - ./log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${SCP_IP} ausf: image: docker_open5gs depends_on: - nrf + - scp container_name: ausf env_file: - .env @@ -77,6 +95,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: udr env_file: @@ -97,6 +116,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp container_name: udm env_file: - .env @@ -116,6 +136,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp container_name: smf env_file: - .env @@ -143,6 +164,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - smf container_name: upf env_file: @@ -174,6 +196,7 @@ services: - smf - upf - nrf + - scp - ausf - udm - udr @@ -201,6 +224,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: pcf env_file: @@ -221,6 +245,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: bsf env_file: @@ -241,6 +266,7 @@ services: image: docker_open5gs depends_on: - nrf + - scp - mongo container_name: nssf env_file: diff --git a/scp/scp.yaml b/scp/scp.yaml new file mode 100644 index 0000000..07678b6 --- /dev/null +++ b/scp/scp.yaml @@ -0,0 +1,16 @@ +logger: + file: /open5gs/install/var/log/open5gs/scp.log + +parameter: + +scp: + sbi: + addr: + - SCP_IP + port: 7777 + +nrf: + sbi: + - addr: + - NRF_IP + port: 7777 diff --git a/scp/scp_init.sh b/scp/scp_init.sh new file mode 100755 index 0000000..3844a8c --- /dev/null +++ b/scp/scp_init.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# BSD 2-Clause License + +# Copyright (c) 2020, Supreeth Herle +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cp /mnt/scp/scp.yaml install/etc/open5gs +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/scp.yaml +sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/scp.yaml + +# Sync docker time +#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/smf/smf.yaml b/smf/smf.yaml index 27f698f..c5c769d 100644 --- a/smf/smf.yaml +++ b/smf/smf.yaml @@ -37,10 +37,10 @@ smf: - PCSCF_IP mtu: 1400 -nrf: +scp: sbi: - addr: - - NRF_IP + - SCP_IP port: 7777 upf: diff --git a/smf/smf_init.sh b/smf/smf_init.sh index e7cec5f..176e607 100755 --- a/smf/smf_init.sh +++ b/smf/smf_init.sh @@ -38,7 +38,7 @@ cp /mnt/smf/smf.conf install/etc/freeDiameter cp /mnt/smf/make_certs.sh install/etc/freeDiameter sed -i 's|SMF_IP|'$SMF_IP'|g' install/etc/open5gs/smf.yaml -sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/smf.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/smf.yaml sed -i 's|UPF_IP|'$UPF_IP'|g' install/etc/open5gs/smf.yaml sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' install/etc/open5gs/smf.yaml sed -i 's|SMF_IP|'$SMF_IP'|g' install/etc/freeDiameter/smf.conf diff --git a/udm/udm.yaml b/udm/udm.yaml index bb8b09b..53aa58c 100644 --- a/udm/udm.yaml +++ b/udm/udm.yaml @@ -8,8 +8,8 @@ udm: - addr: UDM_IP port: 7777 -nrf: +scp: sbi: - addr: - - NRF_IP + - SCP_IP port: 7777 diff --git a/udm/udm_init.sh b/udm/udm_init.sh index 928f376..087f39c 100755 --- a/udm/udm_init.sh +++ b/udm/udm_init.sh @@ -28,7 +28,7 @@ cp /mnt/udm/udm.yaml install/etc/open5gs sed -i 's|UDM_IP|'$UDM_IP'|g' install/etc/open5gs/udm.yaml -sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/udm.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/udm.yaml # Sync docker time #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/udr/udr.yaml b/udr/udr.yaml index 1ffbb4a..ded18bf 100644 --- a/udr/udr.yaml +++ b/udr/udr.yaml @@ -10,8 +10,8 @@ udr: - addr: UDR_IP port: 7777 -nrf: +scp: sbi: - addr: - - NRF_IP + - SCP_IP port: 7777 diff --git a/udr/udr_init.sh b/udr/udr_init.sh index bee4575..96b0d97 100755 --- a/udr/udr_init.sh +++ b/udr/udr_init.sh @@ -30,7 +30,7 @@ export DB_URI="mongodb://${MONGO_IP}/open5gs" cp /mnt/udr/udr.yaml install/etc/open5gs sed -i 's|UDR_IP|'$UDR_IP'|g' install/etc/open5gs/udr.yaml -sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/udr.yaml +sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/udr.yaml sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/udr.yaml # Sync docker time