laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34264?usp=email )
Change subject: ipa: use LSBs of file descriptor as SLS in IPA->M3UA direction
......................................................................
ipa: use LSBs of file descriptor as SLS in IPA->M3UA direction
when IPA/SCCPlite traffic traverses the osmo_ss7 stack, so far the
SLS of the MTP3 label was always set to 0 (default initialization).
However, in order to achieve a better distribution of signaling traffic
in SS7 networks that actually utilize the SLS to select any links (or
ASPs), it makes sense to use non-zero values.
Instead of introducing some kind of new, configurable attribute for
each ASP (IPA client connection), let's simply use the lower 4 bits of
the file descriptor integer. Those file descriptors should have a
roughly equal distribution, resulting in traffic (from multiple IPA
clients) to be spread across the 4-bit SLS number space.
Also, this mechanism ensures that traffic from one IPA client will
always get the same SLS and hence routed the same way in any underlying
CS7/SS7 network.
Change-Id: Ice7bab997b84cfed00c7d6d780c70f4e9fac6002
Related: SYS#6543
---
M src/ipa.c
M src/osmo_ss7.c
M src/xua_internal.h
3 files changed, 35 insertions(+), 6 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
diff --git a/src/ipa.c b/src/ipa.c
index 8daa5e0..a77d331 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -211,7 +211,7 @@
return sccp_msg_out;
}
-static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg)
+static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg, uint8_t sls)
{
int rc;
struct m3ua_data_hdr data_hdr;
@@ -276,6 +276,7 @@
data_hdr.si = MTP_SI_SCCP;
data_hdr.opc = osmo_htonl(opc);
data_hdr.dpc = osmo_htonl(dpc);
+ data_hdr.sls = sls;
data_hdr.ni = as->inst->cfg.network_indicator;
/* Create M3UA message in XUA structure */
xua = m3ua_xfer_from_data(&data_hdr, msgb_l2(msg), msgb_l2len(msg));
@@ -292,8 +293,9 @@
/*! \brief process M3UA message received from socket
* \param[in] asp Application Server Process receiving \a msg
* \param[in] msg received message buffer. Callee takes ownership!
+ * \param[in] sls The SLS (signaling link selector) field to use in the generated M3UA header
* \returns 0 on success; negative on error */
-int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg)
+int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg, uint8_t sls)
{
struct ipaccess_head *hh;
int rc;
@@ -309,7 +311,7 @@
rc = ipa_rx_msg_ccm(asp, msg);
break;
case IPAC_PROTO_SCCP:
- rc = ipa_rx_msg_sccp(asp, msg);
+ rc = ipa_rx_msg_sccp(asp, msg, sls);
break;
default:
rc = ss7_asp_rx_unknown(asp, hh->proto, msg);
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index b8124d1..440014a 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -2046,7 +2046,7 @@
}
msg->dst = asp;
- return ipa_rx_msg(asp, msg);
+ return ipa_rx_msg(asp, msg, ofd->fd & 0xf);
}
/* netif code tells us we can read something from the socket */
@@ -2194,7 +2194,7 @@
}
msg->dst = asp;
rate_ctr_inc2(asp->ctrg, SS7_ASP_CTR_PKT_RX_TOTAL);
- return ipa_rx_msg(asp, msg);
+ return ipa_rx_msg(asp, msg, ofd->fd & 0xf);
}
static int xua_cli_read_cb(struct osmo_stream_cli *conn)
diff --git a/src/xua_internal.h b/src/xua_internal.h
index 26cb3fc..93f6140 100644
--- a/src/xua_internal.h
+++ b/src/xua_internal.h
@@ -116,7 +116,7 @@
const struct xua_msg_part *rctx_ie);
int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua);
-int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg);
+int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg, uint8_t sls);
int osmo_isup_party_parse(char *out_digits, const uint8_t *in,
unsigned int in_num_bytes, bool odd);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34264?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ice7bab997b84cfed00c7d6d780c70f4e9fac6002
Gerrit-Change-Number: 34264
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34273?usp=email )
Change subject: m3ua: Add some TODO comments on where we fall short of our potential
......................................................................
m3ua: Add some TODO comments on where we fall short of our potential
Change-Id: I75d7b8f3fb6a06f6941b6dff4072287fdbb1d33e
---
M src/m3ua.c
M src/xua_as_fsm.c
2 files changed, 15 insertions(+), 2 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/m3ua.c b/src/m3ua.c
index 85ac974..f4dbf76 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -462,9 +462,11 @@
return NULL;
}
- if (xua->hdr.msg_class == M3UA_MSGC_XFER)
+ if (xua->hdr.msg_class == M3UA_MSGC_XFER) {
+ /* TODO: M3UA RFC says that multiple different streams within the SCTP association
+ * *may* be used, for example, by using the SLS value. Not required but makes sense. */
msgb_sctp_stream(msg) = 1;
- else
+ } else
msgb_sctp_stream(msg) = 0;
msgb_sctp_ppid(msg) = M3UA_PPID;
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index 2b16139..e239c74 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -158,6 +158,8 @@
asp = xua_as_select_asp_override(as);
break;
case OSMO_SS7_AS_TMOD_LOADSHARE:
+ /* TODO: actually use the SLS value to ensure same SLS goes through same ASP. Not
+ * strictly required by M3UA RFC, but would fit the overall principle. */
case OSMO_SS7_AS_TMOD_ROUNDROBIN:
asp = xua_as_select_asp_roundrobin(as);
break;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34273?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I75d7b8f3fb6a06f6941b6dff4072287fdbb1d33e
Gerrit-Change-Number: 34273
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34273?usp=email )
Change subject: m3ua: Add some TODO comments on where we fall short of our potential
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34273?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I75d7b8f3fb6a06f6941b6dff4072287fdbb1d33e
Gerrit-Change-Number: 34273
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 04 Sep 2023 20:20:48 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment