Project

General

Profile

OsmoHNBGW » History » Version 1

laforge, 02/21/2016 08:16 PM

1 1 laforge
h1. OsmoHNBGW
2
3
We are implementing Iuh support in the Osmocom stack, mostly carried out by employees of sysmocom GmbH[1], with highly appreciated (yet undisclosed) external backing.
4
5
Iu support in Osmocom will allow using a femto-cell aka hNodeB as BTS, thus enabling UMTS voice (IuCS) and data (IuPS) connectivity using FOSS software from the core network right up to the femto-cell's ethernet jack.
6
7
Here is an ASCII art overview of our current aim:
8
<pre>
9
        +------------+           +--------+          +----------+
10
 UE <-->| hNodeB     |<--Iuh---->| HNB-GW |<--IuCS-->| OsmoCSCN |
11
 UE <-->| femto cell |     ...-->|        |    ...-->|          |
12
        |            |           |        |          +----------+
13
        +------------+<--GTP-U   |        |
14
                              \  |        |          +------+           +------+
15
                              |  |        |<--IuPS-->| SGSN |<--GTP-C-->| GGSN |
16
                              |  +--------+    ...-->|      |   GTP-U-->|      |
17
                              |                      +------+  /        +------+
18
                              \_______________________________/
19
20
21
                      Iuh                         IuCS/IuPS
22
23
NAS                   +----+----+                 +----+----+
24
Non-Access Stratum    | CC | MM |                 | CC | MM |
25
- - - - - - - - - - - +----+----+-------+         +----+----+
26
                      | RANAP   |       |    H    | RANAP   |
27
Access Stratum        +---------+ HNBAP |    N    +---------+ - - SCCP USER SAP
28
                      | RUA     |       |    B    | SUA     |  \
29
                      +---------+-------+    -    +---------+  |
30
                      |        SCTP     |    G    | SCTP    |  } SIGTRAN
31
                      +-----------------+    W    +---------+  |
32
                      |        IP       |         | IP      |  /
33
                      +-----------------+         +---------+
34
</pre>
35
36
UE (User Endpoint) == MS (Mobile Subscriber) == mobile device
37
CSCN (Circuit Switched Core Network) == OsmoNITB without BSC
38
(Source: ​http://git.osmocom.org/osmo-iuh/tree/doc/protocols_around_hnbgw.txt )
39
40
41
h2. 3G in a Nutshell
42
43
Let me illustrate some details of the Iu interfaces. The following is basically Harald's 3G talk at the 32c3[2], but with the sheer abundance of complexity it can't hurt to read it in prose.
44
45
h3. HNB-GW
46
47
The HNB-GW, i.e. the HomeNodeB Gateway, merely reads the CN-DomainIndicator from the RUA layer, which says whether the frame is for voice or data comms (IuCS or IuPS). It then sends the actual RANAP payload either to the OsmoCSCN or the OsmoSGSN. The HNB-GW is implemented in osmo-iuh/src/hnbgw.c, compiling as osmo-hnbgw, and is (mostly?) complete.
48
49
An interesting factoid is that for an hNodeB, the GTP-Control handshaking goes via the HNB-GW, while the packet user data actually goes directly to/from the hNodeB and the GGSN.
50
51
h3. HNBAP
52
53
HNBAP is merely the protocol employed to register an hNodeB with the HomeNodeB Gateway. After HNBAP is done, the hNodeB sends RANAP-over-RUA, which the HNB-GW happily passes on to the proper consumers.
54
55
h3. SIGTRAN
56
57
Typically, the IuCS and IuPS interfaces would talk this layering of protocols:
58
<pre>
59
  CC/MM
60
  RANAP
61
  SCCP  <--- note
62
  M3UA  <--- note
63
  SCTP
64
  IP
65
</pre>
66
67
We do have SCCP support in Osmocom, but so far only for "connectionless" messages (like your standard UDP datagrams). Iu now adds the need for establishing and tearing down connections (like TCP).
68
69
However, since SUA does the same as SCCP-over-M3UA and is simpler to implement, our HNB-GW talks SUA towards IuCS and IuPS:
70
<pre>
71
  CC/MM
72
  RANAP
73
  SUA   <--- note
74
  SCTP
75
  IP
76
</pre>
77
78
To support third-party MSC and SGSN components, we would either add SCCP-over-M3UA capability, or simply use an external signalling gateway that supports both M3UA and SUA (should be possible e.g. with osmo_ss7[3]).
79
80
Various SIGTRAN implementations:
81
<pre>
82
                IuCS/IuPS
83
                  usual
84
                   |     simplest
85
                   |       |
86
                   v       v
87
  +------+------+------+-----+
88
  | SCCP | SCCP |      |     |
89
  +------+------+ SCCP |     |
90
  | MTP3 | MTP3 |      |     |
91
  +------+------+------+ SUA |
92
  | MTP2 |      |      |     |
93
  +------+ M2UA | M3UA |     |
94
  | M2PA |      |      |     |
95
  +------+------+------+-----+
96
  |           SCTP           |
97
  +--------------------------+
98
  |            IP            |
99
  +--------------------------+
100
</pre>
101
102
h3. ASN1 Convolutions
103
104
RANAP, RUA and HNBAP, which make up the Iuh interface, are ASN1 encoded. Fair enough, but their ASN1 encoding uses APER, and heavily employs Information Object Classes (which basically means it wraps ASN1 encoded binary data in ASN1 IEs, with several levels of depth). In consequence, the libre asn1c compiler as-is unfortunately is not capable of generating de-/encoders for UMTS. The proprietary ffasn1c is capable of that, and we could publish the ffasn1c generated code without licensing problems, but we'd highly prefer to empower the FOSS community with the ability to modify and fix the ASN1 de-/encoders independently of proprietary software.
105
106
The great news is that Eurecom[4] has worked on supporting both APER and the nested ASN1 structures ("Information Object Classes") in asn1c, and we are able to use their solutions in a FOSS way. With some fixes added, we have both their APER support and their pythonic solution for nested ASN1 available in Osmocom's libasn1c and asn1c git repositories (5).
107
108
Another problem with the Iuh ASN1 is that various type names are identical across RANAP, RUA and HNBAP, while their encodings differ. This causes type name collisions in the code generated by asn1c, hence we have added prefixing support to our version of asn1c. This simply means that each RANAP-related type name or function begins with "ranap_", and RUA names begin with "rua_", thus avoiding any and all name collisions between those protocols. See osmo-iuh/include/osmocom/ranap/ and ../rua/.
109
110
It could be more beautiful, but the bottom line is that we now have fully free/libre support for Iuh ASN1 encodings. Cheers!
111
112
h2. Conclusion
113
114
Osmocom is on a clear trajectory towards full 3G support, empowering remote communities and small to medium businesses worldwide. Work is ongoing, but the really hard problems have already been solved. Stay tuned!
115
116
h2. External References
117
118
fn1. ​http://www.sysmocom.de 
119
120
fn2. ​https://media.ccc.de/v/32c3-7412-running_your_own_3g_3_5g_network
121
 
122
fn3. ​http://git.osmocom.org/erlang/osmo_ss7
123
124
fn4. ​http://www.eurecom.fr 
125
126
fn5. See ​http://git.osmocom.org/libasn1c/ and ​http://git.osmocom.org/asn1c/log/?h=aper-prefix
Add picture from clipboard (Maximum size: 48.8 MB)