dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/34058 )
Change subject: pcu_l1_if: add support for PCU_IF_SAPI_AGCH_DT for PCUIF v.11
......................................................................
pcu_l1_if: add support for PCU_IF_SAPI_AGCH_DT for PCUIF v.11
When an downlink IMMEDIATE ASSIGNMENT message is sent through the PCH,
an IMSI is always required in order to be able to calculate the paging
group. However, when the downlink IMMEDIATE ASSIGNMENT has to be sent
before the MS has completed the GMM ATTACH REQUEST, the IMSI is still
unknown. In this case we may assume that the MS is still in non-DRX
mode, which means it listens on all CCCH blocks (PCH and AGCH).
This means we may send the IMMEDIATE ASSIGNMENT through the AGCH in this
situation. This will also have the advantage that the scheduling through
the AGCH will have less latency than the paging queue.
Unfortunately the SAPI PCU_IF_SAPI_AGCH only supports sending whole MAC
blocks, so it won't be possible to attach a TLLI that can be used for
confirmation. To fix this, let's add a new SAPI_PCUI_IF_AGCH_DT, that
works similar as SAPI PCU_IF_SAPI_PCH_DT and use it to send the
IMMEDIATE ASSIGNMENT through the AGCH.
CAUTION: This patch breaks compatibility with current master osmo-bts
and osmo-bsc (see "Depends")
Related: OS#5927
Depends: osmo-bts.git I29858fa20ad8bd0aefe81a5c40ad77a2559a8c10
Change-Id: I9effdcec1da91a6e2e7a7c41f95d3300ad1bb292
---
M include/osmocom/pcu/pcuif_proto.h
M src/bts.cpp
M src/pcu_l1_if.cpp
M src/pcu_l1_if.h
4 files changed, 98 insertions(+), 20 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/58/34058/1
diff --git a/include/osmocom/pcu/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h
index 1dda160..0d02379 100644
--- a/include/osmocom/pcu/pcuif_proto.h
+++ b/include/osmocom/pcu/pcuif_proto.h
@@ -42,6 +42,7 @@
#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */
#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */
#define PCU_IF_SAPI_PCH_DT 0x08 /* assignment on PCH (confirmed using TLLI) */
+#define PCU_IF_SAPI_AGCH_DT 0x09 /* assignment on AGCH (confirmed using TLLI) */
/* flags */
#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */
@@ -282,6 +283,15 @@
uint8_t data[GSM_MACBLOCK_LEN];
} __attribute__((packed));
+/* Struct to send a (confirmed) IMMEDIATE ASSIGNMENT message via AGCH. The struct is sent as a data request
+ * (data_req) under SAPI PCU_IF_SAPI_AGCH_DT. */
+struct gsm_pcu_if_agch_dt {
+ /* TLLI as reference for confirmation */
+ uint32_t tlli;
+ /* GSM mac-block (with immediate assignment message) */
+ uint8_t data[GSM_MACBLOCK_LEN];
+} __attribute__((packed));
+
struct gsm_pcu_if {
/* context based information */
uint8_t msg_type; /* message type */
diff --git a/src/bts.cpp b/src/bts.cpp
index fe48018..31f4d9e 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -1033,7 +1033,10 @@
rip->burst_type);
bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_UL_TBF);
if (plen >= 0) {
- pcu_l1if_tx_agch(bts, bv, plen);
+ if (the_pcu->pcu_if_version >= 0x0b)
+ pcu_l1if_tx_agch_dt(bts, bv, plen, tbf->tlli());
+ else
+ pcu_l1if_tx_agch(bts, bv, plen);
rc = 0;
} else {
rc = plen;
@@ -1047,8 +1050,12 @@
bv, rip->ra, rip->rfn, rip->burst_type,
(uint8_t)osmo_tdef_get(bts->T_defs_bts, 3142, OSMO_TDEF_S, -1));
bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_REJ);
- if (plen >= 0)
- pcu_l1if_tx_agch(bts, bv, plen);
+ if (plen >= 0) {
+ if (the_pcu->pcu_if_version >= 0x0b)
+ pcu_l1if_tx_agch_dt(bts, bv, plen, tbf->tlli());
+ else
+ pcu_l1if_tx_agch(bts, bv, plen);
+ }
bitvec_free(bv);
/* rc was already properly set before goto */
return rc;
@@ -1128,10 +1135,26 @@
GSM_L1_BURST_TYPE_ACCESS_0);
if (plen >= 0) {
bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_DL_TBF);
- if (the_pcu->pcu_if_version >= 0x0b)
- pcu_l1if_tx_pch_dt(bts, immediate_assignment, plen, tbf->imsi(), tbf->tlli());
- else
+
+ if (the_pcu->pcu_if_version >= 0x0b) {
+ if (ms_imsi_is_valid(tbf->ms())) {
+ pcu_l1if_tx_pch_dt(bts, immediate_assignment, plen, tbf->imsi(), tbf->tlli());
+ } else {
+ /* During GMM ATTACH REQUEST, the IMSI is not yet known to the PCU or SGSN. (It is requested
+ * after the GMM ATTACH REQUEST with the GMM IDENTITY REQUEST.) When the PCU has to assign a
+ * DL TBF but the IMSI is not known, then the IMMEDIATE ASSIGNMENT is sent on the AGCH. The
+ * reason for this is that without an IMSI we can not calculate the paging group, which would
+ * be necessary for transmission on PCH. Since the IMSI is usually only unknown during the GMM
+ * ATTACH REQUEST, we may assume that the MS is in non-DRX mode and hence it is listening on
+ * all CCCH blocks, including AGCH.
+ *
+ * See also: 3gpp TS 44.060, section 5.5.1.5
+ * 3gpp TS 45.002, section 6.5.3, 6.5.6 */
+ pcu_l1if_tx_agch_dt(bts, immediate_assignment, plen, tbf->tlli());
+ }
+ } else {
pcu_l1if_tx_pch(bts, immediate_assignment, plen, tbf->imsi());
+ }
}
bitvec_free(immediate_assignment);
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index f42a3d4..283a97e 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -251,6 +251,8 @@
void pcu_l1if_tx_agch(struct gprs_rlcmac_bts *bts, bitvec *block, int plen)
{
+ /* TODO: When PCUIF v.11 has become mainline, we will use pcu_l1if_tx_agch_dt() exclusively.
+ * This will make this function obsolote, so we can remove it. */
uint8_t data[GSM_MACBLOCK_LEN]; /* prefix PLEN */
/* FIXME: why does OpenBTS has no PLEN and no fill in message? */
@@ -263,10 +265,30 @@
pcu_tx_data_req(bts, 0, 0, PCU_IF_SAPI_AGCH, 0, 0, 0, data, sizeof(data));
}
+/* Send a MAC block via the access gant channel. This will (obviously) only work for MAC blocks that contain
+ * an IMMEDIATE ASSIGNMENT. In case the MAC block contains an IMMEDIATE ASSIGNMENT message, the receiving end
+ * is required to confirm when the IMMEDIATE ASSIGNMENT has been sent. */
+void pcu_l1if_tx_agch_dt(struct gprs_rlcmac_bts *bts, bitvec *block, int plen, uint32_t tlli)
+{
+ struct gsm_pcu_if_agch_dt agch_dt = { 0 };
+
+ agch_dt.tlli = tlli;
+ agch_dt.data[0] = (plen << 2) | 0x01;
+ bitvec_pack(block, agch_dt.data + 1);
+
+ if (the_pcu->gsmtap_categ_mask & (1 << PCU_GSMTAP_C_DL_AGCH))
+ gsmtap_send(the_pcu->gsmtap, 0, 0, GSMTAP_CHANNEL_AGCH, 0, 0, 0, 0, agch_dt.data, GSM_MACBLOCK_LEN);
+
+ pcu_tx_data_req(bts, 0, 0, PCU_IF_SAPI_AGCH_DT, 0, 0, 0, (uint8_t*)&agch_dt, sizeof(agch_dt));
+}
+
#define IMSI_DIGITS_FOR_PAGING 3
/* Send a MAC block via the paging channel. (See also comment below) */
void pcu_l1if_tx_pch(struct gprs_rlcmac_bts *bts, bitvec *block, int plen, const char *imsi)
{
+ /* TODO: When PCUIF v.11 has become mainline, we will use pcu_l1if_tx_pch_dt() exclusively.
+ * This will make this function obsolote, so we can remove it. */
+
uint8_t data[IMSI_DIGITS_FOR_PAGING + GSM_MACBLOCK_LEN];
/* prepend last three IMSI digits (if present) from which BTS/BSC will calculate the paging group */
@@ -275,16 +297,6 @@
else
memset(data, '0', IMSI_DIGITS_FOR_PAGING);
- /* OS#6097: if strlen(imsi) == 0: We assume the MS is in non-DRX
- * mode (TS 44.060 5.5.1.5) and hence it is listening on all CCCH blocks
- * (TS 45.002 6.5.3, 6.5.6).
- * Hence, pgroup 000 is taken "randomly" to send it over it. This of
- * course not optimal since it can actually be sent on any CCCH blocks,
- * so we are delaying the ImmAss for no good reason. But anyway,
- * pcu_l1if_tx_pch() is deprecated and pcu_l1if_tx_pch_dt() should be
- * used instead, which doesn't suffer from this problem.
- */
-
/* block provided by upper layer comes without first byte (plen), prepend it manually: */
OSMO_ASSERT(sizeof(data) >= IMSI_DIGITS_FOR_PAGING + 1 + block->data_len);
data[IMSI_DIGITS_FOR_PAGING] = (plen << 2) | 0x01;
@@ -304,13 +316,13 @@
{
struct gsm_pcu_if_pch_dt pch_dt = { 0 };
+ /* The caller must provide a valid IMSI, in case no IMSI is present, the caller may use pcu_l1if_tx_agch_dt()
+ * to send the MAC block via AGCH instead. */
+ OSMO_ASSERT(strlen(imsi) > 0);
+
pch_dt.tlli = tlli;
if (imsi)
OSMO_STRLCPY_ARRAY(pch_dt.imsi, imsi);
- /* OS#6097: if strlen(pch_dt.imsi) == 0: We assume the MS is in non-DRX
- * mode (TS 44.060 5.5.1.5) and hence it is listening on all CCCH blocks
- * (TS 45.002 6.5.3, 6.5.6).
- */
pch_dt.data[0] = (plen << 2) | 0x01;
bitvec_pack(block, pch_dt.data + 1);
@@ -559,6 +571,7 @@
switch (data_cnf_dt->sapi) {
case PCU_IF_SAPI_PCH_DT:
+ case PCU_IF_SAPI_AGCH_DT:
bts_rcv_imm_ass_cnf(bts, NULL, data_cnf_dt->tlli, data_cnf_dt->fn);
break;
default:
diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h
index bc036bf..2e66830 100644
--- a/src/pcu_l1_if.h
+++ b/src/pcu_l1_if.h
@@ -147,6 +147,7 @@
uint32_t fn, uint8_t block_nr,
uint8_t *data, size_t data_len);
void pcu_l1if_tx_agch(struct gprs_rlcmac_bts *bts, bitvec *block, int len);
+void pcu_l1if_tx_agch_dt(struct gprs_rlcmac_bts *bts, bitvec *block, int plen, uint32_t tlli);
#endif
#ifdef __cplusplus
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/34058
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I9effdcec1da91a6e2e7a7c41f95d3300ad1bb292
Gerrit-Change-Number: 34058
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34056 )
Change subject: tests/vty: test multiple local/remote IP addresses
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34056
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I9e8c6499b26edea271ee8d8c4ab86506e765e000
Gerrit-Change-Number: 34056
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 04 Aug 2023 08:50:43 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: osmith, fixeria.
Hello osmith, Jenkins Builder, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/34057
to look at the new patch set (#2).
Change subject: stream: Split cli/srv specific code out of stream.c
......................................................................
stream: Split cli/srv specific code out of stream.c
The dev/user in general is only interested about one side of the stream
when looking at the code. Since the stream.c file is tarting to be quite
large/bloated, this patch splits its content into stream_cli.c and
stream_srv.c to make it easier to improve/extend and review.
Keep common code between cli and srv in stream.c, and add a private header
to contain references to it.
Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159
---
M include/osmocom/netif/Makefile.am
M include/osmocom/netif/stream.h
A include/osmocom/netif/stream_private.h
M src/Makefile.am
M src/stream.c
A src/stream_cli.c
A src/stream_srv.c
7 files changed, 1,993 insertions(+), 1,786 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/57/34057/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34057
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159
Gerrit-Change-Number: 34057
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34056 )
Change subject: tests/vty: test multiple local/remote IP addresses
......................................................................
tests/vty: test multiple local/remote IP addresses
Change-Id: I9e8c6499b26edea271ee8d8c4ab86506e765e000
---
M tests/vty/ss7_asp_test.vty
1 file changed, 21 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/56/34056/1
diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty
index f7d92bd..3296c65 100644
--- a/tests/vty/ss7_asp_test.vty
+++ b/tests/vty/ss7_asp_test.vty
@@ -248,6 +248,13 @@
ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role
------------ ------------ ------------- ---- ---- ----------------------- ---------
my-asp ? uninitialized m3ua sg 127.0.0.200:12345 server
+ss7_asp_vty_test(config-cs7-asp)# remote-ip 127.0.0.201
+ss7_asp_vty_test(config-cs7-asp)# local-ip 127.0.0.101
+ss7_asp_vty_test(config-cs7-asp)# do show cs7 instance 0 asp
+ Current Primary Link
+ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role
+------------ ------------ ------------- ---- ---- ----------------------- ---------
+my-asp ? uninitialized m3ua sg (127.0.0.200|127.0.0.201):12345 server
ss7_asp_vty_test(config-cs7-asp)# exit
ss7_asp_vty_test(config-cs7)# as my-ass m3ua
@@ -311,14 +318,14 @@
Current Primary Link
ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role
------------ ------------ ------------- ---- ---- ----------------------- ---------
-my-asp my-ass ASP_DOWN m3ua sg 127.0.0.200:12345 server
+my-asp my-ass ASP_DOWN m3ua sg (127.0.0.200|127.0.0.201):12345 server
ss7_asp_vty_test(config-cs7-as)# exit
ss7_asp_vty_test(config-cs7)# do show cs7 instance 0 asp
Current Primary Link
ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role
------------ ------------ ------------- ---- ---- ----------------------- ---------
-my-asp my-ass ASP_DOWN m3ua sg 127.0.0.200:12345 server
+my-asp my-ass ASP_DOWN m3ua sg (127.0.0.200|127.0.0.201):12345 server
ss7_asp_vty_test(config-cs7)# exit
@@ -327,7 +334,7 @@
Current Primary Link
ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role
------------ ------------ ------------- ---- ---- ----------------------- ---------
-my-asp my-ass ASP_DOWN m3ua sg 127.0.0.200:12345 server
+my-asp my-ass ASP_DOWN m3ua sg (127.0.0.200|127.0.0.201):12345 server
ss7_asp_vty_test(config)# do show cs7 instance 0 as all
Routing Routing Key Cic Cic Traffic
@@ -342,7 +349,9 @@
cs7 instance 0
asp my-asp 12345 54321 m3ua
local-ip 127.0.0.100
+ local-ip 127.0.0.101
remote-ip 127.0.0.200
+ remote-ip 127.0.0.201
role sg
sctp-role server
as my-ass m3ua
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34056
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I9e8c6499b26edea271ee8d8c4ab86506e765e000
Gerrit-Change-Number: 34056
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange