Harald Welte | 9f1331b | 2016-02-20 10:56:10 +0100 | [diff] [blame] | 1 | == Configuring OsmoSGSN |
| 2 | |
| 3 | Contrary to other network elements (like OsmoBSC, OsmoNITB), the |
| 4 | OsmoSGSN has a relatively simple configuration. |
| 5 | |
| 6 | On the one hand, this is primary because the PCU configuration happens |
| 7 | from the BSC side. |
| 8 | |
| 9 | On the other hand, it is because the Gb interface does not need an |
| 10 | explicit configuration of all each PCU connecting to the SGSN. The |
| 11 | administrator only has to ensure that the NS and BSSGP layer identities |
| 12 | (NSEI, NSVCI, BVCI) are unique for each PCU connecting to the SGSN. |
| 13 | |
| 14 | === Configuring the Gp interface |
| 15 | |
| 16 | The Gp interface is the GTP-C and GTP-U based interface between the SGSN |
| 17 | and the GGSNs. It is implemented via UDP on well-known source and |
| 18 | destination ports. |
| 19 | |
| 20 | When a MS requests establishment of a PDP context, it specifies the APN |
| 21 | (Access Point Name) to which the context shall be established. This APN |
| 22 | determines which GGSN shall be used, and that in turn determines which |
| 23 | external IP network the MS will be connected to. |
| 24 | |
| 25 | There are two modes in which GGSNs can be configured: |
| 26 | |
| 27 | . static GGSN/APN configuration |
| 28 | . dynamic GGSN/APN configuration |
| 29 | |
| 30 | ==== Static GGSN/APN configuration |
| 31 | |
| 32 | In this mode, there is a static list of GGSNs and APNs configured in |
| 33 | OsmoSGSN via the VTY / config file. |
| 34 | |
| 35 | This is a non-standard method outside of the 3GPP specifications for the |
| 36 | SGSN, and is typically only used in private/small GPRS networks without |
| 37 | any access to a GRX. |
| 38 | |
| 39 | .Example: Static GGSN/APN configuration (single catch-all GGSN) |
| 40 | ---- |
| 41 | OsmoSGSN(config-sgsn)# gtp local-ip 172.0.0.1 <1> |
| 42 | OsmoSGSN(config-sgsn)# ggsn 0 remote-ip 127.0.0.2 <2> |
| 43 | OsmoSGSN(config-sgsn)# ggsn 0 gtp-version 1 <3> |
| 44 | OsmoSGSN(config-sgsn)# apn * ggsn 0 <4> |
| 45 | ---- |
| 46 | <1> Configure the local IP address at the SGSN used for Gp/GTP |
| 47 | <2> Specify the remote IP address of the GGSN (for GGSN 0) |
| 48 | <3> Specify the GTP protocol version used for GGSN 0 |
| 49 | <4> Route all APN names to GGSN 0 |
| 50 | |
| 51 | |
| 52 | ==== Dynamic GGSN/APN configuration |
| 53 | |
| 54 | In this mode, the SGSN will use a DNS-based method to perform the lookup |
| 55 | from the APN (as specified by the MS) towards the GGSN IP address. |
| 56 | |
| 57 | This is the official method as per the 3GPP specifications for the SGSN, |
| 58 | and what is used on GRX. |
| 59 | |
| 60 | .Example: Dynamic GGSN/APN configuration |
| 61 | ---- |
| 62 | OsmoSGSN(config-sgsn)# gtp local-ip 192.168.0.11 <1> |
| 63 | OsmoSGSN(config-sgsn)# ggsn dynamic <2> |
| 64 | OsmoSGSN(config-sgsn)# grx-dns-add 1.2.3.4 <3> |
| 65 | ---- |
| 66 | <1> Configure the local IP address at the SGSN used for Gp/GTP |
| 67 | <2> Enable the dynamic GGSN resolving mode |
| 68 | <3> Specify the IP address of a DNS server for APN resolution |
| 69 | |
| 70 | |
| 71 | === Subscriber Configuration |
| 72 | |
| 73 | As opposed to OsmoNITB, OsmoSGSN does not feature a built-in HLR. |
| 74 | |
| 75 | It can thus operate only in the following two modes: |
| 76 | |
| 77 | . Accessing an external HLR (or HLR gateway) via the GSUP protocol |
| 78 | . Accepting subscribers based on internal ACL (access control list) |
| 79 | |
| 80 | ==== Accessing an external HLR via GSUP |
| 81 | |
| 82 | The non-standard GSUP protocol was created to provide OsmoSGSN with |
| 83 | access to an external HLR while avoiding the complexities of the |
| 84 | TCAP/MAP protocol stack commonly used by HLRs. |
| 85 | |
| 86 | A custom HLR could either directly implement GSUP, or an external gateway |
| 87 | can be used to convert GSUP to the respective MAP operations. |
| 88 | |
| 89 | The primitives/operations of GSUP are modelled to have a 1:1 |
| 90 | correspondence to their MAP counterparts. However, the encoding is much |
| 91 | simplified by use of a binary TLV encoding similar to Layer 3 of |
| 92 | GSM/GPRS. |
| 93 | |
| 94 | GSUP performs a challenge-response authentication protocol called OAP, |
| 95 | which uses the standard MILEAGE algorithm for mutual authentication |
| 96 | between OsmoSGSN and the HLR/HLR-GW. |
| 97 | |
| 98 | [[sgsn-ex-gsup]] |
| 99 | .Example: Using an external HLR via GSUP |
| 100 | ---- |
| 101 | OsmoSGSN(config-sgsn)# gsup remote-ip 2.3.4.5 <1> |
| 102 | OsmoSGSN(config-sgsn)# gsup remote-port 10000 <2> |
| 103 | OsmoSGSN(config-sgsn)# gsup oap-k 000102030405060708090a0b0c0d0e0f <3> |
| 104 | OsmoSGSN(config-sgsn)# gsup oap-opc 101112131415161718191a1b1c1d1e1f <4> |
| 105 | ---- |
| 106 | <1> Configure the IP address of the (remote) HLR or HLR-GW |
| 107 | <2> Configure the TCP port of the (remote) HLR or HLR-GW |
| 108 | <3> Specify the OAP shared key |
| 109 | <4> Specify the OAP shared OPC |
| 110 | |
| 111 | |
| 112 | === CDR configuration |
| 113 | |
| 114 | OsmoSGSN can write a text log file containing CDR (call data records), |
| 115 | which are commonly used for accounting/billing purpose. |
| 116 | |
| 117 | .Example: CDR configuration |
| 118 | ---- |
| 119 | OsmoSGSN(config-sgsn)# cdr filename /var/log/osmosgsn.cdr |
| 120 | OsmoSGSN(config-sgsn)# cdr interval 600 <1> |
| 121 | ---- |
| 122 | <1> Periodically log existing PDP contexts every 600 seconds (10 min) |
| 123 | |
| 124 | The CDR file is a simple CSV file including a header line naming the |
| 125 | individual fields of each CSV line. |
| 126 | |
| 127 | [[sgsn-cdr]] |
| 128 | .Descripton of CSV fields in OsmoSGSN CDR file |
| 129 | [options="header",cols="15%,85%"] |
| 130 | |=== |
Harald Welte | 36dea39 | 2016-02-20 18:35:37 +0100 | [diff] [blame^] | 131 | |Field Name|Description |
Harald Welte | 9f1331b | 2016-02-20 10:56:10 +0100 | [diff] [blame] | 132 | |timestamp|Timestamp in YYYYMMDDhhmmssXXX where XXX are milli-seconds |
| 133 | |imsi|IMSI causing this CDR |
| 134 | |imei|IMEI causing this CDR |
| 135 | |msisdn|MSISDN causing this CDR (if known) |
| 136 | |cell_id|Cell ID in which the MS was registered last |
| 137 | |lac|Location Area Code in which the MS was registered last |
| 138 | |hlr|HLR of the subscriber |
Harald Welte | 36dea39 | 2016-02-20 18:35:37 +0100 | [diff] [blame^] | 139 | |event|Possible events are explained below in <<sgsn-cdr-event>> |
Harald Welte | 9f1331b | 2016-02-20 10:56:10 +0100 | [diff] [blame] | 140 | |pdp| |
| 141 | |pdp_duration|duration of the PDP context so far |
| 142 | |ggsn_addr|GGSN related to the PDP context |
| 143 | |sgsn_addr|SGSN related to the PDP context |
| 144 | |apni|APN identifier of the PDP context |
| 145 | |eua_addr|IP address allocated to the PDP context |
| 146 | |vol_in|Number of bytes in MO direction |
| 147 | |vol_out|Number of bytes in MT direction |
| 148 | |charging_id|Related charging ID |
| 149 | |=== |
| 150 | |
| 151 | [[sgsn-cdr-event]] |
| 152 | .Description of OsmoSGSN CDR Events |
| 153 | [options="header",cols="15%,85%"] |
| 154 | |=== |
| 155 | |Event|Description |
| 156 | |attach|GMM ATTACH COMPLETE about to be sent to MS |
| 157 | |update|GMM ROUTING AREA UPDATE COMPLETE about to be sent to MS |
| 158 | |detach|GMM DETACH REQUEST received from MS |
| 159 | |free|Release of the MM context memory |
| 160 | |pdp-act|GTP CREATE PDP CONTEXT CONFIRM received from GGSN |
| 161 | |pdp-deact|GTP DELETE PDP CONTEXT CONFIRM received from GGSN |
| 162 | |pdp-terminate|Forced PDP context termination during MM context release |
| 163 | |pdp-free|Release of the PDP context memory |
| 164 | |=== |