Project

General

Profile

Osmocom Network In The Box » History » Version 82

neels, 11/23/2017 12:29 AM

1 23 neels
{{>toc}}
2
3 1 neels
h1. Osmocom Network In The Box
4
5 22 neels
This is a brief guide to the most basic and minimal setup of an Osmocom 2G and/or 3G network for voice and data services. It is a good starting point for newcomers to familiarize with the software, and to expand upon by the [[Osmocom Manuals]] and other wiki pages.
6 21 neels
7 68 neels
h1. OsmoNITB R.I.P., long live the Network In The Box
8 1 neels
9 2 neels
Historically, Osmocom offered the [[OsmoNITB:]] "Network-In-The-Box" as an actual single program. It was a useful simplification at the time, but in 2017, Osmocom have decided to split OsmoNITB into programs more closely resembling traditional network architecture. It is recommended to use the new separate components instead of the OsmoNITB, since active development focus has moved there.
10 1 neels
11 4 neels
It is still very much possible to run a complete Osmocom core network in one "box". For example, a sysmoBTS can run the entire core network on the same hardware that drives the TRX, making it a complete network in actually one single box. At the same time, having separate components also allows scaling to large deployments, with properly distributed load and a central subscriber database.
12 1 neels
13 2 neels
To migrate from OsmoNITB to the new separate programs, see the [[OsmoNITB Migration Guide]].
14
15 68 neels
h1. Part of this Complete Network
16 2 neels
17 32 neels
Assuming that you have your radio hardware ready (a BTS, a femto cell or an SDR driven by osmo-trx), the core network consists of separate programs providing voice/SMS/USSD ("circuit-switched" or CS) and data ("packet-switched" or PS) services.
18 2 neels
19 32 neels
Here is a table of the components you need:
20 1 neels
21 32 neels
|\4. *Required for*  |/3. *Program* |/3. *Description* |
22
|\2. *2G*  |\2. *3G* |
23
| *CS* | *PS* | *CS* | *PS* |
24
| ✔ | ✔ | ✔ | ✔ | [[OsmoHLR:]] | Home Location Register, stores subscriber IMSI, phone number and auth tokens. |
25
| ✔ | (1) | ✔ | (1) | [[OsmoMSC:]] | Mobile Switching Center, handles signalling, i.e. attach/detach of subscribers, call establishment, messaging (SMS and USSD). |
26
| ✔ |   | ✔ |   | [[OsmoMGW:]] | Media Gateway, is instructed by the MSC and/or the BSC to direct RTP streams for active voice calls. |
27
| ✔ | ✔ | ✔ | ✔ | [[OsmoSTP:]] | Signal Transfer Point, routes SCCP messages between MSC, BSC, HNBGW and for 3G also the SGSN. |
28
| ✔ | (1) |   |   | [[OsmoBSC:]] | 2G Base Station Controller, manages logical channels and other lower level aspects for one or more 2G BTS; it is technically part of the BSS and not the "core network". |
29
|   |   | ✔ | ✔ | [[OsmoHNBGW:]] | 3G HomeNodeB Gateway, receives the Iuh protocol from a 3G femto cell and forwards to MSC and SGSN by SCCP/M3UA via OsmoSTP. |
30
|   | ✔ (2) |   | ✔ (2) | [[OpenGGSN:|OsmoGGSN]] | Gateway GPRS Support Node, "opens" GTP tunnels received from SGSNs to internet uplink. |
31
|   | ✔ |   | ✔ | [[OsmoSGSN:]] | Serving GPRS Support Node, handles signalling, i.e. attach/detach of subscribers and PDP contexts. |
32
| ✔ | (1) |   |   | [[OsmoBTS:]] | for 2G networks, drives the TRX and ties to the BSC via Abis-interface. |
33
|   | ✔ |   |   | [[OsmoPCU:]] | for 2G networks, a component closely tied to the BTS, drives the TRX for PS timeslots and ties to the SGSN via Gb-interface. |
34 37 neels
|   |   | ✔ | ✔ | hNodeb | 3rd party 3G femto cell hardware to connect to OsmoHNBGW via Iuh |
35 5 neels
36 32 neels
1: PS is always an _addition_ to CS: even though these components do not handle PS requests, you need to have these to be able to setup and register with a network, which is a prerequisite for data services.
37 28 neels
38 74 neels
2: For the GGSN to successfully route packets to an internet uplink, it needs a tun device set up and usually IP masquerading/forwarding enabled. Please refer to the OsmoGGSN manual for more details.
39 18 neels
40 68 neels
h2. Topology
41 55 neels
42
{{graphviz_link()
43
digraph G {
44
  rankdir = LR;
45 56 neels
  
46
  MS [label="MS\n(2G phone)"]
47
  UE [label="UE\n(3G phone)"]
48 1 neels
49 56 neels
  subgraph cluster_bts {
50
    BTS [rank="min"]
51
    PCU [rank="min"]
52
  }
53
54
  subgraph cluster_msc_mgw {
55 59 neels
    label=MGCP;style=dotted
56 56 neels
    MSC
57 57 neels
    MGW1 [label="MGW"]
58 56 neels
  }
59
60
  subgraph cluster_bsc_mgw {
61 59 neels
    label=MGCP;style=dotted
62 56 neels
    BSC
63 57 neels
    MGW2 [label="MGW"]
64 1 neels
  }
65
66 59 neels
  hNodeB [shape="box",label="hNodeB\n(3G femto cell)"]
67
68 61 neels
  MS -> BTS [label="Um"]
69 65 neels
  MS -> PCU [style="dashed"]
70 60 neels
 
71 56 neels
  BTS -> BSC [label="Abis/IP"]
72
  STP [label="STP\n(SCCP/M3UA)"]
73
  BSC -> STP -> MSC [label="A"]
74 70 neels
  MSC -> HLR [label="GSUP"]
75
  SGSN -> HLR [label="GSUP",style="dashed"]
76 62 neels
  UE -> hNodeB [label="Uu"]
77 65 neels
  UE -> hNodeB [style="dashed"]
78 56 neels
  hNodeB -> HNBGW [label="Iuh"]
79
  HNBGW -> STP -> MSC [label="IuCS"]
80 58 neels
  HNBGW -> STP -> SGSN [label="IuPS",style="dashed"]
81 61 neels
  PCU -> SGSN [label="Gb",style="dashed"]
82 58 neels
  SGSN -> GGSN [label="GTP-C",style="dashed"]
83
  SGSN -> GGSN [label="GTP-U(2G)",style="dashed"]
84
  hNodeB -> GGSN [label="GTP-U(3G)",style="dashed"]
85
  GGSN -> internet [label="tun",style="dashed"]
86 56 neels
87 73 neels
  BTS -> MGW2 -> MGW1 [label="RTP"]
88 59 neels
  MGW1 -> MGW1 [label="RTP"]
89 1 neels
  hNodeB -> MGW1 [label="IuUP/RTP"]
90 59 neels
91
  A, B, C, D [style="invisible"]
92 63 neels
  A -> B [label="data (PS)",style="dashed"]
93
  C -> D [label="voice (CS)"]
94 56 neels
95 55 neels
}
96
}}
97
98 5 neels
h1. Have to Know
99 10 neels
100
Each program features a detailed [[Osmocom Manuals|user manual]], your primary source of information to expand on the setup described here.
101 24 laforge
102 5 neels
Osmocom offers [[Binary_Packages|compiled packages for various distributions]]. If you're up to it, you may also [[Build from Source]].
103
104
Each Osmocom program typically has
105
106 1 neels
* a distinct configuration file;
107 25 neels
* a VTY telnet console for live interaction;
108 1 neels
* a CTRL interface for live interaction from 3rd party programs.
109 18 neels
110
See [[Port Numbers]] to find out which program runs VTY on which port.
111
112
h1. Configuration Examples
113 5 neels
114 6 neels
h2. OsmoHLR
115
116 67 neels
Home Location Register, stores subscriber IMSI, phone number and auth tokens. This is where you configure who is allowed on your network and who has which phone number.
117
118 72 neels
osmo-hlr will automatically bootstrap an empty subscriber database. See the [[Osmocom Manuals|manual]] on how to add one or more subscribers -- if you don't know your IMSI, it can be useful to attempt a connection and watch the OsmoHLR log for a rejected IMSI. To migrate subscribers from an older OsmoNITB database, see the [[OsmoNITB migration guide]].
119 6 neels
120 50 neels
While you do need one, your configuration file may actually remain empty. This will serve GSUP on localhost (127.0.0.1), sufficient for a Network In The Box with MSC and SGSN on the same machine as the HLR.
121 6 neels
122 48 neels
*osmo-hlr.cfg*
123
<pre>
124 71 neels
# empty, the defaults are sufficient
125 48 neels
</pre>
126
127 6 neels
h2. OsmoMSC
128 1 neels
129 67 neels
Mobile Switching Center, handles signalling, i.e. attach/detach of subscribers, call establishment, messaging (SMS and USSD). The OsmoMSC is your central "manager" of the network.
130 66 neels
131 6 neels
The VLR component of OsmoMSC needs to connect to the OsmoHLR's GSUP server to know which subscribers are authorized. By default, it will connect to OsmoHLR on localhost, no explicit config needed.
132 26 neels
133 6 neels
To be reachable by OsmoBSC and OsmoHNBGW, OsmoMSC needs an SCCP point code, and it needs to connect to OsmoSTP to make itself known to SCCP routing.
134 7 neels
135 6 neels
* There is a default point code, currently 0.23.1 (in 8.8.3 point code format).
136
* OsmoMSC will by default look for OsmoSTP on localhost's M3UA port, 2905.
137 7 neels
138 51 neels
To direct RTP streams, OsmoMSC needs an OsmoMGW instance (see OsmoMGW below).
139 38 neels
140 51 neels
You only need to set up your MCC, MNC, and how to reach/use the MGW.
141 43 neels
142 49 neels
*osmo-msc.cfg*
143 1 neels
<pre>
144 38 neels
network
145
 network country code 901
