Project

General

Profile

Getting Started with 3G » History » Version 1

neels, 02/08/2017 01:19 AM

1 1 neels
{{>toc}}
2
3
h1. Getting Started with 3G
4
5
_This reflects the state of Osmocom 3G development on 2017-02-08_
6
7
If you have your 3G femto cell, this is how to get started:
8
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
 UE <-->| hNodeB     |           | Osmo   |          | OsmoCSCN |        +------+
32
 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
45
h1. Core Network
46
47
To get your 3G core network up and running, you need to manually build specific
48
branches from various the Osmocom projects:
49
50
* libosmocore: master
51
* libosmo-abis: master
52
* libosmo-netif: sysmocom/sctp
53
* libosmo-sccp: sysmocom/iu
54
* libsmpp34: master
55
* asn1c: aper-prefix-onto-upstream
56
* libasn1c: master
57
* osmo-iuh: master
58
* openggsn: master
59
* openbsc: sysmocom/iu -- *DISCLAIMER!* This branch is not yet capable of talking to OsmoHLR and thus no true UMTS (3G) Authentication is possible yet; should be coming soon.
60
* osmo-hlr: master
61
62
See [[Build from Source]] on build instructions; the git command to get onto a
63
branch other than 'master' is:
64
<pre>
65
git checkout the_branch_name
66
</pre>
67
68
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
and IuPS links towards the osmo-cscn and osmo-sgsn default to 127.0.0.1 and
75
127.0.0.2, respectively, i.e. it's easiest to run osmo-cscn and osmo-sgsn on
76
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
has to be reachable both by the hNodeB as well as the osmo-cscn process. The
81
osmo-cscn.cfg is then told where to reach the MGCPGW.
82
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
Once you have configured the IP addresses, start up your core network: launch
110
osmo-cscn, osmo-bsc_mgcp, osmo-sgsn, ggsn and osmo-hnbgw. You should see log
111
messages indicating established IuCS and IuPS links (HNBGW, CSCN and SGSN).
112
113
h2. Core Network Configuration Example
114
115
Here is a specific 3G core network configuration example, including a highly
116
specialized launcher script that configures the network (on a linux system) and
117
runs all the programs needed for a 3G core network -- but be aware:
118
119
*config:*
120
121
* This was run in a 192.168.0.1/24 subnet, yours may vary.
122
* Your femto cell will get itself an IP address from your DHCP server, which
123
  will almost certainly differ from this example. You (so far still) need to
124
  set this address in the mgcp.cfg.
125
* The ggsn.conf 'listen' address here is the additional interface (ala 'ip addr
126
  add' above) and needs to match whichever address you picked there.
127
* Make sure all the other IP addresses in the config files match yours.
128
* Make sure the MCC and MNC match the ones configured in the femto cell.
129
130
*run.sh*:
131
132
* It assumes the Osmocom libs and programs to be installed in /usr/local/*.
133
* It launches each component in a separate X terminal.
134
* It uses rxvt-unicode, you may want to change the @urxvt@ call to your favorite xterm instead.
135
* Make sure the ethernet interface makes sense.
136
* Make sure the IP address makes sense.
137
* Run it in a directory where it will find the various configuration files.
138
* It runs most of the processes in a gdb for easier debugging.
139
* Once you hit Enter in the original terminal where you started, all the other
140
  terminals will be torn down in one fell swoop (hopefully).
141
* *TODO* it doesn't launch osmo-hlr *TODO* (add once the 3G branch is rebased onto the VLR branch)
142
143
Now that you've taken notice of the points above, here are the config and
144
script: attachment:3G-config-example.tar
145
146
h1. Femto Config
147
148
With your CN up and running, configure the hNodeB to contact osmo-hnbgw via
149
Iuh. Also make sure the PLMN ID matches the MCC and MNC in the osmo-cscn.cfg --
150
otherwise the hNodeB may reject all attach requests.
151
152
Depending on your femto cell, the steps to configure it will be radically
153
different:
154
155
* [[Configuring the ip.access nano3G]]
156
* ...
157
158
159
h1. Subscriber Configuration
160
161
For your phone loaded with your USIM to be able to subscribe to your network,
162
the IMSI needs to be authorized to enter and the authentication keys need to be
163
added to the HLR.
164
165
*TODO* currently, the sysmocom/iu branch has a hardcoded Ki of
166
000102030405060708090a0b0c0d0e0f, and you need a SIM card that offers only
167
non-UMTS pre-R99 authentication. We need to rebase the sysmocom/iu branch onto
168
the VLR development (neels/vlr) in order to enable full UMTS authentication and
169
so that sysmoUSIMs added to our OsmoHLR work with our 3G stack.
170
171
172
h1. Further Links
173
174
The "3G Voice Works" blog post from 2016 has some explanations:
175
https://osmocom.org/news/59
Add picture from clipboard (Maximum size: 48.8 MB)