Skip to content

Commit

Permalink
Add ueransim
Browse files Browse the repository at this point in the history
  • Loading branch information
niloysh committed Oct 14, 2023
1 parent 3edb6e3 commit ad6f3b8
Show file tree
Hide file tree
Showing 15 changed files with 684 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ueransim/ueransim-gnb/config/free5gc-gnb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
mcc: '001' # Mobile Country Code value
mnc: '01' # Mobile Network Code value (2 or 3 digits)

nci: '0x000000010' # NR Cell Identity (36-bit)
idLength: 32 # NR gNB ID length in bits [22...32]
tac: 1 # Tracking Area Code

linkIp: 129.97.168.65 # gNB's local IP address for Radio Link Simulation (Usually same with local IP)
ngapIp: 10.10.2.22 # gNB's local IP address for N2 Interface (Usually same with local IP)
gtpIp: 10.10.3.22 # gNB's local IP address for N3 Interface (Usually same with local IP)

# List of AMF address information
amfConfigs:
- address: 10.10.2.1
port: 38412

# List of supported S-NSSAIs by this gNB
slices:
- sst: 1
sd: 000001
- sst: 1
sd: 000002

# Indicates whether or not SCTP stream number errors should be ignored.
ignoreStreamIds: true
40 changes: 40 additions & 0 deletions ueransim/ueransim-gnb/gnb-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gnb-configmap
labels:
app: ueransim
component: gnb
data:
gnb-config.yaml: |
mcc: '001' # Mobile Country Code value
mnc: '01' # Mobile Network Code value (2 or 3 digits)
nci: '0x000000010' # NR Cell Identity (36-bit)
idLength: 32 # NR gNB ID length in bits [22...32]
tac: 1 # Tracking Area Code
linkIp: 0.0.0.0 # gNB's local IP address for Radio Link Simulation (Usually same with local IP)
ngapIp: 10.10.2.31 # gNB's local IP address for N2 Interface (Usually same with local IP)
gtpIp: 10.10.3.31 # gNB's local IP address for N3 Interface (Usually same with local IP)
# List of AMF address information
amfConfigs:
- address: 10.10.2.1
port: 38412
# List of supported S-NSSAIs by this gNB
slices:
- sst: 1
sd: 000001
- sst: 2
sd: 000002
# Indicates whether or not SCTP stream number errors should be ignored.
ignoreStreamIds: true
wrapper.sh: |
#!/bin/bash
/ueransim/nr-gnb --config /ueransim/config/gnb-config.yaml
58 changes: 58 additions & 0 deletions ueransim/ueransim-gnb/gnb-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ueransim-gnb
labels:
app: ueransim
component: gnb
spec:
selector:
matchLabels:
app: ueransim
component: gnb
replicas:
template:
metadata:
labels:
app: ueransim
component: gnb
annotations:
k8s.v1.cni.cncf.io/networks: '[
{ "name": "n2network", "interface": "n2", "ips": [ "10.10.2.31/24" ] },
{ "name": "n3network", "interface": "n3", "ips": [ "10.10.3.31/24" ] }
]'
spec:
containers:
- image: ghcr.io/niloysh/ueransim:v3.2.6
name: gnb
ports:
- name: gnb-ue
containerPort: 4997
protocol: UDP
securityContext:
capabilities:
add: ["NET_ADMIN"]
command: [ "/ueransim/config/wrapper.sh" ]
volumeMounts:
- mountPath: /ueransim/config
name: gnb-volume
resources:
requests:
memory: "1024Mi"
cpu: "1000m"
limits:
memory: "2048Mi"
cpu: "2000m"
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- name: gnb-volume
configMap:
name: gnb-configmap
items:
- key: gnb-config.yaml
path: gnb-config.yaml
- key: wrapper.sh
path: wrapper.sh
mode: 0777
17 changes: 17 additions & 0 deletions ueransim/ueransim-gnb/gnb-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: v1
kind: Service
metadata:
name: gnb-service
labels:
app: ueransim
component: gnb
spec:
type: ClusterIP
ports:
- port: 4997
nodePort: null
protocol: UDP
selector:
app: ueransim
component: gnb
7 changes: 7 additions & 0 deletions ueransim/ueransim-gnb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- gnb-configmap.yaml
- gnb-deployment.yaml
- gnb-service.yaml
3 changes: 3 additions & 0 deletions ueransim/ueransim-ue/config/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resources:
- ue1
- ue2
72 changes: 72 additions & 0 deletions ueransim/ueransim-ue/config/ue1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
supi: 'imsi-001010000000001'
# Mobile Country Code value of HPLMN
mcc: '001'
# Mobile Network Code value of HPLMN (2 or 3 digits)
mnc: '01'

# Permanent subscription key
key: '465B5CE8B199B49FAA5F0A2EE238A6BC'
# Operator code (OP or OPC) of the UE
op: 'E8ED289DEBA952E4283B54E88E6183CA'
# This value specifies the OP type and it can be either 'OP' or 'OPC'
opType: 'OPC'
# Authentication Management Field (AMF) value
amf: '8000'
# IMEI number of the device. It is used if no SUPI is provided
imei: '356938035643803'
# IMEISV number of the device. It is used if no SUPI and IMEI is provided
imeiSv: '4370816125816151'

