osmo-pcu/src
Pau Espin c1278288b5 gprs_rlc_ul_window: Mark received BSNs falling out of the V(N)/RBB when V(R) is raised
This is a port of libosmo-gprs.git commit 49535bec37caddcea5718ed4e526c477c71f1b3a applied to osmo-pcu.

Problem this patch is fixing:
The current RLCMAC code is never invalidating the BSNs which have
been received after they are not needed.
This is somehow workaround by the following check when eg BSN wraps
around 127->0 and the BSN=0 is received:
""""
rcv_data_block_acknowledged()
	m_window.m_v_n.is_received(rdbi->bsn)
		/* Offset to the end of the received window */
		offset_v_r = (m_v_r - 1 - bsn) & mod_sns();
		return m_v_n.is_received(bsn) && offset_v_r < ws();
"""

The first m_v_n_is_received() would return true because the BSN has
never been invalidated, which is wrong, but fortunately the extra check
"offset_v_r < ws()" returns > ws() since:
v_r=0, bsn=0: "(0 - 1 - 0) & 127" ----> 0xffff & 0x007f ---> 0x007f > 64

So thanks to the above the BSN is considered not received, but looking
at the V(N) array would say the opposite. Hence, this commit aims at
fixing the V(N) array to contain proper values (marked "invalid") for
BSNs becoming out of the window when it rolls forward.

Explanation of the solution:
The V(N) array contains the status of the previous WS (64 in GPRS) data
blocks. This array is used to construct the RRB signaled to the peer
during PKT UL ACK/NACK messages together with the SSN (start sequence
number), which in our case is mainly V(R), aka one block higher than the
highest received block in the rx window.
Hence, whenever PKT UL ACK/NACK is transmitted, it contains an RRB
ranging [V(R)-1,...V(R)-WS)] mod SNS (SNS=128 in GPRS).

