Project

General

Profile

Osmocom Network In The Box » History » Version 14

neels, 10/20/2017 12:29 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
*osmo-bsc.cfg*
110
<pre>
111
network
112
 network country code 901
113
 mobile network code 70
114
 mm info 1
115
 short name Osmocom
116
 long name Osmocom
117
 auth policy closed
118
 encryption a5 0
119
 bts 0
120
  type sysmobts
121
  band GSM-1800
122
  cell_identity 0
123
  location_area_code 23
124
  ip.access unit_id 1800 0
125
  gprs mode none
126
  trx 0
127
   rf_locked 0
128
   arfcn 868
129
   nominal power 23
130
   timeslot 0
131
    phys_chan_config CCCH+SDCCH4
132
   timeslot 1
133
    phys_chan_config SDCCH8
134
   timeslot 2
135
    phys_chan_config TCH/H
136
   timeslot 3
137
    phys_chan_config TCH/H
138
   timeslot 4
139
    phys_chan_config TCH/H
140
   timeslot 5
141
    phys_chan_config TCH/H
142
   timeslot 6
143
    phys_chan_config TCH/H
144
   timeslot 7
145
    phys_chan_config TCH/H
146
cs7 instance 0
147
 ! osmo-bsc's own point code
148
 point-code 0.42.0
149
 ! address book entry named 'msc_remote', used below
150
 sccp-address msc_remote
151
  point-code 0.23.1
152
msc 0
153
 msc-addr msc_remote
154
</pre>
155 12 neels
156
h2. OsmoHNBGW
157
158
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.
159
160
OsmoHNBGW needs to connect to OsmoSTP for routing, and needs to know the MSC and SGSN point codes. It must also be reachable by the hNodeB, hence it must typically run on a public IP, not a loopback address like 127.0.0.1.
161
162
*osmo-hnbgw.cfg*
163
<pre>
164
cs7 instance 0
165
 ! OsmoHNBGW's own local point code
166
 point-code 0.3.0
167
 ! Address book entries, used below
168
 sccp-address msc
169
  point-code 0.23.1
170
 sccp-address sgsn
171
  point-code 0.23.2
172
hnbgw
173
 iuh
174
  local-ip 192.168.0.3
175
 iucs
176
  remote-addr msc
177
 iups
178
  remote-addr sgsn
179
</pre>
180 13 neels
181
h2. OsmoGGSN
182
183 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.
184 13 neels
185
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.
186
187
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.
188
189
OsmoGGSN furthermore indicates DNS servers, as well as an IPv4 address range to assign to subscribers' PDP contexts.
190 1 neels
191 14 neels
*osmo-ggsn.cfg*
192 13 neels
<pre>
193
ggsn ggsn0
194
 gtp bind-ip 127.0.0.2
195
 apn internet
196
  tun-device tun4
197
  type-support v4
198
  ip dns 0 192.168.100.1
199
  ip dns 1 8.8.8.8
200
  ip ifconfig 176.16.222.0/24
201 1 neels
  ip prefix dynamic 176.16.222.0/24
202 14 neels
</pre>
203
204
h2. OsmoSGSN
205
206
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.
207
208
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).
209
210
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.
211
212
Finally, OsmoSGSN needs access to OsmoHLR to access subscriber data. Set 'auth-policy remote' to use the HLR for subscriber authorization. The default 
213
214
*osmo-sgsn.cfg*
215
<pre>
216
sgsn
217
 gtp local-ip 192.168.0.3
218
 ggsn 0 remote-ip 192.168.0.142
219
 auth-policy remote
220
 gsup remote-ip 127.0.0.1
221 13 neels
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)