From badf17d3dabb056cc44f1d2561ec35fb2adf507f Mon Sep 17 00:00:00 2001 From: herlesupreeth Date: Thu, 7 Jan 2021 08:20:41 +0100 Subject: [PATCH] Use UERANSIM from tag v2.2.1 and its related changes --- ueransim.yaml | 5 +++- ueransim/Dockerfile | 11 ++++---- ueransim/open5gs/gnb.yaml | 58 +++++++++++++++++---------------------- ueransim/open5gs/ue.yaml | 24 ++++++++++++---- 4 files changed, 53 insertions(+), 45 deletions(-) diff --git a/ueransim.yaml b/ueransim.yaml index 7d06bfa..12e6ccb 100644 --- a/ueransim.yaml +++ b/ueransim.yaml @@ -13,9 +13,12 @@ services: env_file: - .env expose: - - "49972/udp" - "38412/sctp" - "2152/udp" + cap_add: + - NET_ADMIN + devices: + - "/dev/net/tun" networks: default: ipv4_address: ${GNB_UE_IP} diff --git a/ueransim/Dockerfile b/ueransim/Dockerfile index 8c1308b..ead6f74 100644 --- a/ueransim/Dockerfile +++ b/ueransim/Dockerfile @@ -28,7 +28,8 @@ FROM ubuntu:bionic # Install updates and dependencies RUN apt-get update && \ - apt-get -y install make g++ openjdk-11-jdk maven libsctp-dev lksctp-tools git vim + apt-get -y install make g++ openjdk-11-jdk maven libsctp-dev lksctp-tools git vim \ + iptables net-tools ifupdown iputils-ping ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" ENV PATH="$PATH:$JAVA_HOME/bin" @@ -37,12 +38,12 @@ ENV LANG=C.UTF-8 # Clone and build UERANSIM RUN git clone https://github.com/herlesupreeth/UERANSIM && \ - cd UERANSIM && \ - chmod +x build.sh run.sh && \ - ./build.sh + cd UERANSIM && git checkout tags/v2.2.1 && \ + ./nr-build --allow-root # Set the working directory to UERANSIM WORKDIR UERANSIM CMD /mnt/ueransim/ueransim_init.sh && \ - /UERANSIM/run.sh + ./nr-agent & \ + bash diff --git a/ueransim/open5gs/gnb.yaml b/ueransim/open5gs/gnb.yaml index baf576d..6f24909 100644 --- a/ueransim/open5gs/gnb.yaml +++ b/ueransim/open5gs/gnb.yaml @@ -1,40 +1,32 @@ -gnbId: 1 -tac: 1 -nci: '000000000000000000000000000000010000' - -host: GNB_UE_IP -gtpPort: 2152 -tunPort: 49972 - -gnbPlmn: +# MCC and MNC values of the gNB +plmn: mcc: MCC mnc: MNC +# ID of the gNB inside of its PLMN +gnbId: 1 + +# Tracking Area Code (TAC) +tac: 1 + +# NR Cell Identity (NCI) +nci: '0000000100' + +# gNB's local IP address for N2 interface. +ngapIp: GNB_UE_IP + +# gNB's local IP address for N3 interface. +gtpIp: GNB_UE_IP + +# List of AMF address information amfConfigs: - - guami: - mcc: MCC - mnc: MNC - amfRegionId: - hex: '2a' - amfSetId: - hex: '5580' - amfPointer: - hex: 'a8' - host: AMF_IP - port: 38412 + - ngapIp: AMF_IP + ngapPort: 38412 -supportedTAs: - - tac: - hex: '000001' - broadcastPlmns: - - plmn: - mcc: MCC - mnc: MNC - taiSliceSupportNssais: - - sst: - value: 1 - sd: - value: - hex: '010203' +# List of NSSAIs supported by this gNB +nssais: + - sst: '0x01' + sd: '0x010203' +# Indicates whether or not SCTP stream number errors should be ignored. ignoreStreamIds: true diff --git a/ueransim/open5gs/ue.yaml b/ueransim/open5gs/ue.yaml index 59fc7fa..3ec37a4 100644 --- a/ueransim/open5gs/ue.yaml +++ b/ueransim/open5gs/ue.yaml @@ -1,17 +1,29 @@ -key: 'UE1_KI' -op: 'UE1_OP' -amf: 'UE1_AMF' -imei: 'UE1_IMEI' +# IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 or 16 digits) supi: 'imsi-UE1_IMSI' + +# MCC and MNC values of the UE. plmn: mcc: MCC mnc: MNC -smsOverNasSupported: true +# Permanent subscription key. +key: 'UE1_KI' + +# Operator code (OP) of the UE. Please note that 'OP' is different from 'OPC'. +op: 'UE1_OP' + +# Authentication Management Field (AMF) value +amf: 'UE1_AMF' + +# IMEI number of the device. This value is generally not used. +imei: 'UE1_IMEI' + +# Domain Network Name (DNN) dnn: 'internet' +# List of NSSAIs for the UE requestedNssai: - sst: - value: 1 + hex: '01' sd: hex: '010203'