Getting Started with 3G » History » Version 2
neels, 02/08/2017 01:58 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 | 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 | * 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. |
||
59 | * osmo-hlr: master |
||
60 | |||
61 | See [[Build from Source]] on build instructions; the git command to get onto a |
||
62 | branch other than 'master' is: |
||
63 | <pre> |
||
64 | git checkout the_branch_name |
||
65 | </pre> |
||
66 | |||
67 | Once the CN stack is built, set up the configuration and launch the core |
||
68 | network components. Find further below example configuration files and a run |
||
69 | script that may help to get you started. Here are some details explained: |
||
70 | |||
71 | Tell the osmo-hnbgw which local IP address to use to listen for Iuh |
||
72 | connections. This needs to be on an interface reachable by the hNodeB. The IuCS |
||
73 | and IuPS links towards the osmo-cscn and osmo-sgsn default to 127.0.0.1 and |
||
74 | 127.0.0.2, respectively, i.e. it's easiest to run osmo-cscn and osmo-sgsn on |
||
75 | the same machine as the osmo-hnbgw. These will listen on the proper port |
||
76 | (14001) without further configuration. |
||
77 | |||
78 | Also tell the MGCPGW (osmo-bsc_mgcp) which local IP address to bind to, which |
||
79 | has to be reachable both by the hNodeB as well as the osmo-cscn process. The |
||
80 | osmo-cscn.cfg is then told where to reach the MGCPGW. |
||
81 | |||
82 | A notable detail for 3G data is that the GGSN has to be reachable by the |
||
83 | hNodeB. Since the GTP standard defines fixed port numbers which both SGSN and |
||
84 | GGSN have to to use, the SGSN may not bind on the same IP address as the GGSN! |
||
85 | |||
86 | Typically this requires to add another IP address to your ethernet interface. |
||
87 | On linux this is achieved, for example, by: |
||
88 | |||
89 | <pre> |
||
90 | sudo ip addr add 10.9.1.13/32 dev eth0 |
||
91 | </pre> |
||
92 | |||
93 | The above adds the address 10.9.1.13 to eth0, which works e.g. when your |
||
94 | machine is in a 10.9.1.0/24 net and the address 10.9.1.13 is not yet taken by |
||
95 | anyone else. (You probably want to use something like 192.168.0.222 instead.) |
||
96 | |||
97 | Also, IP forwarding and masquerading must be enabled for your GGSN to be able |
||
98 | to connect to your mobile phones to the internet uplink. On linux, that can be |
||
99 | done for eth0 by: |
||
100 | |||
101 | <pre> |
||
102 | sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" |
||
103 | sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE |
||
104 | </pre> |
||
105 | |||
106 | You may need a different interface, possibly a wildcard like 'eth*'. |
||
107 | |||
108 | Once you have configured the IP addresses, start up your core network: launch |
||
109 | osmo-cscn, osmo-bsc_mgcp, osmo-sgsn, ggsn and osmo-hnbgw. You should see log |
||
110 | messages indicating established IuCS and IuPS links (HNBGW, CSCN and SGSN). |
||
111 | |||
112 | h2. Core Network Configuration Example |
||
113 | |||
114 | Here is a specific 3G core network configuration example, including a highly |
||
115 | specialized launcher script that configures the network (on a linux system) and |
||
116 | runs all the programs needed for a 3G core network -- but be aware: |
||
117 | |||
118 | *config:* |
||
119 | |||
120 | * This was run in a 192.168.0.1/24 subnet, yours may vary. |
||
121 | * Your femto cell will get itself an IP address from your DHCP server, which |
||
122 | will almost certainly differ from this example. You (so far still) need to |
||
123 | set this address in the mgcp.cfg. |
||
124 | * The ggsn.conf 'listen' address here is the additional interface (ala 'ip addr |
||
125 | add' above) and needs to match whichever address you picked there. |
||
126 | * Make sure all the other IP addresses in the config files match yours. |
||
127 | * Make sure the MCC and MNC match the ones configured in the femto cell. |
||
128 | |||
129 | *run.sh*: |
||
130 | |||
131 | * It assumes the Osmocom libs and programs to be installed in /usr/local/*. |
||
132 | * It launches each component in a separate X terminal. |
||
133 | * It uses rxvt-unicode, you may want to change the @urxvt@ call to your favorite xterm instead. |
||
134 | * Make sure the ethernet interface makes sense. |
||
135 | * Make sure the IP address makes sense. |
||
136 | * Run it in a directory where it will find the various configuration files. |
||
137 | * It runs most of the processes in a gdb for easier debugging. |
||
138 | * Once you hit Enter in the original terminal where you started, all the other |
||
139 | terminals will be torn down in one fell swoop (hopefully). |
||
140 | * *TODO* it doesn't launch osmo-hlr *TODO* (add once the 3G branch is rebased onto the VLR branch) |
||
141 | |||
142 | Now that you've taken notice of the points above, here are the config and |
||
143 | script: attachment:3G-config-example.tar |
||
144 | |||
145 | h1. Femto Config |
||
146 | |||
147 | With your CN up and running, configure the hNodeB to contact osmo-hnbgw via |
||
148 | Iuh. Also make sure the PLMN ID matches the MCC and MNC in the osmo-cscn.cfg -- |
||
149 | otherwise the hNodeB may reject all attach requests. |
||
150 | |||
151 | Depending on your femto cell, the steps to configure it will be radically |
||
152 | different: |
||
153 | |||
154 | * [[Configuring the ip.access nano3G]] |
||
155 | * ... |
||
156 | |||
157 | |||
158 | h1. Subscriber Configuration |
||
159 | |||
160 | For your phone loaded with your USIM to be able to subscribe to your network, |
||
161 | the IMSI needs to be authorized to enter and the authentication keys need to be |
||
162 | added to the HLR. |
||
163 | |||
164 | *TODO* currently, the sysmocom/iu branch has a hardcoded Ki of |
||
165 | 000102030405060708090a0b0c0d0e0f, and you need a SIM card that offers only |
||
166 | non-UMTS pre-R99 authentication. We need to rebase the sysmocom/iu branch onto |
||
167 | the VLR development (neels/vlr) in order to enable full UMTS authentication and |
||
168 | so that sysmoUSIMs added to our OsmoHLR work with our 3G stack. |
||
169 | |||
170 | |||
171 | h1. Further Links |
||
172 | |||
173 | The "3G Voice Works" blog post from 2016 has some explanations: |
||
174 | https://osmocom.org/news/59 |