blob: cc30515348e01b597e974c8c26a8e3bd49b6b1be [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 Willmann5b75f852021-04-22 16:01:53 +020051! Configure the Network Service
Daniel Willmannae303b42021-01-27 19:24:41 +010052ns
53 bind udp sgsn
54 listen 10.0.0.1 23000
55 nse 1
Daniel Willmann5b75f852021-04-22 16:01:53 +020056 ip-sns-bind sgsn
57 ip-sns-remote 10.0.1.1 23000
58 ip-sns-remote 10.0.1.1 23001
Daniel Willmannae303b42021-01-27 19:24:41 +010059 nse 2
Daniel Willmann5b75f852021-04-22 16:01:53 +020060 ip-sns-bind sgsn
61 ip-sns-remote 10.0.1.2 23000
Daniel Willmannae303b42021-01-27 19:24:41 +010062 nse 3
Daniel Willmann5b75f852021-04-22 16:01:53 +020063 ip-sns-bind sgsn
64 ip-sns-remote 10.0.1.3 23000
65! configure NRI value ranges
Daniel Willmannae303b42021-01-27 19:24:41 +010066gbproxy
Daniel Willmann22248f32021-01-27 18:34:02 +010067 nri bitlen 10
68 nri null add 0
Daniel Willmann5b75f852021-04-22 16:01:53 +020069sgsn nsei 1
70 name SGSN01
Daniel Willmann22248f32021-01-27 18:34:02 +010071 nri add 1 341
Daniel Willmann5b75f852021-04-22 16:01:53 +020072sgsn nsei 2
73 name SGSN02
Daniel Willmann22248f32021-01-27 18:34:02 +010074 nri add 342 682
Daniel Willmann5b75f852021-04-22 16:01:53 +020075sgsn nsei 3
76 name SGSN03
Daniel Willmann22248f32021-01-27 18:34:02 +010077 nri add 683 1023
78----
79
80==== NRI Value Bit Length
81
Daniel Willmannae303b42021-01-27 19:24:41 +010082In OsmGbProxy, the NRI value's bit length is freely configurable from 0 to 15
83bits. 3GPP TS 23.236 suggests a typical bit length of 10. Setting the length
84to 0 disables SGSN pooling, this is also the default.
85The NRI bit length must be identical across the entire SGSN pool.
Daniel Willmann22248f32021-01-27 18:34:02 +010086
Daniel Willmannae303b42021-01-27 19:24:41 +010087Change the NRI value bit length in OsmoGbProxy's VTY configuration like this:
Daniel Willmann22248f32021-01-27 18:34:02 +010088
89----
Daniel Willmannae303b42021-01-27 19:24:41 +010090gbproxy
Daniel Willmann22248f32021-01-27 18:34:02 +010091 nri bitlen 10
92----
93
94In the TMSI bits, regardless of the NRI bit length, the NRI value always starts
95just after the most significant octet of a TMSI (most significant bit at TMSI's
96bit 23).
97
98==== NULL-NRI
99
Daniel Willmannae303b42021-01-27 19:24:41 +0100100Since OsmoGbProxy supports serving only one PLMN, NULL-NRI are configured globally.
Daniel Willmann22248f32021-01-27 18:34:02 +0100101Even though 3GPP TS 23.236 indicates that there is a single NULL-NRI per PLMN,
Daniel Willmannae303b42021-01-27 19:24:41 +0100102OsmoGbProxy allows configuring multiple NULL-NRI values.
Daniel Willmann22248f32021-01-27 18:34:02 +0100103
104----
105network
106 nri null add 0
107 nri null add 423
108----
109
Daniel Willmannae303b42021-01-27 19:24:41 +0100110==== Assigning NRI Ranges to SGSNs
Daniel Willmann22248f32021-01-27 18:34:02 +0100111
Daniel Willmannae303b42021-01-27 19:24:41 +0100112Each SGSN configured in OsmoGbProxy must be assigned a distinct NRI value range.
Daniel Willmann22248f32021-01-27 18:34:02 +0100113Overlapping NRI value ranges will cause failure to serve subscribers.
114
115NRI values are typically configured in ranges, here dividing a 10bit range
116(0..1023) into three equal ranges, while leaving 0 available to be configured
117as NULL-NRI:
118
119----
Daniel Willmannae303b42021-01-27 19:24:41 +0100120sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100121 nri add 1 341
Daniel Willmannae303b42021-01-27 19:24:41 +0100122sgsn nsei 2
Daniel Willmann22248f32021-01-27 18:34:02 +0100123 nri add 342 684
Daniel Willmannae303b42021-01-27 19:24:41 +0100124sgsn nsei 3
Daniel Willmann22248f32021-01-27 18:34:02 +0100125 nri add 685 1023
126----
127
128NRI can also be assigned in single values:
129
130----
Daniel Willmannae303b42021-01-27 19:24:41 +0100131sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100132 nri add 23
133----
134
135Ranges can be constructed arbitrarily by a sequence of `add` and `del`
136configurations, here a contrived example:
137
138----
Daniel Willmannae303b42021-01-27 19:24:41 +0100139sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100140 nri add 0 342
141 nri del 23
142 nri del 42 235
143 nri add 1000 1023
144----
145
Daniel Willmannae303b42021-01-27 19:24:41 +0100146On the VIEW and ENABLE VTY nodes, `show nri all` shows all SGSNs:
Daniel Willmann22248f32021-01-27 18:34:02 +0100147
148----
Daniel Willmannae303b42021-01-27 19:24:41 +0100149OsmoGbProxy> show nri all
150sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100151 nri add 1 341
Daniel Willmannae303b42021-01-27 19:24:41 +0100152sgsn nsei 2
Daniel Willmann22248f32021-01-27 18:34:02 +0100153 nri add 342 684
Daniel Willmannae303b42021-01-27 19:24:41 +0100154sgsn nsei 3
Daniel Willmann22248f32021-01-27 18:34:02 +0100155 nri add 685 1023
156----
157
Daniel Willmannae303b42021-01-27 19:24:41 +0100158When configuring overlapping NRI value ranges across SGSNs, the telnet VTY warns
159about it, and starting OsmoGbProxy with such a configuration will fail:
Daniel Willmann22248f32021-01-27 18:34:02 +0100160
161----
Daniel Willmannae303b42021-01-27 19:24:41 +0100162sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100163 nri add 1 511
Daniel Willmannae303b42021-01-27 19:24:41 +0100164sgsn nsei 2
Daniel Willmann22248f32021-01-27 18:34:02 +0100165 nri add 512 1023
Daniel Willmannae303b42021-01-27 19:24:41 +0100166sgsn nsei 3
Daniel Willmann22248f32021-01-27 18:34:02 +0100167 nri add 500 555
168----
169
170This results in:
171
172----
Daniel Willmannae303b42021-01-27 19:24:41 +0100173$ osmo-gbproxy
174% 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
175% 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 +0100176----
177
Daniel Willmannae303b42021-01-27 19:24:41 +0100178==== SGSN Offloading
Daniel Willmann22248f32021-01-27 18:34:02 +0100179
Daniel Willmannae303b42021-01-27 19:24:41 +0100180To effectively offload a particular SGSN, it must be marked as no longer taking
181new subscribers in OsmoGbProxy. This can be achieved in the telnet VTY by:
Daniel Willmann22248f32021-01-27 18:34:02 +0100182
183----
Daniel Willmannae303b42021-01-27 19:24:41 +0100184sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100185 no allow-attach
186----
187
Daniel Willmannae303b42021-01-27 19:24:41 +0100188This SGSN will, as long as it is connected, continue to serve subscribers
189already attached to it: those that yield an NRI matching this SGSN, and those
190that are being paged by this SGSN. But OsmoGbProxy will no longer direct new
191subscribers to this SGSN.
Daniel Willmann22248f32021-01-27 18:34:02 +0100192
Daniel Willmannae303b42021-01-27 19:24:41 +0100193To re-enable an SGSN for attaching new subscribers:
Daniel Willmann22248f32021-01-27 18:34:02 +0100194
195----
Daniel Willmannae303b42021-01-27 19:24:41 +0100196sgsn nsei 1
Daniel Willmann22248f32021-01-27 18:34:02 +0100197 allow-attach
198----
Daniel Willmann852ebad2021-01-27 19:32:33 +0100199
200==== Traffic allocation
201
202In a SGSN pool, osmo-gbproxy is facing the problem of dividing the downlink
203capacity of a cell towards the SGSN. The BSS advertises the per-BVC capacity
204by means of the BSSGP FLOW-CONTROL-BVC messages, but as there are multiple
205SGSN in a pool, they all have to share / divide that total capacity.
206
207By default, osmo-gbproxy advertises the full capacity to _each_ of the SGSN
208pool members, which results in significant over-provisioning and can lead to
209overload situations.
210
211The administrator can configure the _percentage_ of the overall BSS-advertised
212capacity that shall be reported to each pool member SGSN using the
213`pool bvc-flow-control-ratio <1-100>` configuration command.
214
215A setting of 100 means that each pool member is informed of 100% of the
216BSS side capacity.
217
218A setting of 25 means that each pool member is informed of 25% of the
219BSS side capacity. This would make most sense in a set-up with four
220SGSN of equal share.
221
222More complex capacity division schemes are so far not supported by
223osmo-gbproxy.