146 53 neels
 mobile network code 70
147
msc
148 82 neels
 mgw remote-ip 192.168.0.9
149 45 neels
 mgw endpoint-range 1 32
150 38 neels
</pre>
151 47 neels
152 1 neels
h2. OsmoMGW
153
154 67 neels
Media Gateway, is instructed by the MSC and/or the BSC to direct RTP streams for active voice calls. The Media Gateway receives instructions in the form of MGCP messages from OsmoMSC/OsmoBSC. It forwards RTP streams directly between BTS, femto cells and remote endpoints, e.g. other MGW instances, and its job is to transcode between codecs (future).
155 52 neels
156 47 neels
You need an OsmoMGW to serve OsmoMSC's MGCP requests, and an OsmoMGW to serve OsmoBSC's MGCP requests. In fact, these two can be served by one single OsmoMGW instance. If you would like to keep two separate OsmoMGW instances, you need to take care that they don't attempt to bind to identical ports on the same IP address (for MGCP, but also for VTY and CTRL interfaces).
157
158
Consider that you have a 2G network with an external BTS (say a sysmoBTS), which means that you need your OsmoBSC's MGW instance to be reachable on a public interface. So far the MSC's MGW can be on a local loopback interface, it only needs to be reachable by the BSC's MGW and by the MSC.
159
160
If you also have a 3G femto cell, then the MSC's MGW instance also needs to be on a public interface. At this point you either need two public interface addresses, or you need to put one of the MGWs on a different MGCP port.
161
162
If you use one OsmoMGW for both BSC and MSC, there are no port conflicts, but you need to take care that MSC and BSC use differing endpoint identifiers, or they will interfere with each others' RTP stream configurations.
163
164
To increase the likelihood that your first setup will work out, below examples pick distinct endpoint ranges so that MSC and BSC could use the same MGW instance, while at the same time provide config files that allow running two MGWs on the same public IP address.
165
166
h3. OsmoMGW for OsmoMSC
167 1 neels
168 9 neels
*NOTE: Currently, OsmoMSC still requires the legacy osmo-bsc_mgcp program, which will move to the new osmo-mgw soon. osmo-bsc_mgcp is still available from osmo-mgw.git. For osmo-bsc_mgcp, you can use the identical config as shown for the MSC's MGW here.*
169 47 neels
170 1 neels
* In a setup that truly runs in one box (e.g. sysmoBTS or osmo-trx with co-located core network), this may be localhost (127.0.0.1), which is the default, and your config file may omit the 'bind ip'.
171 9 neels
* With a separate BTS and/or RNC (e.g. 3G femto cell or nanoBTS), make sure to configure an IP address that is reachable by the hNodeB and BTS:
172 1 neels
173
*osmo-mgw-for-msc.cfg*
174 9 neels
<pre>
175 48 neels
mgcp
176 82 neels
 bind ip 192.168.0.9
177 40 neels
 number endpoints 64
178 82 neels
line vty
179
 bind 127.0.0.1
180 1 neels
</pre>
181
182 47 neels
h3. OsmoMGW for OsmoBSC
183 1 neels
184
OsmoBSC also requires an OsmoMGW instance to run alongside it. In a setup where OsmoBSC and OsmoMGW run on the same box, they may in fact share the same OsmoMGW instance, as long as BSC and MSC use different endpoint identifiers.
185
186 47 neels
It is semantically more clear to run a separate OsmoMGW instance for the OsmoBSC, which then needs to not interfere with the other MGW's ports, for example:
187 1 neels
188
*osmo-mgw-for-bsc.cfg*
189
<pre>
190 40 neels
mgcp
191 82 neels
 bind ip 192.168.0.9
192
 # default port is 2427 (is used for MSC's MGW)
193 47 neels
 bind port 12427
194
 number endpoints 64
195 41 neels
line vty
196 82 neels
 # default VTY interface is on 127.0.0.1 (used for MSC's MGW)
197 41 neels
 bind 127.0.0.2
198 40 neels
</pre>
199
200 9 neels
Note that osmo-bsc.cfg below sets the 'mgw remote-port' to the 'bind port' configured here (the method to run two MGW on the same public IP address), and picks a different 'mgw endpoint' range than the OsmoMSC (the method to use the same MGW for both BSC and MSC) -- these are two separate, redundant measures, and you usually would pick only one of them.
201 1 neels
202 9 neels
h2. OsmoSTP
203
204 67 neels
Signal Transfer Point, acts as a server for routing SCCP messages. OsmoMSC, OsmoBSC, OsmoHNBGW and OsmoSGSN contact OsmoSTP and announce their own point code, after which they may instruct OsmoSTP to route SCCP messages to each other by these point codes.
205 9 neels
206
The basic configuration that permits dynamic routing is:
207
208
*osmo-stp.cfg*
209
<pre>
210
cs7 instance 0
211
 xua rkm routing-key-allocation dynamic-permitted
