Commit Graph

6659 Commits

Author SHA1 Message Date
Daniel Willmann 6ec5f95748 gbproxy: Add comment, remove unused param in gbproxy_tlli_from_status_pdu
Change-Id: I8fc4c42c11ee38df80fbd316bbe6b1eb243b5323
2021-10-28 16:17:36 +02:00
Daniel Willmann 3d8f599fd1 gbproxy: Route DL STATUS with BVCI on SIG-BVC
Fixes TTCN3 gbproxy test TC_status_sig_dl_bvci

Related: OS#4892
Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
2021-10-28 16:17:36 +02:00
Daniel Willmann 885f430965 gbproxy: Improve STATUS handling from SGSN
STATUS with cause bvci blocked or unknown should not be forwarded

Related: OS#4892
Change-Id: I0ab88634fe2eab5299ff4587fcef4177ce5b4831
2021-09-30 16:59:50 +02:00
Daniel Willmann c5dcebdf42 gbproxy: Add comment, improve log message in gbproxy_tlli_from_status_pdu
Change-Id: Idcd2742f451ba5ae79f62395e033924782336cac
2021-09-30 16:57:51 +02:00
Daniel Willmann cbfc7cf0e2 gpproxy: Route BSSGP STATUS with PDU_IN_ERROR containing a TMSI
Derive a foreign TLLI from a TMSI and route the message according to it
Fixes TC_status_sig_ul_tmsi

Related: OS#4892
Change-Id: Iebda9e9fd433cd28c0f657adc4d475d4e6e247ba
2021-09-30 10:30:56 +02:00
Daniel Willmann 7d37cbb605 gbproxy: Route BSSGP STATUS with PDU_IN_ERROR containing a TLLI
Fixes TC_status_sig_ul_tlli

Related: OS#4892
Change-Id: I9d2ec73520ee46ceedda3f7e63035e6a51a65ac2
2021-09-30 10:30:42 +02:00
Daniel Willmann 723bb36829 gbproxy: Improve log message when no bvc is found (include bvci)
Change-Id: I0cb05b2069d7ef86ed0f7921044aaad01121a412
2021-09-29 17:14:35 +00:00
Daniel Willmann 99a46ff383 gbproxy: Use designated initializers for global_ctr_description
This already showed one unused description where only the enum had been removed.

Change-Id: Ifdb822c25236c19dd52a3ea1370c466d66f9d11d
2021-09-29 13:55:41 +00:00
Daniel Willmann c4b913ba5b gbproxy: Fix stats when no BVC could be found
Change-Id: I413b500515b6c4266370b29943b14447b38a66a0
2021-09-29 11:35:06 +02:00
Daniel Willmann dc763fdf39 gbproxy: Avoid sending STATUS on unexpected BLOCK_ACK
Handle SGSN BVCs that are gone from the BSS differently.

The previous patch removed the gbproxy_bvc on the SGSN-side after it was
gone on the BSS-side. This caused a STATUS response to BVC_BLOCK_ACK messages
that should be valid. Instead of removing the BVC this patch marks it as
inactive so we can still handle BVC_BLOCK_ACK correctly, but ignore
other messages - especially BVC_RESET from the SGSN.

Related: SYS#5628. OS#5236
Change-Id: Ic9f34a27412d6e15ca1198ee140f66a076b5c6b6
2021-09-29 11:35:06 +02:00
Daniel Willmann a1304ee8ef gbproxy: Remove SGSN-side BVC after sending BVC-BLOCK
If we keep the bvc around the SGSN could send a BVC-RESET which the
gbproxy would ACK. This will reestablish the BVC only between the gbproxy and
SGSN which can lead to all sorts of issues.

With this patch the gbproxy will respond with a BVC-STATUS cause BVCI
unknown.

Related: SYS#5628
Fixes: OS#5236
Change-Id: Ib14be6425a81b43353708b2708f79e035e501079
2021-09-24 15:54:10 +02:00
Oliver Smith 00eddca5d2 debian/control: remove dh-systemd build-depend
Related: OS#5223
Change-Id: Ieb8669a9a43ea1acc6b2d8d2e363f2466c51697a
2021-09-01 16:07:06 +02:00
Daniel Willmann 5f762597e5 gbproxy_ctrl: Ignore SIG-BVCI in ctrl commands
Both ctrl commands gbproxy-state and number-of-peers should only
operate on PtP-BVCs. This patch avoids a crash in gbproxy-state and
fixes the count of number-of-peers to only include PtP-BVCs.

Related: SYS#5542, OS#5200
Change-Id: Ida5f9ad0a16b991e77eec0e3cdb779dcfa472fab
2021-07-19 16:10:36 +02:00
Daniel Willmann 5e8c0e813c gbproxy_ctrl: Fix crash in nsvc-state ctrl command
ctrl_nsvc_state_cb() expects us to pass a struct nsvc_cb_data so do that
instead of passing only the ctrl_cmd.

Related: OS#5200, SYS#5542
Change-Id: I8bc67cc9bc90dab9cfca30b062d1d78897aa1e51
2021-07-19 16:05:59 +02:00
Daniel Willmann a631a3a268 gbproxy_peer: Free a cell as soon as no BSS BVC uses it
This patch adds gbproxy_cell_cleanup_bvc() which removes the bvc pointer
to the cell. If the BSS BVC of this cell is removed it frees the whole
cell (removing all the SGSN BVC pointers to the cell). The SGSN-side
BVCs are blocked at this point and will only be reestablished if this
BVC is reset again from the BSS.

Before this patch cells were never freed and might accumulate over time.
They would only be reused if the bvci matched that of a previous cell.

Related: OS#4960
Change-Id: Ib874cbebcea58fa4bf15e1ff40fe11601573e531
2021-07-16 19:15:09 +02:00
Daniel Willmann 990b151fbb gbproxy_peer: Set rate_ctr name for gbproxy_peer stats
Change-Id: I60a5a208ab69ad1184ba643d063717a46a90b131
2021-07-09 20:19:50 +02:00
Daniel Willmann f024eeb9e7 gbproxy: Forward MS_REGISTR_ENQ/_RESP correctly
We need to save the BSS NSE <-> IMSI mapping to correctly route the
answer.

Related: OS#4472
Change-Id: I1908bbe8db11271dbd3f45b0d9f1bc0bfe48f239
2021-07-09 19:04:56 +02:00
Daniel Willmann 361d0b566a gbproxy: Add usage flag to the imsi_cache
This is only used for the imsi cache entries for now. Further uses will
be added in subsequent commits.

Related: OS#4472
Change-Id: I4a4b8c99eb97f6bb5387d0f26aecd861e07d9914
2021-07-09 19:04:47 +02:00
Daniel Willmann f50aa80054 manual: Add chapter describing osmo counters in general
Related: SYS#5005
Change-Id: I088f37abaccd486b9b124c91f5321ee7187873a6
2021-06-16 19:33:01 +02:00
Daniel Willmann 78f3a12c8e manual: Add section describing show gbproxy command usage
Change-Id: Iad2775d125b842f47b0a7b8324fbe417bece04de
2021-06-16 19:33:01 +02:00
Daniel Willmann 226e6cbc8a gbproxy_vty: Remove redundant command "show gbproxy links"
show gbproxy bvc bss displays the same information

Change-Id: I069a4eb8031d2b486a1f88eaf2a0a6a1a06c9fd2
2021-06-16 14:55:25 +02:00
Daniel Willmann 9d98e7cc68 manual: Update counters, add proper chapter for counters
Change-Id: If499ba8f8e26d340e79a42be3fb490e912d507cc
2021-06-16 14:55:25 +02:00
Pau Espin 5643836076 Use new stat item/ctr getter APIs
Generated with spatch:
"""
@@
expression E1, E2;
@@
- &E2->ctr[E1]
+ rate_ctr_group_get_ctr(E2, E1)
"""

Change-Id: Ibc17979c171b6efa522cfd80fddf3f3c593dbd0b
2021-06-04 18:03:44 +02:00
Daniel Willmann 37518b3409 Don't route messages to an SGSN if it is down
If an SGSN in a pool is down we expect the messages to instead be sent
to a different SGSN in the pool. That SGSN will not necessarily know
what to do with those messages, but it should (implicitly) detach that
UE so that it can reattach at the new SGSN. Otherwise UEs on a failed
SGSN would simply stop working as the messages would never be forwarded
anywhere.

Fixes: OS#4952
Change-Id: I3f794659866e1f31496a39ca631b3b042a60aa27
2021-05-28 17:20:44 +02:00
Pau Espin a42963421f Avoid sending tx_status upon rx of RIM messages
Change-Id: Ib8d580ad437f11f6b0a42e76e28b8c3a6c2a12d7
2021-05-07 13:33:34 +02:00
Oliver Smith a45608fe83 examples/osmo-gbproxy.cfg: fix osmo-sgsn conflict
Adjust the config, so osmo-gbproxy and osmo-sgsn can be started with
their default configs on the same machine.