The receive window is basically [V(Q) <= BSN < V(R)] mod SNS, as is of
size 64.
The V(R) is increased whenever a highest new block arrives which is in the
receive window (guaranteeing it will be increased to at most V(Q)+64.

Since we are only announcing state of blocks from V(R)..V(R)-WS, and
blocks received which are before that BSN are dropped since don't fall
inside the rx window, we can securely mark as invalid those blocks
falling behind V(R)-WS whenever we increase V(R).

Related: OS#6102
Change-Id: I5ef4dcb0c5eac07a892114897f9e4f565b1dcc2c
2023-07-26 17:03:53 +02:00
..
ericsson-rbs pcu_l1_if_phy: fix API function names 2023-05-03 09:57:38 +02:00
osmo-bts-litecell15 pcu_l1_if_phy: fix API function names 2023-05-03 09:57:38 +02:00
osmo-bts-oc2g oc2g: Fix multiple definitions of arrays 2023-07-14 19:41:54 +02:00
osmo-bts-sysmo pcu_l1_if_phy: fix API function names 2023-05-03 09:57:38 +02:00
.gitignore Adding .gitignore to source directory 2012-06-27 17:45:15 +02:00
Makefile.am Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
alloc_algo.cpp copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
alloc_algo.h copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
bts.cpp Store T3192 value received from SI13, do some sanity checks 2023-06-20 09:27:10 +00:00
bts.h Derive FN from RFN once and cache it in struct rach_ind_params 2023-06-02 14:37:05 +02:00
bts_pch_timer.c bts_pch_timer: Avoid resend Paging Request over PCUIF if T3113 is armed 2021-11-08 18:54:12 +00:00
bts_pch_timer.h bts_pch_timer: Avoid resend Paging Request over PCUIF if T3113 is armed 2021-11-08 18:54:12 +00:00
coding_scheme.c treewide: remove FSF address 2021-12-14 12:19:13 +01:00
coding_scheme.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
csn1.c treewide: remove FSF address 2021-12-14 12:19:13 +01:00
csn1.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
csn1_dec.c treewide: remove FSF address 2021-12-14 12:19:13 +01:00
csn1_enc.c treewide: remove FSF address 2021-12-14 12:19:13 +01:00
cxx_linuxlist.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
decoding.cpp Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
decoding.h Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
egprs_rlc_compression.cpp Clean false positive in newer GCC version checking guard of else clause 2021-05-19 11:58:57 +02:00
egprs_rlc_compression.h egprs_rlc_compression: fix white spaces 2019-06-17 02:04:09 +02:00
encoding.cpp encoding: pass RFN to write_immediate_assignment(_reject)() 2023-06-02 14:36:57 +02:00
encoding.h encoding: pass RFN to write_immediate_assignment(_reject)() 2023-06-02 14:36:57 +02:00
gprs_bssgp_pcu.c bts: Rename bts_ms_by_{tlli,imsi} -> bts_get_ms_by_{tlli,imsi} 2023-04-20 16:17:38 +02:00
gprs_bssgp_pcu.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
gprs_bssgp_rim.c ms: Merge ms_storage into bts.cpp 2023-04-20 16:17:38 +02:00
gprs_bssgp_rim.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
gprs_codel.c treewide: remove FSF address 2021-12-14 12:19:13 +01:00
gprs_codel.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
gprs_debug.c Add new log category 'ms' 2023-04-21 14:36:28 +02:00
gprs_debug.h Add new log category 'ms' 2023-04-21 14:36:28 +02:00
gprs_ms.c gprs_ms: Update assert condition 2023-07-05 14:19:13 +02:00
gprs_ms.h ms_need_dl_tbf(): Fix state checks and document function 2023-06-29 14:41:50 +02:00
gprs_pcu.c Abort UL TBF PACCH Ass based on T3168 2023-06-12 16:24:10 +02:00
gprs_pcu.h ctrl: drop deprecated neighbor resolution interface 2023-05-12 15:22:03 +00:00
gprs_rlcmac.c gprs_rlcmac: also use PCU_IF_SAPI_PCH_DT for paging MAC blocks 2023-05-22 12:35:09 +02:00
gprs_rlcmac.h gprs_rlcmac: convert from C++ to C 2023-04-12 16:13:10 +03:00
gprs_rlcmac_meas.cpp meas: Improve logging formatting 2023-04-21 14:36:28 +02:00
gprs_rlcmac_sched.cpp cosmetic: Remove unneeded curly braces 2023-01-27 11:29:52 +01:00
gsm_rlcmac.c treewide: remove FSF address 2021-12-14 12:19:13 +01:00
gsm_rlcmac.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
llc.c Reestore last LLC frames never completely acked when freeing DL TBF 2023-06-29 14:53:09 +02:00
llc.h Reestore last LLC frames never completely acked when freeing DL TBF 2023-06-29 14:53:09 +02:00
mslot_class.c treewide: remove FSF address 2021-12-14 12:19:13 +01:00
mslot_class.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
nacc_fsm.c nacc_fsm: fix uninitialized neigh_key variable 2023-07-24 13:08:09 +02:00
nacc_fsm.h nacc_fsm: Add support for NACC with UTRAN and E-UTRAN cells 2023-07-18 07:07:59 +00:00
neigh_cache.c neigh_cache: make neigh_cache_lookup_entry static 2023-07-03 12:49:03 +02:00
neigh_cache.h neigh_cache: make neigh_cache_lookup_entry static 2023-07-03 12:49:03 +02:00
osmobts_sock.c pcuif: Log read() error cause 2023-07-05 14:03:36 +02:00
pcu_l1_if.cpp pcu_l1_if: Document tx_pch empty IMSI scenario 2023-07-14 19:41:54 +02:00
pcu_l1_if.h gprs_rlcmac: also use PCU_IF_SAPI_PCH_DT for paging MAC blocks 2023-05-22 12:35:09 +02:00
pcu_l1_if_phy.h pcu_l1_if_phy: fix API function names 2023-05-03 09:57:38 +02:00
pcu_main.cpp pcu_l1_if_phy: add new PHY API function to initialize PHY 2023-02-27 16:47:12 +01:00
pcu_utils.h Document pcu_lsb() function 2023-06-03 12:46:26 +00:00
pcu_vty.c ctrl: drop deprecated neighbor resolution interface 2023-05-12 15:22:03 +00:00
pcu_vty.h vty: add attributes to VTY commands indicating when they apply 2020-10-08 07:16:31 +00:00
pcu_vty_functions.cpp vty: Several improvements to 'show ms' output format 2023-04-21 14:42:10 +02:00
pcu_vty_functions.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
pdch.cpp cosmetic: pdch.cpp: Drop wrong comment due to copy-paste error 2023-06-29 14:53:37 +02:00
pdch.h pdch: Introduce APIs to print PDCH name 2022-12-16 12:11:23 +01:00
pdch_ul_controller.c pdch_ul_controller: log reserved frame numbers 2023-03-27 09:14:40 +00:00
pdch_ul_controller.h constify pdch_ulc_get_next_free_fn() parameter 2022-11-17 19:32:40 +03:00
rlc.cpp Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
rlc.h Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
rlc_window.cpp Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
rlc_window.h Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
rlc_window_dl.cpp Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
rlc_window_dl.h Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
rlc_window_ul.cpp gprs_rlc_ul_window: Mark received BSNs falling out of the V(N)/RBB when V(R) is raised 2023-07-26 17:03:53 +02:00
rlc_window_ul.h gprs_rlc_ul_window: Mark received BSNs falling out of the V(N)/RBB when V(R) is raised 2023-07-26 17:03:53 +02:00
sba.c treewide: remove FSF address 2021-12-14 12:19:13 +01:00
sba.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00
tbf.cpp Change several log lines to start with capital letter 2023-06-13 17:20:38 +02:00
tbf.h Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
tbf_dl.cpp Reestore last LLC frames never completely acked when freeing DL TBF 2023-06-29 14:53:09 +02:00
tbf_dl.h Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
tbf_dl_ass_fsm.c Mark several fsm related internal symbols as static 2023-01-30 10:42:44 +01:00
tbf_dl_ass_fsm.h Mark several fsm related internal symbols as static 2023-01-30 10:42:44 +01:00
tbf_dl_fsm.c tbf_dl_fsm: Fix '{FLOW}: Event ASSIGN_PCUIF_CNF not permitted' 2023-06-29 14:53:37 +02:00
tbf_fsm.c Mark several fsm related internal symbols as static 2023-01-30 10:42:44 +01:00
tbf_fsm.h Differentiate between T3192 and T3193 2023-06-20 12:07:45 +02:00
tbf_ul.cpp gprs_rlc_ul_window: Mark received BSNs falling out of the V(N)/RBB when V(R) is raised 2023-07-26 17:03:53 +02:00
tbf_ul.h Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} 2023-07-26 16:55:22 +02:00
tbf_ul_ack_fsm.c Fix DL_TBF PACCH ass done on UL_TBF already scheduled to tx last PKT CTRL ACK 2023-06-20 07:17:52 +00:00
tbf_ul_ack_fsm.h Mark several fsm related internal symbols as static 2023-01-30 10:42:44 +01:00
tbf_ul_ass_fsm.c cosmetic: Improve comment 2023-06-13 17:25:01 +02:00
tbf_ul_ass_fsm.h Mark several fsm related internal symbols as static 2023-01-30 10:42:44 +01:00
tbf_ul_fsm.c tbf_ul_fsm: Delay moving ul_tbf to FLOW 2023-06-29 14:42:33 +02:00
wireshark_compat.h treewide: remove FSF address 2021-12-14 12:19:13 +01:00