blob: 8b259ed0d133dadbe373095daae6f8a4ca55e12c [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
70
71=== Subscriber Configuration
72
73As opposed to OsmoNITB, OsmoSGSN does not feature a built-in HLR.
74
75It 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
82The non-standard GSUP protocol was created to provide OsmoSGSN with
83access to an external HLR while avoiding the complexities of the
84TCAP/MAP protocol stack commonly used by HLRs.
85
86A custom HLR could either directly implement GSUP, or an external gateway
87can be used to convert GSUP to the respective MAP operations.
88
89The primitives/operations of GSUP are modelled to have a 1:1
90correspondence to their MAP counterparts. However, the encoding is much
91simplified by use of a binary TLV encoding similar to Layer 3 of
92GSM/GPRS.
93
94GSUP performs a challenge-response authentication protocol called OAP,
95which uses the standard MILEAGE algorithm for mutual authentication
96between OsmoSGSN and the HLR/HLR-GW.
97
98[[sgsn-ex-gsup]]
99.Example: Using an external HLR via GSUP
100----
101OsmoSGSN(config-sgsn)# gsup remote-ip 2.3.4.5 <1>
102OsmoSGSN(config-sgsn)# gsup remote-port 10000 <2>
103OsmoSGSN(config-sgsn)# gsup oap-k 000102030405060708090a0b0c0d0e0f <3>
104OsmoSGSN(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
114OsmoSGSN can write a text log file containing CDR (call data records),
115which are commonly used for accounting/billing purpose.
116
117.Example: CDR configuration
118----
119OsmoSGSN(config-sgsn)# cdr filename /var/log/osmosgsn.cdr
120OsmoSGSN(config-sgsn)# cdr interval 600 <1>
121----
122<1> Periodically log existing PDP contexts every 600 seconds (10 min)
123
124The CDR file is a simple CSV file including a header line naming the
125individual fields of each CSV line.
126
127[[sgsn-cdr]]
Jonathan Brielmaier5530c912016-05-25 15:01:11 +0200128.Description of CSV fields in OsmoSGSN CDR file
Harald Welte9f1331b2016-02-20 10:56:10 +0100129[options="header",cols="15%,85%"]
130|===
Harald Welte36dea392016-02-20 18:35:37 +0100131|Field Name|Description
Harald Welte9f1331b2016-02-20 10:56:10 +0100132|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 Welte36dea392016-02-20 18:35:37 +0100139|event|Possible events are explained below in <<sgsn-cdr-event>>
Harald Welte9f1331b2016-02-20 10:56:10 +0100140|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|===