Project

General

Profile

Getting Started with 3G » History » Version 16

neels, 03/07/2017 03:30 PM

1 1 neels
{{>toc}}
2
3
h1. Getting Started with 3G
4
5 14 neels
_This reflects the state of Osmocom 3G development on 2017-03-04_
6 1 neels
7 5 neels
If you have your 3G femto cell[1], this is how to get started:
8 1 neels
9
The physical setup is:
10
11
<pre>
12
  _____________              _____________
13
  |           |              |           |
14
  | femto     |<--Ethernet-->| Laptop/PC |
15
  |___________|              |___________|
16
17
</pre>
18
19
On the protocol layer, the femto cell is the hNodeB and talks to various core
20
network elements over the ethernet cable, typically all located on your
21
computer, and talks to the phone (UE) over the air:
22
23
<pre>
24
                                 +--------+
25
                             ,-->| Osmo   |
26
                            /    | MGCPGW |
27
                            |    |        |<--MGCP
28
                            |    +--------+       \
29
                            /                     |
30
        +------------+<--RTP     +--------+       `->+----------+
31 4 neels
 UE <-->| hNodeB     |           | Osmo   |          | OsmoMSC  |        +------+
32 1 neels
 UE <-->|            |<--Iuh---->| HNB-GW |<--IuCS-->|          |        | Osmo |
33
        |            |           |        |          |     (VLR)|<-GSUP->| HLR  |
34
        |            |           |        |          +----------+  GSUP->+------+
35
        +------------+<--GTP-U   |        |                       /
36
                              \  |        |          +------+<---'       +------+
37
                              |  |        |<--IuPS-->| Osmo |<--GTP-C--->| Open |
38
                              |  +--------+          | SGSN |   GTP-U--->| GGSN |
39
                              |                      +------+  /         +------+
40
                              \_______________________________/
41
42
</pre>
43
44
h1. Core Network
45
46
To get your 3G core network up and running, you need to manually build specific
47 2 neels
branches from various Osmocom projects:
48 1 neels
49
* libosmocore: master
50
* libosmo-abis: master
51
* libosmo-netif: sysmocom/sctp
52
* libosmo-sccp: sysmocom/iu
53
* libsmpp34: master
54
* asn1c: aper-prefix-onto-upstream
55
* libasn1c: master
56
* osmo-iuh: master
57
* openggsn: master
58 12 neels
* openbsc: sysmocom/iu -- *Be aware that this branch may still be rebased frequently until things have settled.*
59 1 neels
* osmo-hlr: master
60
61 11 neels
The git command to get onto a branch other than 'master' is:
62 1 neels
<pre>
63
git checkout the_branch_name
64
</pre>
65
66 14 neels
See [[Build from Source]] on build instructions
67
(remember to pass _--enable-iu_ for openbsc's _./configure_ step).
68 11 neels
69 1 neels
Once the CN stack is built, set up the configuration and launch the core
70
network components. Find further below example configuration files and a run
71
script that may help to get you started. Here are some details explained:
72
73
Tell the osmo-hnbgw which local IP address to use to listen for Iuh
74
connections. This needs to be on an interface reachable by the hNodeB. The IuCS
75 4 neels
and IuPS links towards the osmo-msc and osmo-sgsn default to 127.0.0.1 and
76
127.0.0.2, respectively, i.e. it's easiest to run osmo-msc and osmo-sgsn on
77 1 neels
the same machine as the osmo-hnbgw. These will listen on the proper port
78
(14001) without further configuration.
79
80
Also tell the MGCPGW (osmo-bsc_mgcp) which local IP address to bind to, which
81 4 neels
has to be reachable both by the hNodeB as well as the osmo-msc process. The
82
osmo-msc.cfg is then told where to reach the MGCPGW.
83 1 neels
84
A notable detail for 3G data is that the GGSN has to be reachable by the
85
hNodeB. Since the GTP standard defines fixed port numbers which both SGSN and
86
GGSN have to to use, the SGSN may not bind on the same IP address as the GGSN!
87
88
Typically this requires to add another IP address to your ethernet interface.
89
On linux this is achieved, for example, by:
90
91
<pre>
92
sudo ip addr add 10.9.1.13/32 dev eth0
93
</pre>
94
95
The above adds the address 10.9.1.13 to eth0, which works e.g. when your
96
machine is in a 10.9.1.0/24 net and the address 10.9.1.13 is not yet taken by
97
anyone else. (You probably want to use something like 192.168.0.222 instead.)
98
99
Also, IP forwarding and masquerading must be enabled for your GGSN to be able
100
to connect to your mobile phones to the internet uplink. On linux, that can be
101
done for eth0 by:
102
103
<pre>
104
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
105
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
106
</pre>
107
108
You may need a different interface, possibly a wildcard like 'eth*'.
109
110 5 neels
The GGSN needs permissions to create a @tun@ device, which @sudo@ will allow.
111
It may be safer though to allow your user to create tunnels instead of running
112
the GGSN as root.
113
114
If programs complain about missing library @.so@ files, you will probably need
115
to @export LD_LIBRARY_PATH=/usr/local/lib@. With sudo that would be @sudo
116
LD_LIBRARY_PATH=/usr/local/lib ggsn ...@, and you may need to add "SETENV" to
117
your sudoers config -- see the sudo documentation.
118
119 1 neels
Once you have configured the IP addresses, start up your core network: launch
120 4 neels
osmo-msc, osmo-bsc_mgcp, osmo-sgsn, ggsn and osmo-hnbgw. You should see log
121
messages indicating established IuCS and IuPS links (HNBGW, MSC and SGSN).
122 1 neels
123
h2. Core Network Configuration Example
124
125
Here is a specific 3G core network configuration example, including a highly
126
specialized launcher script that configures the network (on a linux system) and
127
runs all the programs needed for a 3G core network -- but be aware:
128
129
*config:*
130
131
* This was run in a 192.168.0.1/24 subnet, yours may vary.
132
* Your femto cell will get itself an IP address from your DHCP server, which
133
  will almost certainly differ from this example. You (so far still) need to
134
  set this address in the mgcp.cfg.
135
* The ggsn.conf 'listen' address here is the additional interface (ala 'ip addr
136
  add' above) and needs to match whichever address you picked there.
137
* Make sure all the other IP addresses in the config files match yours.
138
* Make sure the MCC and MNC match the ones configured in the femto cell.
139
140
*run.sh*:
141
142
* It assumes the Osmocom libs and programs to be installed in /usr/local/*.
143
* It launches each component in a separate X terminal.
144
* It uses rxvt-unicode, you may want to change the @urxvt@ call to your favorite xterm instead.
145
* Make sure the ethernet interface makes sense.
146
* Make sure the IP address makes sense.
147
* Run it in a directory where it will find the various configuration files.
148
* It runs most of the processes in a gdb for easier debugging.
149
* Once you hit Enter in the original terminal where you started, all the other
150
  terminals will be torn down in one fell swoop (hopefully).
151
* *TODO* it doesn't launch osmo-hlr *TODO* (add once the 3G branch is rebased onto the VLR branch)
152
153
Now that you've taken notice of the points above, here are the config and
154 15 neels
script: attachment:3G-config-example-v3.tar
155 5 neels
156 1 neels
h1. Femto Config
157
158
With your CN up and running, configure the hNodeB to contact osmo-hnbgw via
159 4 neels
Iuh. Also make sure the PLMN ID matches the MCC and MNC in the osmo-msc.cfg --
160 1 neels
otherwise the hNodeB may reject all attach requests.
161
162
Depending on your femto cell, the steps to configure it will be radically
163
different:
164
165
* [[Configuring the ip.access nano3G]]
166
* ...
167
168
h1. Subscriber Configuration
169
170
For your phone loaded with your USIM to be able to subscribe to your network,
171
the IMSI needs to be authorized to enter and the authentication keys need to be
172
added to the HLR.
173
174 16 neels
*NOTE*: *sysmoUSIM-SJS1 will work only from SQN=32 onwards.*
175
(see https://osmocom.org/issues/1965#note-13  #1965-13)
176
Set all SQN to >= 32 in your hlr.db:
177
<pre>
178
$ sqlite3 hlr.db
179
sqlite3> update auc_3g set sqn = 32 where sqn < 32;
180
</pre>
181
(Also remember to set sqn = 32 for any new subscriber you add to your db.)
182
183
As soon as we resolved #1968 and #1969, this will work automatically,
184
but so far you need to set sqn = 32 manually to get started.
185 1 neels
186 5 neels
h1. APN for Data Service
187 1 neels
188 6 neels
For the 3G data service to work, phones generally need an APN added to their
189 5 neels
configuration, or they will not even attempt to establish a data connection.
190
For the Osmocom 3G CN, any arbitrary APN name will do.
191
192
The APN configuration steps are usually similar to:
193
194
* Navigate to APN settings:
195
** 'Settings'
196
** 'Wireless & Networks'
197
** 'Mobile networks'
198
** 'Access Point Names'
199
* You should see the list of APNs (possibly empty)
200
* Press the Menu button
201
* Choose 'New APN'
202
* Enter values for 'Name' as well as 'APN'
203
** For both, any nonempty value is sufficient, e.g. "test".
204
* Again press the Menu button
205
* Choose 'Save'
206
* The APN should now appear in the list of APNs.
207
* Possibly tap the bullet icon to select the APN as default.
208
209 1 neels
h1. Further Links
210
211
The "3G Voice Works" blog post from 2016 has some explanations:
212
https://osmocom.org/news/59
213
214 9 neels
With almost any question, you can go back to the 3GPP specs. Here is a list of which is for what:
215
* [[GSMStandards]]
216
* and [[Interesting3GPPSpecsForDevelopers]]
217
218 3 neels
h1. Tips and Facts
219
220
h3. Analyzing RTP streams in wireshark
221
222
IuCS actually uses UP over RTP. See 3GPP TS 25.414, and 25.415 6.6.2.
223
(an interesting insight is https://www.ietf.org/mail-archive/web/avt/current/msg05907.html )
224
225
In the wireshark preferences, go to protocol IuUP, enable it and enter the dynamic protocol
226 1 neels
number that you see in the RTP frames (e.g. 96).
227
228 5 neels
h1. Help
229
230
If you experience problems you may ask for assistance on our
231
"mailing list":https://lists.osmocom.org/mailman/listinfo/openbsc.
232
233
------
234
235
fn1. For details on obtaining suitable 3G hardware, you can ask at info@sysmocom.de
236
or on our "mailing list":https://lists.osmocom.org/mailman/listinfo/openbsc.
Add picture from clipboard (Maximum size: 48.8 MB)