Ueransim: Penggunaan
Sumber: https://github.com/aligungr/UERANSIM/wiki/Usage
Penggunaan Dasar
Setelah menyelesaikan konfigurasi dan pengaturan, sekarang kita dapat mulai menggunakan UERANSIM.
Jalankan perintah berikut untuk memulai gNB:
nr-gnb -c myconfig.yaml
Jalankan perintah berikut untuk memulai UE:
nr-ue -c myconfig.yaml
Kita juga dapat mengatur jumlah UE dengan:
nr-ue -c myconfig.yaml -n 10
Dengan cara ini, 10 UE akan di start dan di run dalam proses. Nomor IMSI di tambah satu untuk setiap UE (mulai dari IMSI yang ditentukan dalam file konfigurasi). Kita juga dapat mengganti parameter IMSI di file konfigurasi melalui baris perintah dengan:
nr-ue -c myconfig.yaml -i imsi-286010000000001
atau
nr-ue -c myconfig.yaml -n 10 -i imsi-286010000000001
Penggunaan Command Line Interface (CLI)
UERANSIM menyediakan nr-cli tool untuk gNB dan UE.
CATATAN: UE dan gNB memiliki perintah CLI yang berbeda. Misalnya di gNB Anda dapat memeriksa status koneksi AMF, atau di UE Anda dapat memicu de-registration.
Penggunaan:
nr-cli <node-name>
Di sini kita perlu mengganti <node-name> dengan nama UE atau gNB. Sebagai contoh:
nr-cli imsi-001010000000001
Kita dapat menanyakan UE dan gNB saat ini di lingkungan kita menggunakan:
$ nr-cli --dump
imsi-001010000000001 imsi-001010000000002 imsi-001010000000003
Setelah menjalankan perintah nr-cli <node-name>, shell interaktif akan terbuka jika node yang diberikan ada dan berjalan di lingkungan. Kita sekarang dapat menjalankan perintah lebih lanjut untuk node ini.
Untuk melihat perintah yang tersedia, gunakan perintah.
Misalnya:
user@pc:~/UERANSIM/build$ ./nr-cli UERANSIM-gnb-001-01-1 -------------------------------------------------------------------------------------------- $ commands amf-info | Show some status information about the given AMF amf-list | List all AMFs associated with the gNB info | Show some information about the gNB status | Show some status information about the gNB ue-count | Print the total number of UEs connected the this gNB ue-list | List all UEs associated with the gNB --------------------------------------------------------------------------------------------
Kita dapat menyelidiki lebih lanjut penggunaan dan informasi bantuan untuk sub-perintah. Misalnya:
$ amf-info --help $ ue-list --version dll.
Kita juga dapat menggunakan opsi -e/--exec jika kita ingin menjalankan perintah secara langsung daripada menggunakan shell interaktif. Misalnya:
nr-cli imsi-001010000000001 --exec "status"
Untuk lebih detail, silahkan lihat
nr-cli --help
Penggunaan Data Plane
UERANSIM provides a TUN interface in order to use UE's internet connectivity. With the version v2.2.1 all TUN configurations are automatically applied.
A TUN interface is setup for each PDU session. After successful establishment of a PDU session, the UE automatically performs the following operations:
A TUN interface is created. A routing table, an IP rule, and an IP route are configured. NOTE: Routing configurations may clash with your current settings. You can start the UE with nr-ue --no-route-config if you don't want the automatic routing configurations (item 2). However TUN interface is always created after a PDU session establishment (item 1).
NOTE: Using UE and Core Network on the same computer usually causes problems. Please use 2 different machines for UERANSIM and core network. (You can use virtual machines or non-virtual machines.)
Using the TUN Interface If you want to manually utilize the interface, just bind your TCP/IP socket to uesimtunX interface.
For example:
ping -I uesimtun0 google.com
or
sudo curl --interface uesimtun0 google.com
etc. However we also provide our experimental ./nr-binder tool to utilize UE's connection easily.
Using the TUN via ./nr-binder You can bind the uesimtunX interface to almost any application using ./nr-binder tool.
NOTE: Automatic routing configurations must be enabled for using ./nr-binder. i.e. don't start the UE with --no-routing-config if you want to use nr-binder feature.
NOTE: ./nr-binder is experimental and may not work for some applications.
Usage:
./nr-binder {PDU-SESSION-IP-ADDRESS} {COMMAND} {ARGS}
For example:
./nr-binder 10.45.0.2 curl google.com
In this way, curl command will use UE's internet connection with IP 10.45.0.2. (Here 10.45.0.2 is the IP address of the PDU session that you want to utilize. You may need to replace it with your own PDU session address.)
You can also use web browsers such as Firefox. For example:
./nr-binder 10.45.0.2 firefox
After running this command, all network traffic occurred in Firefox, will use UE's internet connectivity.
NOTE: Please kill all Firefox processes before running the command above.
Troubleshooting
If you are not able to connect to the internet, make sure that the following conditions are satisfied:
- UERANSIM and core network successfully configured.
- A PDU Session is successfully established.
- IP address given to nr-binder is exactly same with the IP address of the related IP PDU Session.
NOTE: Routing configurations in UERANSIM are experimental and it's not a primary feature of the software. UERANSIM only guarantees to create a TUN interface, but IP routing configurations are not guaranteed to serve any purpose. You should directly bind your applications to the TUN interface in order to utilize the UE's internet connectivity, as described in this document.