falconia has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/38794?usp=email )
Change subject: change default reject cause to plmn-not-allowed ......................................................................
change default reject cause to plmn-not-allowed
Unless the Osmocom-based network operator has very carefully considered what they are doing, returning MM/GMM reject cause #2 (IMSI unknown in HLR) to LU requests from bystander phones is a very bad idea. Here is what typically happens when someone sets up an Osmocom-based GSM network for development, testing or research, without roaming interconnection with any commercial operators:
* Even when the private network operates its BTS at very low power levels, bystander phones in close proximity (e.g., in directly adjacent neighbor apartments or office suites) will receive a much stronger signal from the private/test network BTS than from any commercial operator, i.e., the private/test network will be the strongest signal.
* Many phones will attempt to "jump ship" to this strongest signal even if it broadcasts a completely unknown PLMN ID that is not in the preferred operator list, and even when they were previously not roaming at all, registered to their most preferred home operator with perfectly good reception quality.
* If these wayward phones receive reject cause #2 in response to their LU attempt, the spec effectively requires them to go into a "black hole" where they no longer attempt to register to any operator, including their own legitimate one.
Returning reject cause #11 instead (PLMN not allowed) solves this problem: wayward phones that erroneously attempted to register to the private/test network go back to their own legitimate commercial operator, and everyone is happy.
This bug should be considered critical: when the reject cause is set to #2 by default, any private Osmocom-based network, no matter how low-power, will effectively cause service disruption to all nearby commercially-served phones even when there is no clash in terms of used radio frequencies.
Change-Id: Icff1d19670c398b119ec68b1d5f0fad87b605702 --- M src/hlr.c M tests/test_nodes.vty 2 files changed, 2 insertions(+), 2 deletions(-)
Approvals: keith: Looks good to me, but someone else must approve falconia: Looks good to me, approved Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve
diff --git a/src/hlr.c b/src/hlr.c index 6f444aa..3d020d6 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -779,7 +779,7 @@ g_hlr->db_file_path = talloc_strdup(g_hlr, HLR_DEFAULT_DB_FILE_PATH); g_hlr->mslookup.server.mdns.domain_suffix = talloc_strdup(g_hlr, OSMO_MDNS_DOMAIN_SUFFIX_DEFAULT); g_hlr->mslookup.client.mdns.domain_suffix = talloc_strdup(g_hlr, OSMO_MDNS_DOMAIN_SUFFIX_DEFAULT); - g_hlr->reject_cause = GMM_CAUSE_IMSI_UNKNOWN; + g_hlr->reject_cause = GMM_CAUSE_PLMN_NOTALLOWED; g_hlr->no_proxy_reject_cause = GMM_CAUSE_IMSI_UNKNOWN;
/* Init default (call independent) SS session guard timeout value */ diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index 516360f..a9203b7 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -113,7 +113,7 @@ logging level dgsm notice ... hlr - reject-cause not-found imsi-unknown + reject-cause not-found plmn-not-allowed reject-cause no-proxy imsi-unknown store-imei database hlr_vty_test.db