aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-08-22 17:10:01 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2014-09-02 09:53:47 +0200
commit5f4ef321a62a3a6aadc6a815f7f25d167a197911 (patch)
tree4d3cba625a0ea30d5e9c8daf52683bd45a3ce869 /openbsc/tests
parent28fe98891fbe6475164f508790d19b4b06a88810 (diff)
gbproxy: Implement IMSI acquisition
To modify or route messages based on the IMSI the latter must be known when the action shall take place. This patch modifies the gbproxy to optionally retain and enqueue messages from the MS while initiating an identification procedure. Further message processing of the LLC PTP link towards the SGSN will be done, when the identity of the MS has been acquired. Note that the N(U) of the LLC GMM SAPI are not adjusted, so it is possible that adjacent messages of a single LLC link arriving either at the BSS or the SGSN have the same N(U) and might get discarded, leading to retransmissions and additional delay. Note also that retransmissions and packet loss are not yet handled explicitely. If for instance the generated IDENT REQ gets lost, the gbproxy will not act on its own. In this case, the MS will time out and eventually resend the Attach Request on which the gbproxy will act exactly like before (thus having two Attach Req messages in its queue, which will both be sent after the Ident Resp arrives). This has been tested successfully with an E71, needing one retransmission by the SGSN due to an N(U) collision. Ticket: OW#1261 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.c20
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.ok43
2 files changed, 49 insertions, 14 deletions
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index 8f339b9cd..6fd2e5546 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -137,8 +137,16 @@ static int dump_peers(FILE *stream, int indent, time_t now,
fprintf(stream, "/%08x",
tlli_info->sgsn_tlli.assigned);
}
- rc = fprintf(stream, ", IMSI %s, AGE %d\n",
- mi_buf, (int)age);
+ fprintf(stream, ", IMSI %s, AGE %d",
+ mi_buf, (int)age);
+
+ if (tlli_info->imsi_acq_pending)
+ fprintf(stream, ", IMSI acquisition in progress");
+
+ if (!llist_empty(&tlli_info->stored_msgs))
+ fprintf(stream, ", stored messages");
+
+ rc = fprintf(stream, "\n");
if (rc < 0)
return rc;
}
@@ -1659,6 +1667,7 @@ static void test_gbproxy_imsi_acquisition()
gbcfg.core_apn = talloc_zero_size(NULL, 100);
gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
gbcfg.patch_ptmsi = 1;
+ gbcfg.acquire_imsi = 1;
gbcfg.bss_ptmsi_state = 0;
gbcfg.sgsn_tlli_state = 1;
@@ -1693,6 +1702,13 @@ static void test_gbproxy_imsi_acquisition()
dump_peers(stdout, 0, 0, &gbcfg);
+ send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
+ foreign_bss_tlli, &rai_bss, cell_id,
+ GPRS_SAPI_GMM, bss_nu++,
+ dtap_identity_resp, sizeof(dtap_identity_resp));
+
+ dump_peers(stdout, 0, 0, &gbcfg);
+
send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
random_sgsn_tlli, 0, NULL, 0,
GPRS_SAPI_GMM, sgsn_nu++,
diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok
index 2efc12532..4f9a2351b 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.ok
+++ b/openbsc/tests/gbproxy/gbproxy_test.ok
@@ -2469,11 +2469,30 @@ PROCESSING ATTACH REQUEST from 0x01020304:1111
CALLBACK, event 0, msg length 75, bvci 0x1002
00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
+NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
+MESSAGE to BSS at 0x01020304:1111, msg length 28
+00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c0 01 08 15 01 ff 6c ba
+
+result (ATTACH REQUEST) = 0
+
+Peers:
+ NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
+ RAID patched (BSS ): 1
+ Attach Request count : 1
+ TLLI cache size : 1
+ TLLI-Cache: 1
+ TLLI 8000dead -> 7c69fb81, IMSI (none), AGE 0, IMSI acquisition in progress, stored messages
+PROCESSING IDENT RESPONSE from 0x01020304:1111
+00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 18 ad 05 28
+
+CALLBACK, event 0, msg length 40, bvci 0x1002
+00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 18 ad 05 28
+
NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
MESSAGE to SGSN at 0x05060708:32000, msg length 79
00 00 10 02 01 7c 69 fb 81 00 00 04 08 88 21 63 54 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-result (ATTACH REQUEST) = 79
+result (IDENT RESPONSE) = 0
Peers:
NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
@@ -2482,7 +2501,7 @@ Peers:
Attach Request count : 1
TLLI cache size : 1
TLLI-Cache: 1
- TLLI 8000dead -> 7c69fb81, IMSI (none), AGE 0
+ TLLI 8000dead -> 7c69fb81, IMSI 12131415161718, AGE 0
PROCESSING IDENT REQUEST from 0x05060708:32000
00 00 10 02 00 7c 69 fb 81 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
@@ -2503,16 +2522,16 @@ Peers:
Attach Request count : 1
TLLI cache size : 1
TLLI-Cache: 1
- TLLI 8000dead -> 7c69fb81, IMSI (none), AGE 0
+ TLLI 8000dead -> 7c69fb81, IMSI 12131415161718, AGE 0
PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 18 ad 05 28
+00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 18 ba 14 c3
CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 18 ad 05 28
+00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 18 ba 14 c3
NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 7c 69 fb 81 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 18 ad 05 28
+00 00 10 02 01 7c 69 fb 81 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 18 ba 14 c3
result (IDENT RESPONSE) = 44
@@ -2549,14 +2568,14 @@ Peers:
TLLI-Cache: 1
TLLI 8000dead/c00f7304 -> 7c69fb81/efe2b700, IMSI 12131415161718, AGE 0
PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 c0 0f 73 04 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
+00 00 10 02 01 c0 0f 73 04 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 c0 0f 73 04 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
+00 00 10 02 01 c0 0f 73 04 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
+00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
result (ATTACH COMPLETE) = 35
@@ -2792,14 +2811,14 @@ Gbproxy global:
BSSGP protocol error (SGSN): 1
Patch error: no peer : 1
PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 c0 0f 73 04 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 0d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 37 67 c6
+00 00 10 02 01 c0 0f 73 04 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 c0 0f 73 04 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 0d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 37 67 c6
+00 00 10 02 01 c0 0f 73 04 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
MESSAGE to SGSN at 0x05060708:32000, msg length 48
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 15 01 c0 0d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 37 67 c6
+00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
result (DETACH REQ) = 48