pespin submitted this change.

View Change

Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved
gtp: Introduce VTY configurable GTP timer X3

This timer controls the amount of time a resp message transmitted by the
local gsn is to be stored in the resp queue. This is used in order to
detect duplicate requests received, since GTP states the exact same
response should be answered if a duplicate request is received.

Prior to this patch, this timer was hardcoded to 60 seconds.
This patch actually should be set, in general, to a value
equal than (T3-RESPONSE * N3-REQUESTS) values configured at
the peer, since that is the maximum period during which the local gsn
expects to receive req retransmissions from the peer.
Hence, this value must be user configurable to adapt it to the peers
connected to the GSN.

The 60 seconds hardcoded value is therefore changed to default to our
local (T3-RESPONSE * N3-REQUESTS), since the most common scenario for
osmo-ggsn/osmo-sgsn is to run it against a peer osmo-sgsn/osmo-ggsn,
which will have the same values by default.
This way we avoid by default caching response messages for way too long,
potentially filling the queue.

Related: OS#5485
Change-Id: Ia15c1cfd201d7c43e9a1d6ceb6725ddf392d2c65
---
M gtp/gsn.c
M gtp/gsn.h
M gtp/gtp.c
3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gtp/gsn.c b/gtp/gsn.c
index da30fc9..ce66244 100644
--- a/gtp/gsn.c
+++ b/gtp/gsn.c
@@ -108,6 +108,9 @@
{ .T = GTP_GSN_TIMER_N3_REQUESTS, .default_val = 3, .unit = OSMO_TDEF_CUSTOM,
.desc = "Counter N3-REQUESTS holds the maximum number of attempts made by GTP to send a request message"
},
+ { .T = GTP_GSN_TIMER_T3_HOLD_RESPONSE, .default_val = 5 * 3 /* (GTP_GSN_TIMER_T3_RESPONSE * GTP_GSN_TIMER_N3_REQUESTS) */, .unit = OSMO_TDEF_S,
+ .desc = "Time a GTP respoonse message is kept cached to re-transmit it when a duplicate request is received. Value is generally equal to (T3-RESPONSE * N3-REQUESTS) set at the peer"
+ },
{}
};

diff --git a/gtp/gsn.h b/gtp/gsn.h
index 3b9cb1d..8e47ce3 100644
--- a/gtp/gsn.h
+++ b/gtp/gsn.h
@@ -67,6 +67,7 @@
enum gtp_gsn_timers {
GTP_GSN_TIMER_T3_RESPONSE = 3,
GTP_GSN_TIMER_N3_REQUESTS = 1003,
+ GTP_GSN_TIMER_T3_HOLD_RESPONSE = -3,
};

struct gsn_t {
diff --git a/gtp/gtp.c b/gtp/gtp.c
index f32461c..1ebc6dc 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -499,11 +499,13 @@
LOGP(DLGTP, LOGL_ERROR, "Retransmit resp queue is full (seq=%" PRIu16 ")\n",
seq);
} else {
+ unsigned int t3_hold_resp;
LOGP(DLGTP, LOGL_DEBUG, "Registering seq=%" PRIu16
" in restransmit resp queue\n", seq);
+ t3_hold_resp = osmo_tdef_get(gsn->tdef, GTP_GSN_TIMER_T3_HOLD_RESPONSE, OSMO_TDEF_S, -1);
memcpy(&qmsg->p, packet, sizeof(union gtp_packet));
qmsg->l = len;
- qmsg->timeout = time(NULL) + 60; /* When to timeout */
+ qmsg->timeout = time(NULL) + t3_hold_resp; /* When to timeout */
qmsg->retrans = 0; /* No retransmissions so far */
qmsg->cbp = NULL;
qmsg->type = 0;

To view, visit change 30279. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Ia15c1cfd201d7c43e9a1d6ceb6725ddf392d2c65
Gerrit-Change-Number: 30279
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged