Project

General

Profile

Getting Started with 3G » History » Version 13

neels, 03/04/2017 03:34 AM

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