aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2020-06-26sgsn_libgtp: Avoid ps-paging MS on GMM Suspended statepespin/pspagingPau Espin Pedrol1-4/+3
The MS notifies movement to GMM SUSPEND state because it is for instance handling a call and cannot use PDCH anymore. Once it releases the TCH it will ASAP move to either dedicated mode or trigger RAU, which means it will get out of SUSPEND state. So it doesn't make sense to try paging the MS when in that state. Related: OS#4616 Change-Id: Ia245899eb9f16c7f839785def4ceb721a1c3a11b
2020-06-26gprs_gmm_fsm.c: Add missing license headerPau Espin Pedrol1-0/+22
The file was created by myself on September 2019, 31c4657c971e40407163034526aafeb9b5a83460. Change-Id: I94299b9ccf760ad13429e149067f06ed60d37de3
2020-06-18sgsn_libgtp: Improve ps-paging loggingPau Espin Pedrol1-1/+7
Change-Id: I0c3d48d54295824c3ba5b0fa9e3c035983556326
2020-06-18use new osmo_mobile_identity API everywhereNeels Hofmeyr5-107/+123
Depends: If4f7be606e54cfa1c59084cf169785b1cbda5cf5 (libosmocore) Change-Id: I4cacb10bac419633ca0c14f244f9903f7f517b49
2020-06-17Treat RAU as implicit RESUME if GMM is suspendedHarald Welte1-3/+8
We so far only resumed from suspend upon receiving an explicit BSSGP RESUME message from the BSS. The latter is only possible in BSC-colocated PCU, where the BSC can trigger the message when releasing the dedicated channel. In BTS-colocated PCUs, this is not possible, and we have to rely on the MS resuming by RAU. See 3GPP TS 23.060 section 16.2.1.1.1 clause 6: The MS shall resume GPRS services by sending a Routeing Area Update Request message to the SGSN: * if the BSS did not successfully request the SGSN to resume GPRS services, * if the RR Channel Release message was not received before the MS left dedicated mode, * if the MS locally determines that the conditions for the GPRS suspension have disappeared Without this patch, the GMM state would forever be stuck in SUSPEND, which in turn causes the SGSN to page the MS all the time. Change-Id: I3c09187a27483d95fa0070bbb467f94a2ea3978f Related: OS4616
2020-06-08Fix memory leak when SNDCP de-fragmentation is usedHarald Welte1-0/+4
As msgb ownership is not passed along, we need to free the message buffer memory we allocate in defrag_segments() after calling sgsn_rx_sndcp_ud_ind(). Change-Id: I1185b1aa99bb167d616eb469e5445e4ed5ad949d Closes: OS#4603
2020-05-12gsup: send RAT type on LUNeels Hofmeyr1-2/+14
At 36c3, osmo-hlr was run with a patch that records the RAN type of attached subscribers. Even though this is not in osmo-hlr master, it is nice information to send along. Change-Id: I5dbe610738aed7ea1edf6b33543b1c03818cc274
2020-05-10fix nullpointer: in gsm48_rx_gmm_ra_upd_req()Neels Hofmeyr1-1/+1
This caused frequent crashes at 36c3. The "proper" fix is probably elsewhere (lynxis mentions an unfinished patch), but at least this prevented some crashes during active operation. Once this is merged, we can (re)enable SGSN_Tests_Iu.TC_geran_attach_iu_rau, which tests exactly for this scenario: A Subscriber / MM context that is so far attached via GERAN, but now receives a RAU via UTRAN/Iu. Closes: OS#4339 Change-Id: Ifde15dc4151d84748f0e67b32c9c260cb2d9d8fc
2020-05-09Use OSMO_FD_* instead of deprecated BSC_FD_*Pau Espin Pedrol3-13/+13
New define is available since libosmocore 1.1.0, and we already require 1.2.0, so no need to update dependenices. Let's change it to avoid people re-using old BSC_FD_* symbols when copy-pasting somewhere else. Change-Id: Iaebd049e383b02204a12f39cc6c932a53d25fd72
2020-02-04gprs_gmm_fsm.c: Implement RAT change between 2g and 3gAlexander Couzens2-2/+55
Related: OS#2737 Change-Id: I3fc614da6ba137e871ee0fe86ca22b6a4a354dd2
2020-02-04gprs_gmm: Check for RAT change and ensure this only happens for RAU/ATTDaniel Willmann1-0/+27
Change-Id: I38cb31907eddeade5350cdb648df179408d908d2 Related: OS#3727
2019-12-03exit(2) on unsupported positional arguments on command lineHarald Welte3-0/+15
Change-Id: I4f2d70d0b0f1b7bdb8604c930aba8fbb53d8bd54
2019-12-01check for osmo_ss7_init() error return valueHarald Welte1-1/+1
Change-Id: Ic228273aa6fb197b78c70c467a4a99af317e8098
2019-12-01check for osmo_fsm_register() error return valuesHarald Welte4-4/+4
Change-Id: I2028c82ac1b0421101c3f5d04fd999b65abdbf08
2019-11-30LLC: Don't use hard-coded N201-U / N201-I values in XIDHarald Welte1-2/+5
The N201 values are negotiated per SAPI, and there are default values per each SAPI. Let's use those rather than hard-coded values. Closes: OS#3954 Change-Id: I447a3c6dd85311772a6e219c62dc820d2726857f
2019-11-21gprs_gmm.c: Send XID reset with received TLLIPau Espin Pedrol1-1/+1
Otherwise lower layers will end up using a TLLI from PTMSI which was not yet announced to the MS if it is still not in GMM attached state, as showcased by SGSN_Tests.TC_attach_req_id_req_ra_update. Related: OS#3957, OS#4245 Change-Id: Ide51726abb82f5784eca4ab8d62b2ad8512be843
2019-11-21gprs_llc.c: Use enum instead of hardcoded valuePau Espin Pedrol1-1/+1
Change-Id: I89815f44f615a188f46a13f3785b3f7484f73bb3
2019-11-21Improve logging in gprs_llc.c codePau Espin Pedrol2-8/+23
Change-Id: Id89cc6760179fb9b1709a30b5d1af41d466b280b
2019-11-08gmm: Fix assertion hit during RA UPD REQ before completting gmm attachPau Espin Pedrol1-2/+2
Output: 20191107021548500 DMM <0002> gprs_gb.c:40 MM_STATE_Gb(2596296189)[0x6120000084a0]{Idle}: Received Event E_MM_PDU_RECEPTION 20191107021548500 DMM <0002> gprs_gmm.c:1531 MM(/d4b6d7af) -> GMM RA UPDATE REQUEST type="RA updating" 20191107021548501 DMM <0002> gprs_gmm.c:1615 MM(/d4b6d7af) The MM context cannot be used, RA: 901-70-2758-208 Assert failed mmctx->gb.llme == NULL gprs_gmm.c:1620 Scenario reproducing the crash can be triggered with TTCN3 SGSN_Tests.TC_attach_req_id_req_ra_update. Basically, SGSN first receives an ATTACH REQ with a given RA ID, then SGSN switches to state CommonProcedureInitiated and sends GMM ID REQ, and MS/PCU answers immediatelly with a RA Update instead with a new RA ID. Related: OS#3957, OS#4245 Change-Id: I64fa5cf1b427d3abb99e553e584897261a827ce6
2019-10-21sgsn_libgtp.c: Drop use of deprecated libgtp APIs gtp_retrans*()Pau Espin Pedrol1-26/+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: Gb: implementing PS Paging when MS is MM_STANDBYAlexander Couzens1-0/+6
When the MS is in MM_STANDBY, the Routing Area is known, but not the exact cell. Start the paging procedure. (Even this is only supported for the last known cell, not the Routing Area. Routing Area paging is not yet supported.) Change-Id: Icc2c6ba70f8f74054546a1e31741fc90b232a23c
2019-10-17sgsn_libgtp: refactor ps paging into gprs_gbAlexander Couzens2-11/+25
Paging should be done in gprs_gb Change-Id: I3020020f52005aa460ca6b245ee2297aec9821b3
2019-10-09gprs_mm_state_iu_fsm.c: fix: assign timer_cb to mm_state_iu_fsmVadim Yanitskiy1-0/+1
GCC warns us that 'pmm_state_fsm_timer_cb' is defined but not used. This function was introduced in [1], but was not assigned to the FSM. [1] I66c2ac0350cb074aefd9a22c5121acf723f239d3 Change-Id: Ib040befc87b2676aad2b8fe3671404fb3f5b030b
2019-10-08sgsn_mm_ctx_alloc(): check for unallocated fsmsAlexander Couzens1-0/+25
Change-Id: I867612a60236eaf7009400c92f5d871006aaf008
2019-10-08gprs_gmm: release Iu connection on RAU failuresAlexander Couzens1-0/+6
When a RAU fails without an a GMM context, release the Iu connection after sending a response. Change-Id: I05a9200f55d608ccfb3f86184c324a2b428da76b
2019-10-08ranap: add non-spec X1001Alexander Couzens2-3/+11
When the SGSN releases a RANAP connection, it sends a Release Command and waits for a Release Complete. Use X1001 to release the Iu connection when the Release Complete is lost/never received. Change-Id: I39a0169c22a4ac430b3d6f3c281d1f381eaa4756
2019-10-08sgsn: MM Gb Fsm: fix event handling for implicit detachAlexander Couzens1-1/+3
Implicit detach means there won't be any Gb state afterwards. Change-Id: Iececb730e7135e14ebd94f82edb79b03ced1f9e3
2019-10-08gprs_sgsn: always allocate Gb/Iu mm fsmAlexander Couzens1-6/+6
When moving between RANs we need them at a later point. Allocate them always to not make the code (more) complex. Change-Id: I1724790335b0820f153a0cbdb5cfd1cfea36d1e9
2019-10-08gprs_ranap: add missing rc = 0Alexander Couzens1-0/+1
After processing the event, set the return code to success. Thanks to manatails (redmine). Change-Id: I73b3b3c3dd330bc953835737758854cf68539495 Fixes: #3969
2019-10-08gprs_mm_state_gb_fsm: ensure T3350 is not running when entering IDLEAlexander Couzens1-0/+4
In IDLE there is not further context with the MS. Prevents the Timer from sending packages to a MS which can not respond Change-Id: Ibdd913173af11d0e6d04aa392e047d5d9aee1243
2019-10-08gprs_ranap: on Iu release, stop the attach fsm if runningAlexander Couzens1-0/+3
A Iu release should stop any active procedure. Change-Id: I78c6c0c4024657212d6abef51e226ce233018fee
2019-10-08Iu: implement a user inactivity timerAlexander Couzens2-2/+27
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 Couzens2-1/+40
PMM Connected defines a Iu signaling connection. The 2 other PMM states do not have an active Iu signaling connection. Change-Id: Ie05d2bdf8dfb593b4c7e837107a3a06f22e90119
2019-10-03Avoid compiling unneeded files when building without IuAlexander Couzens2-6/+5
Remove gprs_ranap.c and gprs_mm_state_iu_fsm.c from the Makefile when building without IU. Change-Id: I2386f8e86bbf0b87eedce9f57eb86b1b64998a69
2019-09-28sgsn: when receiving data PDU notify the Gb GMM fsmAlexander Couzens2-1/+18
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-12gprs_ranap: refactor REQUIRE_MM defineAlexander Couzens1-16/+6
All branches need a MM context. Exit early if no MM context present. Change-Id: Ifa4c55f1f2c199fa63bd755311026b8586a65f3f
2019-09-12mm_gb_fsm: unassign the llme when entering MM_IDLEAlexander Couzens1-0/+11
MM_IDLE means there is no known state to this MM. Change-Id: Ieb0d6cea828842763c13942fe1a63dd89399f799
2019-09-12gprs_ranap: send CommonId after receiving Security Mode CompleteAlexander Couzens1-0/+1
After Security Mode Complete, the sender has been authenticated. Send a CommonId to enable paging coordination between CS and PS. Change-Id: If195c26e87ba3054e159746671babf93a12e7013
2019-09-10sgsn_pdp_ctx_terminate: check llme before accessingAlexander Couzens1-1/+2
Change-Id: Ib4361cdc12f9c1674c89c6fafeeb52a3f42abe1d
2019-09-06sgsn: Reject PdpActReq if no GTP pdp ctx existsPau Espin Pedrol1-0/+5
It could happen that SGSN drops GTP side of a pdp ctx (pdp->lib=NULL) while still maintaing the other side (to notify about the entire pdp ctx being torn down). If a PdpActReq arrives during that time, we need to account for that situation, otherwise osmo-sgsn crashes accessing pdp->lib. If no pdp->lib is found at that time, let's reject the request and expect at some point later in time the entire pdp context will be destroyed and reestablished. Related: OS#4173 Change-Id: I6dd87557ebb26fdbd280504abde10d976acecf64
2019-09-03Split out GPRS SM layer into its own filePau Espin Pedrol7-700/+760
Change-Id: Ie61d22e7868af6de73cdf9c731f07130b282599d
2019-09-03Implement GMM State using osmocom FSMPau Espin Pedrol6-39/+220
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-02gmm: Move code handling GMM PTMSI Realloc Complete to its own functionPau Espin Pedrol1-11/+17
Change-Id: I3b21a976c6683bea5419a33f0ccb8b56483d6e21
2019-09-02gmm: Move code handling GMM Routing Area Update Complete to its own functionPau Espin Pedrol1-25/+32
Change-Id: I8e28ac03edf82374e804701ebe635e1171a2b36a
2019-09-02gmm: Move code handling GMM Attach Complete to its own functionPau Espin Pedrol1-33/+40
Change-Id: I2d8d947ab1eb4100f404b885461f7a30583c9ac6
2019-09-02Move out sgsn to its own subdirPau Espin Pedrol28-58/+89
Change-Id: I16fccc0eadf588599b9e5578d0f4dbaf9df81737
2019-09-02Move out gtphub to its own subdirPau Espin Pedrol8-19/+46
Change-Id: I707d5e9b775179e732d281ce3d245de83d648eea
2019-09-02Move out gbproxy to its own subdirPau Espin Pedrol10-16/+47
Change-Id: I2cc98d3a276d953609bbbbaa9782a0112687791e
2019-09-02src/gprs/Makefile.am: Move build of shared .c files to an internal libPau Espin Pedrol1-10/+22
Build files shared by osmo-sgsn, osmo-gbpy and osmo-gtphub into a .la library, so we can later split each application into its own subdir and clearly identify what's used by who. Due to a dependency error with .Po files, I cannot depend on the specific .o files directly in LDADD for each binary, but it works fine on follow up commits when binaries are splitted into different makefiles, so it will be done later. Change-Id: Ib7665c530c086a5f3135c395bb8bf19ed4a882b6
2019-09-02vty: Print MM state and RAN type in show mm-contextPau Espin Pedrol2-1/+15
Value presviosuly printed as MM state is actually usually refereed as GMM state, so rename it. Change-Id: Ia06c53f0cd2a6348237ed3abeb9367d965745aba