diff --git a/ci-scripts/Dockerfile.traffic.generator.ubuntu18.04 b/ci-scripts/Dockerfile.traffic.generator.ubuntu18.04 new file mode 100644 index 0000000000000000000000000000000000000000..90c1accae821fe059e2659850c34e654efef566a --- /dev/null +++ b/ci-scripts/Dockerfile.traffic.generator.ubuntu18.04 @@ -0,0 +1,52 @@ +#/* +# * 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 +# */ +#--------------------------------------------------------------------- +# +# Dockerfile for the Open-Air-Interface 5G Traffic Generator +# Valid for Ubuntu-18.04 (bionic) +# +#--------------------------------------------------------------------- + +#--------------------------------------------------------------------- +# TARGET IMAGE +#--------------------------------------------------------------------- +FROM ubuntu:bionic as trf-gen-cn5g +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=Europe/Paris +# We install some debug tools for the moment in addition of mandatory libraries +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \ + DEBIAN_FRONTEND=noninteractive apt-get install --yes \ + psmisc \ + net-tools \ + tshark \ + tzdata \ + iperf \ + iproute2 \ + iputils-ping \ + traceroute \ + tcpdump \ + iperf3 \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /tmp + +CMD ["sleep", "infinity"] diff --git a/ci-scripts/Jenkinsfile-GitLab-Tutorial-Check b/ci-scripts/Jenkinsfile-GitLab-Tutorial-Check index 7d63f91cd5d5324ca2cd59c6a61dc271ab8db742..2a3f261a98d90d57a7171e2a6dd9cde27f8d4298 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Tutorial-Check +++ b/ci-scripts/Jenkinsfile-GitLab-Tutorial-Check @@ -50,6 +50,7 @@ def upfVppTag = params.upfVppTag def upfVppBranch = params.upfVppTag // means to shorten the pipeline +def run_mini_gnbsim = true def run_static_ue_ip = true def run_vpp_upf = true def run_slicing_w_nssf = true @@ -88,6 +89,7 @@ pipeline { if (params.NRF_TAG != null) { nrfTag = params.NRF_TAG echo "Upstream Job passed NRF_TAG to use: ${nrfTag}" + run_mini_gnbsim = true run_static_ue_ip = true run_vpp_upf = true run_slicing_w_nssf = true @@ -99,6 +101,7 @@ pipeline { if (params.AMF_TAG != null) { amfTag = params.AMF_TAG echo "Upstream Job passed AMF_TAG to use: ${amfTag}" + run_mini_gnbsim = true run_static_ue_ip = true run_vpp_upf = true run_slicing_w_nssf = true @@ -110,6 +113,7 @@ pipeline { if (params.SMF_TAG != null) { smfTag = params.SMF_TAG echo "Upstream Job passed SMF_TAG to use: ${smfTag}" + run_mini_gnbsim = true run_static_ue_ip = true run_vpp_upf = true run_slicing_w_nssf = true @@ -121,6 +125,7 @@ pipeline { if (params.SPGWU_TAG != null) { spgwuTag = params.SPGWU_TAG echo "Upstream Job passed SPGWU_TAG to use: ${spgwuTag}" + run_mini_gnbsim = true run_static_ue_ip = true run_vpp_upf = false run_slicing_w_nssf = true @@ -132,6 +137,7 @@ pipeline { if (params.AUSF_TAG != null) { ausfTag = params.AUSF_TAG echo "Upstream Job passed AUSF_TAG to use: ${ausfTag}" + run_mini_gnbsim = false run_static_ue_ip = true run_vpp_upf = true run_slicing_w_nssf = true @@ -143,6 +149,7 @@ pipeline { if (params.UDM_TAG != null) { udmTag = params.UDM_TAG echo "Upstream Job passed UDM_TAG to use: ${udmTag}" + run_mini_gnbsim = false run_static_ue_ip = true run_vpp_upf = true run_slicing_w_nssf = true @@ -154,6 +161,7 @@ pipeline { if (params.UDR_TAG != null) { udrTag = params.UDR_TAG echo "Upstream Job passed UDR_TAG to use: ${udrTag}" + run_mini_gnbsim = false run_static_ue_ip = true run_vpp_upf = true run_slicing_w_nssf = true @@ -165,6 +173,7 @@ pipeline { if (params.NSSF_TAG != null) { nssfTag = params.NSSF_TAG echo "Upstream Job passed NSSF_TAG to use: ${nssfTag}" + run_mini_gnbsim = false run_static_ue_ip = false run_vpp_upf = false run_slicing_w_nssf = true @@ -176,6 +185,7 @@ pipeline { if (params.UPF_VPP_TAG != null) { upfVppTag = params.UPF_VPP_TAG echo "Upstream Job passed UPF_VPP_TAG to use: ${upfVppTag}" + run_mini_gnbsim = false run_static_ue_ip = false run_vpp_upf = true run_slicing_w_nssf = true @@ -261,6 +271,29 @@ pipeline { } } } + stage ('Check Minimalist Deployment Tutorial') { + when { expression {run_mini_gnbsim} } + steps { + script { + updateDockerCompose('docker-compose/docker-compose-mini-nrf.yaml', amfTag, nrfTag, smfTag, spgwuTag, ausfTag, udmTag, udrTag, nssfTag, upfVppTag) + dir ('ci-scripts') { + // Tee will make the command always pass + // Please use the same log name as the folder used in the tutorial + sh 'python3 ./checkTutorial.py --tutorial DEPLOY_SA5G_WITH_GNBSIM.md | tee ../archives/mini-gnbsim.log' + } + // Checking if FAIL appears + try { + sh 'grep -L FAIL archives/mini-gnbsim.log > /dev/null' + currentBuild.result = 'FAILURE' + echo "Minimalist gnbsim Tutorial FAILED" + } catch (Exception e) { + echo "Minimalist gnbsim Tutorial PASSED" + } + archivesArtifacts('docker-compose/docker-compose-mini-nrf.yaml', 'mini-gnbsim') + cleanUpDockerCompose('docker-compose/docker-compose-mini-nrf.yaml') + } + } + } stage ('Check Static UE IP Tutorial') { when { expression {run_static_ue_ip} } steps { diff --git a/ci-scripts/checkTutorialHtmlReport.py b/ci-scripts/checkTutorialHtmlReport.py index dd836bc35107a10699b510656736940274ebc7d3..8bcfc92efbd3323a463824d0fe97af99560b371b 100644 --- a/ci-scripts/checkTutorialHtmlReport.py +++ b/ci-scripts/checkTutorialHtmlReport.py @@ -40,7 +40,7 @@ class HtmlReport(): self.file = open(cwd + '/test_results_oai_cn5g_tutorials.html', 'w') self.generateHeader() - tutorials = ['static-ue-ip', 'vpp-upf-gnbsim', 'slicing-with-nssf'] + tutorials = ['mini-gnbsim', 'static-ue-ip', 'vpp-upf-gnbsim', 'slicing-with-nssf'] for tutorial in tutorials: if not os.path.isfile(cwd + '/archives/' + tutorial + '.log'): continue diff --git a/ci-scripts/validateN4UpfReportMessages.py b/ci-scripts/validateN4UpfReportMessages.py new file mode 100644 index 0000000000000000000000000000000000000000..ddb529e590e751d27bf71fcb89faa9b68eaee75b --- /dev/null +++ b/ci-scripts/validateN4UpfReportMessages.py @@ -0,0 +1,113 @@ +""" + 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 +""" + +import argparse +import os +import re +import sys + +class N4Statistics(): + def __init__(self): + self.nbN4Messages = 0 + self.totalDuration = 0 + self.nbPacketsTotal = 0 + self.nbPacketsDL = 0 + self.nbPacketsUL = 0 + self.totalVolume = 0 + self.dlVolume = 0 + self.ulVolume = 0 + + def printStats(self): + print(f'Received {self.nbN4Messages} N4 SESSION REPORT REQUESTS from an UPF') + print(f'- for a total duration of {self.totalDuration} seconds') + print(f'- Total Number of Packets : {self.nbPacketsTotal}') + print(f'- DL Number of Packets : {self.nbPacketsDL}') + print(f'- UL Number of Packets : {self.nbPacketsUL}') + print(f'- Total Volume : {self.totalVolume} bytes') + print(f'- DL Volume : {self.dlVolume} bytes') + print(f'- UL Volume : {self.ulVolume} bytes') + +def main() -> None: + args = _parse_args() + status = analyzeSmfLog(args.filename) + sys.exit(status) + +def _parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser(description='Analysis for SMF/UPF N4 Report messages') + + parser.add_argument( + '--filename', '-f', + action='store', + required=True, + help='Absolute path to the SMF file to analyze' + ) + return parser.parse_args() + +def analyzeSmfLog(logfile): + if not os.path.isfile(logfile): + print(f'{logfile} does not exist!') + return -1 + stats = N4Statistics() + with open(logfile, 'r') as smfLog: + printSection = False + packetSection = False + volumeSection = False + for line in smfLog: + if re.search('Received N4 SESSION REPORT REQUEST from an UPF', line): + printSection = True + stats.nbN4Messages += 1 + if re.search('itti_n4_session_report_response', line): + printSection = False + volumeSection = False + packetSection = False + if printSection: + res = re.search('Duration -> (?P<duration>[0-9]+)', line) + if res is not None: + stats.totalDuration += int(res.group('duration')) + res = re.search('NoP Total -> (?P<total>[0-9]+)', line) + if res is not None: + stats.nbPacketsTotal += int(res.group('total')) + packetSection = True + volumeSection = False + res = re.search('Volume Total -> (?P<total>[0-9]+)', line) + if res is not None: + stats.totalVolume += int(res.group('total')) + volumeSection = True + packetSection = False + res = re.search(' Uplink -> (?P<ul>[0-9]+)', line) + if res is not None and packetSection: + stats.nbPacketsUL += int(res.group('ul')) + if res is not None and volumeSection: + stats.ulVolume += int(res.group('ul')) + res = re.search(' Downlink -> (?P<dl>[0-9]+)', line) + if res is not None and packetSection: + stats.nbPacketsDL += int(res.group('dl')) + if res is not None and volumeSection: + stats.dlVolume += int(res.group('dl')) + smfLog.close() + stats.printStats() + if stats.nbN4Messages == 0: + return -1 + else: + return 0 + +if __name__ == '__main__': + main() diff --git a/docker-compose/core-network.py b/docker-compose/core-network.py index 042e3dee7c660d9aec141560dc5c6e89f1709864..1c3ff1bdd5bd4f35b40e41df990e6222f62c69db 100644 --- a/docker-compose/core-network.py +++ b/docker-compose/core-network.py @@ -141,7 +141,7 @@ def deploy(file_name, ct, extra_interface=False): cmd = f'docker-compose -f {file_name} up -d' res = run_cmd(cmd, False) # sometimes first try does not go through - if args.capture is None: + if args.capture is not None: cmd = f'sudo chmod 666 {args.capture}' run_cmd(cmd) if res is None: diff --git a/docker-compose/docker-compose-basic-nonrf.yaml b/docker-compose/docker-compose-basic-nonrf.yaml index cb51c3bf3150110c2ba04e0d257e1b256ac53ced..e53e55d64700f3befd0802e5a4f1df47aa1b3ddd 100644 --- a/docker-compose/docker-compose-basic-nonrf.yaml +++ b/docker-compose/docker-compose-basic-nonrf.yaml @@ -188,8 +188,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.132 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -272,12 +272,10 @@ services: public_net: ipv4_address: 192.168.70.134 oai-ext-dn: - image: ubuntu:bionic + image: trf-gen-cn5g:latest privileged: true container_name: oai-ext-dn entrypoint: /bin/bash -c \ - "apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\ - "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ "ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity" depends_on: - oai-spgwu diff --git a/docker-compose/docker-compose-basic-nrf.yaml b/docker-compose/docker-compose-basic-nrf.yaml index cc0019c58d63a5b5094b4d51bdff534f74b469f7..41c8a6ae3c85bccfa6218996bb459e7bf029b882 100644 --- a/docker-compose/docker-compose-basic-nrf.yaml +++ b/docker-compose/docker-compose-basic-nrf.yaml @@ -227,8 +227,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.132 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -250,6 +250,7 @@ services: - DNN_RANGE1=12.1.1.2 - 12.1.1.128 - DNN_RANGE0=12.2.1.2 - 12.2.1.128 - DNN_NI1=default + - UE_MTU=1500 depends_on: - oai-nrf - oai-amf @@ -313,11 +314,10 @@ services: public_net: ipv4_address: 192.168.70.134 oai-ext-dn: - image: ubuntu:bionic + image: trf-gen-cn5g:latest privileged: true container_name: oai-ext-dn entrypoint: /bin/bash -c \ - "apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\ "ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity" depends_on: - oai-spgwu diff --git a/docker-compose/docker-compose-basic-vpp-nonrf.yaml b/docker-compose/docker-compose-basic-vpp-nonrf.yaml index 5520f564b0860e7afc19d774b483b74250d33805..2d44ccd3c64707c2a31c87c0e15ba524c23ba030 100644 --- a/docker-compose/docker-compose-basic-vpp-nonrf.yaml +++ b/docker-compose/docker-compose-basic-vpp-nonrf.yaml @@ -190,8 +190,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.132 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -213,6 +213,7 @@ services: - DNN_RANGE1=12.1.1.2 - 12.1.1.128 - DNN_RANGE0=12.2.1.2 - 12.2.1.128 - DNN_NI1=default + - ENABLE_USAGE_REPORTING=yes extra_hosts: - "gw1.vppupf.node.5gcn.mnc95.mcc208.3gppnetwork.org:192.168.70.202" depends_on: @@ -239,9 +240,7 @@ services: - MCC=208 - REALM=3gppnetwork.org - NETWORK_UE_IP=12.2.1.0/24 - - N3_IPV4_ADDRESS_REMOTE=192.168.72.141 # GNB IP Address - - N4_IPV4_ADDRESS_REMOTE=192.168.70.133 # SMF IP Address - - N6_IPV4_ADDRESS_REMOTE=192.168.73.135 # EXT-DN IP Address + - N6_IPV4_ADDRESS_REMOTE=192.168.73.135 # EXT-DN (NAT Gateway) IP Address - VPP_MAIN_CORE=0 - VPP_CORE_WORKER=1 # - VPP_PLUGIN_PATH=/usr/lib64/vpp_plugins/ # RHEL7 @@ -269,11 +268,10 @@ services: public_net_core: ipv4_address: 192.168.73.134 oai-ext-dn: - image: ubuntu:bionic + image: image: trf-gen-cn5g:latest privileged: true container_name: "oai-ext-dn" entrypoint: /bin/bash -c \ - "apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\ "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ "ip route add 12.2.1.0/24 via 192.168.73.202 dev eth0; sleep infinity" command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"] diff --git a/docker-compose/docker-compose-basic-vpp-nrf.yaml b/docker-compose/docker-compose-basic-vpp-nrf.yaml index b185f914613fc6efc90638c799a7b91224d2bd0f..0056bbf430e3b23563ae8e9a07573b3a5ade7ffb 100644 --- a/docker-compose/docker-compose-basic-vpp-nrf.yaml +++ b/docker-compose/docker-compose-basic-vpp-nrf.yaml @@ -228,8 +228,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.132 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -251,6 +251,7 @@ services: - DNN_RANGE1=12.1.1.2 - 12.1.1.128 - DNN_RANGE0=12.2.1.2 - 12.2.1.128 - DNN_NI1=default + - ENABLE_USAGE_REPORTING=yes extra_hosts: - "gw1.vppupf.node.5gcn.mnc95.mcc208.3gppnetwork.org:192.168.70.202" depends_on: @@ -277,9 +278,7 @@ services: - MCC=208 - REALM=3gppnetwork.org - NETWORK_UE_IP=12.2.1.0/24 - - N3_IPV4_ADDRESS_REMOTE=192.168.72.141 # GNB IP Address - - N4_IPV4_ADDRESS_REMOTE=192.168.70.133 # SMF IP Address - - N6_IPV4_ADDRESS_REMOTE=192.168.73.135 # EXT-DN IP Address + - N6_IPV4_ADDRESS_REMOTE=192.168.73.135 # EXT-DN (NAT Gateway) IP Address - VPP_MAIN_CORE=0 - VPP_CORE_WORKER=1 # - VPP_PLUGIN_PATH=/usr/lib64/vpp_plugins/ # RHEL7 @@ -309,11 +308,10 @@ services: public_net_core: ipv4_address: 192.168.73.134 oai-ext-dn: - image: ubuntu:bionic + image: trf-gen-cn5g:latest privileged: true container_name: "oai-ext-dn" entrypoint: /bin/bash -c \ - "apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\ "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ "ip route add 12.1.1.0/24 via 192.168.73.202 dev eth0; sleep infinity" command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"] diff --git a/docker-compose/docker-compose-gnbsim-vpp.yaml b/docker-compose/docker-compose-gnbsim-vpp.yaml index e5541706eb21f9cedd57f58351e1b41991e7f334..7cd2fbdbdb161f23f5bb1db175b5ed68b05dda3e 100644 --- a/docker-compose/docker-compose-gnbsim-vpp.yaml +++ b/docker-compose/docker-compose-gnbsim-vpp.yaml @@ -28,13 +28,14 @@ services: - NGAPPeerAddr=192.168.70.132 - GTPuLocalAddr=192.168.72.141 - GTPuIFname=eth1 +# - DEREG_AFTER=20 # Deregister UE after 20 Sec networks: public_net: ipv4_address: 192.168.70.141 public_net_access: ipv4_address: 192.168.72.141 healthcheck: - test: /bin/bash -c "ifconfig gtp-gnb" + test: /bin/bash -c "ip address show dev gtp-gnb" interval: 10s timeout: 5s retries: 5 diff --git a/docker-compose/docker-compose-gnbsim.yaml b/docker-compose/docker-compose-gnbsim.yaml index eb58417b812d63c0d670bb690e9e2d4b31f64a46..164d5adbdfb21fde4f2a2b3f254169074351d4d9 100644 --- a/docker-compose/docker-compose-gnbsim.yaml +++ b/docker-compose/docker-compose-gnbsim.yaml @@ -30,7 +30,7 @@ services: public_net: ipv4_address: 192.168.70.156 healthcheck: - test: /bin/bash -c "ifconfig gtp-gnb" + test: /bin/bash -c "ip address show dev gtp-gnb" interval: 10s timeout: 5s retries: 5 @@ -64,7 +64,7 @@ services: public_net: ipv4_address: 192.168.70.157 healthcheck: - test: /bin/bash -c "ifconfig gtp-gnb" + test: /bin/bash -c "ip address show dev gtp-gnb" interval: 10s timeout: 5s retries: 5 @@ -98,7 +98,7 @@ services: public_net: ipv4_address: 192.168.70.158 healthcheck: - test: /bin/bash -c "ifconfig gtp-gnb" + test: /bin/bash -c "ip address show dev gtp-gnb" interval: 10s timeout: 5s retries: 5 @@ -132,7 +132,7 @@ services: public_net: ipv4_address: 192.168.70.159 healthcheck: - test: /bin/bash -c "ifconfig gtp-gnb" + test: /bin/bash -c "ip address show dev gtp-gnb" interval: 10s timeout: 5s retries: 5 @@ -166,7 +166,7 @@ services: public_net: ipv4_address: 192.168.70.160 healthcheck: - test: /bin/bash -c "ifconfig gtp-gnb" + test: /bin/bash -c "ip address show dev gtp-gnb" interval: 10s timeout: 5s retries: 5 @@ -198,7 +198,7 @@ services: networks: public_net: healthcheck: - test: /bin/bash -c "ifconfig gtp-gnb" + test: /bin/bash -c "ip address show dev gtp-gnb" interval: 10s timeout: 5s retries: 5 diff --git a/docker-compose/docker-compose-mini-nonrf.yaml b/docker-compose/docker-compose-mini-nonrf.yaml index 099551dfbd44c952a74dcf74e3634c4eed0bbc06..db279925ef10bc2d24bb54fb64f8dc0d00afa873 100644 --- a/docker-compose/docker-compose-mini-nonrf.yaml +++ b/docker-compose/docker-compose-mini-nonrf.yaml @@ -104,8 +104,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.132 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -187,12 +187,10 @@ services: public_net: ipv4_address: 192.168.70.134 oai-ext-dn: - image: ubuntu:bionic + image: trf-gen-cn5g:latest privileged: true container_name: oai-ext-dn entrypoint: /bin/bash -c \ - "apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\ - "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ "ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity" depends_on: - oai-spgwu diff --git a/docker-compose/docker-compose-mini-nrf.yaml b/docker-compose/docker-compose-mini-nrf.yaml index 52ebd4f93f4918dbb34ea7426ca9a8cca057ea1e..ed8f94e224019b09bda07ecaf4cb25f2f939c7e7 100644 --- a/docker-compose/docker-compose-mini-nrf.yaml +++ b/docker-compose/docker-compose-mini-nrf.yaml @@ -125,8 +125,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.132 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -147,6 +147,7 @@ services: - DNN_RANGE1=12.1.1.2 - 12.1.1.128 - DNN_RANGE0=12.2.1.2 - 12.2.1.128 - DNN_NI1=default + - UE_MTU=1500 depends_on: - oai-nrf - oai-amf @@ -210,12 +211,10 @@ services: public_net: ipv4_address: 192.168.70.134 oai-ext-dn: - image: ubuntu:bionic + image: trf-gen-cn5g:latest privileged: true container_name: oai-ext-dn entrypoint: /bin/bash -c \ - "apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\ - "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ "ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity" depends_on: - oai-spgwu diff --git a/docker-compose/docker-compose-no-privilege.yaml b/docker-compose/docker-compose-no-privilege.yaml index a06bdf55ea2e9a21eb0cebef67bb59aab0af14e6..2ec24ec14f4a41936022f503a6b9456e7e1debea 100644 --- a/docker-compose/docker-compose-no-privilege.yaml +++ b/docker-compose/docker-compose-no-privilege.yaml @@ -121,8 +121,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=0.0.0.0 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -210,12 +210,10 @@ services: public_net: ipv4_address: 192.168.70.134 oai-ext-dn: - image: ubuntu:bionic + image: trf-gen-cn5g:latest privileged: true container_name: oai-ext-dn entrypoint: /bin/bash -c \ - "apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\ - "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ "ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity" depends_on: - oai-spgwu @@ -233,4 +231,4 @@ networks: config: - subnet: 192.168.70.128/26 driver_opts: - com.docker.network.bridge.name: "demo-oai" \ No newline at end of file + com.docker.network.bridge.name: "demo-oai" diff --git a/docker-compose/docker-compose-slicing-basic-nrf.yaml b/docker-compose/docker-compose-slicing-basic-nrf.yaml index da0e207019956037857341bd4f56cbe2bba87c44..5fcce86e19be1bc700ae473a7267c41d428fa18b 100644 --- a/docker-compose/docker-compose-slicing-basic-nrf.yaml +++ b/docker-compose/docker-compose-slicing-basic-nrf.yaml @@ -270,8 +270,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=8080 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.138 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -316,8 +316,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=8080 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.138 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -362,8 +362,8 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=8080 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 - - DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8 - AMF_IPV4_ADDRESS=192.168.70.138 - AMF_PORT=80 - AMF_API_VERSION=v1 @@ -507,8 +507,7 @@ services: - REALM=3gppnetwork.org - NETWORK_UE_IP=12.2.1.0/24 - N3_IPV4_ADDRESS_REMOTE=192.168.72.156 # GNB IP Address - - N4_IPV4_ADDRESS_REMOTE=192.168.70.140 # SMF IP Address - - N6_IPV4_ADDRESS_REMOTE=192.168.73.137 # EXT-DN IP Address + - N6_IPV4_ADDRESS_REMOTE=192.168.73.145 # EXT-DN (NAT Gateway) IP Address - VPP_MAIN_CORE=0 - VPP_CORE_WORKER=1 - VPP_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/vpp_plugins/ @@ -537,11 +536,10 @@ services: public_net_core: ipv4_address: 192.168.73.144 oai_ext_dn: - image: ubuntu:bionic + image: trf-gen-cn5g:latest privileged: true container_name: oai-ext-dn entrypoint: /bin/bash -c \ - "apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\ "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ "ip route add 12.2.1.2/32 via 192.168.70.142 dev eth0;"\ "ip route add 12.1.1.129/32 via 192.168.70.143 dev eth0;"\ diff --git a/docker-compose/docker-compose-slicing-ransim.yaml b/docker-compose/docker-compose-slicing-ransim.yaml index 84cb5f2f4145bb6ca04f6632dfbf00f4e14307de..3f779cf36fbce59faa8dd1caaaeb7d06f2f841a0 100644 --- a/docker-compose/docker-compose-slicing-ransim.yaml +++ b/docker-compose/docker-compose-slicing-ransim.yaml @@ -148,7 +148,7 @@ services: public_net_access: ipv4_address: 192.168.72.156 healthcheck: - test: /bin/bash -c "ifconfig gtp-gnb" + test: /bin/bash -c "ip address show dev gtp-gnb" interval: 10s timeout: 5s retries: 5 diff --git a/docs/BUILD_IMAGES.md b/docs/BUILD_IMAGES.md index de6f060dd14791cdd191a3c3c1449f15969f555b..15a4750544dbefa42f563cf090d8d187d8872791 100644 --- a/docs/BUILD_IMAGES.md +++ b/docs/BUILD_IMAGES.md @@ -440,6 +440,15 @@ $ sudo podman build --target oai-nssf --tag oai-nssf:latest \ The above command is with podman, in case of docker it can be changed with its docker equivalent. +# 12. Build Traffic-Generator Image # + +This is just an utility image. + +```bash +$ docker build --target trf-gen-cn5g --tag trf-gen-cn5g:latest \ + --file ci-scripts/Dockerfile.traffic.generator.ubuntu18.04 \ + . +``` You are ready to [Configure the Containers](./CONFIGURE_CONTAINERS.md) or deploying the images using [helm-charts](./DEPLOY_SA5G_HC.md) diff --git a/docs/DEPLOY_HOME.md b/docs/DEPLOY_HOME.md index 5f25252a15c5f071a0f347ed936fed58c640be4f..6787928948ec4ab29f098c3e9cfcfe1879739f75 100644 --- a/docs/DEPLOY_HOME.md +++ b/docs/DEPLOY_HOME.md @@ -27,5 +27,6 @@ Welcome to the tutorial home page of OAI 5g Core project. Here you can find lot - [Using Docker-Compose, perform a `basic` deployment and test with `OAI RF simulator`](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/ci-scripts/yaml_files/5g_rfsimulator) - [Using Docker-Compose, perform a `basic` deployment and test with `UERANSIM`](./DEPLOY_SA5G_WITH_UERANSIM.md) - [Using Docker-Compose, perform a `basic` deployment and test with `Network Slicing`](./DEPLOY_SA5G_SLICING.md) + - [Using Docker-Compose, when testing with Commercial UE, troubleshoot traffic issues](./TROUBLESHOOT_COTS_UE_TRAFFIC.md) - The Developer Corner - [How to Deploy Developers Core Network and Basic Debugging](./DEBUG_5G_CORE.md) diff --git a/docs/DEPLOY_SA5G_BASIC_STATIC_UE_IP.md b/docs/DEPLOY_SA5G_BASIC_STATIC_UE_IP.md index 62645baadeebd2077c9537c2f26ac96020246219..a4514dc53597d16982ad5778140ddbc523781fbd 100644 --- a/docs/DEPLOY_SA5G_BASIC_STATIC_UE_IP.md +++ b/docs/DEPLOY_SA5G_BASIC_STATIC_UE_IP.md @@ -195,7 +195,7 @@ docker-compose-host $: tshark -i demo-oai -f -w /tmp/oai/static-ue-ip/capture.p <!--- For CI purposes please ignore this line ``` shell - docker-compose-host $: sleep 10 + docker-compose-host $: sleep 30 ``` --> diff --git a/docs/DEPLOY_SA5G_SLICING.md b/docs/DEPLOY_SA5G_SLICING.md index 898140be7f23627789406489c556285d135c8923..19f33ff10fca4a0bdd7a95b9e92aa55b57ed8406 100644 --- a/docs/DEPLOY_SA5G_SLICING.md +++ b/docs/DEPLOY_SA5G_SLICING.md @@ -207,7 +207,7 @@ Creating rfsim5g-oai-nr-ue1 ... done ``` Wait a bit ``` shell -docker-compose-host $: sleep 30 +docker-compose-host $: sleep 60 ``` ``` shell diff --git a/docs/DEPLOY_SA5G_WITH_GNBSIM.md b/docs/DEPLOY_SA5G_WITH_GNBSIM.md index 576cab69520068723ea6f0c9f912fceb18557c34..3a45e30b9ec2c7cc44a9a828a2d564941c2955f0 100644 --- a/docs/DEPLOY_SA5G_WITH_GNBSIM.md +++ b/docs/DEPLOY_SA5G_WITH_GNBSIM.md @@ -24,15 +24,16 @@ Note: In case readers are interested in deploying debuggers/developers core netw **TABLE OF CONTENTS** -1. Pre-requisites +1. [Pre-requisites](#1-pre-requisites) 2. Building Container Images 3. Configuring Host Machines 4. Configuring OAI 5G Core Network Functions -5. Deploying OAI 5G Core Network +5. [Deploying OAI 5G Core Network](#5-deploying-oai-5g-core-network) 6. [Getting a `gnbsim` docker image](#6-getting-a-gnbsim-docker-image) 7. [Executing `gnbsim` Scenario](#7-executing-the-gnbsim-scenario) -8. [Analysing Scenario Results](#8-analysing-the-scenario-results) +8. [Analysing the Scenario Results](#8-analysing-the-scenario-results) 9. [Trying some advanced stuff](#9-trying-some-advanced-stuff) +10. [Undeploy the network functions](#10-undeploy-the-network-functions) * In this demo the image tags and commits which were used are listed below, follow the [Building images](./BUILD_IMAGES.md) to build images with below tags. @@ -49,26 +50,56 @@ This tutorial is an extension of a previous tutorial: [testing a `minimalist` de Moreover, there are various other opensource gnb/ue simulator tools that are available for SA5G test. In this tutorial, we use an opensource simulator tool called `gnbsim`. With the help of `gnbsim` tool, we can perform very basic SA5G test by simulating one gnb and one ue. -##### About gnbsim - +**About gnbsim:** Gnbsim is a 5G SA gNB/UE (Rel. 16) simulator for testing 5G System. It is a 3rd party opensource tool written in golang. The [original repository](https://github.com/hhorai/gnbsim) is not available anymore, but a number of forks can be found, e.g., [here](https://github.com/AlohaLuo/gnbsim-backup), [here](https://github.com/Prabhjot-Sethi/gnbsim), and in [this repo](https://gitlab.eurecom.fr/kharade/gnbsim) which we will use in the following. Gnbsim simulates NGAP, NAS and GTPU protocols. Current version of gnbsim simulates one gnb and one ue. Let's begin !! * Steps 1 to 5 are similar as previous tutorial. Please follow these steps to deploy OAI 5G core network components. -* We depoloy gnbsim docker service on same host as of core network, so there is no need to create additional route as +* We deploy gnbsim docker service on same host as of core network, so there is no need to create additional route as we did for dsTest-host. * Before we proceed further for end-to-end SA5G test, make sure you have healthy docker services for OAI cn5g -```bash -oai-cn5g-fed/docker-compose$ python3 core-network.py --type start-mini --fqdn no --scenario 1 +## 1. Pre-requisites + +Create the folder to store the logs. + +<!--- +For CI purposes please ignore this line +``` shell +docker-compose-host $: rm -rf /tmp/oai/mini-gnbsim +``` +--> + +``` shell +docker-compose-host $: mkdir -p /tmp/oai/mini-gnbsim +docker-compose-host $: chmod 777 /tmp/oai/mini-gnbsim +``` + +**CAUTION: all the commands are to be executed from the `docker-compose` folder on the `CN5G host` server.** + +## 5. Deploying OAI 5G Core Network + +As a first timer, we recommend to first run without any PCAP capture. + +``` console +docker-compose-host $: python3 ./core-network.py --type start-mini --fqdn no --scenario 1 ... [2021-09-14 16:44:47,176] root:DEBUG: OAI 5G Core network is configured and healthy.... ``` +For CI purposes, we are deploying with an automated PCAP capture on the docker network. + +**REMEMBER: if you are planning to run your CN5G deployment for a long time, the PCAP file can become huge!** + +``` shell +docker-compose-host $: python3 ./core-network.py --type start-mini --fqdn no --scenario 1 --capture /tmp/oai/mini-gnbsim/mini-gnbsim.pcap +``` + More details in [section 7 of the `minimalist` tutorial](./DEPLOY_SA5G_MINI_DS_TESTER_DEPLOYMENT.md#7-deploying-oai-5g-core-network). -```bash +``` console oai-cn5g-fed/docker-compose$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c25db05aa023 ubuntu:bionic "/bin/bash -c ' apt …" 23 seconds ago Up 22 seconds oai-ext-dn @@ -82,16 +113,19 @@ oai-cn5g-fed/docker-compose$ We can also use basic deployment of 5GCN (with AUSF, UDM, UDR) as below - -```bash -oai-cn5g-fed/docker-compose$ python3 core-network.py --type start-basic +``` console +docker-compose-host $: python3 ./core-network.py --type start-basic ``` -## 6. Getting a `gnbsim` docker image ## +## 6. Getting a `gnbsim` docker image You have the choice: -* Build `gnbsim` docker image +* Building `gnbsim` docker image + +Please clone the repository outside of the `oai-cn5g-fed` workspace. -```bash +``` console +$ cd $ git clone https://gitlab.eurecom.fr/kharade/gnbsim.git $ cd gnbsim $ docker build --tag gnbsim:latest --target gnbsim --file docker/Dockerfile.ubuntu.18.04 . @@ -101,23 +135,30 @@ OR * You can pull a prebuilt docker image for `gnbsim` -```bash +``` console docker pull rohankharade/gnbsim docker image tag rohankharade/gnbsim:latest gnbsim:latest ``` -## 7. Executing the `gnbsim` Scenario ## +## 7. Executing the `gnbsim` Scenario + +* The configuration parameters are preconfigured in [docker-compose-gnbsim.yaml](../docker-compose/docker-compose-gnbsim.yaml) and one can modify it for test. -* The configuration parameters, are preconfigured in [docker-compose.yaml](../docker-compose/docker-compose.yaml) and [docker-compose-gnbsim.yaml](../docker-compose/docker-compose-gnbsim.yaml) and one can modify it for test. -* Launch gnbsim docker service -```bash -oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim +### 7.1. Launch gnbsim docker service +``` shell +docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim Creating gnbsim ... done +docker-compose-host $: sleep 40 +docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml ps -a +Name Command State Ports +-------------------------------------------------------------- +gnbsim /gnbsim/bin/entrypoint.sh ... Up (healthy) ``` -* After launching gnbsim, make sure all services status are healthy - -```bash -oai-cn5g-fed/docker-compose$ docker ps -a + +After launching gnbsim, make sure all services status are healthy - +``` console +docker-compose-host $: docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2ad428f94fb0 gnbsim:latest "/gnbsim/bin/entrypo…" 33 seconds ago Up 32 seconds (healthy) gnbsim c25db05aa023 ubuntu:bionic "/bin/bash -c ' apt …" 4 minutes ago Up 4 minutes oai-ext-dn @@ -128,11 +169,19 @@ c25db05aa023 ubuntu:bionic "/bin/bash -c ' apt …" 4 minu 565617169b42 mysql:5.7 "docker-entrypoint.s…" 4 minutes ago Up 4 minutes (healthy) 3306/tcp, 33060/tcp mysql ``` Now we are ready to perform some traffic test. -* Ping test <br/> + +You can see also if the UE got an allocated IP address. + +``` shell +docker-compose-host $: docker logs gnbsim 2>&1 | grep "UE address:" +[gnbsim]2022/09/14 16:45:40.584271 example.go:329: UE address: 12.1.1.2 +``` + +### 7.2. Ping test Here we ping UE from external DN container. -```bash -$ docker exec -it oai-ext-dn ping -c 3 12.1.1.2 +``` shell +docker-compose-host $: docker exec oai-ext-dn ping -c 3 12.1.1.2 PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data. 64 bytes from 12.1.1.2: icmp_seq=1 ttl=64 time=0.235 ms 64 bytes from 12.1.1.2: icmp_seq=2 ttl=64 time=0.145 ms @@ -141,12 +190,11 @@ PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data. --- 12.1.1.2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2036ms rtt min/avg/max/mdev = 0.145/0.276/0.448/0.127 ms -rohan@rohan:~/gitrepo/oai-cn5g-fed/docker-compose$ ``` Here we ping external DN from UE (gnbsim) container. -```bash -oai-cn5g-fed/docker-compose$ docker exec gnbsim ping -c 3 -I 12.1.1.2 google.com +``` console +docker-compose-host $: docker exec gnbsim ping -c 3 -I 12.1.1.2 google.com PING google.com (172.217.18.238) from 12.1.1.2 : 56(84) bytes of data. 64 bytes from par10s10-in-f238.1e100.net (172.217.18.238): icmp_seq=1 ttl=115 time=5.12 ms 64 bytes from par10s10-in-f238.1e100.net (172.217.18.238): icmp_seq=2 ttl=115 time=7.52 ms @@ -157,10 +205,11 @@ PING google.com (172.217.18.238) from 12.1.1.2 : 56(84) bytes of data. rtt min/avg/max/mdev = 5.119/6.606/7.515/1.064 ms ``` -* Iperf test <br/> +### 7.3. Iperf test + Here we do iperf traffic test between gnbsim UE and external DN node. We can make any node as iperf server/client.<br/> Running iperf server on external DN container -```bash +``` console $ docker exec -it oai-ext-dn iperf3 -s ----------------------------------------------------------- Server listening on 5201 @@ -188,7 +237,7 @@ Server listening on 5201 ----------------------------------------------------------- ``` Running iperf client on gnbsim -```bash +``` console $ docker exec -it gnbsim iperf3 -c 192.168.70.135 -B 12.1.1.2 Connecting to host 192.168.70.135, port 5201 [ 5] local 12.1.1.2 port 55553 connected to 192.168.70.135 port 5201 @@ -210,9 +259,20 @@ Connecting to host 192.168.70.135, port 5201 iperf Done. ``` -* Note:- The iperf test is just for illustration purpose and results of the test may vary based on resources available for the docker services -## 8. Analysing the Scenario Results ## +**Note:- The iperf test is just for illustration purpose and results of the test may vary based on resources available for the docker services.** + +## 8. Analysing the Scenario Results + +You can recover the logs like this: + +``` console +docker-compose-host $: docker logs oai-nrf > /tmp/oai/mini-gnbsim/nrf.log 2>&1 +docker-compose-host $: docker logs oai-amf > /tmp/oai/mini-gnbsim/amf.log 2>&1 +docker-compose-host $: docker logs oai-smf > /tmp/oai/mini-gnbsim/smf.log 2>&1 +docker-compose-host $: docker logs oai-spgwu > /tmp/oai/mini-gnbsim/spgwu.log 2>&1 +docker-compose-host $: docker logs gnbsim > /tmp/oai/mini-gnbsim/gnbsim.log 2>&1 +``` | Container | Ip-address | | ------------- |:-------------- | @@ -235,22 +295,32 @@ iperf Done. * For detailed analysis of messages, please refer previous tutorial of [testing with dsTester](./docs/DEPLOY_SA5G_WITH_DS_TESTER.md). -## 9. Trying Some Advanced Stuff ## +## 9. Trying Some Advanced Stuff Here we try some scaling test with gnbsim. There are additional IMSIs are added into database (208950000000031-208950000000040). Now we create few more gnbsim instances (4 more for now). We use same script to generate additional instance as follow - -```bash -oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim2 +``` shell +docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim2 Creating gnbsim2 ... done -oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim3 +docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim3 Creating gnbsim3 ... done -oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim4 +docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim4 Creating gnbsim4 ... done -oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim5 +docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim5 Creating gnbsim5 ... done +docker-compose-host $: sleep 40 +docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml ps -a +docker-compose-host $: docker logs gnbsim2 2>&1 | grep "UE address:" +[gnbsim]2022/09/14 16:45:41.584271 example.go:329: UE address: 12.1.1.3 +docker-compose-host $: docker logs gnbsim3 2>&1 | grep "UE address:" +[gnbsim]2022/09/14 16:45:42.584271 example.go:329: UE address: 12.1.1.4 +docker-compose-host $: docker logs gnbsim4 2>&1 | grep "UE address:" +[gnbsim]2022/09/14 16:45:43.584271 example.go:329: UE address: 12.1.1.5 +docker-compose-host $: docker logs gnbsim5 2>&1 | grep "UE address:" +[gnbsim]2022/09/14 16:45:44.584271 example.go:329: UE address: 12.1.1.6 ``` So here basically, minimum configuration parameters that need to change is gnbid, imsi and container ip address in docker-compose-gnbsim.yaml. Please make sure status of instance is healthy before creating one more instance. Now here we have deployed all 5 gnbsim intances - -```bash +``` console $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a25174c51297 gnbsim:latest "/gnbsim/bin/entrypo…" 3 minutes ago Up 3 minutes (healthy) gnbsim5 @@ -267,7 +337,7 @@ cc407925adf2 oai-nrf:latest "/bin/bash /openair-…" 16 min ``` * Let's verify all gnb and ue are registered at our 5G core - -```bash +``` console $ docker logs oai-amf truncated output [2021-05-17T12:17:28.539943] [AMF] [amf_app] [info ] @@ -294,8 +364,8 @@ truncated output ``` * Finally lets ping UE from external DN node - -```bash -$ docker exec -it oai-ext-dn ping -c 2 12.1.1.2 +``` shell +docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.2 PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data. 64 bytes from 12.1.1.2: icmp_seq=1 ttl=64 time=0.416 ms 64 bytes from 12.1.1.2: icmp_seq=2 ttl=64 time=0.763 ms @@ -303,7 +373,7 @@ PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data. --- 12.1.1.2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1008ms rtt min/avg/max/mdev = 0.416/0.589/0.763/0.175 ms -$ docker exec -it oai-ext-dn ping -c 2 12.1.1.3 +docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.3 PING 12.1.1.3 (12.1.1.3) 56(84) bytes of data. 64 bytes from 12.1.1.3: icmp_seq=1 ttl=64 time=0.328 ms 64 bytes from 12.1.1.3: icmp_seq=2 ttl=64 time=0.620 ms @@ -311,7 +381,7 @@ PING 12.1.1.3 (12.1.1.3) 56(84) bytes of data. --- 12.1.1.3 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1005ms rtt min/avg/max/mdev = 0.328/0.474/0.620/0.146 ms -$ docker exec -it oai-ext-dn ping -c 2 12.1.1.4 +docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.4 PING 12.1.1.4 (12.1.1.4) 56(84) bytes of data. 64 bytes from 12.1.1.4: icmp_seq=1 ttl=64 time=0.408 ms 64 bytes from 12.1.1.4: icmp_seq=2 ttl=64 time=0.694 ms @@ -319,7 +389,7 @@ PING 12.1.1.4 (12.1.1.4) 56(84) bytes of data. --- 12.1.1.4 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1032ms rtt min/avg/max/mdev = 0.408/0.551/0.694/0.143 ms -$ docker exec -it oai-ext-dn ping -c 2 12.1.1.5 +docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.5 PING 12.1.1.5 (12.1.1.5) 56(84) bytes of data. 64 bytes from 12.1.1.5: icmp_seq=1 ttl=64 time=0.289 ms 64 bytes from 12.1.1.5: icmp_seq=2 ttl=64 time=0.233 ms @@ -327,13 +397,37 @@ PING 12.1.1.5 (12.1.1.5) 56(84) bytes of data. --- 12.1.1.5 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1004ms rtt min/avg/max/mdev = 0.233/0.261/0.289/0.028 ms +docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.6 +PING 12.1.1.6 (12.1.1.6) 56(84) bytes of data. +64 bytes from 12.1.1.6: icmp_seq=1 ttl=63 time=0.577 ms +64 bytes from 12.1.1.6: icmp_seq=2 ttl=63 time=0.346 ms + +--- 12.1.1.6 ping statistics --- +2 packets transmitted, 2 received, 0% packet loss, time 1015ms +rtt min/avg/max/mdev = 0.346/0.461/0.577/0.117 ms ``` +Let recover one last time the logs: + +``` shell +docker-compose-host $: docker logs oai-nrf > /tmp/oai/mini-gnbsim/nrf.log 2>&1 +docker-compose-host $: docker logs oai-amf > /tmp/oai/mini-gnbsim/amf.log 2>&1 +docker-compose-host $: docker logs oai-smf > /tmp/oai/mini-gnbsim/smf.log 2>&1 +docker-compose-host $: docker logs oai-spgwu > /tmp/oai/mini-gnbsim/spgwu.log 2>&1 +docker-compose-host $: docker logs gnbsim > /tmp/oai/mini-gnbsim/gnbsim.log 2>&1 +docker-compose-host $: docker logs gnbsim2 > /tmp/oai/mini-gnbsim/gnbsim2.log 2>&1 +docker-compose-host $: docker logs gnbsim3 > /tmp/oai/mini-gnbsim/gnbsim3.log 2>&1 +docker-compose-host $: docker logs gnbsim4 > /tmp/oai/mini-gnbsim/gnbsim4.log 2>&1 +docker-compose-host $: docker logs gnbsim5 > /tmp/oai/mini-gnbsim/gnbsim5.log 2>&1 +``` +## 10. Undeploy the network functions + Last thing is to remove all services - <br/> -* Undeploy the gnbsim -```bash -/oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml down +### 10.1. Undeploy the gnbsim container(s) + +``` shell +docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml down Stopping service gnbsim ... Stopping gnbsim5 ... done Stopping gnbsim4 ... done @@ -349,10 +443,12 @@ Network demo-oai-public-net is external, skipping Service gnbsim is stopped ``` -* Undeploy the core network -```bash -oai-cn5g-fed/docker-compose$ python3 ./core-network.py --type stop-mini --fqdn no --scenario 1 +### 10.2. Undeploy the core network + +``` shell +docker-compose-host $: python3 ./core-network.py --type stop-mini --fqdn no --scenario 1 ... [2021-09-14 16:47:44,070] root:DEBUG: OAI 5G core components are UnDeployed.... ``` +## 11. End of tutorial diff --git a/docs/DEPLOY_SA5G_WITH_VPP_UPF.md b/docs/DEPLOY_SA5G_WITH_VPP_UPF.md index 1001f012386814c0e86e0e0f94012effde08eed7..8462c213aba0574e7856faa0bca6c48b04ef2e82 100644 --- a/docs/DEPLOY_SA5G_WITH_VPP_UPF.md +++ b/docs/DEPLOY_SA5G_WITH_VPP_UPF.md @@ -51,7 +51,7 @@ In previous tutorials, we were using the `oai-spgwu-tiny` implementation UPF. Th Moreover in this tutorial, we are going to integrate OAI 5G core with opensource `VPP-UPF` by [Travelping](https://www.travelping.com/). VPP-based UPF uses vector packet processing and it is has proven very good performance in the user plane. Motivation for this integration to test and validate high performance VPP-UPF in with OAI 5G core. -##### About VPP-UPG - +**About VPP-UPG** UPG implements a GTP-U user plane based on `3GPP TS 23.214` and `3GPP TS 29.244` Release `15`. It is implemented as an out-of-tree plugin for [Fdio VPP](https://github.com/FDio/vpp). The possible uses for UPG are: @@ -85,6 +85,8 @@ docker-compose-host $: chmod 777 /tmp/oai/vpp-upf-gnbsim * We will use same wrapper script for docker-compose that used for previous tutorials to set up 5gcn with `UPF-VPP`. Use help option to check how to use this wrapper script. +**Note: - To use vpp-upf on bare metal, follow [these instructions.](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-upf-vpp/-/blob/develop/docs/INSTALL_ON_HOST.md)** + All the following commands shall be executed from the `oai-cn5g-fed/docker-compose` folder. ``` console @@ -334,6 +336,94 @@ PING 192.168.73.135 (192.168.73.135) from 12.1.1.2 : 56(84) bytes of data. rtt min/avg/max/mdev = 0.183/0.283/0.353/0.062 ms ``` +Let's analyze the N4 Traffic report from the UPF. + +``` shell +docker-compose-host $: sleep 10 +docker-compose-host $: docker logs oai-smf > /tmp/oai/vpp-upf-gnbsim/smf.log 2>&1 +docker-compose-host $: python3 ../ci-scripts/validateN4UpfReportMessages.py --filename /tmp/oai/vpp-upf-gnbsim/smf.log +Received 7 N4 SESSION REPORT REQUESTS from an UPF +- for a total duration of 70 seconds +- Total Number of Packets : 16 +- DL Number of Packets : 8 +- UL Number of Packets : 8 +- Total Volume : 1344 bytes +- DL Volume : 672 bytes +- UL Volume : 672 bytes +``` + +The SMF receives regularly N4 messages like this one: + +``` console +[2022-04-08T11:27:46.540271] [smf] [smf_n4 ] [info ] Received N4 SESSION REPORT REQUEST from an UPF +[2022-04-08T11:27:46.540357] [smf] [smf_app] [info ] SEID -> 1 +[2022-04-08T11:27:46.540378] [smf] [smf_app] [info ] UR-SEQN -> 4 +[2022-04-08T11:27:46.540384] [smf] [smf_app] [info ] Duration -> 10 +[2022-04-08T11:27:46.540389] [smf] [smf_app] [info ] NoP Total -> 2 +[2022-04-08T11:27:46.540394] [smf] [smf_app] [info ] Uplink -> 1 +[2022-04-08T11:27:46.540399] [smf] [smf_app] [info ] Downlink -> 1 +[2022-04-08T11:27:46.540404] [smf] [smf_app] [info ] Volume Total -> 168 +[2022-04-08T11:27:46.540409] [smf] [smf_app] [info ] Uplink -> 84 +[2022-04-08T11:27:46.540423] [smf] [smf_app] [info ] Downlink -> 84 +``` + +Let's create a bigger traffic: + +``` shell +docker-compose-host $: docker exec oai-ext-dn ping 12.1.1.2 -c40 -i0.1 -s500 +docker-compose-host $: sleep 10 +docker-compose-host $: docker logs oai-smf > /tmp/oai/vpp-upf-gnbsim/smf.log 2>&1 +docker-compose-host $: python3 ../ci-scripts/validateN4UpfReportMessages.py --filename /tmp/oai/vpp-upf-gnbsim/smf.log +Received 9 N4 SESSION REPORT REQUESTS from an UPF +- for a total duration of 90 seconds +- Total Number of Packets : 96 +- DL Number of Packets : 48 +- UL Number of Packets : 48 +- Total Volume : 43584 bytes +- DL Volume : 21792 bytes +- UL Volume : 21792 bytes +``` + +Now create an asymmetrical traffic with iperf3 in Downlink: + +``` shell +docker-compose-host $: docker exec -d gnbsim-vpp /bin/bash -c "nohup iperf3 -B 12.1.1.2 -s -i 1 > /tmp/iperf-server-dl.log 2>&1" +docker-compose-host $: sleep 1 +docker-compose-host $: docker exec oai-ext-dn iperf3 -c 12.1.1.2 -t 20 -i 1 +docker-compose-host $: sleep 10 +docker-compose-host $: docker logs oai-smf > /tmp/oai/vpp-upf-gnbsim/smf.log 2>&1 +docker-compose-host $: python3 ../ci-scripts/validateN4UpfReportMessages.py --filename /tmp/oai/vpp-upf-gnbsim/smf.log +Received 13 N4 SESSION REPORT REQUESTS from an UPF +- for a total duration of 130 seconds +- Total Number of Packets : 20926 +- DL Number of Packets : 13306 +- UL Number of Packets : 7620 +- Total Volume : 23912637 bytes +- DL Volume : 23436499 bytes +- UL Volume : 476138 bytes +``` + +**Don't forget to kill the iperf3 server process on `gnbsim-vpp` container.** + +``` console +docker-compose-host $: docker exec gnbsim-vpp ps aux +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +root 1 1.0 0.0 927132 9952 ? Ssl 11:51 0:01 /gnbsim/bin/example +root 126 0.0 0.0 18384 3064 ? Ss 11:53 0:00 /bin/bash -c nohup iperf3 -B 12.1.1.2 -s -i 1 > /tmp/iperf-server-dl.log 2>&1 +root 131 0.2 0.0 10412 2752 ? S 11:53 0:00 iperf3 -B 12.1.1.2 -s -i 1 +root 174 0.0 0.0 18516 3480 pts/0 Ss 11:54 0:00 /bin/bash +root 195 0.0 0.0 34412 2924 pts/0 R+ 11:54 0:00 ps aux + +# Here it is an example, kill the one corresponding to your run +docker-compose-host $: docker exec gnbsim-vpp kill -9 131 + +docker-compose-host $: docker exec gnbsim-vpp ps aux +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +root 1 1.0 0.0 927132 9952 ? Ssl 11:51 0:01 /gnbsim/bin/example +root 174 0.0 0.0 18516 3480 pts/0 Ss 11:54 0:00 /bin/bash +root 208 0.0 0.0 34412 2900 pts/0 R+ 11:54 0:00 ps aux +``` + ## 7. Recover the logs ``` shell diff --git a/docs/RETRIEVE_OFFICIAL_IMAGES.md b/docs/RETRIEVE_OFFICIAL_IMAGES.md index 5575612d6b91d6dd2a543b7e3174a69f4a6eff47..6f09d73704787d52a813949988b56146ab1869ba 100644 --- a/docs/RETRIEVE_OFFICIAL_IMAGES.md +++ b/docs/RETRIEVE_OFFICIAL_IMAGES.md @@ -49,6 +49,8 @@ $ docker pull rdefosseoai/oai-udm:latest $ docker pull rdefosseoai/oai-ausf:latest $ docker pull rdefosseoai/oai-upf-vpp:latest $ docker pull rdefosseoai/oai-nssf:latest +# Utility image to generate traffic +$ docker pull rdefosseoai/trf-gen-cn5g:latest ``` And **re-tag** them for tutorials' docker-compose file to work. @@ -63,6 +65,7 @@ $ docker image tag rdefosseoai/oai-udm:latest oai-udm:latest $ docker image tag rdefosseoai/oai-ausf:latest oai-ausf:latest $ docker image tag rdefosseoai/oai-upf-vpp:latest oai-upf-vpp:latest $ docker image tag rdefosseoai/oai-nssf:latest oai-nssf:latest +$ docker image tag rdefosseoai/trf-gen-cn5g:latest trf-gen-cn5g:latest ``` Finally you may logoff --> your token is stored in plain text.. diff --git a/docs/TROUBLESHOOT_COTS_UE_TRAFFIC.md b/docs/TROUBLESHOOT_COTS_UE_TRAFFIC.md new file mode 100644 index 0000000000000000000000000000000000000000..886674f43609a1550382c6481f4e0aa50b9327ab --- /dev/null +++ b/docs/TROUBLESHOOT_COTS_UE_TRAFFIC.md @@ -0,0 +1,81 @@ +<table style="border-collapse: collapse; border: none;"> + <tr style="border-collapse: collapse; border: none;"> + <td style="border-collapse: collapse; border: none;"> + <a href="http://www.openairinterface.org/"> + <img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150> + </img> + </a> + </td> + <td style="border-collapse: collapse; border: none; vertical-align: center;"> + <b><font size = "5">OpenAirInterface 5G Core Network : testing with Commercial UE traffic troubleshooting</font></b> + </td> + </tr> +</table> + +`COTS-UE` means `Commercial Off-The-Shelf UE`. + +Prior to `2022.w12` tag, if you were deploying a `minimalist` or `basic` OAI 5G CN, you see the following issue: + +* Ping operations from `ext-dn` to `COTS-UE` or from `COTS-UE` to `ext-dn` were OK +* `TCP` iperf traffic test was OK in `Downlink` and `Uplink` +* `UDP` iperf traffic test was OK in `Uplink` (ie from `COTS-UE` to `ext-dn`) +* But `UDP` `Downlink` iperf traffic test was not working. + +The issue is the `MTU` value affected to the interface on the UE. + +For example, we are using Quectel modules and it looked like this: + +```bash +$ ifconfig wwan0 +wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1356 + inet 12.1.1.129 netmask 255.255.255.0 broadcast 12.1.1.255 +``` + +2 solutions: + +* Either you force the `MTU` value (if possible): + +```bash +$ sudo ip link set dev wwan0 mtu 1500 +``` + +* The better one is to tell the `SMF` to use this `1500` value. + +I made 2 examples in the `docker-compose/docker-compose-basic-nrf.yaml` and `docker-compose/docker-compose-mini-nrf.yaml` files: + +```bash +$ git diff docker-compose/docker-compose-basic-nrf.yaml +diff --git a/docker-compose/docker-compose-basic-nrf.yaml b/docker-compose/docker-compose-basic-nrf.yaml +index 04aceae..fef0835 100644 +--- a/docker-compose/docker-compose-basic-nrf.yaml ++++ b/docker-compose/docker-compose-basic-nrf.yaml +@@ -250,6 +250,7 @@ services: + - DNN_RANGE1=12.1.1.2 - 12.1.1.128 + - DNN_RANGE0=12.2.1.2 - 12.2.1.128 + - DNN_NI1=default ++ - UE_MTU=1500 + depends_on: + - oai-nrf + - oai-amf +$ git diff docker-compose/docker-compose-mini-nrf.yaml +diff --git a/docker-compose/docker-compose-mini-nrf.yaml b/docker-compose/docker-compose-mini-nrf.yaml +index cd58557..35b3d3b 100644 +--- a/docker-compose/docker-compose-mini-nrf.yaml ++++ b/docker-compose/docker-compose-mini-nrf.yaml +@@ -147,6 +147,7 @@ services: + - DNN_RANGE1=12.1.1.2 - 12.1.1.128 + - DNN_RANGE0=12.2.1.2 - 12.2.1.128 + - DNN_NI1=default ++ - UE_MTU=1500 + depends_on: + - oai-nrf + - oai-amf +``` + +With this `SMF` setup: + +```bash +$ ifconfig wwan0 +wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 + inet 12.1.1.129 netmask 255.255.255.0 broadcast 12.1.1.255 +```