Connecting containers/VMs via emulated 5G NR network. Possible?

270 views
Skip to first unread message

Bruno Péjac

unread,
Apr 22, 2022, 12:46:10 PM4/22/22
to 5G-LENA-users
Hello,

I want to emulate a 5G NR network with at least one enbNode and at least two ueNodes. I want to use LXD containers or a similar technology to run applications/clients. The container instances are each connected with a ueNode using taps/bridges.

Is this possible? Is there anything I am missing? Can I install the TapBridge directly on the node with the ueNetDevice?

Maybe somebody has already done an emulation with 5g-lena and can give me some pointers.

Thanks!

Bruno Péjac

unread,
Apr 23, 2022, 5:39:46 AM4/23/22
to 5G-LENA-users
It is said in another conversation that running in real time might be slower than actual real time, although I hope the effect will not be to noticeable for a simple setup.

Tim Upthegrove

unread,
Apr 24, 2022, 8:15:55 PM4/24/22
to Bruno Péjac, 5G-LENA-users
Hi Bruno,

Whether or not things work well depends on how much traffic you want to send, and to some extent, how many nodes you want to run. You will want to make sure that you enable the optimized build in ns-3 when you try things, as the debug build won't be able to keep up even with simple topologies.

You may also find that things work well for short experiments, but extended runs may fail sporadically. I found that dedicating a core to the ns-3 process can help with this when I want to run longer experiments (i.e. more than a minute), but that process is a bit heavy-weight if you are not using a machine dedicated to your experiment.

Good luck,
Tim

--
You received this message because you are subscribed to the Google Groups "5G-LENA-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 5g-lena-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/5g-lena-users/2fc7188d-4cae-48fa-8679-f78acb95d6fen%40googlegroups.com.


--
 
Tim Upthegrove

Bruno Péjac

unread,
Apr 25, 2022, 5:34:12 AM4/25/22
to 5G-LENA-users
Hi Tim, thank for your reply.

I attempted to setup an emulation like the following image illustrates. The ue nodes each have a tabbridge with in "ConfigureLocal" mode.

Screenshot from 2022-04-25 11-32-38.png

Now when I try to see available hosts on the network by running nmap via the tap-bridge that connects to one of the ueNodes, ns3 crashes with the following error:
aborted. cond="protocolNumber != Ipv4L3Protocol::PROT_NUMBER && protocolNumber != Ipv6L3Protocol::PROT_NUMBER", msg="unsupported protocol 2054, only IPv4 and IPv6 are supported", +15.279312000s 2 file=<my-path>/ns-3-dev/contrib/nr/model/nr-ue-net-device.cc, line=213
terminate called without an active exception
Command 'build/scratch/ns3-dev-emu-debug' died with <Signals.SIGABRT: 6>.

2054 is the protocol number for the Address Resolution Protocol. The examples provided always use static routing as far as I understand. Is that the issue?
I also cannot ping any of the other ue node or the remote host in the network because of the same error.

I can provide my code if anybody is interested.

Thanks,

Bruno

Tim Upthegrove

unread,
Apr 25, 2022, 5:51:04 AM4/25/22
to Bruno Péjac, 5G-LENA-users
Hi Bruno,

Yes, I believe what you described is causing the issue. If you connect your external traffic into ns-3 using TapBridges and you want to inject the traffic into the NR network, then you likely need to use so-called "Ghost nodes" which connect the tap bridge to another ns-3 node where you will rely on L3 routing to get traffic into the NR network, rather than directly attempting to send L2 frames. I personally am not sure of a faster way to get things up and going other than setting up static routing.

Tim



--
 
Tim Upthegrove

Bruno

unread,
May 16, 2022, 5:10:13 AM5/16/22
to 5G-LENA-users
Hello Tim et al,

I am still trying to implement the emulated 5g network using a tap bridge (just one for now).
However, I am stuck on what I believe to be a routing issue.

Screenshot from 2022-05-16 11-00-30.png

I am able to ping the ueNode0 from my local system (ping -I mytap 10.1.1.2).
I am also able to send pings withing the emulation (from ue0 to ue1, from remoteHost to ue0, etc.)

I am just not able to ping from my local system to ueNode1, remoteHost. I cannot ping anything past the other end of the csma link.

Below is my routing configuration:
GhostNode0                                                                                                                                                                                    
        Interfaces:                                                                                                                                                                          
                0: 127.0.0.1 (Loopback)                                                                                                                                                      
                1: 10.1.1.1                                                                                                                                                                  
        Routes:                                                                                                                                                                              
                127.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 0)                                                                                                                              
                10.1.1.0 (255.255.255.0) --> 0.0.0.0 (interface 1)                                                                                                                            
