Unipisa / Unipisa/Simu5G

Using Simu5G for real-time simulation

Open
#281 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
235
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am attempting to use Simu5G for real-time simulation. I modify the extclientserver example code in the emulation. Specifically, I am using Host A with two network cards. One of the network cards is used to connect to another host B in the local area network (192.168.3.0/24), and the other network card connects to the gateway (192.168.2.10) for Internet access. Theoretically, the hosts in the local area network can access the Internet through the simulated 5G network.

The current problem is that I can use the local host to ping the IP address of the UE (192.168.3.1) in Simu5G, but I cannot ping the IP address of the gNB (10.0.1.2), and I cannot observe any traffic on the external network card.

I enabled IP forwarding on Host A and configured NAT rules. When simu5G is not enabled, local host B can access the Internet.

My configuration is shown below:

sudo ip link add sim-veth1 type veth peer name ext-veth1
sudo ip link add sim-veth2 type veth peer name ext-veth2

sudo ip link set sim-veth1 up
sudo ip link set sim-veth2 up
sudo ip link set ext-veth1 up
sudo ip link set ext-veth2 up

sudo ip link add name br-client type bridge
sudo ip link set ext-veth1 master br-client

sudo ip link add name br-server type bridge
sudo ip link set ext-veth2 master br-server

sudo ip link set br-client up
sudo ip link set br-server up
sudo ip link set enx00e04c36136b up
sudo ip link set enxc8a362edbde2 up

sudo ip addr add 192.168.3.2/24 dev br-client
sudo ip addr add 192.168.2.2/24 dev br-server

# Add route to gateway
sudo ip route add default via 192.168.2.10 dev br-server

sudo ip link set enxc8a362edbde2 master br-server
sudo ip link set enx00e04c36136b master br-client

sudo iptables -t nat -A POSTROUTING -s 192.168.3.0/24 -o br-server -j MASQUERADE

I enabled simu5G and disabled the network card routing on Host A (while still keeping ip forwarding enabled) to ensure that all traffic passed through simu5G:

sudo iptables -t nat -A POSTROUTING -s 192.168.3.0/24 -o br-server -j MASQUERADE

sudo iptables -A FORWARD -i br-client -o br-server -j DROP
sudo iptables -A FORWARD -i br-server -o br-client -j DROP

I have checked the mrt file of simu5G. The routing rules in it are correct. Maybe there is a problem with other configurations?
I am willing to provide any configuration file used if it is useful.
Thank you in advance!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the extclientserver example and the Simu5G .mrt file mentioned in the report, then review the shown Linux bridge, routing, forwarding, and NAT configuration. Reproduce the setup and trace whether traffic reaches the external network card; done means the gNB address is reachable and the LAN host can access the Internet through the simulated 5G network.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.