Hi list,
I've noted a subtle difference in specifications for BCD-coding MCC and MNC.
I'll illustrate by encoding the two sets MCC 123, MNC 45 and MCC 123, MNC 456
In Figure 10.5.3/3GPP TS 04.08, we have both the third digits in the second byte, i.e. above are encoded as: 21 f3 54 and 21 63 54 respectively
In 3GPP TS 25.413 in 9.2.3.55 PLMN Identity, I see a very similar definition for BCD coding, but it omits the detail to put the last MNC digit into the second byte. So, by omittance, it defines a different coding from 04.08: 21 f3 54 (same) but 21 43 65 respectively.
This strikes me as pretty odd, and I wonder whether the spec author overlooked this detail. The definition in the RANAP spec is also squeezed into the rightmost column of the IE description table, so it looks like a "quick hack".
I would like to replace the ranap_parse_lai() implementation with gsm48_mcc_mnc_from_bcd() to have less code duplication, and hence I hit this weird difference.
Does anyone have an idea how I should handle this?
We could test it by setting our hNodeB to a three digit MNC and see whether it encodes it like 04.08 in the RANAP coding... Daniel, could you check this out in wireshark while you're busy testing?
~Neels
Hi,
On Wed, 2016-04-06 at 14:20 +0200, Neels Hofmeyr wrote:
Hi list,
I've noted a subtle difference in specifications for BCD-coding MCC and MNC.
I'll illustrate by encoding the two sets MCC 123, MNC 45 and MCC 123, MNC 456
In Figure 10.5.3/3GPP TS 04.08, we have both the third digits in the second byte, i.e. above are encoded as: 21 f3 54 and 21 63 54 respectively
In 3GPP TS 25.413 in 9.2.3.55 PLMN Identity, I see a very similar definition for BCD coding, but it omits the detail to put the last MNC digit into the second byte. So, by omittance, it defines a different coding from 04.08: 21 f3 54 (same) but 21 43 65 respectively.
This is what the hnb does. A PLMNID of 901123 results in 09 11 32 being transmitted in HNBAP. PLMNID of 90123 corresponds to 09 f1 32
The RANAP fields for LAI and SAI are encoded the same.
This strikes me as pretty odd, and I wonder whether the spec author overlooked this detail. The definition in the RANAP spec is also squeezed into the rightmost column of the IE description table, so it looks like a "quick hack".
Yet another fun quirk...
I would like to replace the ranap_parse_lai() implementation with gsm48_mcc_mnc_from_bcd() to have less code duplication, and hence I hit this weird difference.
Does anyone have an idea how I should handle this?
Since the coding differs I wouldn't try to merge the implementations. I'd think that it would obscure more than it helps.
Regards Daniel
On Wed, Apr 06, 2016 at 05:18:54PM +0200, Daniel Willmann wrote:
In 3GPP TS 25.413 in 9.2.3.55 PLMN Identity, I see a very similar definition for BCD coding, but it omits the detail to put the last MNC digit into the second byte. So, by omittance, it defines a different coding from 04.08: 21 f3 54 (same) but 21 43 65 respectively.
This is what the hnb does. A PLMNID of 901123 results in 09 11 32 being transmitted in HNBAP. PLMNID of 90123 corresponds to 09 f1 32
The RANAP fields for LAI and SAI are encoded the same.
[...]
Since the coding differs I wouldn't try to merge the implementations. I'd think that it would obscure more than it helps.
Excellent, thanks for testing it!! Quite curious result though. I agree to not use gsm48_mcc_mnc_from_bcd() directly, but maybe ranap_parse_lai() can reuse some more general bcd code...
~Neels
On Wed, 2016-04-06 at 17:46 +0200, Neels Hofmeyr wrote:
On Wed, Apr 06, 2016 at 05:18:54PM +0200, Daniel Willmann wrote:
In 3GPP TS 25.413 in 9.2.3.55 PLMN Identity, I see a very similar definition for BCD coding, but it omits the detail to put the last MNC digit into the second byte. So, by omittance, it defines a different coding from 04.08: 21 f3 54 (same) but 21 43 65 respectively.
This is what the hnb does. A PLMNID of 901123 results in 09 11 32 being transmitted in HNBAP. PLMNID of 90123 corresponds to 09 f1 32
The RANAP fields for LAI and SAI are encoded the same.
[...]
Since the coding differs I wouldn't try to merge the implementations. I'd think that it would obscure more than it helps.
Excellent, thanks for testing it!! Quite curious result though. I agree to not use gsm48_mcc_mnc_from_bcd() directly, but maybe ranap_parse_lai() can reuse some more general bcd code...
Yeah, that could help. The BCD descrambling is needed for more than those two (MSISDN, IMSI, ...).
Fun fact: The Dell phone displays the network correctly as 901123 - the Sony Ericsson K800i incorrectly displays it as 901231. :-)
Daniel
On Wed, Apr 06, 2016 at 06:17:23PM +0200, Daniel Willmann wrote:
Fun fact: The Dell phone displays the network correctly as 901123 - the Sony Ericsson K800i incorrectly displays it as 901231. :-)
LOL, this thing is causing widespread confusion :)
So the Ericsson is decoding the RANAP PLMN-Id in a 04.08 way, and the Dell and our hnb agree that RANAP works differently... Counting a vote of 2 against 1 that the codings differ.
~Neels