MEC
Based on Environment setup of multiple SMF, DNN, and UPF, divide the UE and gNB into different VM and try to connect to Internet.
Result:
- UE1 (UE1 → gNB → I-UPF → PSA-UP2 → DNN:internet): failed
- UE2 (UE2 → gNB → PSA-UP1 → DNN:IMS): succeed
VM | interface | Type | IP | 用途 |
---|---|---|---|---|
free5gc | enp0s3 | internal N1 | 172.16.1.100/24 | AMF 接 UE |
enp0s8 | internal N2 | 172.16.2.100/24 | AMF 接 gNB | |
enp0s9 | internal N4 | 172.16.4.98/24 | SMF 接 UPF | |
enp0s10 | host-only | 192.168.56.103/24 | SSH | |
I-UPF | enps03 | internal N3 | 172.16.3.100/24 | I-UPF 接 gNB |
enps08 | internal N4 | 172.16.4.100/24 | I-UPF 接 SMF | |
enps09 | internal N6 | 172.16.6.100/24 | I-UPF 接 MEC | |
enps010 | internal N9 | 172.16.9.100/24 | I-UPF 接 PSA-UPF | |
PSA-UPF1 | enp0s3 | NAT | dhcp | UPF 接 DN: IMS |
enp0s8 | internal N3 | 172.16.3.101/24 | UPF 接 gNB | |
enp0s9 | internal N9 | 172.16.4.101/24 | UPF 接 SMF | |
enp0s10 | host-only | 192.168.56.102/24 | SSH | |
PSA-UPF2 | enp0s3 | NAT | dhcp | PSA 接 DN: internet |
enp0s8 | internal N4 | 172.16.4.102/24 | PSA 接 SMF | |
enp0s9 | internal N9 | 172.16.9.102/24 | PSA 接 I-UPF | |
enp0s10 | host-only | 192.168.56.105/24 | SSH | |
gNB | enps03 | internal N2 | 172.16.2.1/24 | gNB 接 AMF |
enps08 | internal N3 | 172.16.3.1/24 | gNB 接 UPF | |
enps09 | internal Nn | 192.168.0.131/24 | gNB 接 UE | |
enps010 | host-only | 192.168.56.101/24 | SSH | |
UE | enp0s3 | internal N1 | 172.16.1.2/24 | UE 接 AMF |
enps08 | internal Nn | 192.168.0.132/24 | UE 接 gNB | |
enps09 | host-only | 192.168.56.104/24 | SSH |
在UE設定NIC時輸入 sudo netplan try 時遇到問題:object has no attribute 'state'
可輸入 netplan try –state /etc/netplan 解決
UE1 can' t connect Internet via tunnel
$ ping -I uesimtun0 8.8.8.8
要確認一下若此時不執行 forward command 會不會有影響
cat /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_forward
sudo sysctl net.ipv4.conf.all.proxy_arp=1
sudo sysctl net.ipv4.conf.enp0sX.proxy_arp=1 //通往 UE
sudo sysctl net.ipv4.conf.enp0sX.proxy_arp=1 // 通往 UPF
sudo sysctl -p
free5gc-ue1.yaml
gnbSearchList
: gNB Nn
interfacefree5gc-gnb.yaml
linkIp
: gNB Nn
interfacengapIp
: gNB N2
interfacegtpIp
: gNB N3
interfaceamfConfigs
:AMF N2
interfacesst
:setting0x1
for UE2sd
:setting 0x112233
for UE2upfcfg.yaml
pfcp
:I-UPF N4
interfacegtpu
:because this UPF have N3
、N9
so setting: 0.0.0.0
dnn_list
:intranet
(accoarding to free5gc SMF Config / ULCL Config)cidr
:60.60.0.0/24
upfcfg.yaml
pfcp
:PSA-UPF1 N4
gtpu
:PSA-UPF1 N3
dnn
:IMS
for UE2cidr
:60.61.0.0/24
upfcfg.yaml
pcfp
:PSA-UPF2 N4
gtpu
:PSA-UPF2 N9
cidr
:60.60.0.0/24
amfcfg.yaml
ngapIpList
: AMF N2
smfcfg.yaml
pfcp
: SMF N4
for I-UPF and PSA-UPF2IUPF
:
node_id
: I-UPF N4
sNssai
: for UE1dnnUpfInfoList
: intranetinterface
: N3
and N9
PSA2
:
node_id
: UPF-PSA N4
dnnUpfInfoList
: internetcidr
: 60.60.0.0/24
interface
: N9
links
: gNB1 ⇄ IUPF, IUPF ⇄ PSA2ulcl
: true
uerouting.yaml
members
: UE1topology
: gNB1 ⇄ IUPF, IUPF ⇄ PSA2specificPath
: MEC N6
path
: [IUPF,IUPF]
according to Environment setup of multiple SMF, DNN, and UPFrun.sh
$ sudo sysctl -w net.ipv4.ip_forward=1
$ sudo iptables -t nat -A POSTROUTING -o enp0s9 -j MASQUERADE
$ sudo systemctl stop ufw
$ sudo iptables -I FORWARD 1 -j ACCEPT
$ cd ~/free5gc/NFs/upf/build/
$ sudo ./bin/free5gc-upfd
$ sudo sysctl -w net.ipv4.ip_forward=1
$ sudo iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
$ sudo systemctl stop ufw
$ sudo iptables -I FORWARD 1 -j ACCEPT
$ cd ~/free5gc/NFs/upf/build/
$ sudo ./bin/free5gc-upfd
$ sudo sysctl -w net.ipv4.ip_forward=1
$ sudo iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
$ sudo systemctl stop ufw
$ sudo iptables -I FORWARD 1 -j ACCEPT
$ cd ~/free5gc/NFs/upf/build/
$ sudo ./bin/free5gc-upfd
$ cd free5gc
$ ./run.sh
$ cd UERANSIM
$ build/nr-gnb -c config/free5gc-gnb.yaml
$ cd UERANSIM
$ sudo build/nr-ue -c config/free5gc-ue1.yaml
uesimtun0
uesimtun0
Only capture ICMP echo request (UE → 8.8.8.8
) but ICMP reply (8.8.8.8
→ UE)
Nn
The third packet might be ICMP request packet (UE → gNB).
I think there should appear the ICMP reply packet (gNB → UE)
N3
Nn
Second packet might be ICMP request
N3
N9
NAT
N9
By using mrt 8.8.8.8
do not show anything.
N2
N4
N4
N4
N2
、I-UPF N4
、PSA-UPF1 N4
、PSA-UPF2 N4
UE2 can access Internet via core network successfully:
60.61.0.1
Nn
N3
、UE Nn
N3
First, I just start UE1 and set default gateway.
60.60.0.1
N3
、UE Nn
N9
、gNB N3
、SMF N4
N4
、I-UPF N9
、I-UPF N3
$sudo route add -net 192.168.0.0/24 dev enp0s9
$sudo route add -net 192.168.0.0/24 dev enp0s3
$sudo route add -net 172.16.9.0/24 dev enp0s8