pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39707?usp=email )
Change subject: ASP loadsharing: Normal ASP distribution regardless of active state
......................................................................
ASP loadsharing: Normal ASP distribution regardless of active state
Before this patch, the normal ASP for a given loadshare eSLS entry (seed)
would only be filled in with active ASPs.
That means that if eg. N ASPs are configured but only 1 is successfully
activated upon startup and a lot of traffic happens, the full eSLS will
be filled with that ASP, and as a result all traffic will be sent to
that ASP, with the exception during the time that ASP is inactive.
Instead, we want to populate the eSLS table with Normal ASP field
properly distributed over all ASPs. If a given ASP is not active at that
time, then simply pick an Alternative ASP during that time.
Change-Id: I2064fe89bac2d3bd86fee544a64ab21417e1c368
---
M src/osmo_ss7_as.c
M src/ss7_as.h
2 files changed, 46 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/07/39707/1
diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c
index 35a2650..22fcb14 100644
--- a/src/osmo_ss7_as.c
+++ b/src/osmo_ss7_as.c
@@ -304,6 +304,33 @@
return asp;
}
+/* Pick an ASP serving AS in a round-robin fashion.
+ * During Loadshare eSLS table generation we want to pick Normal ASP
+ * in a distributed fashion, regardless of active state (Alternative ASP will
+ * be picked up temporarily later on if needed).
+ * Morevoer, we must use a different index from the "active"
+ * ss7_as_select_asp_roundrobin() below, in order to avoid tainting the
+ * distribution. */
+static struct osmo_ss7_asp *ss7_as_assign_asp_roundrobin(struct osmo_ss7_as *as)
+{
+ struct osmo_ss7_asp *asp;
+ unsigned int i;
+ unsigned int first_idx;
+
+ first_idx = (as->cfg.last_asp_idx_assigned + 1) % ARRAY_SIZE(as->cfg.asps);
+ i = first_idx;
+ do {
+ asp = as->cfg.asps[i];
+ if (asp)
+ break;
+ i = (i + 1) % ARRAY_SIZE(as->cfg.asps);
+ } while (i != first_idx);
+ as->cfg.last_asp_idx_assigned = i;
+
+ return asp;
+}
+
+/* Pick an active ASP serving AS in a round-robin fashion, to send a message to. */
static struct osmo_ss7_asp *ss7_as_select_asp_roundrobin(struct osmo_ss7_as *as)
{
struct osmo_ss7_asp *asp;
@@ -397,17 +424,24 @@
/* No current ASP available, try to find a new current ASP: */
- /* No normal route selected yet: */
+ /* No normal route assigned yet: */
if (!aeslse->normal_asp) {
- asp = ss7_as_select_asp_roundrobin(as);
- /* Either a normal route was selected or none found: */
+ /* Establish a Normal ASP, regardless of active state: */
+ asp = ss7_as_assign_asp_roundrobin(as);
+ /* No ASP found for Normal ASP, regardless of state... */
+ if (!asp)
+ return NULL;
aeslse->normal_asp = asp;
- if (asp)
- LOGPAS(as, DLSS7, LOGL_DEBUG, "Tx Loadshare: OPC=%u=%s,SLS=%u -> eSLS=%u: "
- "picked Normal ASP '%s' round-robin style\n",
- mtp->opc, osmo_ss7_pointcode_print(as->inst, mtp->opc),
- mtp->sls, as_ext_sls, asp->cfg.name);
- return asp;
+ LOGPAS(as, DLSS7, LOGL_DEBUG, "Tx Loadshare: OPC=%u=%s,SLS=%u -> eSLS=%u: "
+ "picked Normal ASP '%s' round-robin style\n",
+ mtp->opc, osmo_ss7_pointcode_print(as->inst, mtp->opc),
+ mtp->sls, as_ext_sls, aeslse->normal_asp->cfg.name);
+ if (osmo_ss7_asp_active(aeslse->normal_asp)) {
+ /* Found active Normal Route: */
+ return aeslse->normal_asp;
+ }
+ /* Normal ASP was assigned, but it is not active, fall-through
+ * below to attempt transmission through Alternative ASP: */
}
/* Normal ASP unavailable and no alternative ASP (or unavailable too).
diff --git a/src/ss7_as.h b/src/ss7_as.h
index c4dfdf6..13592e9 100644
--- a/src/ss7_as.h
+++ b/src/ss7_as.h
@@ -108,7 +108,9 @@
} pc_override;
struct osmo_ss7_asp *asps[16];
- uint8_t last_asp_idx_sent; /* used for load-sharing traffic mode (round robin implementation) */
+ /* used for load-sharing traffic mode (round robin implementation) */
+ uint8_t last_asp_idx_assigned;
+ uint8_t last_asp_idx_sent;
struct {
/* How many bits from ITU SLS field (starting from least-significant-bit)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39707?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I2064fe89bac2d3bd86fee544a64ab21417e1c368
Gerrit-Change-Number: 39707
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39708?usp=email )
Change subject: AS loadsharing: Normal route distribution regardless of active state
......................................................................
AS loadsharing: Normal route distribution regardless of active state
Before this patch, the normal route for a given loadshare eSLS entry (seed)
would only be filled in with available routes.
That means that if eg. N routes are configured but only 1 is really
available upon startup and a lot of traffic happens, the full eSLS will
be filled with that route, and as a result all traffic on that combined
linkset will be sent through that route.
Instead, we want to populate the eSLS table with Normal Route field
properly distributed over all routes. If a given route is not active at
that time, then simply pick an Alternative Route during that time.
Change-Id: I6daf114416c69c84bdc3042efcaf2918f91c2e87
---
M src/osmo_ss7_combined_linkset.c
M src/ss7_combined_linkset.h
2 files changed, 60 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/08/39708/1
diff --git a/src/osmo_ss7_combined_linkset.c b/src/osmo_ss7_combined_linkset.c
index a741aba..37da4fc 100644
--- a/src/osmo_ss7_combined_linkset.c
+++ b/src/osmo_ss7_combined_linkset.c
@@ -151,11 +151,17 @@
}
/* Update round robin state */
- if (rt == clset->last_route_roundrobin) {
- ss7_llist_round_robin(&clset->routes, &clset->last_route_roundrobin, struct osmo_ss7_route, list);
+ if (rt == clset->last_route_roundrobin_ass) {
+ ss7_llist_round_robin(&clset->routes, &clset->last_route_roundrobin_ass, struct osmo_ss7_route, list);
/* If there's only one left, remove state: */
- if (rt == clset->last_route_roundrobin)
- clset->last_route_roundrobin = NULL;
+ if (rt == clset->last_route_roundrobin_ass)
+ clset->last_route_roundrobin_ass = NULL;
+ }
+ if (rt == clset->last_route_roundrobin_tx) {
+ ss7_llist_round_robin(&clset->routes, &clset->last_route_roundrobin_tx, struct osmo_ss7_route, list);
+ /* If there's only one left, remove state: */
+ if (rt == clset->last_route_roundrobin_tx)
+ clset->last_route_roundrobin_tx = NULL;
}
llist_del(&rt->list);
@@ -195,6 +201,36 @@
return NULL;
}
+/* Pick a Route from Combined Linkset in a round-robin fashion.
+ * During Loadshare eSLS table generation we want to pick Normal Route
+ * in a distributed fashion, regardless of active state (Alternative Route will
+ * be picked up temporarily later on if needed).
+ * Morevoer, we must use a different index from the "active"
+ * ss7_combined_linkset_select_route_roundrobin() below, in order to avoid tainting
+ * the distribution.
+ */
+static struct osmo_ss7_route *ss7_combined_linkset_assign_route_roundrobin(struct osmo_ss7_combined_linkset *clset)
+{
+ struct osmo_ss7_route *rt;
+ struct osmo_ss7_route *rt_found = NULL;
+ unsigned int i = 0;
+
+ while (i < clset->num_routes) {
+ i++;
+ rt = ss7_llist_round_robin(&clset->routes, &clset->last_route_roundrobin_ass, struct osmo_ss7_route, list);
+ if (rt) {
+ rt_found = rt;
+ break;
+ }
+ }
+
+ if (!rt_found)
+ return NULL;
+
+ return rt_found;
+}
+
+/* Pick an available route from Combined Linkset in a round-robin fashion, to send a message through. */
static struct osmo_ss7_route *ss7_combined_linkset_select_route_roundrobin(struct osmo_ss7_combined_linkset *clset)
{
struct osmo_ss7_route *rt;
@@ -203,8 +239,8 @@
while (i < clset->num_routes) {
i++;
- rt = ss7_llist_round_robin(&clset->routes, &clset->last_route_roundrobin, struct osmo_ss7_route, list);
- if (ss7_route_is_available(rt)) {
+ rt = ss7_llist_round_robin(&clset->routes, &clset->last_route_roundrobin_tx, struct osmo_ss7_route, list);
+ if (rt && ss7_route_is_available(rt)) {
rt_found = rt;
break;
}
@@ -256,18 +292,24 @@
/* No normal route selected yet: */
if (!eslse->normal_rt) {
- rt = ss7_combined_linkset_select_route_roundrobin(clset);
- /* Either a normal route was selected or none found: */
+ /* Establish a Normal Route, regardless of available state: */
+ rt = ss7_combined_linkset_assign_route_roundrobin(clset);
+ /* No route found for Normal Route, regardless of state... */
+ if (!rt)
+ return NULL;
eslse->normal_rt = rt;
- if (rt) {
- LOGPCLSET(clset, DLSS7, LOGL_DEBUG, "RT loookup: OPC=%u=%s,DPC=%u=%s,SLS=%u -> eSLS=%u: "
- "picked Normal Route via '%s' round-robin style\n",
- rtlabel->opc, osmo_ss7_pointcode_print(inst, rtlabel->opc),
- rtlabel->dpc, osmo_ss7_pointcode_print2(inst, rtlabel->dpc),
- rtlabel->sls, esls,
- rt->dest.as ? rt->dest.as->cfg.name : "<linkset>");
+ LOGPCLSET(clset, DLSS7, LOGL_DEBUG, "RT loookup: OPC=%u=%s,DPC=%u=%s,SLS=%u -> eSLS=%u: "
+ "picked Normal Route via '%s' round-robin style\n",
+ rtlabel->opc, osmo_ss7_pointcode_print(inst, rtlabel->opc),
+ rtlabel->dpc, osmo_ss7_pointcode_print2(inst, rtlabel->dpc),
+ rtlabel->sls, esls,
+ rt->dest.as ? rt->dest.as->cfg.name : "<linkset>");
+ if (ss7_route_is_available(eslse->normal_rt)) {
+ /* Found available Normal Route: */
+ return eslse->normal_rt;
}
- return rt;
+ /* Normal Route was assigned, but it is not active, fall-through
+ * below to attempt transmission through Alternative Route: */
}
/* Normal route unavailable and no alternative route (or unavailable too).
diff --git a/src/ss7_combined_linkset.h b/src/ss7_combined_linkset.h
index b79810b..432ebd7 100644
--- a/src/ss7_combined_linkset.h
+++ b/src/ss7_combined_linkset.h
@@ -33,7 +33,8 @@
/*! list of \ref osmo_ss7_route */
struct llist_head routes;
unsigned int num_routes;
- void *last_route_roundrobin;
+ void *last_route_roundrobin_ass;
+ void *last_route_roundrobin_tx;
struct {
uint32_t pc;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39708?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I6daf114416c69c84bdc3042efcaf2918f91c2e87
Gerrit-Change-Number: 39708
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: osmith.
Hello Jenkins Builder, daniel, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/38731?usp=email
to look at the new patch set (#14).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: AS loadsharing: Introduce combined_linkset
......................................................................
AS loadsharing: Introduce combined_linkset
A "Combined linkset" is a set of routes for different AS or linksets
whose destination (DPC & mask) and priority are the same.
An SP is expected to load share traffic among linksets/AS of a given
combined linkset, based on DPC/OPC,SLS. This means certain state or
heuristics need to be stored in the combined linkset in order to keep
forwarding messages of the same transaction (SLS) over the same specific
AS/linkset.
This commit introduces the osmo_ss7_combined_linkset object, which
is roughly a set of osmo_ss7_route sharing DPC+MASK+PRIO key, and
it is placed in between the osmo_ss7_route_table and osmo_ss7_route
entries.
User still operates/manages indiviual routes, but those are grouped
internally inside its corresponding combined linkset.
No routing change is implemented in this commit. Code is only tweaked
minimally so far to retrieve the first route in the combined link.
This will allow future work, i.e to:
- Check if data can be sent over the combined link (at least one
AS/linkset is ACTIVE), and otherwise try using a combined link with a
less specific match (shorter prefix mask or/and lower priority).
- Select one of the AS/linksets inserted the combined link, based on
OPC/DPC/SLS of the message.
Related: SYS#7112
Change-Id: I500ec74ba975e3c93071771027e4e5fe6000e6f3
---
M src/Makefile.am
A src/osmo_ss7_combined_linkset.c
M src/osmo_ss7_route.c
M src/osmo_ss7_route_table.c
M src/osmo_ss7_vty.c
A src/ss7_combined_linkset.h
M src/ss7_route.h
M src/ss7_route_table.h
8 files changed, 357 insertions(+), 95 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/31/38731/14
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38731?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I500ec74ba975e3c93071771027e4e5fe6000e6f3
Gerrit-Change-Number: 38731
Gerrit-PatchSet: 14
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Attention is currently required from: pespin.
Hello Jenkins Builder, daniel, laforge, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email
to look at the new patch set (#10).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: AS loadsharing: Introduce AS rate_ctr rx:msu:sls:*
......................................................................
AS loadsharing: Introduce AS rate_ctr rx:msu:sls:*
Related: SYS#7112
Change-Id: I695bd3933a116323db45ab7f45dcf539791139aa
---
M src/ipa.c
M src/m3ua.c
M src/osmo_ss7_as.c
M src/ss7_as.h
M src/sua.c
5 files changed, 43 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/06/39406/10
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I695bd3933a116323db45ab7f45dcf539791139aa
Gerrit-Change-Number: 39406
Gerrit-PatchSet: 10
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Hello Jenkins Builder, daniel, laforge, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39407?usp=email
to look at the new patch set (#10).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: AS loadsharing: Introduce AS rate_ctr tx:msu:sls:*
......................................................................
AS loadsharing: Introduce AS rate_ctr tx:msu:sls:*
Related: SYS#7112
Change-Id: Ia446e11ea24ecb021a3dddf5547aa2b3cdbbe60b
---
M src/osmo_ss7_as.c
M src/osmo_ss7_hmrt.c
M src/ss7_as.h
3 files changed, 35 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/07/39407/10
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39407?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ia446e11ea24ecb021a3dddf5547aa2b3cdbbe60b
Gerrit-Change-Number: 39407
Gerrit-PatchSet: 10
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>