Difference between revisions of "DMR IDs"

From W9CR
Jump to navigation Jump to search
(Created page with "DMR ID's I've been getting more into amateur DMR and of course you need an ID. Radioid.net is the DB for this of course, but the scheme in use was developed by [https://www....")
 
Line 22: Line 22:
 
Sub Country level (state/province)  
 
Sub Country level (state/province)  
  
In the MMMSUUU decimal format there is only a possible number of 10 sub country levels.  This is an issue for many countries which have more than 10 sub-regions.  What is done here is to invent  
+
In the MMMSUUU decimal format there is only a possible number of 10 sub country levels.  This is an issue for many countries which have more than 10 sub-regions.  What is done here is to invent new country codes
  
  
Line 31: Line 31:
  
 
= awk to process dmrid file =
 
= awk to process dmrid file =
 +
#match DMR ID's not starting with 1 and 7 digits long.
 +
awk -F\; '$1 !~ /^1/ && length($1) == 7 { print }' dmrid.dat |wc
 +
  184388  184388 2870086
 +
 +
# process the db, and sort into unique country codes. 
 +
awk -F\; '$1 !~ /^1/ && length($1) == 7 { print substr($1,1,3) }' dmrid.dat | sort | uniq |wc
 +
      178    178    712
  
  awk -F\; '$1 !~ /^1/ && length($1) == 7 { print }' dmrid.dat |wc
+
#Compare the unique MCC from the DMR db and the real MCC file
  184388  184388 2870086
+
  awk -F";" 'NR==FNR{a[$1]=$1;next} {if (a[$1]) ;else print "Invalid MCC", $1;} ' MCC-Valid.txt dmr-mcc-in-use.txt
 +
Invalid MCC 263
 +
Invalid MCC 264
 +
Invalid MCC 313
 +
Invalid MCC 314
 +
Invalid MCC 315
 +
Invalid MCC 317
 +
Invalid MCC 535
 +
Invalid MCC 658
 +
  |wc
 +
        8      24    128

Revision as of 13:58, 27 June 2021

DMR ID's

I've been getting more into amateur DMR and of course you need an ID. Radioid.net is the DB for this of course, but the scheme in use was developed by DMR-MARC. They came up with some convoluted scheme back in the day using Mobile Country Codes as a prefix to segregate the ID's so uses could load only the countries they wish in their contact lists. There is no hierarchical authority (ala DNS) where Radioid.net passes off lookups to country (or lower) levels, and the entire DB stands at under 1mb as text, so this segregation is simply for the users.


DMR ID

First some words on the DMR ID from the specs. It's simple, a 24 bit number, however certain types of DMR systems only use the first 16 bits (Cap Plus trunking for one). Hams tend to use the entire 24 bit ID, and it's typically represented at decimal.

24 bits = 16,777,215 possible ID's

16 bits = 65,536 possible ID's for cap plus

DMR-MARC scheme

DMR MARC's scheme uses the Mobile Country Code ("MCC") as the first part of the ID in decimal, then one digit for sub-country (State), and 3 decimal digits for the user.

First doing this as decimal means we cannot use any ID over 9,999,999 as MNC cannot begin with a 1, thus we're limited to the 7 decimal digits. This removes 6,777,216 ID's from the scope of use.

Another issue is using a 3 digits for the MCC. There are only 226 MCC's leaving 774 blocks of 10000 ID's unused or 7,740,000 total ID's unable to be used. (actually a bit less than this due to the next issue)

Sub Country level (state/province)

In the MMMSUUU decimal format there is only a possible number of 10 sub country levels. This is an issue for many countries which have more than 10 sub-regions. What is done here is to invent new country codes




awk to process dmrid file

#match DMR ID's not starting with 1 and 7 digits long.
awk -F\; '$1 !~ /^1/ && length($1) == 7 { print }' dmrid.dat |wc
  184388  184388 2870086

# process the db, and sort into unique country codes.  
awk -F\; '$1 !~ /^1/ && length($1) == 7 { print substr($1,1,3) }' dmrid.dat | sort | uniq |wc 
     178     178     712
#Compare the unique MCC from the DMR db and the real MCC file 
awk -F";" 'NR==FNR{a[$1]=$1;next} {if (a[$1]) ;else print "Invalid MCC", $1;} ' MCC-Valid.txt dmr-mcc-in-use.txt 
Invalid MCC 263
Invalid MCC 264
Invalid MCC 313
Invalid MCC 314
Invalid MCC 315
Invalid MCC 317
Invalid MCC 535
Invalid MCC 658
  |wc
       8      24     128