blob: f1c151425fe4f0889bc94e0bbc4f34f9f3999787 [file] [log] [blame]
llpb3534642023-08-02 09:23:52 -07001Emulated RAN
2----------------
3
4gNBsim emulates a 5G RAN, generating (mostly) Control Plane traffic
5that can be directed at SD-Core. This section describes how to
6configure gNBsim, so as to both customize and scale the workload it
7generates. We assume gNBsim runs in one or more servers, independent
8of the server(s) that host SD-Core. These servers are specified in the
Larry Peterson782fec32023-10-09 12:30:57 -07009``hosts.ini`` file, as described in the section on Scaling Aether. This
10blueprint assumes you start with a variant of ``vars/main.yml``
11customized for running gNBsim. This is easy to do:
llpb3534642023-08-02 09:23:52 -070012
13.. code-block::
14
15 $ cd vars
16 $ cp main-gnbsim.yml main.yml
17
18Configure gNBsim
19~~~~~~~~~~~~~~~~~~
20
21Two sets of parameters control gNBsim. The first set, found in the
22``gnbsim`` section of ``vars/main.yml``, controls how gNBsim is
23deployed: (1) the number of servers it runs on; (2) the number of
24Docker containers running within each server; (3) what configuration
25to run in each of those containers; and
26(4) how those containers connect to SD-Core. For example, consider the
27following variable definitions:
28
29.. code-block::
30
31 gnbsim:
32 docker:
33 container:
34 image: omecproject/5gc-gnbsim:main-PR_88-cc0d21b
35 prefix: gnbsim
36 count: 2
37 network:
38 macvlan:
39 name: gnbnet
40
41 router:
42 data_iface: ens18
43 macvlan:
44 iface: gnbaccess
45 subnet_prefix: "172.20"
46
47 servers:
48 0:
49 - "config/gnbsim-s1-p1.yaml"
50 - "config/gnbsim-s1-p2.yaml"
51 1:
52 - "config/gnbsim-s2-p1.yaml"
53 - "config/gnbsim-s2-p2.yaml"
54
55The ``container.count`` variable in the ``docker`` block specifies how
56many containers run in each server (``2`` in this example). The
57``router`` block then gives the network specification needed for these
58containers to connect to the SD-Core; all of these variables are
59described in the previous section on Networking. Finally, the
60``servers`` block names the configuration files that parameterize each
61container. In this example, there are two servers with two containers
62running in each, with ``config/gnbsim-s2-p1.yaml`` parameterizing the
63first container on the second server.
64
65These config files then specify the second set of gNBsim parameters.
66A detailed description of these parameters is outside the scope of
67this guide (see https://github.com/omec-project/gnbsim for details),
68but at a high-level, gNBsim defines a set of *profiles*, each of which
69exercises a common usage scenario that the Core has to deal with. Each
70of these sequences is represented by a ``profileType`` in the config
71file. gNBsim supports seven profiles, which we list here:
72
73.. code-block::
74
75 - profileType: register # UE Registration
76 - profileType: pdusessest # UE Initiated Session
77 - profileType: anrelease # Access Network (AN) Release
78 - profileType: uetriggservicereq # UE Initiated Service Request
79 - profileType: deregister # UE Initiated De-registration
80 - profileType: nwtriggeruedereg # Network Initiated De-registration
81 - profileType: uereqpdusessrelease # UE Initiated Session Release
82
83The second profile (``pdusettest``) is selected by default. It causes
84the specified number of UEs to register with the Core, initiate a user
85plane session, and then send a minimal data packet over that session.
86Note that the rest of the per-profile parameters are highly redundant.
87For example, they specify the IMSI- and PLMD-related information UEs
88need to connect to the Core.
89
90Finally, it is necessary to edit the ``core`` section of
91``vars/main.yml`` to indicate the address at which gNBsim can find the
92AMF. For our running example, this would look like the following:
93
94.. code-block::
95
96 core:
97 amf: "10.76.28.113"
98
99
100Install/Uninstall gNBsim
101~~~~~~~~~~~~~~~~~~~~~~~~~~
102
103Once you have edited the parameters (and assuming you already have
104SD-Core running), you are ready to install gNBsim. This includes starting
105up all the containers and configuring the network so they can reach
106the Core. This is done from the main OnRamp server you've been using,
107where you type:
108
109.. code-block::
110
111 $ make gnbsim-docker-install
112 $ make aether-gnbsim-install
113
114Note that the first step may not be necessary, depending on whether
115Docker is already installed on the server(s) you've designated to host
116gNBsim.
117
118When you are finished, the following uninstalls everything:
119
120.. code-block::
121
122 $ make aether-gnbsim-uninstall
123
124Run gNBsim
125~~~~~~~~~~~~~~~~~~
126
127Once gNBsim is installed and the Docker containers instantiated, you
128can run the simulation by typing
129
130.. code-block::
131
132 $ make aether-gnbsim-run
133
134This can be done multiple times without reinstalling. For each run,
135you can use Docker to view the results, which have been saved in each
136of the containers. To do so, ssh into one of the servers designated to
137to run gNBsim, and then type
138
139.. code-block::
140
141 $ docker exec -it gnbsim-1 cat summary.log
142
143Note that container name ``gnbsim-1`` is constructed from the
144``prefix`` variable defined in the ``docker`` section of
145``vars/main.yml``, with ``-1`` indicating the first container.
Larry Peterson5d6b3b32023-09-05 15:11:55 -0700146
147In addition to scaling up the workload you put on the Core, you can
148also experiment with the emulation settings defined in any or all of
149the config files in ``deps/gnbsim/config/``. Focusing on ``profile2``
150in particular (because it sends data packets after registering each
151UE), variable ``defaultAs: "192.168.250.1"`` specifies the target of
152ICMP Echo Request packets. Changing the value to the IP address of a
153real-world server (e.g., ``8.8.8.8``) causes the emulated UE to
154actually ping that server. Success is a good indication that your
155Aether cluster is properly configured to support end-to-end
156connectivity.
157