Project

General

Profile

OsmoHNBGW » History » Revision 14

Revision 13 (neels, 08/12/2022 10:56 PM) → Revision 14/21 (neels, 08/12/2022 11:37 PM)

h1. OsmoHNBGW 

 {{>toc}} 

 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. 

 Iu support in Osmocom allows will allow using a femto-cell aka hNodeB as 3G base transceiver station, 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. 

 Here is an overview of HNBGW operation: 

 {{graphviz_link() 

 digraph G { 
   rankdir = LR; 
  
   UE [label="UE\n(3G phone)"] 
   PBX [label="PBX\nAsterisk, FreeSwitch,\nKamailio, Yate, ..."] 

   subgraph cluster_msc_mgw { 
     style=dotted 
     MSC 
     MGW1 [label="MGW"] 
     MSC -> MGW1 [label="MGCP",constraint=false] 
   } 

   subgraph cluster_hnbgw_mgw_upf { 
     style=dotted 
     MGW3 [label="MGW"] 
     UPF 
     HNBGW 
     HNBGW -> MGW3 [label="MGCP",constraint=false] 
     HNBGW -> UPF [label="PFCP",constraint=false] 
   } 

   hNodeB [shape="box",label="hNodeB\n(3G femto cell)"] 

   MSC -> HLR [label="\nGSUP",style=bold] 
   SGSN -> HLR [label="GSUP",style="dashed,bold"] 
   UE -> hNodeB [label="Uu",style=bold] 
   UE -> hNodeB [style="dashed,bold"] 
   hNodeB -> HNBGW [label="Iuh",style="bold"] 
   STP2 [label="STP\n(SCCP/M3UA)"] 
   HNBGW -> STP2 -> SGSN [label="IuPS",style="dashed,bold"] 
   HNBGW -> STP2 -> MSC [label="IuCS",style="bold"] 
   SGSN -> GGSN [label="GTP-C",style="dashed,bold"] 
   hNodeB -> UPF -> GGSN [label="GTP-U(3G)",style="dashed"] 
   GGSN -> internet [label="tun",style="dashed"] 

   hNodeB -> MGW3 [label="IuUP/RTP",constraint=false] 
   MGW3 -> MGW1 [label="IuUP/RTP"] 

   MSC -> SIPConnector [label="MNCC socket",style=bold] 

   SIPConnector -> PBX [label="SIP",style=bold] 
   MGW1 -> PBX [label="RTP"] 

   A, B, C, D [style="invisible"] 
   A -> B [label="data (PS)",style="dashed"] 
   C -> D [label="voice/SMS/USSD (CS)"] 

 } 

 }} 

 <pre> 
                       Iuh                           IuCS/IuPS 

 NAS                     +----+----+                   +----+----+ 
 Non-Access Stratum      | CC | MM |                   | CC | MM | 
 - - - - - - - - - - - +----+----+-------+           +----+----+ 
                       | RANAP     |         |      H      | RANAP     | 
 Access Stratum          +---------+ HNBAP |      N      +---------+ - - SCCP USER SAP 
                       | RUA       |         |      B      | M3UA      |    \ 
                       +---------+-------+      -      +---------+    | 
                       |          SCTP       |      G      | SCTP      |    } SIGTRAN 
                       +-----------------+      W      +---------+    | 
                       |          IP         |           | IP        |    / 
                       +-----------------+           +---------+ 
 </pre> 

 UE (User Endpoint) == MS (Mobile Subscriber) == mobile device 
 (Source: https://gitea.osmocom.org/cellular-infrastructure/osmo-hnbgw/src/branch/master/doc/protocols_around_hnbgw.txt) 

 {{include(cellular-infrastructure:MacroBinaryPackages)}} 


 h2. 3G in a Nutshell 

 h2. 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. 

 h3. HNB-GW 

 The HNB-GW, i.e. the HomeNodeB Gateway, negotiates HNBAP to register hNodeB connections, and 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 splits Iuh (RUA) sends the actual RANAP payload either to IuCS the OsmoMSC or the OsmoSGSN. The HNB-GW is implemented in osmo-hnbgw/src/osmo-hnbgw/hnbgw.c, compiling as osmo-hnbgw, and IuPS (RANAP). IuCS/RANAP is delivered to (mostly?) complete. 

 An interesting factoid is that for an hNodeB, the MSC, IuPS/RANAP to GTP-Control handshaking goes via the SGSN. 

 The IuUP/RTP and GTP HNB-GW, while the packet user plane data is optionally proxied via a local MGW and UPF instance, or sent actually goes directly to to/from the MSC's MGW hNodeB and the GGSN. 

 h2. Manuals h3. HNBAP 

 * OsmoHNBGW User Manual: https://ftp.osmocom.org/docs/latest/osmohnbgw-usermanual.pdf 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. 

 h3. SIGTRAN 

 Typically, the IuCS and IuPS interfaces would talk this layering of protocols: 
 * osmo-hnbgw VTY Reference: https://ftp.osmocom.org/docs/latest/osmohnbgw-vty-reference.pdf <pre> 
   CC/MM 
   RANAP 
   SCCP    <--- note 
   M3UA    <--- note 
   SCTP 
   IP 
 </pre> 

 h2. Source code 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). 

 The source code However, since SUA does the same as SCCP-over-M3UA and is available from @gitea.osmocom.org@ (module @osmo-hnbgw@). 

 Public read-only access is available via simpler to implement, our HNB-GW talks SUA towards IuCS and IuPS: 
 <pre> 
   CC/MM 
   RANAP 
   SUA     <--- note 
   SCTP 
   IP 
 git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-hnbgw.git 
 </pre> 

 You can browse it via gitea: https://gitea.osmocom.org/cellular-infrastructure/osmo-hnbgw 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]). 

 Contributions are welcome via [[cellular-infrastructure:Gerrit]]. 

 h2. Test Suite 

 * Source code: https://gitea.osmocom.org/ttcn3/osmo-ttcn3-hacks/src/branch/master/hnbgw Various SIGTRAN implementations: 
 * Test results: https://jenkins.osmocom.org/jenkins/job/ttcn3-hnbgw-test/ <pre> 
                 IuCS/IuPS 
                   usual 
                    |       simplest 
                    |         | 
                    v         v 
   +------+------+------+-----+ 
   | SCCP | SCCP |        |       | 
   +------+------+ SCCP |       | 
   | MTP3 | MTP3 |        |       | 
   +------+------+------+ SUA | 
   | MTP2 |        |        |       | 
   +------+ M2UA | M3UA |       | 
   | M2PA |        |        |       | 
   +------+------+------+-----+ 
   |             SCTP             | 
   +--------------------------+ 
   |              IP              | 
   +--------------------------+ 
 </pre> 

 h2. Some context 

 See Harald's 3G talk at the 32c3[2] 

 h3. ASN1 support Convolutions 

 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. 

 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). 

 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/. 

 It could be more beautiful, but the bottom line is that we now have fully free/libre support for Iuh ASN1 encodings. Cheers Cheers! 

 h2. Conclusion 

 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! 

 {{include(cellular-infrastructure:MacroBinaryPackages)}} 

 h2. Manuals 

 No HNB-GW user manual yet, sorry.    See #2588 
 * osmo-hnbgw VTY Reference: https://ftp.osmocom.org/docs/latest/osmohnbgw-vty-reference.pdf 


 h2. Source code 

 The source code is available from @gitea.osmocom.org@ (module @osmo-hnbgw@). 

 Public read-only access is available via 
 <pre> 
 git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-hnbgw.git 
 </pre> 

 You can browse it via gitea: https://gitea.osmocom.org/cellular-infrastructure/osmo-hnbgw 

 Contributions are welcome via [[cellular-infrastructure:Gerrit]]. 

 h2. Test Suite 

 * Source code: https://gitea.osmocom.org/ttcn3/osmo-ttcn3-hacks/src/branch/master/hnbgw 
 * Test results: https://jenkins.osmocom.org/jenkins/job/ttcn3-hnbgw-test/ 

 h2. External References 

 fn1. ​http://www.sysmocom.de  

 fn2. ​https://media.ccc.de/v/32c3-7412-running_your_own_3g_3_5g_network 
 
 fn3. ​http://git.osmocom.org/erlang/osmo_ss7 

 fn4. ​http://www.eurecom.fr  

 fn5. See ​http://git.osmocom.org/libasn1c/ and ​http://git.osmocom.org/asn1c/log/?h=aper-prefix 

 {{include(cellular-infrastructure:MacroCommercialSupport)}}
Add picture from clipboard (Maximum size: 48.8 MB)