falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/36896?usp=email )
Change subject: common: add support for TW-TS-001
......................................................................
common: add support for TW-TS-001
Themyscira Wireless Technical Specification TW-TS-001 defines
an enhanced RTP transport format for FR and EFR codecs within
an IP-based GSM RAN, restoring the full functionality and semantics
of GSM 08.60 TRAU-UL format that were lost in the industry transition
to RTP with payload formats standardized by TIPHON and IETF.
Given that this new enhanced RTP transport format runs counter
to commonly accepted standards, it is strictly optional. OsmoBTS
always accepts both basic and extended RTP formats, but it sends
the extended RTP format of TW-TS-001 only when commanded to do so
by the BSC via an RSL extension IE; OsmoBSC will in turn direct
the BTS to use this extension only when the CN asks for it via
the BSSMAP extension defined in TW-TS-003.
Spec references:
https://www.freecalypso.org/specs/tw-ts-001-v010100.txthttps://www.freecalypso.org/specs/tw-ts-003-v010002.txt
Related: OS#6448
Change-Id: Id997e8666bc19e60936aaa83b43a968d30320bd7
---
M include/osmo-bts/lchan.h
M src/common/bts.c
M src/common/l1sap.c
M src/common/rsl.c
M src/common/rtp_input_preen.c
5 files changed, 147 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/36896/1
diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h
index 585483b..60c2710 100644
--- a/include/osmo-bts/lchan.h
+++ b/include/osmo-bts/lchan.h
@@ -168,6 +168,7 @@
uint16_t conn_id;
uint8_t rtp_payload;
uint8_t rtp_payload2;
+ uint8_t rtp_extensions;
uint8_t speech_mode;
struct {
bool use;
diff --git a/src/common/bts.c b/src/common/bts.c
index 56765ec..633e0d1 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -393,6 +393,7 @@
osmo_bts_set_feature(bts->features, BTS_FEAT_ETWS_PN);
osmo_bts_set_feature(bts->features, BTS_FEAT_IPV6_NSVC);
osmo_bts_set_feature(bts->features, BTS_FEAT_PAGING_COORDINATION);
+ osmo_bts_set_feature(bts->features, BTS_FEAT_TWTS001);
/* Maximum TA supported by the PHY (can be overridden by PHY specific code) */
bts->support.max_ta = MAX_TA_DEF;
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 5f275cd..5a900f8 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -34,6 +34,7 @@
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/rsl.h>
#include <osmocom/gsm/rlp.h>
+#include <osmocom/gsm/rtp_extensions.h>
#include <osmocom/core/gsmtap.h>
#include <osmocom/core/gsmtap_util.h>
#include <osmocom/core/utils.h>
@@ -1990,13 +1991,42 @@
send_ul_rtp_packet_speech(lchan, fn, msg->data, msg->len);
}
+/* a helper function for emitting FR/EFR UL in TW-TS-001 format */
+static void send_rtp_twts001(struct gsm_lchan *lchan, uint32_t fn,
+ struct msgb *msg, bool good_frame)
+{
+ uint8_t teh;
+ bool send_frame;
+
+ if (msg->len == GSM_FR_BYTES || msg->len == GSM_EFR_BYTES) {
+ if (good_frame)
+ teh = 0xE0;
+ else
+ teh = 0xE2;
+ send_frame = true;
+ } else {
+ teh = 0xE6;
+ send_frame = false;
+ }
+ /* always set DTXd and TAF bits */
+ if (lchan->ts->trx->bts->dtxd)
+ teh |= 0x08;
+ if (fn % 104 == 52)
+ teh |= 0x01;
+ if (send_frame) {
+ msgb_push_u8(msg, teh);
+ send_ul_rtp_packet_speech(lchan, fn, msg->data, msg->len);
+ } else {
+ send_ul_rtp_packet_speech(lchan, fn, &teh, 1);
+ }
+}
+
/* A helper function for l1sap_tch_ind(): handling BFI
*
- * Please note that we pass the msgb to this function, even though it is
- * currently not used. This msgb passing is a provision for adding
- * support for TRAU-UL-like RTP payload formats like TW-TS-001 that allow
- * indicating BFI along with deemed-bad frame data bits, just like
- * GSM 08.60 and 08.61 TRAU-UL frames.
+ * Please note that the msgb passed to this function is used only when
+ * the CN asked the BSS to emit extended RTP formats (currently TW-TS-001,
+ * later TW-TS-002 as well) that can indicate BFI along with deemed-bad
+ * frame data bits, just like GSM 08.60 and 08.61 TRAU-UL frames.
*/
static void tch_ul_bfi_handler(struct gsm_lchan *lchan,
const struct gsm_time *g_time, struct msgb *msg)
@@ -2005,6 +2035,20 @@
uint8_t ecu_out[GSM_FR_BYTES];
int rc;
+ /* Are we on TCH/FS or TCH/EFS, configured to emit TW-TS-001 extended
+ * RTP format? If so, emit BFI per that spec. The placement of
+ * this check before the ECU is intentional: the modes of TW-TS-001
+ * UL output (closely replicating the classic GSM architecture in which
+ * a BTS never applies an ECU to its UL output) and internal UL ECU
+ * are mutually exclusive. */
+ if ((lchan->abis_ip.rtp_extensions & OSMO_RTP_EXT_TWTS001) &&
+ lchan->type == GSM_LCHAN_TCH_F &&
+ (lchan->tch_mode == GSM48_CMODE_SPEECH_V1 ||
+ lchan->tch_mode == GSM48_CMODE_SPEECH_EFR)) {
+ send_rtp_twts001(lchan, fn, msg, false);
+ return;
+ }
+
/* Are we applying an ECU to this uplink, and are we in a state
* (not DTX pause) where we emit ECU output? */
if (lchan->ecu_state && !osmo_ecu_is_dtx_pause(lchan->ecu_state)) {
@@ -2084,11 +2128,27 @@
/* hand msg to RTP code for transmission */
switch (lchan->rsl_cmode) {
case RSL_CMOD_SPD_SPEECH:
- if (bts->emit_hr_rfc5993 && lchan->type == GSM_LCHAN_TCH_H &&
- lchan->tch_mode == GSM48_CMODE_SPEECH_V1)
- send_rtp_rfc5993(lchan, fn, msg);
- else
+ /* support different RTP output formats per codec */
+ if (lchan->type == GSM_LCHAN_TCH_F &&
+ (lchan->tch_mode == GSM48_CMODE_SPEECH_V1 ||
+ lchan->tch_mode == GSM48_CMODE_SPEECH_EFR)) {
+ /* FR and EFR codecs */
+ if (lchan->abis_ip.rtp_extensions & OSMO_RTP_EXT_TWTS001)
+ send_rtp_twts001(lchan, fn, msg, true);
+ else
+ send_ul_rtp_packet_speech(lchan, fn, msg->data, msg->len);
+ } else if (lchan->type == GSM_LCHAN_TCH_H &&
+ lchan->tch_mode == GSM48_CMODE_SPEECH_V1) {
+ /* HR codec: TS 101 318 or RFC 5993,
+ * will also support TW-TS-002 in the future. */
+ if (bts->emit_hr_rfc5993)
+ send_rtp_rfc5993(lchan, fn, msg);
+ else
+ send_ul_rtp_packet_speech(lchan, fn, msg->data, msg->len);
+ } else {
+ /* generic case, no RTP alterations */
send_ul_rtp_packet_speech(lchan, fn, msg->data, msg->len);
+ }
break;
case RSL_CMOD_SPD_DATA:
send_ul_rtp_packet_data(lchan, tch_ind, msg->data, msg->len);
diff --git a/src/common/rsl.c b/src/common/rsl.c
index fa5f495..c7ee550 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2979,6 +2979,7 @@
struct gsm_lchan *lchan = msg->lchan;
struct gsm_bts *bts = lchan->ts->trx->bts;
const uint8_t *payload_type, *speech_mode, *payload_type2, *osmux_cid, *csd_fmt;
+ const uint8_t *rtp_extensions;
uint32_t connect_ip = 0;
uint16_t connect_port = 0;
int rc, inc_ip_port = 0;
@@ -3033,6 +3034,10 @@
if (osmux_cid)
LOGPC(DRSL, LOGL_DEBUG, "osmux_cid=%u ", *osmux_cid);
+ rtp_extensions = TLVP_VAL(&tp, RSL_IE_OSMO_RTP_EXTENSIONS);
+ if (rtp_extensions)
+ LOGPC(DRSL, LOGL_DEBUG, "rtp_extensions=%u ", *rtp_extensions);
+
if (dch->c.msg_type == RSL_MT_IPAC_CRCX && connect_ip && connect_port)
inc_ip_port = 1;
@@ -3161,6 +3166,12 @@
if (speech_mode)
lchan->abis_ip.speech_mode = *speech_mode;
+ /* Configure non-standard RTP extensions */
+ if (rtp_extensions)
+ lchan->abis_ip.rtp_extensions = *rtp_extensions;
+ else
+ lchan->abis_ip.rtp_extensions = 0;
+
/* FIXME: CSD, jitterbuffer, compression */
return rsl_tx_ipac_XXcx_ack(lchan, payload_type2 ? 1 : 0,
diff --git a/src/common/rtp_input_preen.c b/src/common/rtp_input_preen.c
index 5729229..addd55b 100644
--- a/src/common/rtp_input_preen.c
+++ b/src/common/rtp_input_preen.c
@@ -64,21 +64,49 @@
static enum pl_input_decision
input_preen_fr(const uint8_t *rtp_pl, unsigned rtp_pl_len)
{
- if (rtp_pl_len != GSM_FR_BYTES)
+ switch (rtp_pl_len) {
+ case GSM_FR_BYTES: /* standard TS 101 318 or RFC 3551 format */
+ /* magic must be correct */
+ if ((rtp_pl[0] & 0xF0) != 0xD0)
+ return PL_DECISION_DROP;
+ return PL_DECISION_ACCEPT;
+ case GSM_FR_BYTES+1: /* Themyscira TW-TS-001 format */
+ /* TEH octet must be correct, and not a BFI */
+ if ((rtp_pl[0] & 0xF6) != 0xE0)
+ return PL_DECISION_DROP;
+ /* standard FR magic must be correct too */
+ if ((rtp_pl[1] & 0xF0) != 0xD0)
+ return PL_DECISION_DROP;
+ /* Strip TEH octet, leaving only standard FR payload. */
+ return PL_DECISION_STRIP_HDR_OCTET;
+ default:
+ /* invalid payload */
return PL_DECISION_DROP;
- if ((rtp_pl[0] & 0xF0) != 0xD0)
- return PL_DECISION_DROP;
- return PL_DECISION_ACCEPT;
+ }
}
static enum pl_input_decision
input_preen_efr(const uint8_t *rtp_pl, unsigned rtp_pl_len)
{
- if (rtp_pl_len != GSM_EFR_BYTES)
+ switch (rtp_pl_len) {
+ case GSM_EFR_BYTES: /* standard TS 101 318 or RFC 3551 format */
+ /* magic must be correct */
+ if ((rtp_pl[0] & 0xF0) != 0xC0)
+ return PL_DECISION_DROP;
+ return PL_DECISION_ACCEPT;
+ case GSM_EFR_BYTES+1: /* Themyscira TW-TS-001 format */
+ /* TEH octet must be correct, and not a BFI */
+ if ((rtp_pl[0] & 0xF6) != 0xE0)
+ return PL_DECISION_DROP;
+ /* standard EFR magic must be correct too */
+ if ((rtp_pl[1] & 0xF0) != 0xC0)
+ return PL_DECISION_DROP;
+ /* Strip TEH octet, leaving only standard EFR payload. */
+ return PL_DECISION_STRIP_HDR_OCTET;
+ default:
+ /* invalid payload */
return PL_DECISION_DROP;
- if ((rtp_pl[0] & 0xF0) != 0xC0)
- return PL_DECISION_DROP;
- return PL_DECISION_ACCEPT;
+ }
}
static enum pl_input_decision
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/36896?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id997e8666bc19e60936aaa83b43a968d30320bd7
Gerrit-Change-Number: 36896
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
Attention is currently required from: laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email )
Change subject: per-HNB GTP-U traffic counters via nft
......................................................................
Patch Set 9:
(1 comment)
Patchset:
PS9:
the remaining unresolved comments are open to responses; if i made my point / my opinion clear enough, maybe reviewers can mark them resolved...
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
Gerrit-Change-Number: 36539
Gerrit-PatchSet: 9
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 22 May 2024 01:26:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email )
Change subject: per-HNB GTP-U traffic counters via nft
......................................................................
Patch Set 9:
(2 comments)
Patchset:
PS9:
sprinkled some more comments everywhere clarifying which thread runs what
File src/osmo-hnbgw/nft_kpi.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/70169773_66a0d04c
PS6, Line 419: rate_ctr_add2(cg, cgidx, new_val - *last_val);
> you're right, these two functions were in the wrong place of the file, moving them further down
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
Gerrit-Change-Number: 36539
Gerrit-PatchSet: 9
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 22 May 2024 01:23:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
to look at the new patch set (#9).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: per-HNB GTP-U traffic counters via nft
......................................................................
per-HNB GTP-U traffic counters via nft
Add optional feature: retrieve GTP-U traffic counters per hNodeB (not
per individual subscriber!) using nftables, to provide new rate_ctr
stats.
This is a "workaround" to get performance indicators per hNodeB, without
needing a UPF that supports URR.
When an hNodeB registers, set up nftables rules to count GTP-U packets
(UDP port 2152) to and from that hNodeB's address -- we are assuming
that it is the same address that Iuh is connecting from.
From the per-hNodeB packet and byte counters from nftables, also derive
a "UE bytes" counter, which is counting only the GTP-U payload. Assume
IP header of 20 bytes; UDP and GTP-U headers are 8 bytes each:
ue_bytes = total_bytes - packets * (20 + 8 + 8)
Query these periodically, as configurable by new timer X34. Default is
one second of wait time between querying counters (excluding the time it
takes to retrieve and update the counters).
Add compile-time switch --enable-nftables, to build with/without
external dependency libnftables. Default is without, as before.
Add jenkins axis NFTABLES to switch --enable-nftables.
Add cfg file option 'hnbgw' / 'nft-kpi' to enable use of nftables.
This requires osmo-hnbgw to be run with cap_net_admin.
The VTY config commands are always visible -- simplifies VTY testing.
Refuse to start osmo-hnbgw when the user is requesting nft-kpi in the
config but when built without --enable-nftables.
Do nft commands in 2 separate threads. Run the same request queue
implementation twice, with two thread workers to handle them:
- one thread receives all requests to init the nft table, add and remove
hNodeB counters, and start and stop counting for a specific hNodeB.
- Another thread handles all retrieval and parsing of counters from nft.
The main() thread hence never blocks for nftables commands, and services
the responses from nft when they are ready, via an osmo_it_q registered
in the main() select loop.
Persistently keep an nftables named counter for each seen hNodeB cell id
in the nftables ruleset, for the lifetime of a hnb_persistent instance
that holds the target rate_ctrs.
Add the rules to feed into these persistent counters to the ruleset when
the particular cell attaches and detaches via HNBAP HNB (De-)Register.
On hnb_persistent_free(), remove all items relating to this cell id from
nftables, including the persistent named counters.
Loosely related: upcoming patches will implement
- a hashtable for faster cell id lookup (important for updating
counters)
Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
- proper MNC-3-digit support in cell ids (better have a 100% correct
primary key).
Id9a91c80cd2745424a916aef4736993bb7cd8ba0
- idle timeout for disconnected hnbp, so we are sure stale state does
not build up for eternity.
Ic819d7cbc03fb39e98c204b70d016c5170dc6307
Related: SYS#6773
Related: OS#6425
Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
---
M configure.ac
M contrib/jenkins.sh
M debian/control
M debian/rules
M include/osmocom/hnbgw/Makefile.am
M include/osmocom/hnbgw/hnbgw.h
A include/osmocom/hnbgw/nft_kpi.h
M src/osmo-hnbgw/Makefile.am
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_hnbap.c
M src/osmo-hnbgw/hnbgw_vty.c
A src/osmo-hnbgw/nft_kpi.c
M src/osmo-hnbgw/osmo_hnbgw_main.c
M src/osmo-hnbgw/tdefs.c
M tests/osmo-hnbgw.vty
15 files changed, 1,380 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/39/36539/9
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
Gerrit-Change-Number: 36539
Gerrit-PatchSet: 9
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email )
Change subject: per-HNB GTP-U traffic counters via nft
......................................................................
Patch Set 8:
(1 comment)
File src/osmo-hnbgw/nft_kpi.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/a50479b1_7fa9b125
PS6, Line 419: rate_ctr_add2(cg, cgidx, new_val - *last_val);
> update_ctr does what it does: updating counters. The important part is where is it called from: […]
you're right, these two functions were in the wrong place of the file, moving them further down
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
Gerrit-Change-Number: 36539
Gerrit-PatchSet: 8
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 22 May 2024 01:22:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
to look at the new patch set (#8).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: per-HNB GTP-U traffic counters via nft
......................................................................
per-HNB GTP-U traffic counters via nft
Add optional feature: retrieve GTP-U traffic counters per hNodeB (not
per individual subscriber!) using nftables, to provide new rate_ctr
stats.
This is a "workaround" to get performance indicators per hNodeB, without
needing a UPF that supports URR.
When an hNodeB registers, set up nftables rules to count GTP-U packets
(UDP port 2152) to and from that hNodeB's address -- we are assuming
that it is the same address that Iuh is connecting from.
From the per-hNodeB packet and byte counters from nftables, also derive
a "UE bytes" counter, which is counting only the GTP-U payload. Assume
IP header of 20 bytes; UDP and GTP-U headers are 8 bytes each:
ue_bytes = total_bytes - packets * (20 + 8 + 8)
Query these periodically, as configurable by new timer X34. Default is
one second of wait time between querying counters (excluding the time it
takes to retrieve and update the counters).
Add compile-time switch --enable-nftables, to build with/without
external dependency libnftables. Default is without, as before.
Add jenkins axis NFTABLES to switch --enable-nftables.
Add cfg file option 'hnbgw' / 'nft-kpi' to enable use of nftables.
This requires osmo-hnbgw to be run with cap_net_admin.
The VTY config commands are always visible -- simplifies VTY testing.
Refuse to start osmo-hnbgw when the user is requesting nft-kpi in the
config but when built without --enable-nftables.
Do nft commands in 2 separate threads. Run the same request queue
implementation twice, with two thread workers to handle them:
- one thread receives all requests to init the nft table, add and remove
hNodeB counters, and start and stop counting for a specific hNodeB.
- Another thread handles all retrieval and parsing of counters from nft.
The main() thread hence never blocks for nftables commands, and services
the responses from nft when they are ready, via an osmo_it_q registered
in the main() select loop.
Persistently keep an nftables named counter for each seen hNodeB cell id
in the nftables ruleset, for the lifetime of a hnb_persistent instance
that holds the target rate_ctrs.
Add the rules to feed into these persistent counters to the ruleset when
the particular cell attaches and detaches via HNBAP HNB (De-)Register.
On hnb_persistent_free(), remove all items relating to this cell id from
nftables, including the persistent named counters.
Loosely related: upcoming patches will implement
- a hashtable for faster cell id lookup (important for updating
counters)
Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
- proper MNC-3-digit support in cell ids (better have a 100% correct
primary key).
Id9a91c80cd2745424a916aef4736993bb7cd8ba0
- idle timeout for disconnected hnbp, so we are sure stale state does
not build up for eternity.
Ic819d7cbc03fb39e98c204b70d016c5170dc6307
Related: SYS#6773
Related: OS#6425
Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
---
M configure.ac
M contrib/jenkins.sh
M debian/control
M debian/rules
M include/osmocom/hnbgw/Makefile.am
M include/osmocom/hnbgw/hnbgw.h
A include/osmocom/hnbgw/nft_kpi.h
M src/osmo-hnbgw/Makefile.am
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_hnbap.c
M src/osmo-hnbgw/hnbgw_vty.c
A src/osmo-hnbgw/nft_kpi.c
M src/osmo-hnbgw/osmo_hnbgw_main.c
M src/osmo-hnbgw/tdefs.c
M tests/osmo-hnbgw.vty
15 files changed, 1,361 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/39/36539/8
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
Gerrit-Change-Number: 36539
Gerrit-PatchSet: 8
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/36895?usp=email )
Change subject: include/osmocom/gsm: add rtp_extensions.h
......................................................................
include/osmocom/gsm: add rtp_extensions.h
Previous patches add definitions of GSM0808_IE_THEMWI_RTP_EXTENSIONS
and RSL_IE_OSMO_RTP_EXTENSIONS to BSSMAP and RSL; this new header file
provides definitions for individual bits in the single value octet
of the new IE.
Related: OS#6448
Change-Id: I0eccfe5ddcf44f8f20440acb01e2d4870ec0cd91
---
M include/osmocom/gsm/Makefile.am
A include/osmocom/gsm/rtp_extensions.h
2 files changed, 39 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/95/36895/1
diff --git a/include/osmocom/gsm/Makefile.am b/include/osmocom/gsm/Makefile.am
index 5678a51..e42ffec 100644
--- a/include/osmocom/gsm/Makefile.am
+++ b/include/osmocom/gsm/Makefile.am
@@ -50,6 +50,7 @@
oap_client.h \
rlp.h \
rsl.h \
+ rtp_extensions.h \
rxlev_stat.h \
sysinfo.h \
tlv.h \
diff --git a/include/osmocom/gsm/rtp_extensions.h b/include/osmocom/gsm/rtp_extensions.h
new file mode 100644
index 0000000..edea431
--- /dev/null
+++ b/include/osmocom/gsm/rtp_extensions.h
@@ -0,0 +1,23 @@
+/*
+ * Themyscira Wireless Technical Specification TW-TS-003 defines a BSSMAP
+ * extension whereby a CN implementation and a BSS implementation can
+ * negotiate the use of non-3GPP-standard extensions to RTP user plane,
+ * extensions that modify RTP formats counter to the stipulations of
+ * 3GPP TS 48.103. There is also a private Osmocom-defined IE in Abis RSL
+ * that communicates the same RTP extensions from OsmoBSC to OsmoBTS.
+ *
+ * This header file defines the meaning of the bits in the first (and currently
+ * only) value octet of the TLV IE added to BSSMAP and RSL interfaces,
+ * namely, GSM0808_IE_THEMWI_RTP_EXTENSIONS and RSL_IE_OSMO_RTP_EXTENSIONS.
+ * It is based on this authoritative definition:
+ *
+ * https://www.freecalypso.org/specs/tw-ts-003-v010002.txt
+ *
+ * Section 5.3 in the above specification defines the assignment of
+ * individual bits in the single value octet.
+ */
+
+#pragma once
+
+#define OSMO_RTP_EXT_TWTS001 0x01
+#define OSMO_RTP_EXT_TWTS002 0x02
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36895?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0eccfe5ddcf44f8f20440acb01e2d4870ec0cd91
Gerrit-Change-Number: 36895
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
Attention is currently required from: laforge, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: per-HNB GTP-U traffic counters via nft
......................................................................
per-HNB GTP-U traffic counters via nft
Add optional feature: retrieve GTP-U traffic counters per hNodeB (not
per individual subscriber!) using nftables, to provide new rate_ctr
stats.
This is a "workaround" to get performance indicators per hNodeB, without
needing a UPF that supports URR.
When an hNodeB registers, set up nftables rules to count GTP-U packets
(UDP port 2152) to and from that hNodeB's address -- we are assuming
that it is the same address that Iuh is connecting from.
From the per-hNodeB packet and byte counters from nftables, also derive
a "UE bytes" counter, which is counting only the GTP-U payload. Assume
IP header of 20 bytes; UDP and GTP-U headers are 8 bytes each:
ue_bytes = total_bytes - packets * (20 + 8 + 8)
Query these periodically, as configurable by new timer X34. Default is
one second of wait time between querying counters (excluding the time it
takes to retrieve and update the counters).
Add compile-time switch --enable-nftables, to build with/without
external dependency libnftables. Default is without, as before.
Add jenkins axis NFTABLES to switch --enable-nftables.
Add cfg file option 'hnbgw' / 'nft-kpi' to enable use of nftables.
This requires osmo-hnbgw to be run with cap_net_admin.
The VTY config commands are always visible -- simplifies VTY testing.
Refuse to start osmo-hnbgw when the user is requesting nft-kpi in the
config but when built without --enable-nftables.
Do nft commands in 2 separate threads. Run the same request queue
implementation twice, with two thread workers to handle them:
- one thread receives all requests to init the nft table, add and remove
hNodeB counters, and start and stop counting for a specific hNodeB.
- Another thread handles all retrieval and parsing of counters from nft.
The main() thread hence never blocks for nftables commands, and services
the responses from nft when they are ready, via an osmo_it_q registered
in the main() select loop.
Persistently keep an nftables named counter for each seen hNodeB cell id
in the nftables ruleset, for the lifetime of a hnb_persistent instance
that holds the target rate_ctrs.
Add the rules to feed into these persistent counters to the ruleset when
the particular cell attaches and detaches via HNBAP HNB (De-)Register.
On hnb_persistent_free(), remove all items relating to this cell id from
nftables, including the persistent named counters.
Loosely related: upcoming patches will implement
- a hashtable for faster cell id lookup (important for updating
counters)
Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
- proper MNC-3-digit support in cell ids (better have a 100% correct
primary key).
Id9a91c80cd2745424a916aef4736993bb7cd8ba0
- idle timeout for disconnected hnbp, so we are sure stale state does
not build up for eternity.
Ic819d7cbc03fb39e98c204b70d016c5170dc6307
Related: SYS#6773
Related: OS#6425
Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
---
M configure.ac
M contrib/jenkins.sh
M debian/control
M debian/rules
M include/osmocom/hnbgw/Makefile.am
M include/osmocom/hnbgw/hnbgw.h
A include/osmocom/hnbgw/nft_kpi.h
M src/osmo-hnbgw/Makefile.am
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_hnbap.c
M src/osmo-hnbgw/hnbgw_vty.c
A src/osmo-hnbgw/nft_kpi.c
M src/osmo-hnbgw/osmo_hnbgw_main.c
M src/osmo-hnbgw/tdefs.c
M tests/osmo-hnbgw.vty
15 files changed, 1,306 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/39/36539/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
Gerrit-Change-Number: 36539
Gerrit-PatchSet: 7
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset