Project

General

Profile

Osmocom Network In The Box » History » Version 16

neels, 10/20/2017 12:38 AM

1 1 neels
h1. Osmocom Network In The Box
2
3 2 neels
h2. OsmoNITB R.I.P., long live the Network In The Box
4 1 neels
5 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.
6 1 neels
7 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.
8 1 neels
9 2 neels
To migrate from OsmoNITB to the new separate programs, see the [[OsmoNITB Migration Guide]].
10
11
h2. Part of this Complete Network
12
13
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") and data ("packet-switched") services.
14
15
h3. Circuit-Switched Components
16
17
To run a circuit-switched core network, you need:
18
19
* [[OsmoHLR:]] -- Home Location Register, stores subscriber IMSI, phone number and auth tokens.
20
* [[OsmoMSC:]] -- Mobile Switching Center, handles signalling, i.e. attach/detach of subscribers, call establishment, messaging (SMS and USSD).
21 1 neels
* [[OsmoMGW:]] -- Media Gateway, is instructed by the MSC and/or the BSC to direct RTP streams for active voice calls.
22 8 neels
* [[OsmoSTP:]] -- Signal Transfer Point, routes SCCP messages between MSC, BSC, HNBGW and for 3G also the SGSN.
23 2 neels
* [[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".
24
* [[OsmoHNBGW:]] -- 3G HomeNodeB Gateway, receives the Iuh protocol from a 3G femto cell and forwards to MSC and SGSN by SCCP/M3UA via OsmoSTP.
25
26
h3. Packet-Switched Components
27
28 3 neels
* [[OpenGGSN:|OsmoGGSN]] -- Gateway GPRS Support Node, "opens" GTP tunnels received from SGSNs to internet uplink.
29 2 neels
* [[OsmoSGSN:]] -- Serving GPRS Support Node, handles signalling, i.e. attach/detach of subscribers and PDP contexts.
30
* [[OsmoHLR:]] -- same as for circuit switched, see above.
31
* [[OsmoHNBGW:]] -- for 3G packet switched networks, same as for 3G circuit switched, see above.
32
* ([[OsmoPCU:]] -- for 2G networks, a component closely tied to the BTS, drives the TRX and ties to the SGSN via Gb-interface.)
33 5 neels
34
h1. Configuration Example
35
36
h2. Have to Know
37
38 10 neels
Each program features a detailed [[Osmocom Manuals|user manual]], your primary source of information to expand on the setup described here.
39
40
Osmocom offers [[Nightly Builds|compiled packages for various distributions]]. If you're up to it, you may also [[Build from Source]].
41 5 neels
42
Each Osmocom program typically has
43
44
* a distinct configuration file;
45
* a VTY telnet console for live interaction;
46
* a CTRL interface for live interaction with 3rd party programs.
47
48
h2. OsmoHLR
49 6 neels
50
See the [[Osmocom Manuals|manual]] on creating a subscriber database, and add one or more subscribers.
51
52
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.
53
54
h2. OsmoMSC
55
56
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.
57
58
To be reachable by OsmoBSC and OsmoHNBGW, it needs an SCCP point code, and it needs to connect to OsmoSTP to make itself known to SCCP routing.
59
60 7 neels
* There is a default point code, currently 0.23.1 (in 8.8.3 point code format).
61 6 neels
* OsmoMSC will by default look for OsmoSTP on localhost's M3UA port, 2905.
62
63 7 neels
To direct RTP streams, OsmoMSC needs an OsmoMGW instance. By default, it will look for an MGW on localhost and the default MGCP port, 4222.
64 6 neels
65
Again, your config file may remain empty.
66 9 neels
67
h2. OsmoMGW
68
69
The Media Gateway receives instructions in the form of MGCP messages from OsmoMSC. It forwards RTP streams directly between BTS, femto cells and remote endpoints, e.g. other MGW instances.
70
71
Its RTP IP address must be reachable by the BTS / the femto cell.
72
73
* 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).
74
* With a separate BTS or RNC (e.g. 3G femto cell or nanoBTS), make sure to configure an IP address that is reachable.
75
76
*osmo-mgw.cfg*
77
<pre>
78
mgcp
79
  local ip 192.168.0.3
80
  bind ip 192.168.0.3
81
</pre>
82
83
The default is to allow any BTS / femto cell IP address to connect.
84
85
(Near future: a second OsmoMGW may be needed to run alongside each OsmoBSC instance.)
86
87
h2. OsmoSTP
88
89
OsmoSTP acts as a server for routing 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.
90
91
The basic configuration that permits dynamic routing is:
92
93
*osmo-stp.cfg*
94
<pre>
95
cs7 instance 0
96
 xua rkm routing-key-allocation dynamic-permitted
97
 listen m3ua 2905
98
  accept-asp-connections dynamic-permitted
99
</pre>
100 11 neels
101
h2. OsmoBSC
102
103
OsmoBSC needs to register with OsmoSTP, and contact the MSC by its point code.
104
105
OsmoBSC also needs complete configuration of all connected BTS. This example shows configuration for a sysmoBTS.
106
107
Furthermore, some network properties need to be set.
108
109 15 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:
110
111
*osmo-bsc.cfg* for voice only
112 11 neels
<pre>
113
network
114
 network country code 901
115
 mobile network code 70
116
 mm info 1
117
 short name Osmocom
118
 long name Osmocom
119
 auth policy closed
120
 encryption a5 0
121
 bts 0
122
  type sysmobts
123
  band GSM-1800
124
  cell_identity 0
125
  location_area_code 23
126
  ip.access unit_id 1800 0
127
  gprs mode none
128
  trx 0
129
   rf_locked 0
130
   arfcn 868
131
   nominal power 23
132
   timeslot 0
133
    phys_chan_config CCCH+SDCCH4
134
   timeslot 1
135
    phys_chan_config SDCCH8
136
   timeslot 2
137
    phys_chan_config TCH/H
138
   timeslot 3
139
    phys_chan_config TCH/H
140
   timeslot 4
141
    phys_chan_config TCH/H
142
   timeslot 5
143
    phys_chan_config TCH/H
144
   timeslot 6
145
    phys_chan_config TCH/H
146
   timeslot 7
147
    phys_chan_config TCH/H
148
cs7 instance 0
149
 ! osmo-bsc's own point code
150
 point-code 0.42.0
151
 ! address book entry named 'msc_remote', used below
152
 sccp-address msc_remote
153
  point-code 0.23.1
154
msc 0
155
 msc-addr msc_remote
156 1 neels
</pre>
157 15 neels
158
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:
159
160
161
*osmo-bsc.cfg* for voice and data service
162
<pre>
163
network
164
 network country code 901
165
 mobile network code 70
166
 mm info 1
167
 short name Osmocom
168
 long name Osmocom
169
 auth policy closed
170
 encryption a5 0
171
 bts 0
172
  type sysmobts
173
  band GSM-1800
174
  cell_identity 0
175
  location_area_code 23
176
  ip.access unit_id 1800 0
177
  gprs mode gprs
178
  trx 0
179
   rf_locked 0
180
   arfcn 868
181
   nominal power 23
182
   timeslot 0
183
    phys_chan_config CCCH+SDCCH4
184
   timeslot 1
185
    phys_chan_config SDCCH8
186
   timeslot 2
187
    phys_chan_config TCH/F_TCH/H_PDCH
188
   timeslot 3
189
    phys_chan_config TCH/F_TCH/H_PDCH
190
   timeslot 4
191
    phys_chan_config TCH/F_TCH/H_PDCH
192
   timeslot 5
193
    phys_chan_config TCH/F_TCH/H_PDCH
194
   timeslot 6
195
    phys_chan_config TCH/F_TCH/H_PDCH
196
   timeslot 7
197
    phys_chan_config PDCH
198
cs7 instance 0
199
 ! osmo-bsc's own point code
200
 point-code 0.42.0
201
 ! address book entry named 'msc_remote', used below
202
 sccp-address msc_remote
203
  point-code 0.23.1
204
msc 0
205
 msc-addr msc_remote
206
</pre>
207
208 12 neels
h2. OsmoHNBGW
209 1 neels
210 16 neels
For connecting a 3G hNodeB (femto cell), OsmoHNBGW is needed to receive Iuh and forward IuCS and IuPS. (For a pure 2G setup, no HNBGW is needed.)
211 1 neels
212 16 neels
OsmoHNBGW needs to connect to OsmoSTP for routing, and needs to know the MSC and SGSN point codes.
213
214
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.
215 12 neels
216
*osmo-hnbgw.cfg*
217
<pre>
218
cs7 instance 0
219
 ! OsmoHNBGW's own local point code
220
 point-code 0.3.0
221
 ! Address book entries, used below
222
 sccp-address msc
223
  point-code 0.23.1
224
 sccp-address sgsn
225
  point-code 0.23.2
226
hnbgw
227
 iuh
228
  local-ip 192.168.0.3
229
 iucs
230
  remote-addr msc
231
 iups
232
  remote-addr sgsn
233
</pre>
234 13 neels
235
h2. OsmoGGSN
236
237 14 neels
To provide packet switched service, OsmoGGSN must offer GTP service to the OsmoSGSN. Notably, both OsmoGGSN and OsmoSGSN must use identical port numbers, which an intrinsic requirement of the GTP protocol. Hence they must not run on the same IP address. It is sufficient to, for example, run OsmoGGSN on 127.0.0.2, and OsmoSGSN's GTP on 127.0.0.1.
238 13 neels
239
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.
240
241
It also needs access to a tun device. 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 'tun4' device has been created ahead of time. IPv4 operation is enabled by default, but for future compatibility, it is good to indicate that explicitly.
242
243
OsmoGGSN furthermore indicates DNS servers, as well as an IPv4 address range to assign to subscribers' PDP contexts.
244 1 neels
245 14 neels
*osmo-ggsn.cfg*
246 13 neels
<pre>
247
ggsn ggsn0
248
 gtp bind-ip 127.0.0.2
249
 apn internet
250
  tun-device tun4
251
  type-support v4
252
  ip dns 0 192.168.100.1
253
  ip dns 1 8.8.8.8
254
  ip ifconfig 176.16.222.0/24
255 1 neels
  ip prefix dynamic 176.16.222.0/24
256 14 neels
</pre>
257
258
h2. OsmoSGSN
259
260
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.
261
262
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).
263
264
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.
265
266
Finally, OsmoSGSN needs access to OsmoHLR to access subscriber data. Set 'auth-policy remote' to use the HLR for subscriber authorization. The default 
267
268
*osmo-sgsn.cfg*
269
<pre>
270
sgsn
271
 gtp local-ip 192.168.0.3
272
 ggsn 0 remote-ip 192.168.0.142
273
 auth-policy remote
274
 gsup remote-ip 127.0.0.1
275 13 neels
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)