Project

General

Profile

OsmoHNBGW » History » Version 13

neels, 08/12/2022 10:56 PM

1 1 laforge
h1. OsmoHNBGW
2 8 fixeria
3
{{>toc}}
4 1 laforge
5 4 laforge
We have implemented 3GPP Iuh support in the Osmocom stack, mostly carried out by employees of sysmocom GmbH[1], with highly appreciated (yet undisclosed) external backing.
6 1 laforge
7
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.
8
9 13 neels
Here is an overview of HNBGW operation:
10 1 laforge
11 13 neels
{{graphviz_link()
12 1 laforge
13 13 neels
digraph G {
14
  rankdir = LR;
15
  
16
  UE [label="UE\n(3G phone)"]
17
  PBX [label="PBX\nAsterisk, FreeSwitch,\nKamailio, Yate, ..."]
18
19
  subgraph cluster_msc_mgw {
20
    style=dotted
21
    MSC
22
    MGW1 [label="MGW"]
23
    MSC -> MGW1 [label="MGCP",constraint=false]
24
  }
25
26
  subgraph cluster_hnbgw_mgw_upf {
27
    style=dotted
28
    MGW3 [label="MGW"]
29
    UPF
30
    HNBGW
31
    HNBGW -> MGW3 [label="MGCP",constraint=false]
32
    HNBGW -> UPF [label="PFCP",constraint=false]
33
  }
34
35
  hNodeB [shape="box",label="hNodeB\n(3G femto cell)"]
36
37
  MSC -> HLR [label="\nGSUP",style=bold]
38
  SGSN -> HLR [label="GSUP",style="dashed,bold"]
39
  UE -> hNodeB [label="Uu",style=bold]
40
  UE -> hNodeB [style="dashed,bold"]
41
  hNodeB -> HNBGW [label="Iuh",style="bold"]
42
  STP2 [label="STP\n(SCCP/M3UA)"]
43
  HNBGW -> STP2 -> SGSN [label="IuPS",style="dashed,bold"]
44
  HNBGW -> STP2 -> MSC [label="IuCS",style="bold"]
45
  SGSN -> GGSN [label="GTP-C",style="dashed,bold"]
46
  hNodeB -> UPF -> GGSN [label="GTP-U(3G)",style="dashed"]
47
  GGSN -> internet [label="tun",style="dashed"]
48
49
  hNodeB -> MGW3 [label="IuUP/RTP",constraint=false]
50
  MGW3 -> MGW1 [label="IuUP/RTP"]
51
52
  MSC -> SIPConnector [label="MNCC socket",style=bold]
53
54
  SIPConnector -> PBX [label="SIP",style=bold]
55
  MGW1 -> PBX [label="RTP"]
56
57
  A, B, C, D [style="invisible"]
58
  A -> B [label="data (PS)",style="dashed"]
59
  C -> D [label="voice/SMS/USSD (CS)"]
60
61
}
62
63
}}
64
65
<pre>
66 1 laforge
                      Iuh                         IuCS/IuPS
67
68
NAS                   +----+----+                 +----+----+
69
Non-Access Stratum    | CC | MM |                 | CC | MM |
70
- - - - - - - - - - - +----+----+-------+         +----+----+
71
                      | RANAP   |       |    H    | RANAP   |
72
Access Stratum        +---------+ HNBAP |    N    +---------+ - - SCCP USER SAP
73 13 neels
                      | RUA     |       |    B    | M3UA    |  \
74 1 laforge
                      +---------+-------+    -    +---------+  |
75
                      |        SCTP     |    G    | SCTP    |  } SIGTRAN
76
                      +-----------------+    W    +---------+  |
77
                      |        IP       |         | IP      |  /
78
                      +-----------------+         +---------+
