blob: 61806af8cff6a1c8342721569300b5c2d57592fb [file] [log] [blame]
Daniel Willmannae303b42021-01-27 19:24:41 +01001== SGSN Pooling
Daniel Willmann22248f32021-01-27 18:34:02 +01002
Daniel Willmannae303b42021-01-27 19:24:41 +01003SGSN pooling is described in 3GPP TS 23.236 <<3gpp-ts-23-236>>, and is supported
4by OsmoGbProxy since early 2021.
Daniel Willmann22248f32021-01-27 18:34:02 +01005
Daniel Willmannae303b42021-01-27 19:24:41 +01006The aim of SGSN pooling is to distribute load from a BSS across multiple SGSNs,
Daniel Willmann22248f32021-01-27 18:34:02 +01007which are equivalent and redundant infrastructure for the same core network.
8
Daniel Willmannae303b42021-01-27 19:24:41 +01009The main mechanism for SGSN pooling is the TLLI/P-TMSI, which an SGSN hands out
10to its attached subscribers. Typically 10 bits of the P-TMSI are designated as a
11Network Resource Identifier (NRI) that identifies the originating SGSN, and
12allows OsmoGbProxy to direct a subscriber back to the same SGSN instance that
13previously negotiated the Attach procedure. Typically, the full NRI value
14range available is divided into N even ranges, where each SGSN is assigned one
Daniel Willmann22248f32021-01-27 18:34:02 +010015NRI range.
16
Daniel Willmannae303b42021-01-27 19:24:41 +010017Subscribers attaching without a TLLI, or those with unknown NRI value,
18are evenly distributed across SGSN instances. OsmoGbProxy uses a hash-based
19approach to distribute load across all connected SGSNs.
Daniel Willmann22248f32021-01-27 18:34:02 +010020
Daniel Willmannae303b42021-01-27 19:24:41 +010021A Paging Response from a subscriber is always returned back to whichever SGSN
Daniel Willmann22248f32021-01-27 18:34:02 +010022initiated the Paging, regardless of the Mobile Identity used.
23
Daniel Willmannae303b42021-01-27 19:24:41 +010024Finally, a NULL-NRI is a special NRI value that indicates that the SGSN wishes
25to offload this subscriber to a different SGSN. A NULL-NRI is an arbitrary NRI
26value that is chosen distinctly for each PLMN served by a BSS, so that a
Daniel Willmann22248f32021-01-27 18:34:02 +010027subscriber can be reassigned within that PLMN. Upon (periodic) Location
Daniel Willmannae303b42021-01-27 19:24:41 +010028Updating, an offloading SGSN hands out a NULL-NRI value in the assigned TLLI,
Daniel Willmann22248f32021-01-27 18:34:02 +010029along with a non-broadcast LAI. The subscriber will notice the LAI mismatch,
Daniel Willmannae303b42021-01-27 19:24:41 +010030and immediately re-attempt the attach using the TLLI containing the NULL-NRI.
31OsmoGbProxy recognises the NULL-NRI and redirects the subscriber to one of the
32other SGSNs. A prerequisite for this to work well is that the particular SGSN is
33previously marked as not accepting new subscribers, in OsmoGbProxy's configuration.
Daniel Willmann22248f32021-01-27 18:34:02 +010034
35The mechanisms described above make up the NAS node selection function
Daniel Willmannae303b42021-01-27 19:24:41 +010036implemented in OsmoGbProxy.
Daniel Willmann22248f32021-01-27 18:34:02 +010037
Daniel Willmannae303b42021-01-27 19:24:41 +0100383GPP TS 23.236 also defines that an offloading SGSN hands subscriber information
39to the newly assigned SGSN, which takes place outside the scope of OsmoGbProxy.
Daniel Willmann22248f32021-01-27 18:34:02 +010040
Daniel Willmannae303b42021-01-27 19:24:41 +010041=== Configuring SGSN Pooling
Daniel Willmann22248f32021-01-27 18:34:02 +010042
Daniel Willmannae303b42021-01-27 19:24:41 +010043The NRI ranges assigned to each SGSN must match in the OsmoGbProxy and the SGSN
44configuration. If inconsistent NRI value ranges are configured,
45attached subscribers would be redirected to SGSN instances that did not perform the
Daniel Willmann22248f32021-01-27 18:34:02 +010046attach, possibly rendering the core network unusable.
47
Daniel Willmannae303b42021-01-27 19:24:41 +010048==== Connecting Multiple SGSNs
Daniel Willmann22248f32021-01-27 18:34:02 +010049
50----
Daniel Willmannae303b42021-01-27 19:24:41 +010051# Configure the Network Service
52ns
53 bind udp sgsn
54 listen 10.0.0.1 23000
55 nse 1
56 ip-sns 10.0.1.1 23000
57 ip-sns 10.0.1.1 23001
58 nse 2
59 ip-sns 10.0.1.2 23000
60 nse 3
61 ip-sns 10.0.1.3 23000
Daniel Willmann22248f32021-01-27 18:34:02 +010062# configure NRI value ranges
Daniel Willmannae303b42021-01-27 19:24:41 +010063gbproxy
Daniel Willmann22248f32021-01-27 18:34:02 +010064 nri bitlen 10
65 nri null add 0
Daniel Willmannae303b42021-01-27 19:24:41 +010066sgsn 1
Daniel Willmann22248f32021-01-27 18:34:02 +010067 nri add 1 341
Daniel Willmannae303b42021-01-27 19:24:41 +010068sgsn 2
Daniel Willmann22248f32021-01-27 18:34:02 +010069 nri add 342 682
Daniel Willmannae303b42021-01-27 19:24:41 +010070sgsn 3
Daniel Willmann22248f32021-01-27 18:34:02 +010071 nri add 683 1023
72----
73
74==== NRI Value Bit Length
75
Daniel Willmannae303b42021-01-27 19:24:41 +010076In OsmGbProxy, the NRI value's bit length is freely configurable from 0 to 15
77bits. 3GPP TS 23.236 suggests a typical bit length of 10. Setting the length
78to 0 disables SGSN pooling, this is also the default.
79The NRI bit length must be identical across the entire SGSN pool.
Daniel Willmann22248f32021-01-27 18:34:02 +010080
Daniel Willmannae303b42021-01-27 19:24:41 +010081Change the NRI value bit length in OsmoGbProxy's VTY configuration like this:
Daniel Willmann22248f32021-01-27 18:34:02 +010082
83----
Daniel Willmannae303b42021-01-27 19:24:41 +010084gbproxy
Daniel Willmann22248f32021-01-27 18:34:02 +010085 nri bitlen 10
86----
87
88In the TMSI bits, regardless of the NRI bit length, the NRI value always starts
89just after the most significant octet of a TMSI (most significant bit at TMSI's
90bit 23).
91
92==== NULL-NRI
93
Daniel Willmannae303b42021-01-27 19:24:41 +010094Since OsmoGbProxy supports serving only one PLMN, NULL-NRI are configured globally.
Daniel Willmann22248f32021-01-27 18:34:02 +010095Even though 3GPP TS 23.236 indicates that there is a single NULL-NRI per PLMN,
Daniel Willmannae303b42021-01-27 19:24:41 +010096OsmoGbProxy allows configuring multiple NULL-NRI values.
Daniel Willmann22248f32021-01-27 18:34:02 +010097
98----
99network
100 nri null add 0
101 nri null add 423
102----
103
Daniel Willmannae303b42021-01-27 19:24:41 +0100104==== Assigning NRI Ranges to SGSNs
Daniel Willmann22248f32021-01-27 18:34:02 +0100105
Daniel Willmannae303b42021-01-27 19:24:41 +0100106Each SGSN configured in OsmoGbProxy must be assigned a distinct NRI value range.
Daniel Willmann22248f32021-01-27 18:34:02 +0100107Overlapping NRI value ranges will cause failure to serve subscribers.
108
109NRI values are typically configured in ranges, here dividing a 10bit range
110(0..1023) into three equal ranges, while leaving 0 available to be configured
111as NULL-NRI:
112
113----
Daniel Willmannae303b42021-01-27 19:24:41 +0100114sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100115 nri add 1 341
Daniel Willmannae303b42021-01-27 19:24:41 +0100116sgsn nsei 2
Daniel Willmann22248f32021-01-27 18:34:02 +0100117 nri add 342 684
Daniel Willmannae303b42021-01-27 19:24:41 +0100118sgsn nsei 3
Daniel Willmann22248f32021-01-27 18:34:02 +0100119 nri add 685 1023
120----
121
122NRI can also be assigned in single values:
123
124----
Daniel Willmannae303b42021-01-27 19:24:41 +0100125sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100126 nri add 23
127----
128
129Ranges can be constructed arbitrarily by a sequence of `add` and `del`
130configurations, here a contrived example:
131
132----
Daniel Willmannae303b42021-01-27 19:24:41 +0100133sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100134 nri add 0 342
135 nri del 23
136 nri del 42 235
137 nri add 1000 1023
138----
139
Daniel Willmannae303b42021-01-27 19:24:41 +0100140On the VIEW and ENABLE VTY nodes, `show nri all` shows all SGSNs:
Daniel Willmann22248f32021-01-27 18:34:02 +0100141
142----
Daniel Willmannae303b42021-01-27 19:24:41 +0100143OsmoGbProxy> show nri all
144sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100145 nri add 1 341
Daniel Willmannae303b42021-01-27 19:24:41 +0100146sgsn nsei 2
Daniel Willmann22248f32021-01-27 18:34:02 +0100147 nri add 342 684
Daniel Willmannae303b42021-01-27 19:24:41 +0100148sgsn nsei 3
Daniel Willmann22248f32021-01-27 18:34:02 +0100149 nri add 685 1023
150----
151
Daniel Willmannae303b42021-01-27 19:24:41 +0100152When configuring overlapping NRI value ranges across SGSNs, the telnet VTY warns
153about it, and starting OsmoGbProxy with such a configuration will fail:
Daniel Willmann22248f32021-01-27 18:34:02 +0100154
155----
Daniel Willmannae303b42021-01-27 19:24:41 +0100156sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100157 nri add 1 511
Daniel Willmannae303b42021-01-27 19:24:41 +0100158sgsn nsei 2
Daniel Willmann22248f32021-01-27 18:34:02 +0100159 nri add 512 1023
Daniel Willmannae303b42021-01-27 19:24:41 +0100160sgsn nsei 3
Daniel Willmann22248f32021-01-27 18:34:02 +0100161 nri add 500 555
162----
163
164This results in:
165
166----
Daniel Willmannae303b42021-01-27 19:24:41 +0100167$ osmo-gbproxy
168% Warning: NSE(00003/SGSN): NRI range [500..555] overlaps between NSE 00003 and NSE 00001. For overlaps, NSE 00001 has higher priority than NSE 00003
169% Warning: NSE(00003/SGSN): NRI range [500..555] overlaps between NSE 00003 and NSE 00002. For overlaps, NSE 00002 has higher priority than NSE 00003
Daniel Willmann22248f32021-01-27 18:34:02 +0100170----
171
Daniel Willmannae303b42021-01-27 19:24:41 +0100172==== SGSN Offloading
Daniel Willmann22248f32021-01-27 18:34:02 +0100173
Daniel Willmannae303b42021-01-27 19:24:41 +0100174To effectively offload a particular SGSN, it must be marked as no longer taking
175new subscribers in OsmoGbProxy. This can be achieved in the telnet VTY by:
Daniel Willmann22248f32021-01-27 18:34:02 +0100176
177----
Daniel Willmannae303b42021-01-27 19:24:41 +0100178sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100179 no allow-attach
180----
181
Daniel Willmannae303b42021-01-27 19:24:41 +0100182This SGSN will, as long as it is connected, continue to serve subscribers
183already attached to it: those that yield an NRI matching this SGSN, and those
184that are being paged by this SGSN. But OsmoGbProxy will no longer direct new
185subscribers to this SGSN.
Daniel Willmann22248f32021-01-27 18:34:02 +0100186
Daniel Willmannae303b42021-01-27 19:24:41 +0100187TODO: Is paging response relevant for SGSN?
188
189To re-enable an SGSN for attaching new subscribers:
Daniel Willmann22248f32021-01-27 18:34:02 +0100190
191----
Daniel Willmannae303b42021-01-27 19:24:41 +0100192sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100193 allow-attach
194----
Daniel Willmann852ebad2021-01-27 19:32:33 +0100195
196==== Traffic allocation
197
198In a SGSN pool, osmo-gbproxy is facing the problem of dividing the downlink
199capacity of a cell towards the SGSN. The BSS advertises the per-BVC capacity
200by means of the BSSGP FLOW-CONTROL-BVC messages, but as there are multiple
201SGSN in a pool, they all have to share / divide that total capacity.
202
203By default, osmo-gbproxy advertises the full capacity to _each_ of the SGSN
204pool members, which results in significant over-provisioning and can lead to
205overload situations.
206
207The administrator can configure the _percentage_ of the overall BSS-advertised
208capacity that shall be reported to each pool member SGSN using the
209`pool bvc-flow-control-ratio <1-100>` configuration command.
210
211A setting of 100 means that each pool member is informed of 100% of the
212BSS side capacity.
213
214A setting of 25 means that each pool member is informed of 25% of the
215BSS side capacity. This would make most sense in a set-up with four
216SGSN of equal share.
217
218More complex capacity division schemes are so far not supported by
219osmo-gbproxy.