aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
AgeCommit message (Collapse)AuthorFilesLines
2021-02-16Fix nsei+bvci not updated on rx UL SNDCP dataPau Espin Pedrol1-1/+1
msgid2mmctx() was already being called for signalling messages in gsm0408_gprs_rcvmsg_gb() before calling gprs_gb_recv_pdu(), but it was not called in sndcp_llunitdata_ind(). Let's move msgid2mmctx() inside gprs_gb_recv_pdu() since we want to always update the nsei+bvci, regardless of message containing data or control content. This commit fixes the scenario where an MS changes to a new cell (PCU) and then continues transmitting UL data. Prior to this patch, the SGSN kept sending DL content to the old cell (PCU nsei+bvci) instead of the new one even after the MS transmitted Ul content fro mthe new cell. Related: SYS#4909 Change-Id: I2c14e1d65575f54212924f7c5f0a2f4c1b76ec81
2021-02-08gbproxy: remove (moved to own repository)Oliver Smith2-299/+0
New repository: https://git.osmocom.org/osmo-gbproxy/ Related: OS#4992 Change-Id: I37f7cebaf2a06bd93627a452f5df44edcfc0f87a
2021-01-28sgsn_rim: Add routing for (GERAN) BSSGP RIM messagesPhilipp Maier3-0/+5
The SGSN currently does not forward BSSGP RIM messages. Related: SYS#5103 Depends: libosmocore Icd667f41d5735de56cd9fb257670337c679dd258 Change-Id: I6fde8ab8955660b48000ca1b650cfc7c7b2e24ba
2021-01-18gb_proxy: Don't use orphan log subsystem DPCUHarald Welte1-13/+0
DPCU is defined in debug.h, but never registered as log subsystem, so we shall not use it. Also remove other similar "orphan" log subsystems from debug.h Change-Id: I8be54ee49e10d4004128352613923c4700063aa3
2021-01-17gbproxy: Implement IMSI cacheDaniel Willmann1-1/+29
When SGSN pooling is enabled we need to route some responses based on IMSI back to the correct SGSN, e.g. PAGING_PS_REJECT. The IMSI cache keeps track of this IMSI <-> NSE(SGSN) mapping. Change-Id: If0a8d6cc1d63f2fb2c395cc5d4373a915bc2cb87 Related: OS#4951, OS#4472
2021-01-11gbproxy: Implement TLLI cache and use it for SUSPEND/RESUMEDaniel Willmann1-0/+27
When routing a SUSPEND/RESUME we need to keep track of where it came from so we can send the (N)ACK back to the correct BSS. Use the TLLI which is present in both messages to cache and retrieve the correct BSS. A timer runs every two seconds and expires entries that are older than the timeout (hardcoded to 5 seconds for now). Related: SYS#4865, OS#4472 Change-Id: I42adf70f560d2bb358a9e1c7614281e8d2967568
2021-01-04gbproxy: Add VTY command to override the node selection functionDaniel Willmann1-0/+4
This is mainly useful when testing SGSN pooling Change-Id: I2894320413dbd0b9aec9a9bc9b88ce7cdeed206b Related: SYS#5115, OS#4472
2021-01-04gbproxy: Add config option to name an SGSNDaniel Willmann1-2/+6
This is useful for logging and configuration to identify an SGSN by name Change-Id: I2a3410dd9bebb242957e13a63ed70e447204203c Related: SYS#5115, OS#4472
2021-01-04sgsn: Use the new NS2 apiAlexander Couzens2-3/+10
The new NS2 api supports NSE with multiple NS-VC and contains a NS-VC fsm. FR/GRE support is not working. The configuration is compatible except for FR/GRE. Relates: OS#4629 Depends-on: Iaad7b53d44338e5dd81dc2202f23bdcb715af804 (libosmocore) Depends-on: I6cef42749555e577d5573f2ed8b8bce4cf842a98 (libosmocore) Change-Id: I92a3bcaf166b091a22d74c7c1586964d33d7cc9d
2020-12-29gbproxy: Add SGSN pooling supportDaniel Willmann1-0/+2
Change-Id: I58b9f55065f6bd43450e4b07cffe7ba132b1fd9b Related: OS#4472
2020-12-29gbproxy: Add SGSN NRI configurationDaniel Willmann1-2/+37
In order to support SGSN pooling we need to configure the various NRI parameters such as the bitlen, NULL NRI, and which NRIs are assigned to which SGSN. Related: OS#4890, OS#4472 Change-Id: Id67592aa7712e5e04e7264b2fb8f26d57eb7e69e
2020-12-12gbproxy: Implement scaling of BVC flow control in SGSN poolHarald Welte1-0/+5
When there are multiple SGSNs inside a pool, we need to decide how much of the per-BVC capacity advertised by the BSS in its BVC-FLOW-CONTROL we should announce to each of the pool members. A conservative approach would be to advertise 1/num_sgsn, but there may also be use case where over-provisioning (announcing more than an equal share of the capacity) is useful. Hence, let's introduce "pool bvc-flow-control-ratio <1-100>" in order to allow the administrator to decide. Related: OS#4891 Change-Id: Ibe5addf657e7237499ca0205bacfe999ecd1e771
2020-12-10gbproxy: Introduce new DOBJ log category; log object allocation/releaseHarald Welte2-0/+6
Related: OS#4472 Change-Id: I43bcbcda8667d193e7a17fd8e8e9109597b01484
2020-12-10gbproxy major rewrite for SGSN pool supportHarald Welte1-20/+55
Rewrite of a large part of osmo-gbproxy in order to prepare for SGSN pool support. The amount of changes are of such fundamental nature that it doesn't make sense to try to split this into hundreds of individual changesets. Related: OS#4472 Change-Id: Ie0746f17927a9509c3806cc80dc1a31d25df7937
2020-12-10migrate to DLBSSGP as log sub-system for BSSGPHarald Welte1-1/+0
Change-Id: I69ee10b6fad1da2053cf6f3ae99d3ecf62a144ce Depends: libosmocore.git Change-Id I506190aae9217c0956e4b5764d1a0c0772268e93
2020-12-05gbproxy: Remove patching, TLLI-tracking and SGSN2 supportHarald Welte1-218/+0
Those features were introduced a long time ago for one specific use case at one specific user, and they are not needed anymore. They complicate the code base significantly and are hard to maintain with all the upcoming modifications regarding SGSN pool supoprt. Change-Id: Id9cc2e1c63486491ac5bb68876088a615075fde6
2020-12-05gbproxy: convert nse->bvcs from llist_head to hashtableHarald Welte1-2/+2
For the common lookup-by-bvci, this should reduce the computational complexity significantly. Depends: libosmocore.git I8ef73a62fe9846ce45058eb21cf999dd3eed5741 Change-Id: Ic8e9279fd61a3c514fc3203429f36a468f0e81d3
2020-12-05gbproxy: convert bss_nses from llist_head to hashtableHarald Welte1-2/+3
For the common lookup-by-nsei, this should reduce the computational complexity significantly. Depends: libosmocore.git I8ef73a62fe9846ce45058eb21cf999dd3eed5741 Change-Id: Idbb6a362332bb6e3ce22102e7409ae80d0980f44
2020-12-05gbproxy: Rename gbproxy_cfg.nses to gbproxy_cfg.bss_nsesHarald Welte1-3/+3
We will soon also have a list of sgsn-side NSEs, and we need to differentiate those. Change-Id: If5accec0c70c01b88927ea07beba6f6488bd9d5a Related: OS#4472
2020-12-05gb_proxy: Rename gbproxy_peer to gbproxy_bvcHarald Welte1-41/+41
I cannot really read the code while it contains its historical weird naming. A "peer" used to be a strange amalgamation of NSE + BVC, while in reality we can have any number of BVC on top of each NSE. We recently started to split the peer into a gbproxy_nse_peer + gbproxy_peer. This takes it one step further and renames gbproxy_peer to gbproxy_bvc, as that's really what it is. Change-Id: Iae01067282a6401f6af4cab731202872d2cdb080
2020-12-04gbproxy: Add BVC log filtersDaniel Willmann1-0/+3
Since gbproxy doesn't use bssgp_rcvmsg from libosmocore we need to implement our own filtering. Change-Id: I4d1b57b89990945d307f27a58a7f630be0253d5b Related: SYS#5232
2020-12-02gbproxy: Add logging macros for NSE and BVCDaniel Willmann1-0/+11
Change-Id: Ibb2bcf3344bdc750869223b4c4861b4bbc6f417c Related: SYS#5233
2020-11-30gbproxy: Separate function to move gbproxy_peer to different nseDaniel Willmann1-0/+1
Change-Id: I0a8b1e4b78384ea99d50109f050ca501b18ba5d9 Related: SYS#5226
2020-11-30gbproxy: Add NSE peer that can have multiple gbproxy_peersDaniel Willmann1-11/+31
We want this level of indirection to support multiple BVCs per NSE. The current code assumes that an NSE only has one BVC which breaks messages on the signalling BVC which should only be sent once to an NSE regardless of the number of BVCs it contains. Change-Id: I97cc6c8f8c0f1b91577ab8f679c4ae217cc88076 Related: SYS#5226
2020-11-24gprs_gb_parse: Add function to determine TLLI from encoded BSSGPHarald Welte1-0/+2
This will be needed to use the TLLI as link selector parameter in osmo-gbproxy in an upcoming patch. Depends: libosmocore.git I397b32a6e6ea3e9d218446138cceafa9b27685dd Change-Id: Ia6d5300e63ad23987cbdca824db620305bd583d7
2020-11-06Port gbproxy to NS2Alexander Couzens1-5/+6
Since NS2 has a different abstraction we mock up the prim send/recv functions and don't test NS like the old tests did. Related: SYS#4998 Change-Id: Iecfd0408a35a11638d254c1db3c1d477b1a11524
2020-07-18gtphub: rename sgsn's oww osmo_sockaddr into sgsn_sockaddrAlexander Couzens1-31/+31
The osmo_ prefix should be only used for official struct/apis of libosmocore. This commit was done via `sed -i 's/osmo_sockaddr/sgsn_sockaddr/g'`. In prepartion of introducing a different api of osmo_sockaddr to libosmocore. Change-Id: Ibb1ddce9ff1ffe7494de5cdb8ea1843c45fe4566
2020-02-04gprs_gmm_fsm.c: Implement RAT change between 2g and 3gAlexander Couzens1-0/+8
Related: OS#2737 Change-Id: I3fc614da6ba137e871ee0fe86ca22b6a4a354dd2
2019-11-23Use libosmocore constant for IMSI length in ACL entryMax1-1/+1
Presumably the length is chosen to match that of imsi in osmo_gsup_message. Change-Id: I138aea409aab0c748c75546e628797fc7498bf40
2019-11-21Improve logging in gprs_llc.c codePau Espin Pedrol1-3/+3
Change-Id: Id89cc6760179fb9b1709a30b5d1af41d466b280b
2019-10-21sgsn_libgtp.c: Drop use of deprecated libgtp APIs gtp_retrans*()Pau Espin Pedrol1-2/+0
Since osmo-ggsn.git c94837c6a401bf0f80791b619a9b4cfbe9160afd, those APIs are a no-op since timers are tracked internally through osmocom APIs (and at the same time, new implementation fixes some timing related bugs). As a result, osmo-sgsn depends now on at least that libgtp commit. Since it's not yet avaiable on latest libgtp release, let's track it down in TODO-RELESE to not forget to update libgtp requirements during osmo-sgsn release. Related: OS#4178 Change-Id: Ia9a93d4a6ed63cd0c736f9a99d81d730b958d82e
2019-10-17sgsn_libgtp: refactor ps paging into gprs_gbAlexander Couzens1-0/+3
Paging should be done in gprs_gb Change-Id: I3020020f52005aa460ca6b245ee2297aec9821b3
2019-10-08Iu: implement a user inactivity timerAlexander Couzens1-0/+1
The user inactivity timer is similiar to the Gb READY timer and reduces the resources taken by an idle UE. Change-Id: I66c2ac0350cb074aefd9a22c5121acf723f239d3
2019-10-03gprs_ranap: release Iu UE Context when exiting PMM ConnectedAlexander Couzens1-1/+12
PMM Connected defines a Iu signaling connection. The 2 other PMM states do not have an active Iu signaling connection. Change-Id: Ie05d2bdf8dfb593b4c7e837107a3a06f22e90119
2019-09-28sgsn: when receiving data PDU notify the Gb GMM fsmAlexander Couzens1-1/+3
When receiving a PDU, the GMM fsm will change to state MM_READY and will re-arm the T3314 Relates: OS#1941 Change-Id: I78f40762fb17bbd4a6f35608a793f8e5271e9b86
2019-09-03Split out GPRS SM layer into its own filePau Espin Pedrol3-9/+19
Change-Id: Ie61d22e7868af6de73cdf9c731f07130b282599d
2019-09-03Implement GMM State using osmocom FSMPau Espin Pedrol3-10/+36
State machine inspired in the one from TS 24.008 4.1.3.3.1. Some state transitions are inroduced in the code but are still commented out since we lack some functionalitites or improvements in the code to handle different scenarios. Most of the logic is still outside of the FSM, but at least now the states are handled in a sane way triggered by events. Change-Id: Idecb43c10d66224d4f9ba9320825040ce6cf9a07
2019-09-02enum gprs_gmm_state: Fix spec referencePau Espin Pedrol1-1/+1
Change-Id: I62121e46e5091e5b559397aa01f107ddc23e2c18
2019-09-02vty: Print MM state and RAN type in show mm-contextPau Espin Pedrol1-0/+1
Value presviosuly printed as MM state is actually usually refereed as GMM state, so rename it. Change-Id: Ia06c53f0cd2a6348237ed3abeb9367d965745aba
2019-09-02Introduce FSM mm_state_iu_fsmPau Espin Pedrol4-10/+26
Implement TS 23.060 6.1.2 Mobility Management States (Iu mode) using osmocom FSM and drop old implementation. Most of the logic on each state is still kept in gprs_gmm.c, will be inserted into the FSM later. Change-Id: I4c9cf8c27194817c56e8949af0205e1cc14af317
2019-09-02Introduce FSM mm_state_gb_fsmPau Espin Pedrol4-12/+28
Implement TS 23.060 6.1.1 Mobility Management States (A/Gb mode) using osmocom FSM and drop old implementation. Most of the logic on each state is still kept in gprs_gmm.c, will be inserted into the FSM later. Change-Id: I04004423e993107374d5a3549b8a93ac169251dd
2019-09-02Split enum gprs_pmm_state into Iu and Gb counterpartsPau Espin Pedrol2-10/+16
Those two state sets are not part of the same state machine, and are used in different scenarios, so let's split them and handle them in Gb and Iu specific parts of struct sgsn_mm_ctx. This is required in order to improve related code (for instance, use osmocom fsm). Change-Id: I6100d607da316da0595886c6968704dd9ccfbde9
2019-09-02Move llc->MM/SM Gb specific glue code to its own filePau Espin Pedrol3-0/+14
Now that we have RANAP/Iu handling specificities in its own file, let's have also Gb specific glue code for messages coming from llc up to MM/SM layer in its own file. This way same entry points in gprs_gmm.c are used by Gb and Iu: gsm0408_rcv_gmm() (for MM) and gsm0408_rcv_gsm() (for SM). Change-Id: Iaf57922a0970c1d03f6f1d6337d27ae3d4aaf32c
2019-09-02Move lots of Iu/ranap specific code into its own filePau Espin Pedrol4-5/+33
RANAP related functionalities were splitted among several files (gprs_gmm.c, gprs_sgsn.c and sgsn_libgtp.c). Let's move it into its own file to shrink complexity/size of existing files. It also allows to keep a lot of conditionally enabled code (BUILD_IU) and its dependencies (osmo-iuh) together. Change-Id: I549042aaff045a378de77d657cc396ee08f22f33
2019-09-02sgsn: gtp: Drop related pdp contexts on echo timeout against GGSNPau Espin Pedrol1-0/+1
Change-Id: I7e97bac1c13a2c26203eb64e590fd75d77eb44bd
2019-09-02Introduce log helper LOGGGSN and log category DGTPPau Espin Pedrol2-0/+7
It will be used in forthcoming commits. Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
2019-08-28gtp: make echo_interval unsignedPau Espin Pedrol1-1/+1
There's no real need to use -1 to indicate echo timer as disabled, since 0 can also be used (it doesn't make sense to have a timer timeout of 0). This way code is simplified. Change-Id: I689034887188a53590eddeffda781629694eb5ed
2019-08-21vty: Introduce cs7-instance-iuPau Espin Pedrol1-0/+1
Similar to what we already have in osmo-msc. Change-Id: Iaa9e1d06dd0430848ef4f7498a3c15d13f899904
2019-08-20gprs/gprs_gmm: implement T3314. Timeout to reset MM state READY->STANDBYAlexander Couzens1-0/+4
When a MS MM state is READY its exact location is known (PCU). On Gb, T3314 (aka TS 23.060 "READY timer") sets the MM state from READY to STANDBY, where only the RA is known. Introduce a second set of timer variables, because state timer can run while another packet state timer is timing out. Related: OS#1941 Change-Id: I4ce23ebe50d141076c20c9c56990b7103cd25e55
2019-08-20Replace own timer infra with libosmocore osmo_tdefPau Espin Pedrol1-14/+2
VTY command "show timer" is also available now. Change-Id: Ia0cf5f0a49737fbc419e2ccc86312d01c6e0056e