blob: a933d1bb29f479e23446d9817d412ce7046a0daf [file] [log] [blame]
Harald Welte9f1331b2016-02-20 10:56:10 +01001== Configuring OsmoSGSN
2
3Contrary to other network elements (like OsmoBSC, OsmoNITB), the
4OsmoSGSN has a relatively simple configuration.
5
6On the one hand, this is primary because the PCU configuration happens
7from the BSC side.
8
9On the other hand, it is because the Gb interface does not need an
10explicit configuration of all each PCU connecting to the SGSN. The
11administrator 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
16The Gp interface is the GTP-C and GTP-U based interface between the SGSN
17and the GGSNs. It is implemented via UDP on well-known source and
18destination ports.
19
20When 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
22determines which GGSN shall be used, and that in turn determines which
23external IP network the MS will be connected to.
24
25There 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
32In this mode, there is a static list of GGSNs and APNs configured in
33OsmoSGSN via the VTY / config file.
34
35This is a non-standard method outside of the 3GPP specifications for the
36SGSN, and is typically only used in private/small GPRS networks without
37any access to a GRX.
38
39.Example: Static GGSN/APN configuration (single catch-all GGSN)
40----
41OsmoSGSN(config-sgsn)# gtp local-ip 172.0.0.1 <1>
42OsmoSGSN(config-sgsn)# ggsn 0 remote-ip 127.0.0.2 <2>
43OsmoSGSN(config-sgsn)# ggsn 0 gtp-version 1 <3>
44OsmoSGSN(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
54In this mode, the SGSN will use a DNS-based method to perform the lookup
55from the APN (as specified by the MS) towards the GGSN IP address.
56
57This is the official method as per the 3GPP specifications for the SGSN,
58and what is used on GRX.
59
60.Example: Dynamic GGSN/APN configuration
61----
62OsmoSGSN(config-sgsn)# gtp local-ip 192.168.0.11 <1>
63OsmoSGSN(config-sgsn)# ggsn dynamic <2>
64OsmoSGSN(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
ikostovaa6629f2017-01-06 14:34:45 +010070[[auth-pol]]
71=== Authorization Policy
72
73Authorization determines whether a particular subscriber can access
74your network or not.
75
76The following 4 authorization policy options are available:
77
78`accept-all`: All IMSIs will be accepted.
79
80`acl-only`: Accept only IMSIs, which are explicitly white-listed
81by the Access Control List (ACL), and the rest will be rejected.
82
83`closed`: Accept only home network subscribers.
84The combination of MCC and MNC fully identifies a subscriber's
85home network, also known as a Home Network Identity (HNI, i.e.
86MCC and MNC found at the start of the IMSI, e.g. MCC 901 and
87MNC 700 with IMSI 901700000003080). The ACL is also heeded.
88
89`remote`: GSUP protocol is used to remotely access a HLR.
90Only remote subscription data will be used.
91
92.Example: Assign or change authorization policy:
93----
94OsmoSGSN> enable
95OsmoSGSN# configure terminal
96OsmoSGSN(config)# sgsn
97OsmoSGSN(config-sgsn)# auth-policy acl-only <1>
98OsmoSGSN(config-sgsn)# write <2>
99Configuration saved to sgsn.cfg
100OsmoSGSN(config-sgsn)# end
101OsmoSGSN# disable
102OsmoSGSN>
103----
104<1> 'acl-only' is selected as authorization policy
105<2> Saves current changes to cofiguration to make this policy
106persistent
Harald Welte9f1331b2016-02-20 10:56:10 +0100107
108=== Subscriber Configuration
109
110As opposed to OsmoNITB, OsmoSGSN does not feature a built-in HLR.
111
112It can thus operate only in the following two modes:
113
114. Accessing an external HLR (or HLR gateway) via the GSUP protocol
115. Accepting subscribers based on internal ACL (access control list)
116
117==== Accessing an external HLR via GSUP
118
119The non-standard GSUP protocol was created to provide OsmoSGSN with
120access to an external HLR while avoiding the complexities of the
121TCAP/MAP protocol stack commonly used by HLRs.
122
123A custom HLR could either directly implement GSUP, or an external gateway
124can be used to convert GSUP to the respective MAP operations.
125
126The primitives/operations of GSUP are modelled to have a 1:1
127correspondence to their MAP counterparts. However, the encoding is much
128simplified by use of a binary TLV encoding similar to Layer 3 of
129GSM/GPRS.
130
131GSUP performs a challenge-response authentication protocol called OAP,
132which uses the standard MILEAGE algorithm for mutual authentication
133between OsmoSGSN and the HLR/HLR-GW.
134
135[[sgsn-ex-gsup]]
136.Example: Using an external HLR via GSUP
137----
138OsmoSGSN(config-sgsn)# gsup remote-ip 2.3.4.5 <1>
139OsmoSGSN(config-sgsn)# gsup remote-port 10000 <2>
140OsmoSGSN(config-sgsn)# gsup oap-k 000102030405060708090a0b0c0d0e0f <3>
141OsmoSGSN(config-sgsn)# gsup oap-opc 101112131415161718191a1b1c1d1e1f <4>
142----
143<1> Configure the IP address of the (remote) HLR or HLR-GW
144<2> Configure the TCP port of the (remote) HLR or HLR-GW
145<3> Specify the OAP shared key
146<4> Specify the OAP shared OPC
147
148
149=== CDR configuration
150
151OsmoSGSN can write a text log file containing CDR (call data records),
152which are commonly used for accounting/billing purpose.
153
154.Example: CDR configuration
155----
156OsmoSGSN(config-sgsn)# cdr filename /var/log/osmosgsn.cdr
157OsmoSGSN(config-sgsn)# cdr interval 600 <1>
158----
159<1> Periodically log existing PDP contexts every 600 seconds (10 min)
160
161The CDR file is a simple CSV file including a header line naming the
162individual fields of each CSV line.
163
164[[sgsn-cdr]]
Jonathan Brielmaier5530c912016-05-25 15:01:11 +0200165.Description of CSV fields in OsmoSGSN CDR file
Harald Welte9f1331b2016-02-20 10:56:10 +0100166[options="header",cols="15%,85%"]
167|===
Harald Welte36dea392016-02-20 18:35:37 +0100168|Field Name|Description
Harald Welte9f1331b2016-02-20 10:56:10 +0100169|timestamp|Timestamp in YYYYMMDDhhmmssXXX where XXX are milli-seconds
170|imsi|IMSI causing this CDR
171|imei|IMEI causing this CDR
172|msisdn|MSISDN causing this CDR (if known)
173|cell_id|Cell ID in which the MS was registered last
174|lac|Location Area Code in which the MS was registered last
175|hlr|HLR of the subscriber
Harald Welte36dea392016-02-20 18:35:37 +0100176|event|Possible events are explained below in <<sgsn-cdr-event>>
Harald Welte9f1331b2016-02-20 10:56:10 +0100177|pdp|
178|pdp_duration|duration of the PDP context so far
179|ggsn_addr|GGSN related to the PDP context
180|sgsn_addr|SGSN related to the PDP context
181|apni|APN identifier of the PDP context
182|eua_addr|IP address allocated to the PDP context
183|vol_in|Number of bytes in MO direction
184|vol_out|Number of bytes in MT direction
185|charging_id|Related charging ID
186|===
187
188[[sgsn-cdr-event]]
189.Description of OsmoSGSN CDR Events
190[options="header",cols="15%,85%"]
191|===
192|Event|Description
193|attach|GMM ATTACH COMPLETE about to be sent to MS
194|update|GMM ROUTING AREA UPDATE COMPLETE about to be sent to MS
195|detach|GMM DETACH REQUEST received from MS
196|free|Release of the MM context memory
197|pdp-act|GTP CREATE PDP CONTEXT CONFIRM received from GGSN
198|pdp-deact|GTP DELETE PDP CONTEXT CONFIRM received from GGSN
199|pdp-terminate|Forced PDP context termination during MM context release
200|pdp-free|Release of the PDP context memory
201|===