Fixes: OS#5130
Change-Id: I7959ea8ebd1f5c60177f37dd6eb01724308e0fc0
2021-04-26 09:48:30 +02:00
Daniel Willmann 5b75f85871 examples/manuals: Improve/update ns-related documentation
* example config files with current libosmogb options
* Include NS2-related configuration chapters in manual

Closes: SYS#5115
Change-Id: I57cf5dc4ee686352252086917f5f63d5a69dddd7
2021-04-22 18:18:35 +02:00
Daniel Willmann fff868526d gbproxy_main: Process options after all initialization is done
Previously gprs_ns2_vty_init() was called after handle_options(). This
caused config-ns* commands to be missing when calling
osmo-gbproxy --vty-ref-xml
which is used to generate the vty reference manual.

This commit moves argument handling until after all VTY commands have
been installed.

Change-Id: I0f779c16085a42b308925a676b144999106f2b63
2021-04-22 13:40:13 +02:00
Oliver Smith 27dcd33276 gitignore: add gbproxy_vty_reference.xml
Change-Id: I33a0df37b4446b12b53c9e1eace8e5766278be1f
2021-04-13 08:51:06 +02:00
Oliver Smith 9c46926142 doc: include gb-ns2.adoc, not gb-variants.adoc
Adjust to merge of gb-variants.adoc into gb-ns2.adoc in
osmo-gsm-manuals I902b850528cbc04bd469590babd84cccf64300e8.

Change-Id: I17b182db6068ca583078c66c9576029a28016fd4
2021-04-13 08:44:02 +02:00
Harald Welte 838ebb35d1 vty: Print CellId along with RA-ID
The CellIdentifier IE of a BVC-RESET contains RA-ID and CID.  We only
printed the forer, but not the latter. Let's fix that.

Change-Id: Ic8b26afe98e6fe11b130679201493f6bcbade0f4
2021-04-12 08:18:02 +00:00
Daniel Willmann 6701d27313 gb_proxy: Ensure cell info is up to date when receiving PTP-BVC reset
When a BSS resets its BVC and reuses a BVCI with a differente cell id
the SGSN BVC still has the old cell information.

This results in the SGSN receiving a BVC reset for the old cell which in
turn leads to all sorts of issues (probably also with paging) and
conflicting information since the cell info is also present in the
UL-UNITDATA and this is just passed through from the BSS.

Instead of reusing the old BVC on the SGSN side free any existing and create
new ones.

Change-Id: Ia94090a0133340b7b284df6ec5b36546da698b37
2021-04-12 08:17:51 +00:00
Daniel Willmann 76aa06e988 gbproxy_main: Add ctrl vty commands
osmo-gbproxy already provides a ctrl interface, we should be able to
change ctrl-related configuration.

Change-Id: I3f3aa46aa032c1bd0ec88163bb89701d2250f414
2021-04-09 10:51:19 +02:00
Daniel Willmann 1f3470f69a gbproxy: Don't free NSE/BVC0 if SGSN NSE goes down
SGSN NSEs are static and should not be removed. Instead remove all
PtP-BVCs.
BVC0 can't be blocked and will be reset after the NSE becomes available
again. It might be cleaner to remove BVC0 on NS failure and create it
again, but that change is a bit more complicated.

Fixes ttcn3 test after commit f96cac5077 broke them.

Related: OS#4897
Change-Id: Ie0cef38e4423b672f5cba35ae7fc3eb2c4071d5a
2021-03-11 09:53:42 +01:00
Daniel Willmann a16ecc34cc Remove osmo-sgsn relics
* include/osmocom/sgsn -> gbproxy
* (unused) tests specific to osmo-sgsn

Change-Id: I3704760e8936bdd005a3f73727de5f2b3e8774a0
2021-03-10 13:52:07 +01:00
Daniel Willmann f96cac5077 Handle GPRS_NS2_AFF_CAUSE_FAILURE
When a complete NSE becomes unavailable gbproxy should notify the other
side (bss/sgsn).
The current code blocks every PtP-BVC (belonging to that BSS) on all SGSNs if
a BSS goes down.

The BSS-side should not be blocked unless no more SGSN connections are
present. We could also remove all BSS nse and wait for those to reconnect.
This is not yet implemented.

Related: OS#4897
Change-Id: I6354a190ec1090a35c27671c72dab9126d0ad794
2021-03-10 12:14:56 +00:00
Daniel Willmann 38b9c9a9c1 Update the max_sdu_len from NS
Related: OS#4889
Change-Id: Ie26550198db0cc34ca0a882c137c8685a5662f2a
2021-03-10 12:14:56 +00:00
Daniel Willmann 04075ec198 gb_proxy.h: Use pragma once instead of ifndef
Change-Id: I7eb3b1cbd78c25112abf7d526a2aa42bd952c7c9
2021-03-10 12:11:03 +00:00
Daniel Willmann 429c43ce45 Remove some outdated TODO/comments
Change-Id: Icd72ed92585f5701d293807022255b06e5641005
2021-03-10 11:27:13 +00:00
Daniel Willmann f06b4817b9 manuals: Regenerate counters/VTY through docker
Related: SYS#5115, SYS#5005
Change-Id: I39d60a7fd7ec66f3f20bfcef5c32502598f2708f
2021-03-10 11:04:05 +01:00
Daniel Willmann b643765d0a manual: Update manuals, include sgsn pooling and NS variants
Related: SYS#5005, SYS#5115, OS#4523
Change-Id: I440b0f9a6e18c21b11640ca32403f19d7e83b5c1
2021-03-09 16:55:33 +01:00
Daniel Willmann 349b78e8ea gbproxy_main: Fix naming bsc_hack/nsip_proxy -> (osmo-)gbproxy
Change-Id: I58d75561f93ae5f3b23a07d8836e78f21e079928
2021-03-09 15:51:59 +00:00
Pau Espin 52461cfef3 Support setting rt-prio and cpu-affinity mask through VTY
Related: SYS#4986
Change-Id: Id08f858b7f1bc79cc2958af4ffac3e11d644f210
2021-03-03 16:08:29 +01:00
Pau Espin f89d4f899e Bump version: 0.0.1.21-b968-dirty → 0.1.0
Change-Id: Iaf4e2cc6cfc017f7e2e6b29068c00194fe9cd276
2021-02-24 16:54:13 +01:00
Pau Espin b968c5f0ad gitignore: Ignore autofoo files *~
Change-Id: Ie70295259a0e807019755d5199450a6c9b64fffe
2021-02-24 16:40:07 +01:00
Daniel Willmann f8cba65017 gbproxy: Use bssgp2_enc_status when sending STATUS
bssgp_tx_status() is not aware of the MTU and cannot truncate the PDU if
needed. Use the newer bssgp2_enc_status() which supports truncating the
PDU.

Related: OS#4889
Depends: Ic39d918c56399ceb0431299ce938e3bf276f678a (libosmocore.git)
Change-Id: Id5ddb10385655b339b2a4f04651c1da09b3efb62
2021-02-16 16:42:00 +01:00
Daniel Willmann a8b61659e6 Add SDU length for an NSE (== BSSGP PDU size)
Prepare tracking the SDU from NS. Initialize with a conservative default.
The value is not yet updated, that will happen in a later patch.

Related: OS#4889
Depends: I5016b295db6185ec131d83089cf6c806e34ef1b6 (libosmocore.git)
Depends: I9bb82ead27366b7370c9ff968e03ca2113ec11f0 (libosmocore.git)
Change-Id: Ic1080abde942ec5a2ae7cdee0ffe716a2fbddb1e
2021-02-16 16:39:45 +01:00
Oliver Smith a8fa567117 d/changelog: set epoch=1
Let apt know that the current 0.0.1 release of the split osmo-gbproxy
repository should be preferred over all packages from before the split.

Related: https://www.debian.org/doc/debian-policy/ch-controlfields.html#version
Related: OS#4992
Change-Id: I3e3749cd14bff3b38261ae048b928ea8c54dfcef
2021-02-15 14:44:21 +01:00
Daniel Willmann 2689c6e7d7 Move vty node into gbproxy_vty.c
This is no longer shared with osmo-sgsn and osmo-gtphub

Change-Id: I5329ca39e8ecfe29862b0b1f9afa7d35e678a181
2021-02-12 16:26:22 +01:00
Daniel Willmann 86ee31a7d7 Remove unused log categories
Change-Id: I519a687c07410fa3c1a0fa9a903d6c3ed9cbba45
2021-02-12 15:47:22 +01:00