UeNode0                                                                                                                                                                                      
        Interfaces:                                                                                                                                                                          
                0: 127.0.0.1 (Loopback)                                                                                                                                                      
                1: 7.0.0.2                                                                                                                                                                    
                2: 10.1.1.2                                                                                                                                                                  
        Routes:                                                                                                                                                                              
                127.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 0)                                
                7.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 1)
                0.0.0.0 (0.0.0.0) --> 7.0.0.1 (interface 1)
                10.1.1.0 (255.255.255.0) --> 0.0.0.0 (interface 2)
UeNode1                                        
        Interfaces:                            
                0: 127.0.0.1 (Loopback)
                1: 7.0.0.3
        Routes:                                
                127.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 0)
                7.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 1)
                0.0.0.0 (0.0.0.0) --> 7.0.0.1 (interface 1)
                10.1.1.1 (255.255.255.255) --> 7.0.0.2 (interface 1)
RemoteHost                                    
        Interfaces:                            
                0: 127.0.0.1 (Loopback)
                1: 1.0.0.2
        Routes:                                
                127.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 0)
                1.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 1)
                7.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 1)
                10.1.1.1 (255.255.255.255) --> 7.0.0.2 (interface 1)
EnbNode0                                      
        Interfaces:                            
                0: 127.0.0.1 (Loopback)
                1: 10.0.0.5
        Routes:                                
                127.0.0.0 (255.0.0.0) --> 0.0.0.0 (interface 0)
                10.0.0.4 (255.255.255.252) --> 0.0.0.0 (interface 1)

I add the following routes on my local system after starting the emulation:
sudo ip route add 7.0.0.0/24 via 10.1.1.2 dev mytap
sudo ip route add 1.0.0.0/24 via 10.1.1.2 dev mytap


I have attached my code if anybody wants to have a look. It should be placed in the scratch folder and can be started with the following command:
NS_LOG="5gEmu=level_all|prefix_level" ./ns3 run scratch/new

I am thankful for any help or hints, since I have been stuck at this point for a while now.
Kind regards,
Bruno

new.cc

Tim Upthegrove

unread,
May 16, 2022, 8:26:19 PM5/16/22
to Bruno, 5G-LENA-users
Hi Bruno,

Were you able to trace through your most recent code to see where traffic might be getting lost? I recall doing that myself with the 5G traces and pcaps on the IpInterfaces that were being routed through along the way as a helpful step to diagnosing the issues I saw. It would be helpful to see if traffic is failing in the forward or reverse direction, and at which node it appears to be dropped. As you describe your routes, I don't see any obvious issues, although I forget what happens with UE-to-UE traffic that goes via the gNB.

Thanks,
Tim



--
 
Tim Upthegrove

Biljana B.

unread,
May 19, 2022, 3:14:15 AM5/19/22
to 5G-LENA-users
Hi Bruno, Tim,

first of all many thanks Tim for answering Bruno and trying to help. We, the 5G-LENA team, are a small team of people and unfortunately, we do not have time to reply regularly, and also sometimes we don't have experience with all the specific issues that people encounter that are sometimes related to the external modules. So, many thanks Tim from the 5G-LENA team.

Bruno, I was thinking that maybe you should also forward your question to the ns-3 user's group to gain a much wider audience since there are many people there who could help with the routing issues, and the emulation mode. 

Cheers,
Biljana

Bruno

unread,
May 19, 2022, 3:36:07 AM5/19/22
to 5G-LENA-users
Thank you Tim and Biljana for the tips and advice!

praghur

unread,
Jun 19, 2023, 5:49:51 PM6/19/23
to 5G-LENA-users
Hello all. 

I have a similar question in setting up my case. 

I need UE0 and UE1 (connected to gNB1) to communicate with a remote UE (say UE2 and UE3) via gNB 2. 
  • Can I set up up UE2 and UE3 to connect with remote host directly? 
  • Can I use a router instead of remote host?
  • Is there any other way I can go about this? 
Really appreciate any input and advice. Thanks for your help in advance. 

Message has been deleted

Rahul M.

unread,
Aug 17, 2025, 7:32:55 AMAug 17
to 5G-LENA-users
Hi all,
I am facing an issue regarding the ping test. I am not able to get it through. Although L3Tx gets called ie. transmit packet happens, L3Rx, pgwRx, or pgwTx are not called which shows no receiving happens. Which leads to unsuccessful Ping.
If anyone can provide the pointers about the correct usage of EPC (that appears to be the case here but not sure), it will be immensely helpful. The sample code is attached herewith for the reference.
Thanks and Best Regards
Rahul M.

test.cc
Reply all
Reply to author
Forward
0 new messages