Version 0: initial writing
This tutorial explains how to run OpenAir EPC+eNB+UE with a RF card simulator.
Starting point: the all-in-one tutorial has been run, so the system is installed and running.
Setup the UE
The all-in-one tutorial already compiled the UE, even if we didn’t use it yet.
Our patch file also contains the needed configuration files.
We need now to add a virtual SIM card in binary form to our directory:
../../nas_sim_tools/build/conf2uedata -c ~/opencells-mods/sim.conf -o .
conf2uedata command compiles a OpenAir ascii description of a SIM card into binary files that the OpenAir UE can read.
The hss dump file we provided contains the same SIM card.
Two machines: UE on a second machine
Assuming here you have a separate machine for the UE, you have to install OAI again, nevertheless the next step is easy.
On eNB machine, run the eNB as with RF board, but adding “–rfsim” and some parameters in the configuration file (see “rfsimulator” section we added in ~/opencells-mods/enb.10MHz.b200).
sudo ./lte-softmodem –rfsim -O ~/opencells-mods/enb.10MHz.b200 –log_config.hw_log_level error
“–log_config.hw_log_level error” is there to show how you can change the log level per component on the command line. This is possible for all parameters. We will use the same for UE, because the UE doesn’t have a configuration file.
Lets’ run the UE on the second machine
./lte-uesoftmodem -C 2685000000 -r 50 --rfsim --rfsimulator.serveraddra.b.c.d
a.b.s.d is the eNB machine IP address.
The UE is now running, any IP traffic can be routed by the LTE network: UE+eNB+EPC
One machine UE + SGi interface
3GPP networks tunnel the UE IP address to the SGi.
SGi is in the PGW for regular LTE, maybe in the eNB in OpenAir noS1 mode.
The UE can’t run directly on the same “machine” because both UE and the 3GPP network border (PGW, or eNB in all cases where eNB performs local connection to internet (OAI nS1, LIPA, SIPTO, …)) will try to route the same IP address.
One solution is to run the UE in a virtual machine.
A lighter solution is to create only a network namespace for the UE (a component of a “virtual machine”)
In case of previous trails, delete the already created network namespaces
enp0s31f6 is your network interface to internet, and that network
10.200.1.0 can be used freely in your intranet.
ip netns delete ueNameSpace ip link delete v-eth1 ip netns add ueNameSpace ip link add v-eth1 type veth peer name v-ue1 ip link set v-ue1 netns ueNameSpace ip addr add 10.200.1.1/24 dev v-eth1 ip link set v-eth1 up iptables -t nat -A POSTROUTING -s 10.200.1.0/255.255.255.0 -o enp0s31f6 -j MASQUERADE iptables -A FORWARD -i enp0s31f6 -o v-eth1 -j ACCEPT iptables -A FORWARD -o enp0s31f6 -i v-eth1 -j ACCEPT ip netns exec ueNameSpace ip link set dev lo up ip netns exec ueNameSpace ip addr add 10.200.1.2/24 dev v-ue1 ip netns exec ueNameSpace ip link set v-ue1 up
Set your window in the new namespace:
ip netns exec ueNameSpace bash
Run the UE
./lte-uesoftmodem -C 2685000000 -r 50 --rfsim --rfsimulator.serveraddr 10.200.1.1
you need now to transfer all ip packets in the namespace to the IP interface created by the OpenAir UE
route add default oaitun_ue1
Now, you can run any application in the UE namespace: all IP traffic will go through the UE+eNB+EPC
ip netns exec ueNameSpace bash
DNS in the UE namespace
DNS resolv is convenient to use in the UE namespace.
If your DNS configuration uses a gateway on lo (a address starting by 127.0.0 as do Ubuntu by default), resolv won’t work because you have another lo interface inside the network namespace (so the DNS query won’t reach the resolver outside of the namespace).
The simplest is to add a routable DNS server in your Linux configuration for also this namespace, example using the google DNS server:
sudo echo 'nameserver 22.214.171.124' >> /etc/resolv.conf