Amarisoft

Tun Setup on UEsim

The purpose of this tutorial is to show how to setup tun interface for each UE created by UEsim.  In case of MT data traffic (e.g, the data is generated by Callbox(i.e, eNB or gNB) and is sent to UE), you would not need any specific tun interface on UEsim. But if you want to do MO data traffic, you need to setup tun interface for each PDN of each UE simulated by UEsim.

Since there can be multiple UEs simulated in a single UEsim box, these tun interfaces should be created independently for each UE which operate independantly from each other. In other words, those tun interface for each UE should run in a separate container. These container is called a namespace. So the underlying mechanism for tun interface setup is to create a separate network namespace for each UE.

Table of Contents

 

 

Test Setup

Test setup for this tutorial is as shown below.

TestSetup multiUE 01

 

Key Configuration Parameters

Followings are important configuration parameters for this tutorial. You may click on the items for the descriptions from Amarisoft documents.

 

Test 1 : Basic Tun Setup

In this test, we will look into how to enable tun setup on UEsim and perform very basic test (e.g, ping, curl)

 

Configuration

In terms of configuration, it is super simple to enable tun setup for each UE. You just configure the parameter tun_setup_script to the specific shell script (ue-ifup) which is provided with default installation package. (NOTE : most of sample configurations provided by the installation package would have this configured but commented out. Just uncomment the configuration)

UEsim NR MultiUE Config 01

If you are interested in further details, you can find the script (ue-ifup) in /root/ue/config directory and look into the contents of the file in any text editor.

 

Perform the test

First make it sure that UE is in connected mode with eNB or gNB.

This is optional but good to check to learn that UEsim does not setup tun at global ip setup. If you just do ifconfig, you wouldn't see any difference and wouldn't see any specific ip interface for a specific UE.

The tun interface for UEs is created as individual namespaces. So you need to use special command to check or manipulate the namespace. The command for this purpose is 'ip netns'.

Before you do anything especially you are not familiar with what can be done or how it can be done with ip netns, it is always handy to ask for help (ip netns help)

The first meaningful checkup is to see if there is any namespaces created for any UE in communication state. You can check it up by running the command 'ip netns list'. If there is any UE with tun setup, you will see the list as shown in this example. If there is no UEs with the namespace, the command will not return anything.

If you have any items returned by 'ip netns list', you can find the details about the interfaces associated with the UE by running the command 'ip netns exec <UE id> ifconfig'.  

Now you can try with some data traffic like ping by running the command 'ip netns exec <UE id> ping <destination ip>'.

Or you can get access even to http server and download the contents by running 'ip netns exec ue1 curl <url>'.