# List of gNB IP addresses for Radio Link Simulation
gnbSearchList:
- 129.97.168.65

# UAC Access Identities Configuration
uacAic:
mps: false
mcs: false

# UAC Access Control Class
uacAcc:
normalClass: 0
class11: false
class12: false
class13: false
class14: false
class15: false

# Initial PDU sessions to be established
sessions:
- type: 'IPv4'
apn: 'internet'
slice:
sst: 1
sd: 000001

# Configured NSSAI for this UE by HPLMN
configured-nssai:
- sst: 1
sd: 000001

# Default Configured NSSAI for this UE
default-nssai:
- sst: 1
sd: 000001

# Supported integrity algorithms by this UE
integrity:
IA1: true
IA2: true
IA3: true

# Supported encryption algorithms by this UE
ciphering:
EA1: true
EA2: true
EA3: true

# Integrity protection maximum data rate for user plane
integrityMaxRate:
uplink: 'full'
downlink: 'full'
72 changes: 72 additions & 0 deletions ueransim/ueransim-ue/config/ue2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
supi: 'imsi-001010000000002'
# Mobile Country Code value of HPLMN
mcc: '001'
# Mobile Network Code value of HPLMN (2 or 3 digits)
mnc: '01'

# Permanent subscription key
key: 'B199B49F465B5CE8E238A6BCAA5F0A2E'
# Operator code (OP or OPC) of the UE
op: '283B54E8E8ED289D8E6183CAEBA952E4'
# This value specifies the OP type and it can be either 'OP' or 'OPC'
opType: 'OPC'
# Authentication Management Field (AMF) value
amf: '8000'
# IMEI number of the device. It is used if no SUPI is provided
imei: '356938035643803'
# IMEISV number of the device. It is used if no SUPI and IMEI is provided
imeiSv: '4370816125816151'

# List of gNB IP addresses for Radio Link Simulation
gnbSearchList:
- 129.97.168.65

# UAC Access Identities Configuration
uacAic:
mps: false
mcs: false

# UAC Access Control Class
uacAcc:
normalClass: 0
class11: false
class12: false
class13: false
class14: false
class15: false

# Initial PDU sessions to be established
sessions:
- type: 'IPv4'
apn: 'streaming'
slice:
sst: 1
sd: 000002

# Configured NSSAI for this UE by HPLMN
configured-nssai:
- sst: 1
sd: 000002

# Default Configured NSSAI for this UE
default-nssai:
- sst: 1
sd: 000002

# Supported integrity algorithms by this UE
integrity:
IA1: true
IA2: true
IA3: true

# Supported encryption algorithms by this UE
ciphering:
EA1: true
EA2: true
EA3: true

# Integrity protection maximum data rate for user plane
integrityMaxRate:
uplink: 'full'
downlink: 'full'
72 changes: 72 additions & 0 deletions ueransim/ueransim-ue/config/ue3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
supi: 'imsi-001010000000003'
# Mobile Country Code value of HPLMN
mcc: '001'
# Mobile Network Code value of HPLMN (2 or 3 digits)
mnc: '01'

# Permanent subscription key
key: 'B199B49F465B5CE8E238A6BCAA5F0A2E'
# Operator code (OP or OPC) of the UE
op: '283B54E8E8ED289D8E6183CAEBA952E4'
# This value specifies the OP type and it can be either 'OP' or 'OPC'
opType: 'OPC'
# Authentication Management Field (AMF) value
amf: '8000'
# IMEI number of the device. It is used if no SUPI is provided
imei: '356938035643803'
# IMEISV number of the device. It is used if no SUPI and IMEI is provided
imeiSv: '4370816125816151'

# List of gNB IP addresses for Radio Link Simulation
gnbSearchList:
- 129.97.168.65

# UAC Access Identities Configuration
uacAic:
mps: false
mcs: false

# UAC Access Control Class
uacAcc:
normalClass: 0
class11: false
class12: false
class13: false
class14: false
class15: false

# Initial PDU sessions to be established
sessions:
- type: 'IPv4'
apn: 'internet'
slice:
sst: 1
sd: 000001

# Configured NSSAI for this UE by HPLMN
configured-nssai:
- sst: 1
sd: 000001

# Default Configured NSSAI for this UE
default-nssai:
- sst: 1
sd: 000001

# Supported integrity algorithms by this UE
integrity:
IA1: true
IA2: true
IA3: true

# Supported encryption algorithms by this UE
ciphering:
EA1: true
EA2: true
EA3: true

# Integrity protection maximum data rate for user plane
integrityMaxRate:
uplink: 'full'
downlink: 'full'
3 changes: 3 additions & 0 deletions ueransim/ueransim-ue/ue1/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resources:
- ue-configmap.yaml
- ue-deployment.yaml
Loading

0 comments on commit ad6f3b8

Please sign in to comment.