Ensure that existing binds are updated as well.
In some cases the default max length of the osmo_io txqueue could be too
small. Set it to 128 by default and add a VTY option to change it for
an NSI (program-wide).
Change-Id: I993b87fd6b83b3981f5e293f70b931075afec715
Related: SYS#6550
alive_timeout_handler() changes the state to RECOVERING which calls
ns2_st_alive_onenter()->ns2_nse_notify_unblocked(unblocked=false)->
ns2_sns_notify_alive(unblocked=false)
When all (signalling) NSVCs have failed and gss->role is SGSN and not
persistent sns_failed() calls gprs_ns2_free_nse() which talloc_free()s
the nse before returning.
The next line in ns2_nse_notify_unblocked() tries to read nse->alive which then causes the
use-after-free.
Change-Id: I0486a77fd3e21fd3904bd19e4e0225ffbf654935
Related: OS#5302
To answer correct on a BLOCK PDU with a different NSVCI, the
STATUS PDU needs also a NSVCI parameter.
Change-Id: I373eb48697097cdfa45748a091c11f7b3f0345fa
To show adminstrator the last state change of a nsvc add a timestamp and
show it on the vty
> show ns nsei 1234
NSEI 01234: UDP, DEAD since 0d 0h 1m 42s
[...]
4 NS-VC:
UNBLOCKED DYNAMIC sig_weight=1 data_weight=1 udp)[127.0.0.1]:22000<>[127.0.0.1]:23001 ALIVE since 0d 0h 0m 1s
UNBLOCKED DYNAMIC sig_weight=2 data_weight=2 udp)[127.0.0.1]:22000<>[127.0.0.1]:23000 ALIVE since 0d 0h 0m 1s
UNBLOCKED DYNAMIC sig_weight=2 data_weight=2 udp)[127.0.0.1]:22001<>[127.0.0.1]:23000 ALIVE since 0d 0h 0m 1s
UNBLOCKED DYNAMIC sig_weight=1 data_weight=1 udp)[127.0.0.1]:22001<>[127.0.0.1]:23001 ALIVE since 0d 0h 0m 1s
Related: OS#5028
Change-Id: Ie3a039a209869295afa5feda39297cee81fedf22
To show adminstrator the last state change of a nse add a timestamp and
show it on the vty
> show ns nse 1234
NSEI 01234: UDP, ALIVE since 0d 0h 0m 16s
FSM Instance Name: 'GPRS-NS2-SNS-SGSN(NSE01234-SNS)[0x6120000012a0]', ID: 'NSE01234-SNS'
Log-Level: 'DEBUG', State: 'CONFIGURED'
Timer: 4
Maximum number of remote NS-VCs: 8, IPv4 Endpoints: 2, IPv6 Endpoints: 0
[...]
Related: OS#5028
Change-Id: I8143080a3c5c9a55d37dfad44ba2ac6561daa216
When changing the bind ip-sns weight, initiate a
SNS CHANGE WEIGHT procedure to inform the other side.
Related: OS#5036
Change-Id: Icec4dabb46bc198f68f91bfe09ba279fbe68d454
The problem are recursive execution because a free generates an event which could
allow the use to free a nsvcs while the llist_for_each() is still running.
Change-Id: I902557fb6e56e6588728a46e43a9cbe3215d5c68
When removing NSVCs before removing the bind from the SNS list, the removing NSVCs could
trigger a creation of a new NSVC on the same bind ending in a
while(true) loop.
Change-Id: I6f497348f75fb479427d8a4c23313e33fbc62036
Otherwise there could be recursive loop when free'ing NSVCs which
in the end create an event which the SNS want to free the NSVCs a
second time
Change-Id: Ie99ba5fe8a84519fe8a8c0abdf875606715ab7f6
When free'ing a NSE/NSVC/BIND ensure there can't be a double
free by using a free anchor in the struct.
Recursive free's can happen when the NS user reacts on an event
(e.g. GPRS_NS2_AFF_CAUSE_VC_FAILURE) and calls the free().
Or when the user free's a NSVC when the NSE uses SNS as configuration,
the fsm tries to free it again.
Change-Id: If9823aadaa936e136aa43e88cee925ddd5974841
The log line should describe what's reported towards the NS user
and not the NSE MTU itself
Related: OS#5192
Change-Id: I3f5445a1ba8c89c4023ff48be15a80569a128528
When the MTU changes for any fr device, all
NSE will recalculate their MTU. If any NSE is alive,
libosmocore will crash.
Related: OS#5192
Change-Id: I31ba5cefea7bbb0b74060d6664b42c58815ee2a1
When configuring multiple NSE/BINDs the order of the configuration
should be keeped.
Related: OS#5181
Change-Id: Ibbc03f0780b49543b5bd97ee059f11cfd6c2a126
Use the new stats API to set a meaningful name for its stats group too,
so that they are easily to identify when reported.
Example on VTY "show stats":
"""
NSVC Peer Statistics (0)('UDP-NSE01800-NSVC01800'):
ALIVE response time : 0 ms
NS Bind Statistics:
Transmit backlog length: 0 packets
"""
Example reporting to statsd:
"""
my-stats-reporter-prefix.ns.nsvc.UDP-NSE01800-NSVC01800.alive.delay:0|g
"""
Related: SYS#5456
Change-Id: I4c696c615ba3416f8524d0797ce06c0ecd3a18f2
Ensure all nsvcs ids are unique as UDP ids might not be unique when
multiple NSVCs connect to the same remote endpoint (multiple binds).
Change the format of all ids to look similiar.
FR: NSE11-NSVC23-FR-fr0-DLCI13.
UDP: NSE11-NSVC-UDP-10.0.0.1:23000-192.168.1.1:24000
UDP: NSE11-NSVC23-UDP-10.0.0.1:23000-192.168.1.1:24000
UDP: NSE11-NSVC66-UDP-[fd01::1]:23000-[fd03::2]:24000
Change-Id: I618e263e73fcc64d4e46b57aa3a2cb2783837907
Introduce 2 new logging sub systems for signal and unit data.
Unify log messages so all log messages look similiar.
Log also Rx PDUs. Ensure dropped Tx packets (BLOCK/RESET on SNS)
contain *Tx*.
Change-Id: I34b8fde2955ecc010d1dcd9512e1bba9211e2c0d
In the IP-SNS SGSN role, we need to inform the BSS of our local
IP endpoints. For statically configured NSEs, those are explicitly
stated on a per-NSE level.
For dynamically created IP-SNS NSEs, we are adding a new VTY
command, using which the administrator can configure which binds
should be advertised as IP endpoints to such BSS.
Change-Id: Id01c29b07e9203c9305f2129361a4f5aaefa2c52
Related: OS#3373
gprs_ns2_create_nse() doesn't allow the caller to specify if the
BSS or the SGSN role of IP-SNS shall be implemented. Add
gprs_ns2_create_nse2() to fix that.
Change-Id: I6db8c36f7c69b592d7d0fbcf323804f7e9912be2
Related: OS#3373
Setting the NSE dialect possibly involves the creating (or destruction)
of a IP-SNS FSM. Encapsulate that, rather than having every caller
re-implement that.
Change-Id: I24fdc26fbcfda039bd58ea166f4d5c2fd1801da1
When freeing the NS-VC there are cases when the NSE is still alive.
This means that gprs_ns2_free_nsvc() calls ns2_prim_status_ind(),
which in turn calls ns2_count_transfer_cap(). The latter must deal
with such a situation rather than OSMO_ASSERT()
Change-Id: I4f32dee705c9886717339fe7cce5b4cd8d2c18f7
If the SNS fsm isn't freed early, the SNS code will re-create a NSVC
when calling free_nsvc().
Fixes libasan heap-use-after-free.
Change-Id: If350df1d8d6dcea5715dd23b8bd1d684098cdb1f
Implement the load sharing based on modulo of the LSP. As long the gprs_ns2 doesn't
support the resource distribution function (48.016 § 4.4a) this simple
approach is good enought.
Fixes: OS#4836
Change-Id: I8c2fe5d647694886ac600470fca6ea5d5d210a85
Introduce a `ip-sns-bind BINDID` vty command within a `nse` vty object.
The ip-sns-bind defines the binds which will be used by the dynamic
configuration with IP-SNS.
This is only the first part which only uses the binds when doing a
new SNS configuration.
The outgoing add procedure will be supported in a later patch
when the SNS fsm supports outgoing procedures.
This is a behaviour change of the API and must be synchronized with
the osmo-pcu. Otherwise SNS won't work with osmo-pcu.
Related: SYS#5354
Change-Id: I9ab8092bf286e7d90e92f5702a5404425e959c84
The BSSGP layer needs to know the MTU of the NS UNIDATA payload.
The MTU can be 0 if the NSE doesn't contain any NSVC.
Every status indication will contain the mtu value.
The MTU in the status indication contains the maximum transfer
unit of a BSSGP message. From NS side the maximum SDU.
Related: OS#4889
Change-Id: I5016b295db6185ec131d83089cf6c806e34ef1b6
Allow to assign a signalling and data weight to UDP binds.
Those weights will be used when doing dynamic configuration over
IP-SNS.
This is only the first part which only uses the assigned weights
when doing a new SNS configuration.
The outgoing change weight procedure will be supported in a later patch
when the SNS fsm supports outgoing procedures.
Related: SYS#5354
Change-Id: I5133e4229377d44772a9af28628a2bc420fea34b
The SNS must know when all NS-VC have failed. Further more
there might be a corner case when the SNS configuration succeeds but
no NS-VC comes up afterwards.
Related: OS#5355
Change-Id: Ie72da9adeefe0c2850d49a9208b2d0a4556f9101
Log the NS-STATUS primitives from within the library, so we don't have
to keep related code in each and every application.
Change-Id: I368883acfc8ea76529befcd429bf8f2445a60a94
ENOSPC is used with non-volatile (disk) storage, while ENOMEM is
customarily used for RAM allocation failures.
Change-Id: Ia4c16d8278dc30c7cc69169b18428cda5272738d
Avoid code duplication between three different drivers by sharing
the "core" of the bind initialization in a new, shared ns2_bind_alloc().
Change-Id: I535fc68e94fcd695de827dd922706adc1c5a2cb7
It's always a bad idea to have an array of descriptions that's indexed
by an enum, without using named initializers. It's too easy to get
inconsistencies.
Change-Id: Id0ebd2a202a465ca0298f4245f1fb5c495235fc8
The call was only introduced as workaround for the first implementation
of vty. There is no need for this anymore. The configuration can
just add "accept-ipaccess" to the bind to allow creation of dynamic
ipaccess NSE.
Change-Id: Ie924ead6da17657f3da334068c8ada82c8845495
All public enum should have the prefix GPRS_NS2_.
API change which must be synchronized with osmo-pcu,
osmo-gbproxy, osmo-sgsn.
Change-Id: I548ff12f7277cbb7e1a630a3dc02b738ce89be72