Skip to content

Commit

Permalink
Merge pull request #93 from a3828162/feature/n3iwue
Browse files Browse the repository at this point in the history
feature/n3iwue
  • Loading branch information
ianchen0119 authored Jan 25, 2024
2 parents 64998fe + fc8a3cf commit f37df73
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/n3iwf-ipsec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#

ip link add name ipsec0 type vti local $(hostname -i | awk '{print $1}') remote 0.0.0.0 key 5
ip addr add 10.0.0.1/24 dev ipsec0
ip addr add 10.100.200.15/24 dev ipsec0
ip link set dev ipsec0 up
6 changes: 3 additions & 3 deletions config/n3iwfcfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ configuration:

# --- Nwu Interfaces ---
IKEBindAddress: n3iwf.free5gc.org # Nwu interface IP address (IKE) on this N3IWF
IPSecTunnelAddress: 10.0.0.1 # Tunnel IP address of XFRM interface on this N3IWF
UEIPAddressRange: 10.0.0.0/24 # IP address pool allocated to UE in IPSec tunnel
IPSecTunnelAddress: 10.100.200.15 # Tunnel IP address of XFRM interface on this N3IWF
UEIPAddressRange: 10.100.200.0/24 # IP address pool allocated to UE in IPSec tunnel
XFRMInterfaceName: xfrmi # Prefix of XFRM interface name created by N3IWF
XFRMInterfaceID: 1 # XFRM interface if_id for IPSec routing (Any value except to 0, default value is 7 if not defined)

# --- N3 Interfaces ---
GTPBindAddress: n3iwf.free5gc.org # IP address of N3 interface (GTP) on this N3IWF
GTPBindAddress: 10.100.200.15 # IP address of N3 interface (GTP) on this N3IWF

FQDN: n3iwf.free5gc.org # FQDN of this N3IWF

Expand Down
42 changes: 42 additions & 0 deletions config/n3uecfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
info:
version: 1.0.1
description: Non-3GPP UE configuration
configuration:
N3IWFInformation:
IPSecIfaceAddr: n3iwf.free5gc.org # IP address of Nwu interface (IKE) on N3IWF
IPsecInnerAddr: n3iwf.free5gc.org # IP address of IPsec tunnel enpoint on N3IWF
N3UEInformation:
IMSI:
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)
MSIN: 0000001234 # Mobile Subscriber Identification Number (max 9 or 10 digits string, digit: 0~9)
AMFID: cafe00 # For AMF identifier of GUAMI in AP-Parameter (hex string, 3 octets)
IPSecIfaceName: eth0 # Name of Nwu interface (IKE) on this N3UE
IPSecIfaceAddr: n3ue.free5gc.org # IP address of Nwu interface (IKE) on this N3UE
DnIPAddr: # IP address of domain network on this N3UE
XfrmiId: 1 # Default XFRM interface if_id for routing, if_id of additional xfrmi will accumulate
XfrmiName: ipsec # prefix of XFRM interface created
GreIfaceName: gretun # prefix of GRE interface created
IkeSaSPI: 0x000000000006f708 # IKE SA SPI (hex string, 8 octets)
IPSecSA3gppControlPlaneSPI: 0x00000002 # IPsec/Child SA SPI for 3GPP Control Plane (hex string, 4 octets)
SmPolicy: # DNN and Network Slice Requested by N3UE
- DNN: internet
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)
- DNN: internet2
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)
Security:
K: b73a90cbcf3afb622dba83c58a8415df
RAND: b120f1c1a0102a2f507dd543de68281f
SQN: 16f3b3f71005
AMF: 8000
OP: b672047e003bb952dca6cb8af0e5b779
OPC: df0c67868fa25f748b7044c6e7c245b8
logger:
N3UE: # the kind of log output
debugLevel: trace # how detailed to output, value: trace, debug, info, warn, error, fatal, panic
ReportCaller: false # enable the caller report or not, value: true or false
21 changes: 20 additions & 1 deletion docker-compose-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ services:
- NET_ADMIN
networks:
privnet:
ipv4_address: 10.100.200.15
aliases:
- n3iwf.free5gc.org
depends_on:
depends_on:
- free5gc-amf
- free5gc-smf
- free5gc-upf
Expand Down Expand Up @@ -286,6 +287,24 @@ services:
- free5gc-amf
- free5gc-upf

n3iwue:
container_name: n3iwue
build:
context: ./n3iwue
command: sleep infinity
volumes:
- ./config/n3uecfg.yaml:/n3iwue/config/n3ue.yaml
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun"
networks:
privnet:
aliases:
- n3ue.free5gc.org
depends_on:
- free5gc-n3iwf

networks:
privnet:
ipam:
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ services:
- NET_ADMIN
networks:
privnet:
ipv4_address: 10.100.200.15
aliases:
- n3iwf.free5gc.org
depends_on:
Expand Down Expand Up @@ -250,6 +251,23 @@ services:
depends_on:
- free5gc-amf
- free5gc-upf

n3iwue:
container_name: n3iwue
image: free5gc/n3iwue:latest
command: sleep infinity
volumes:
- ./config/n3uecfg.yaml:/n3iwue/config/n3ue.yaml
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun"
networks:
privnet:
aliases:
- n3ue.free5gc.org
depends_on:
- free5gc-n3iwf

networks:
privnet:
Expand Down
30 changes: 30 additions & 0 deletions n3iwue/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM golang:1.18.10-bullseye AS builder

LABEL maintainer="Free5GC <[email protected]>"

ENV DEBIAN_FRONTEND noninteractive

# Install dependencies
RUN apt-get update \
&& apt-get install libsctp-dev lksctp-tools iproute2 -y \
&& apt-get install make -y \
&& git clone https://github.com/free5gc/n3iwue.git \
&& cd ./n3iwue \
&& make

FROM bitnami/minideb:bullseye

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update \
&& apt-get install libsctp-dev lksctp-tools iproute2 iputils-ping procps psmisc tcpdump sudo -y \
&& apt-get clean

WORKDIR /n3iwue
RUN mkdir -p config/
#Install runtime dependencies + ping

COPY --from=builder go/n3iwue/n3iwue .
COPY --from=builder go/n3iwue/run.sh .

VOLUME [ "/n3iwue/config" ]
2 changes: 2 additions & 0 deletions script/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ done

docker tag free5gc-compose_free5gc-webui:latest free5gc/webui:${TAG}
docker tag free5gc-compose_ueransim:latest free5gc/ueransim:${TAG}
docker tag free5gc-compose_n3iwue:latest free5gc/n3iwue:${TAG}

docker push free5gc/webui:${TAG}
docker push free5gc/ueransim:${TAG}
docker push free5gc/n3iwue:${TAG}

0 comments on commit f37df73

Please sign in to comment.