Project

General

Profile

Wiki » History » Version 2

neels, 02/24/2017 02:04 PM

1 1 laforge
h1. OsmoHNBGW
2 1 laforge
3 1 laforge
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 1 laforge
5 1 laforge
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 1 laforge
7 1 laforge
Here is an ASCII art overview of our current aim:
8 1 laforge
<pre>
9 1 laforge
        +------------+           +--------+          +----------+
10 2 neels
 UE <-->| hNodeB     |<--Iuh---->| HNB-GW |<--IuCS-->| OsmoMSC  |
11 1 laforge
 UE <-->| femto cell |     ...-->|        |    ...-->|          |
12 1 laforge
        |            |           |        |          +----------+
13 1 laforge
        +------------+<--GTP-U   |        |
14 1 laforge
                              \  |        |          +------+           +------+
15 1 laforge
                              |  |        |<--IuPS-->| SGSN |<--GTP-C-->| GGSN |
16 1 laforge
                              |  +--------+    ...-->|      |   GTP-U-->|      |
17 1 laforge
                              |                      +------+  /        +------+
18 1 laforge
                              \_______________________________/
19 1 laforge
20 1 laforge
21 1 laforge
                      Iuh                         IuCS/IuPS
22 1 laforge
23 1 laforge
NAS                   +----+----+                 +----+----+
24 1 laforge
Non-Access Stratum    | CC | MM |                 | CC | MM |
25 1 laforge
- - - - - - - - - - - +----+----+-------+         +----+----+
26 1 laforge
                      | RANAP   |       |    H    | RANAP   |
27 1 laforge
Access Stratum        +---------+ HNBAP |    N    +---------+ - - SCCP USER SAP
28 1 laforge
                      | RUA     |       |    B    | SUA     |  \
29 1 laforge
                      +---------+-------+    -    +---------+  |
30 1 laforge
                      |        SCTP     |    G    | SCTP    |  } SIGTRAN
31 1 laforge
                      +-----------------+    W    +---------+  |
32 1 laforge
                      |        IP       |         | IP      |  /
33 1 laforge
                      +-----------------+         +---------+
34 1 laforge
</pre>
35 1 laforge
36 1 laforge
UE (User Endpoint) == MS (Mobile Subscriber) == mobile device
37 1 laforge
(Source: ​http://git.osmocom.org/osmo-iuh/tree/doc/protocols_around_hnbgw.txt )
38 1 laforge
39 1 laforge
40 1 laforge
h2. 3G in a Nutshell
41 1 laforge
42 1 laforge
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.
43 1 laforge
44 1 laforge
h3. HNB-GW
45 1 laforge
46 2 neels
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 OsmoMSC or the OsmoSGSN. The HNB-GW is implemented in osmo-iuh/src/hnbgw.c, compiling as osmo-hnbgw, and is (mostly?) complete.
47 1 laforge
48 1 laforge
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.
49 1 laforge
50 1 laforge
h3. HNBAP
51 1 laforge
52 1 laforge
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.
53 1 laforge
54 1 laforge
h3. SIGTRAN
55 1 laforge
56 1 laforge
Typically, the IuCS and IuPS interfaces would talk this layering of protocols:
57 1 laforge
<pre>
58 1 laforge
  CC/MM
59 1 laforge
  RANAP
60 1 laforge
  SCCP  <--- note
61 1 laforge
  M3UA  <--- note
62 1 laforge
  SCTP
63 1 laforge
  IP
64 1 laforge
</pre>
65 1 laforge
66 1 laforge
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).
67 1 laforge
68 1 laforge
However, since SUA does the same as SCCP-over-M3UA and is simpler to implement, our HNB-GW talks SUA towards IuCS and IuPS:
69 1 laforge
<pre>
70 1 laforge
  CC/MM
71 1 laforge
  RANAP
72 1 laforge
  SUA   <--- note
73 1 laforge
  SCTP
74 1 laforge
  IP
75 1 laforge
</pre>
76 1 laforge
77 1 laforge
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]).
78 1 laforge
79 1 laforge
Various SIGTRAN implementations:
80 1 laforge
<pre>
81 1 laforge
                IuCS/IuPS
82 1 laforge
                  usual
83 1 laforge
                   |     simplest
84 1 laforge
                   |       |
85 1 laforge
                   v       v
86 1 laforge
  +------+------+------+-----+
87 1 laforge
  | SCCP | SCCP |      |     |
88 1 laforge
  +------+------+ SCCP |     |
89 1 laforge
  | MTP3 | MTP3 |      |     |
90 1 laforge
  +------+------+------+ SUA |
91 1 laforge
  | MTP2 |      |      |     |
92 1 laforge
  +------+ M2UA | M3UA |     |
93 1 laforge
  | M2PA |      |      |     |
94 1 laforge
  +------+------+------+-----+
95 1 laforge
  |           SCTP           |
96 1 laforge
  +--------------------------+
97 1 laforge
  |            IP            |
98 1 laforge
  +--------------------------+
99 1 laforge
</pre>
100 1 laforge
101 1 laforge
h3. ASN1 Convolutions
102 1 laforge
103 1 laforge
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.
104 1 laforge
105 1 laforge
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).
106 1 laforge
107 1 laforge
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/.
108 1 laforge
109 1 laforge
It could be more beautiful, but the bottom line is that we now have fully free/libre support for Iuh ASN1 encodings. Cheers!
110 1 laforge
111 1 laforge
h2. Conclusion
112 1 laforge
113 1 laforge
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!
114 1 laforge
115 1 laforge
h2. External References
116 1 laforge
117 1 laforge
fn1. ​http://www.sysmocom.de 
118 1 laforge
119 1 laforge
fn2. ​https://media.ccc.de/v/32c3-7412-running_your_own_3g_3_5g_network
120 1 laforge
 
121 1 laforge
fn3. ​http://git.osmocom.org/erlang/osmo_ss7
122 1 laforge
123 1 laforge
fn4. ​http://www.eurecom.fr 
124 1 laforge
125 1 laforge
fn5. See ​http://git.osmocom.org/libasn1c/ and ​http://git.osmocom.org/asn1c/log/?h=aper-prefix