79
</pre>
80
81
UE (User Endpoint) == MS (Mobile Subscriber) == mobile device
82 11 laforge
(Source: https://gitea.osmocom.org/cellular-infrastructure/osmo-hnbgw/src/branch/master/doc/protocols_around_hnbgw.txt)
83 1 laforge
84 3 laforge
{{include(cellular-infrastructure:MacroBinaryPackages)}}
85
86 1 laforge
87
h2. 3G in a Nutshell
88
89
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.
90
91
h3. HNB-GW
92
93 10 pespin
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-hnbgw/src/osmo-hnbgw/hnbgw.c, compiling as osmo-hnbgw, and is (mostly?) complete.
94 1 laforge
95
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.
96
97
h3. HNBAP
98
99
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.
100
101
h3. SIGTRAN
102
103
Typically, the IuCS and IuPS interfaces would talk this layering of protocols:
104
<pre>
105
  CC/MM
106
  RANAP
107
  SCCP  <--- note
108
  M3UA  <--- note
109
  SCTP
110
  IP
111
</pre>
112
113
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).
114
115
However, since SUA does the same as SCCP-over-M3UA and is simpler to implement, our HNB-GW talks SUA towards IuCS and IuPS:
116
<pre>
117
  CC/MM
118
  RANAP
119
  SUA   <--- note
120
  SCTP
121
  IP
122
</pre>
123
124
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]).
125
126
Various SIGTRAN implementations:
127
<pre>
128
                IuCS/IuPS
129
                  usual
130
                   |     simplest
131
                   |       |
132
                   v       v
133
  +------+------+------+-----+
134
  | SCCP | SCCP |      |     |
135
  +------+------+ SCCP |     |
136
  | MTP3 | MTP3 |      |     |
137
  +------+------+------+ SUA |
138
  | MTP2 |      |      |     |
139
  +------+ M2UA | M3UA |     |
140
  | M2PA |      |      |     |
141
  +------+------+------+-----+
142
  |           SCTP           |
143
  +--------------------------+
144
  |            IP            |
145
  +--------------------------+
146
</pre>
147
148
h3. ASN1 Convolutions
149
150
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.
151
152
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).
153
154
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/.
155
156
It could be more beautiful, but the bottom line is that we now have fully free/libre support for Iuh ASN1 encodings. Cheers!
157
158
h2. Conclusion
159
160
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!
161
162 5 laforge
{{include(cellular-infrastructure:MacroBinaryPackages)}}
163
164
h2. Manuals
165
166 6 daniel
No HNB-GW user manual yet, sorry.  See #2588
167
* osmo-hnbgw VTY Reference: https://ftp.osmocom.org/docs/latest/osmohnbgw-vty-reference.pdf
168
169 5 laforge
170
h2. Source code
171
172 11 laforge
The source code is available from @gitea.osmocom.org@ (module @osmo-hnbgw@).
173 5 laforge
174
Public read-only access is available via
175
<pre>
176 11 laforge
git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-hnbgw.git
177 5 laforge
</pre>
178
179 11 laforge
You can browse it via gitea: https://gitea.osmocom.org/cellular-infrastructure/osmo-hnbgw
180 5 laforge
181 1 laforge
Contributions are welcome via [[cellular-infrastructure:Gerrit]].
182 5 laforge
183
h2. Test Suite
184
185 12 laforge
* Source code: https://gitea.osmocom.org/ttcn3/osmo-ttcn3-hacks/src/branch/master/hnbgw
186
* Test results: https://jenkins.osmocom.org/jenkins/job/ttcn3-hnbgw-test/
187 5 laforge
188 1 laforge
h2. External References
189
190
fn1. ​http://www.sysmocom.de 
191
192
fn2. ​https://media.ccc.de/v/32c3-7412-running_your_own_3g_3_5g_network
193
 
194
fn3. ​http://git.osmocom.org/erlang/osmo_ss7
195
196
fn4. ​http://www.eurecom.fr 
197
198
fn5. See ​http://git.osmocom.org/libasn1c/ and ​http://git.osmocom.org/asn1c/log/?h=aper-prefix
199 7 laforge
200
{{include(cellular-infrastructure:MacroCommercialSupport)}}
Add picture from clipboard (Maximum size: 48.8 MB)