summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gprs
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-07-01 21:04:45 +0200
committerHarald Welte <laforge@gnumonks.org>2019-02-26 12:18:30 +0100
commit047f3872f511353e894659719a6c5346249bca40 (patch)
treee719164186b93e96cfca6daa86b95f7679bbe669 /include/osmocom/gprs
parent35042a29197bd086a545976e5fa38d01c434f8ac (diff)
NS: Add support for GPRS NS IP Sub-Network-Service (SNS)
The NS implementation part of the Gb implementation libosmogb so far implemented a rather classic dialect of Gb, with lots of heritage to FR (Frame Relay) transports. At least since Release 6 of the NS specification, there's an IP Sub-Network Service (SNS), which * permits for dynamic configuration of IP endpoints and their NS-VCs * abandons the concept of a NSVCI on IP transport * forbids the use of RESET/BLOCK/UNBLOCK procedures on IP transport This commit introduces BSS-side IP-SNS support to libosmogb in a minimally invasive way. It adds a corresponding SNS FSM to each NS instance, and implements the new SIZE/CONFIG/ADD/DELETE/CHANGE_WEIGHT procedures very closely aligned with the spec. In order to use the SNS flavor (rather than the classic one), a BSS implementation should use gprs_ns_nsip_connect_sns() instead of the existing gprs_ns_nsip_connect(). This implementation comes with a set of TTCN-3 tests in PCU_Tests_RAW_SNS.ttcn, see Change-ID I0fe3d4579960bab0494c294ec7ab8032feed4fb2 of osmo-ttcn3-hacks.git Closes: OS#3372 Closes: OS#3617 Change-Id: I84786c3b43a8ae34ef3b3ba84b33c90042d234ea
Diffstat (limited to 'include/osmocom/gprs')
-rw-r--r--include/osmocom/gprs/gprs_ns.h21
-rw-r--r--include/osmocom/gprs/protocol/gsm_08_16.h1
2 files changed, 19 insertions, 3 deletions
diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h
index 1c99ed09..c62ef98a 100644
--- a/include/osmocom/gprs/gprs_ns.h
+++ b/include/osmocom/gprs/gprs_ns.h
@@ -14,8 +14,8 @@
#include <osmocom/gprs/protocol/gsm_08_16.h>
-#define NS_TIMERS_COUNT 7
-#define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries)"
+#define NS_TIMERS_COUNT 8
+#define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov)"
#define NS_TIMERS_HELP \
"(un)blocking Timer (Tns-block) timeout\n" \
"(un)blocking Timer (Tns-block) number of retries\n" \
@@ -23,7 +23,8 @@
"Reset Timer (Tns-reset) number of retries\n" \
"Test Timer (Tns-test) timeout\n" \
"Alive Timer (Tns-alive) timeout\n" \
- "Alive Timer (Tns-alive) number of retries\n"
+ "Alive Timer (Tns-alive) number of retries\n" \
+ "SNS Provision Timer (Tsns-prov) timeout\n"
/* Educated guess - LLC user payload is 1500 bytes plus possible headers */
#define NS_ALLOC_SIZE 3072
@@ -37,6 +38,7 @@ enum ns_timeout {
NS_TOUT_TNS_TEST,
NS_TOUT_TNS_ALIVE,
NS_TOUT_TNS_ALIVE_RETRIES,
+ NS_TOUT_TSNS_PROV,
};
#define NSE_S_BLOCKED 0x0001
@@ -102,6 +104,8 @@ struct gprs_ns_inst {
uint32_t local_ip;
unsigned int enabled:1;
} frgre;
+
+ struct osmo_fsm_inst *bss_sns_fi;
};
enum nsvc_timer_mode {
@@ -150,6 +154,10 @@ struct gprs_nsvc {
struct sockaddr_in bts_addr;
} frgre;
};
+ /*! signalling weight. 0 = don't use for signalling (BVCI == 0)*/
+ uint8_t sig_weight;
+ /*! signaling weight. 0 = don't use for user data (BVCI != 0) */
+ uint8_t data_weight;
};
/* Create a new NS protocol instance */
@@ -169,6 +177,9 @@ struct gprs_nsvc *gprs_ns_nsip_connect(struct gprs_ns_inst *nsi,
struct sockaddr_in *dest,
uint16_t nsei, uint16_t nsvci);
+/* Establish a connection (from the BSS) to the SGSN using IP SNS */
+struct gprs_nsvc *gprs_ns_nsip_connect_sns(struct gprs_ns_inst *nsi, struct sockaddr_in *dest,
+ uint16_t nsei, uint16_t nsvci);
struct sockaddr_in;
@@ -185,9 +196,12 @@ int gprs_ns_tx_unblock(struct gprs_nsvc *nsvc);
int gprs_ns_frgre_listen(struct gprs_ns_inst *nsi);
struct gprs_nsvc *gprs_nsvc_create(struct gprs_ns_inst *nsi, uint16_t nsvci);
+struct gprs_nsvc *gprs_nsvc_create2(struct gprs_ns_inst *nsi, uint16_t nsvci,
+ uint8_t sig_weight, uint8_t data_weight);
void gprs_nsvc_delete(struct gprs_nsvc *nsvc);
struct gprs_nsvc *gprs_nsvc_by_nsei(struct gprs_ns_inst *nsi, uint16_t nsei);
struct gprs_nsvc *gprs_nsvc_by_nsvci(struct gprs_ns_inst *nsi, uint16_t nsvci);
+struct gprs_nsvc *gprs_nsvc_by_rem_addr(struct gprs_ns_inst *nsi, const struct sockaddr_in *sin);
/* Initiate a RESET procedure (including timer start, ...)*/
int gprs_nsvc_reset(struct gprs_nsvc *nsvc, uint8_t cause);
@@ -213,6 +227,7 @@ enum signal_ns {
S_NS_ALIVE_EXP, /* Tns-alive expired more than N times */
S_NS_REPLACED, /* nsvc object is replaced (sets old_nsvc) */
S_NS_MISMATCH, /* got an unexpected IE (sets msg, pdu_type, ie_type) */
+ S_SNS_CONFIGURED, /* IP-SNS configuration completed */
};
extern const struct value_string gprs_ns_signal_ns_names[];
diff --git a/include/osmocom/gprs/protocol/gsm_08_16.h b/include/osmocom/gprs/protocol/gsm_08_16.h
index 15d92d37..95efcb6d 100644
--- a/include/osmocom/gprs/protocol/gsm_08_16.h
+++ b/include/osmocom/gprs/protocol/gsm_08_16.h
@@ -66,6 +66,7 @@ enum ns_ctrl_ie {
NS_IE_IPv6_EP_NR = 0x09,
NS_IE_RESET_FLAG = 0x0a,
NS_IE_IP_ADDR = 0x0b,
+ NS_IE_TRANS_ID = 0xff, /* osmocom. Spec has this IE but without IEI! */
};
/*! NS Cause (TS 08.16, Section 10.3.2, Table 13) */