212
 listen m3ua 2905
213 11 neels
  accept-asp-connections dynamic-permitted
214
</pre>
215 1 neels
216
h2. OsmoBSC
217 11 neels
218 67 neels
2G Base Station Controller, manages logical channels and other lower level aspects for one or more 2G BTS. The BSC tells the MSC what the phones would like to do, and in turn the MSC tells the BSC to establish channels, page phones, and take care of the lower level BTS maintenance.
219
220 1 neels
OsmoBSC needs to register with OsmoSTP, and contact the MSC by its point code.
221 11 neels
222 48 neels
OsmoBSC needs to contact an OsmoMGW to direct RTP streams between BTS and the MSC's MGW, as discussed above under "OsmoMGW".
223 42 neels
224 11 neels
OsmoBSC also needs complete configuration of all connected BTS. This example shows configuration for a sysmoBTS.
225 15 neels
226
Furthermore, some network properties need to be set.
227
228 11 neels
The 'gprs mode' determines whether packet switched access will be enabled. 'gprs mode none' switches off data services, as osmo-bts will not contact osmo-pcu to establish data service. This is a configuration without packet switched service:
229 1 neels
230
*osmo-bsc.cfg* for voice only
231
<pre>
232
network
233 48 neels
 network country code 901
234
 mobile network code 70
235 43 neels
 mm info 1
236 11 neels
 short name OsmoBSC
237
 long name OsmoBSC
238
 bts 0
239
  type sysmobts
240
  band GSM-1800
241 1 neels
  location_area_code 23
242 11 neels
  ip.access unit_id 1800 0
243
  trx 0
244
   rf_locked 0
245
   arfcn 868
246
   nominal power 23
247 48 neels
   max_power_red 20
248 11 neels
   timeslot 0
249
    phys_chan_config CCCH+SDCCH4
250
   timeslot 1
251
    phys_chan_config SDCCH8
252
   timeslot 2
253
    phys_chan_config TCH/H
254
   timeslot 3
255
    phys_chan_config TCH/H
256
   timeslot 4
257
    phys_chan_config TCH/H
258 1 neels
   timeslot 5
259
    phys_chan_config TCH/H
260
   timeslot 6
261
    phys_chan_config TCH/H
262
   timeslot 7
263
    phys_chan_config TCH/H
264 48 neels
e1_input
265
 e1_line 0 driver ipa
266 15 neels
msc 0
267 48 neels
 mgw remote-ip 192.168.0.5
268
 mgw remote-port 12427
269
 mgw endpoint-range 33 64
270
 allow-emergency deny
271
 codec-list hr3
272 15 neels
</pre>
273
274
To allow data service, set a 'gprs mode gprs' or 'gprs mode egprs', and configure PDCH timeslots. Traditionally, a fixed amount of TCH timeslots for voice and PDCH timeslots for data service are configured. OsmoBTS also supports two types of dynamic timeslots, as described in the "Abis manual":http://ftp.osmocom.org/docs/latest/osmobts-abis.pdf, chapter "Dynamic Channel Combinations". The following is a configuration with data service based on Osmocom style dynamic timeslots:
275
276
277 43 neels
*osmo-bsc.cfg* for voice and data service
278 48 neels
<pre>
279 75 neels
network
280
 network country code 901
281 1 neels
 mobile network code 70
282 75 neels
 mm info 1
283
 short name OsmoBSC
284
 long name OsmoBSC
285
 bts 0
286
  type sysmobts
287
  band GSM-1800
288
  location_area_code 23
289
  ip.access unit_id 1800 0
290
  gprs mode gprs
291 82 neels
  gprs nsvc 0 remote ip 192.168.0.9
292 75 neels
  gprs nsvc 0 remote udp port 23000
293
  gprs nsvc 0 local udp port 23000
294
  gprs nsvc 0 nsvci 1800
295
  gprs nsei 1800
296
  gprs cell bvci 1800
297
  trx 0
298
   rf_locked 0
299
   arfcn 868
300
   nominal power 23
301
   timeslot 0
302
    phys_chan_config CCCH+SDCCH4
303
   timeslot 1
304
    phys_chan_config SDCCH8
305
   timeslot 2
306
    phys_chan_config TCH/F_TCH/H_PDCH
307
   timeslot 3
308 1 neels
    phys_chan_config TCH/F_TCH/H_PDCH
309 75 neels
   timeslot 4
310
    phys_chan_config TCH/F_TCH/H_PDCH
311
   timeslot 5
312
    phys_chan_config TCH/F_TCH/H_PDCH
313
   timeslot 6
314
    phys_chan_config TCH/F_TCH/H_PDCH
315
   timeslot 7
316
    phys_chan_config PDCH
317
e1_input
318 1 neels
 e1_line 0 driver ipa
319 75 neels
msc 0
320 82 neels
 mgw remote-ip 192.168.0.9
321 75 neels
 mgw remote-port 12427
322
 mgw endpoint-range 33 64
323 1 neels
 allow-emergency deny
324
 codec-list hr3
325
</pre>
326
327
h2. OsmoHNBGW
328
329
3G HomeNodeB Gateway, receives the Iuh protocol from a 3G femto cell, separates it into IuCS and IuPS and forwards to the MSC and SGSN.
330
331 82 neels
OsmoHNBGW needs to connect to OsmoSTP for routing, and needs to know the MSC and SGSN point codes. If omitted, it assumes OsmoSTP on 127.0.0.1 and uses the point codes that are default in OsmoMSC and OsmoSGSN.
332 1 neels
333
It must also be reachable by the hNodeB, hence its Iuh must typically run on a public IP, not a loopback address like 127.0.0.1.
334
335 16 neels
*osmo-hnbgw.cfg*
336 1 neels
<pre>
337 82 neels
hnbgw
338
 iuh
339
  local-ip 192.168.0.9
340
</pre>
341
342
Note, until https://gerrit.osmocom.org/4977 is merged, you need to provide the point-codes explicitly, like:
343
344
<pre>
345 12 neels
cs7 instance 0
346 82 neels
 point-code 0.0.3
347 12 neels
 ! Address book entries, used below
348 1 neels
 sccp-address msc
349
  point-code 0.23.1
350
 sccp-address sgsn
351 82 neels
  point-code 0.0.2
352 1 neels
hnbgw
353
 iuh
354 82 neels
  local-ip 192.168.0.9
355 1 neels
 iucs
356 12 neels
  remote-addr msc
357 1 neels
 iups
358
  remote-addr sgsn
359
</pre>
360
361
h2. OsmoGGSN
362
363
Gateway GPRS Support Node, "opens" GTP tunnels received from SGSNs to internet uplink. To provide packet switched service, OsmoGGSN must offer GTP service to the OsmoSGSN.
364
365 82 neels
Notably, both OsmoGGSN and OsmoSGSN must use identical port numbers, which is an intrinsic requirement of the GTP protocol. Hence they must not run on the same IP address. Furthermore, for 2G networks, the SGSN must be reachable by the PCU and thus needs to be on a public interface if the BTS is a separate box; for 3G networks, the GGSN must be reachable by the hNodeB and thus needs to be on a public interface. So, to cover both, you need to have *two* public interfaces; this example uses 192.168.0.42, made available by
366 12 neels
367 82 neels
<pre>
368
sudo ip addr add 192.168.0.42/32 dev eth0
369
</pre>
370
371
This is of course blatantly ignoring the local DHCP server's authority, just a quick hack.
372
373 1 neels
OsmoGGSN maintains a gsn_restart counter, to be able to reliably communicate to the SGSN that it has restarted. This is kept in the 'state-dir', by default in /tmp.
374 13 neels
375 82 neels
It also needs access to a tun device with an address range available to subscribers' PDP contexts. This may be configured ahead of time, so that OsmoGGSN does not need root privileges. If run with 'sudo', OsmoGGSN may also create its own tun device. In below example, the 'apn0' device has been created ahead of time, with:
376 13 neels
377 82 neels
<pre>
378
sudo ip tuntap add dev apn0 mode tun user $USER group $USER
379
sudo ip addr add 192.168.42.0/24 dev apn0
380
sudo ip link set apn0 up
381
</pre>
382
383
IPv4 operation is enabled by default, but for future compatibility, it is good to indicate that explicitly.
384
385 76 neels
OsmoGGSN furthermore indicates DNS servers, as well as an IPv4 address range to assign to subscribers' PDP contexts.
386 13 neels
387 78 neels
Note that the APN named in this config file (here "internet") needs to be configured on your phone, see [[Osmocom Network In The Box#APN-for-Data-Service|APN for Data Service]] below.
388 13 neels
389
*osmo-ggsn.cfg*
390
NOTE: this configuration requires running osmo-ggsn with root privileges, as well as IP-forwarding and masquerading to be enabled
391
<pre>
392
ggsn ggsn0
393 82 neels
 gtp bind-ip 192.168.0.42
394 76 neels
 apn internet
395 82 neels
  tun-device apn0
396 1 neels
  type-support v4
397
  ip dns 0 192.168.0.1
398 76 neels
  ip dns 1 8.8.8.8
399
  ip prefix dynamic 192.168.42.0/24
400 82 neels
  no shutdown
401
 default-apn internet
402 14 neels
 no shutdown ggsn
403
</pre>
404 67 neels
405
h2. OsmoSGSN
406 14 neels
407
Serving GPRS Support Node, handles signalling, i.e. attach/detach of subscribers and PDP contexts for data services.
408
409
OsmoSGSN needs to reach the GGSN to establish GTP tunnels for subscribers. It must have a separate GTP IP address from OsmoGGSN, as mentioned before.
410
411
For 2G, OsmoSGSN needs to be reachable by the PCU, and needs a public IP for the Gb interface if it is not running directly on the BTS hardware (e.g. on sysmoBTS or when using osmo-trx). For 2G operation, SGSN and GGSN may both use a local IP address for GTP, as long as they differ (e.g. 127.0.0.1 and 127.0.0.2).
412
413
For 3G, OsmoSGSN needs to be reachable by both the HNBGW for IuPS as well as by the hNodeB for GTP, i.e. it definitely needs to have a public IP address for the GTP port. IuPS may remain local if both HNBGW and SGSN are on the same box.
414
415 1 neels
Finally, OsmoSGSN needs access to OsmoHLR to access subscriber data. Set 'auth-policy remote' to use the HLR for subscriber authorization. The default 
416
417
*osmo-sgsn.cfg*
418 14 neels
<pre>
419 77 neels
sgsn
420 82 neels
 gtp local-ip 192.168.0.9
421
 ggsn 0 remote-ip 192.168.0.42
422 79 neels
 ggsn 0 gtp-version 1
423 14 neels
 auth-policy remote
424 77 neels
 gsup remote-ip 127.0.0.1
425
ns
426 82 neels
 encapsulation udp local-ip 192.168.0.9
427 1 neels
 encapsulation udp local-port 23000
428
 encapsulation framerelay-gre enabled 0
429 80 neels
</pre>
430 81 neels
431 18 neels
The @auth-policy remote@ requires that you have the SIM cards' authentication tokens in your OsmoHLR database. Instead, you can use @auth-policy accept-all@, but be aware that this will only work for 2G. 3G networks _require_ successful authentication, and @auth-policy remote@ is your _only_ option for a 3G SGSN.
432 17 neels
433
h1. Running Examples
434
435
Each Osmocom program comes with a systemd service file. It is recommended to place config files in /etc/osmocom/ and launch the individual components using systemd.
436
437
When installed from debian or opkg feeds, you will find the systemd service files in /lib/systemd/system/.
438
439
Re/starting and stopping then works like this:
440
441
<pre>
442 1 neels
systemctl restart osmo-hlr
443
systemctl stop osmo-hlr
444
</pre>
445 36 neels
446
It can be useful to have an @osmo-all@ script to re/start or stop all components at once, edit to pick yours:
447
448
*osmo-all* script
449
<pre>
450
#!/bin/sh
451
cmd="${1:-start}"
452
set -ex
453
systemctl $cmd osmo-hlr osmo-msc osmo-mgw osmo-ggsn osmo-sgsn osmo-stp osmo-bsc osmo-hnbgw osmo-bts-sysmo osmo-pcu 
454
</pre>
455
456
which allows
457
458
<pre>
459 1 neels
./osmo-all restart
460
./osmo-all status
461 36 neels
./osmo-all stop
462
</pre>
463
464 1 neels
For illustration, the manual command invocations for the components would look like this:
465
466
<pre>
467
osmo-hlr -l hlr.db -c osmo-hlr.cfg
468
osmo-msc -c osmo-msc.cfg
469
osmo-mgw -c osmo-mgw-for-msc.cfg
470
osmo-mgw -c osmo-mgw-for-bsc.cfg
471 48 neels
osmo-ggsn -c osmo-ggsn.cfg
472
osmo-sgsn -c osmo-sgsn.cfg
473 36 neels
osmo-stp -c osmo-stp.cfg
474 1 neels
osmo-bsc -c osmo-bsc.cfg
475
osmo-hnbgw -c osmo-hnbgw.cfg
476
# on a 2G sysmoBTS:
477 36 neels
osmo-bts-sysmo -c osmo-bts.cfg -s -M
478
osmo-pcu -c osmo-pcu.cfg
479
</pre>
480 18 neels
481
h1. Logging Examples
482
483
Osmocom programs have a common logging mechanism, configurable by the config files as well as the telnet VTY.
484
485 82 neels
h2. System Logging
486
487 18 neels
Depending on the system's logging configuration, logs may by default be visible in /var/log/daemon.log, or by using journalctl:
488
489 1 neels
<pre>
490
journalctl -f -u osmo-hlr
491
</pre>
492
493
When journalctl is used, it may be necessary to enable it first, e.g. by setting "Storage=volatile" in /etc/systemd/journald.conf followed by a 'systemctl restart systemd-journald'; you may also need to 'systemctl unmask systemd-journald.service systemd-jounald.socket'. Logging will only start appearing for components that were restarted after these changes.
494
495 82 neels
h2. telnet VTY logging
496
497 1 neels
A sure way to see the logs is to connect to the program's telnet VTY and enable logging on the VTY session -- this way you do not modify the application's default logging, but create a separate logging target for your telnet VTY session:
498
499
<pre>
500
$ telnet localhost 4254
501
OsmoMSC> logging enable 
502
OsmoMSC> logging level ?
503
  all      Global setting for all subsystems
504
  rll      A-bis Radio Link Layer (RLL)
505 18 neels
  cc       Layer3 Call Control (CC)
506
  mm       Layer3 Mobility Management (MM)
507
  [...]
508 35 neels
OsmoMSC> logging level all ?
509 19 neels
everything debug      info       notice     error      fatal      
510
OsmoMSC> logging level all debug 
511
OsmoMSC> logging filter all 1
512
</pre>
513
514
You will see logging output on your telnet console immediately. Note that the VTY prompt is still listening, so you may at any time issue 'logging filter all 0' to switch off logging, and be able to type commands without being cluttered by ongoing log output.
515 82 neels
516
h2. stderr logging
517
518
A common configuration you can add to any of the above configuration files to show *all* logging on stderr is:
519
520
<pre>
521
log stderr
522
 logging filter all 1
523
 logging color 1
524
 logging print category 1
525
 logging timestamp 1
526
 logging print extended-timestamp 1
527
 logging level all debug
528
</pre>
529
530
The @filter all 1@ switches on logging, read "do not discard all logging". The amount of logging seen is determined by @logging level ...@ commands, here all categories are set to level @debug@, to show absolutely all logging. You will probably want to refine that.
531 76 neels
532
h1. Troubleshooting
533
534
h2. APN for Data Service
535
536
For the data service to work, phones generally need an APN added to their
537
configuration, or they will not even attempt to establish a data connection.
538
The APN should match the name configured in osmo-ggsn.conf.
539
540
The APN configuration steps are usually similar to:
541
542
* Navigate to APN settings:
543
** 'Settings'
544
** 'Wireless & Networks'
545
** 'Mobile networks'
546
** 'Access Point Names'
547
* You should see the list of APNs (possibly empty)
548
* Press the Menu button
549
* Choose 'New APN'
550
* Enter values for 'Name' as well as 'APN'
551
* Again press the Menu button
552
* Choose 'Save'
553
* The APN should now appear in the list of APNs.
554 1 neels
* Possibly tap the bullet icon to select the APN as default.
Add picture from clipboard (Maximum size: 48.8 MB)