Project

General

Profile

OsmoNITB » History » Revision 17

Revision 16 (laforge, 02/21/2016 02:59 PM) → Revision 17/22 (laforge, 03/06/2016 05:08 AM)

{{>toc}} 

 h1. osmo-nitb 

 {{>toc}} 

 [[OsmoNITB:]] 


 *@osmo-nitb@* (formerly called _bsc_hack_) is the executable program name of [[OpenBSC:]] in NITB (network in the box) mode. 

 See [[OpenBSC:#ConfigurationsModes|Configurations and Modes]] to understand the difference between [[OsmoNITB:]] and [[OsmoBSC:]] mode. 

 


 h2. Manuals 

 * User Manual: http://ftp.osmocom.org/docs/latest/osmonitb-usermanual.pdf 
 * VTY Reference: http://ftp.osmocom.org/docs/latest/osmonitb-vty-reference.pdf 

 h2. Configuration 


 [[OsmoNITB:]] has a configuration file.    The default config file name is @openbsc.cfg@ @openbsc.cfgW in the current working directory of the osmo-nitb process. 

 You can specify an alternate config file location by using the @--config-file@ command line argument. 

 <pre> 
 <pre> 
 <pre> 
 <pre> 
 <pre> 
 <pre> 
 <pre> 
 <pre> 

 For more information, please plase see the User manual linked above. [[osmo-nitb_VTY]] reference. 


 h2. Command Reference 


 <pre> 
 netzing@btsDev:~/openbsc/openbsc/src> ./osmo-nitb --help 
 Usage: osmo-nitb 
   Some useful help... 
   -h --help this text 
   -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable debugging 
   -s --disable-color 
   -c --config-file filename The config file to use. 
   -l --database db-name The database to use 
   -r --reject-cause number The reject cause for LOCATION UPDATING REJECT. 
   -p --pcap file    The filename of the pcap file 
   -T --timestamp Prefix every log line with a timestamp 
 </pre> 


 h3. BS-11 


 you will see something like 
 <pre> 
 DB: Database initialized. 
 DB: Database prepared. 
 1 device found 
         id:               0 
         Dprotocols:       00000018 
         Bprotocols:       0000000e 
         protocol:         4 
         nrbchan:          30 
         name:             hfc-e1.1 
 activate bchan 
 bootstrapping OML 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=0) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=1) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,1) E1=(0,2,1) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=2) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,2) E1=(0,2,2) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=3) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,3) E1=(0,2,3) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=4) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,4) E1=(0,3,0) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=5) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,5) E1=(0,3,1) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=6) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,6) E1=(0,3,2) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=7) 
 Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,7) E1=(0,3,3) 
 bootstrapping RSL MCC=1 MNC=1 
 </pre> 


 h3. ip.access nanoBTS 


 we assume you have a [[nanoBTS]] configured with its primary OML link to the IP address of your Linux PC. 

 After starting osmo-nitb will just wait for your nanoBTS to connect, which can take quite a while. 


 h2. Dealing with the HLR 

 


 We currently use a quite simple sqlite3 database for the HLR.    In fact, it is more than just a HLR, since it actually stores 
 entries even about any subscriber or phone that tries to log into your network. 

 We obtain the IMSI and IMEI of every LOCATION UPDATING REQUEST, and then if neccessary create a new entry for the equipment 
 as well as the subscribers in the respective tables. 

 The schama looks like: 
 <pre> 
 CREATE TABLE Equipment (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, imei NUMERIC UNIQUE NOT NULL, name TEXT); 
 CREATE TABLE [[EquipmentWatch]] (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, subscriber_id NUMERIC NOT NULL, equipment_id NUMERIC NOT NULL, UNIQUE (subscriber_id, equipment_id) ); 
 CREATE TABLE Meta (id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT UNIQUE NOT NULL, value TEXT NOT NULL); 
 CREATE TABLE Subscriber (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, imsi NUMERIC UNIQUE NOT NULL, name TEXT, extension TEXT UNIQUE, authorized INTEGER NOT NULL DEFAULT 0, tmsi TEXT UNIQUE, lac INTEGER NOT NULL DEFAULT 0); 
 </pre> 

 If the subscrber.authorized field is set to '1', then we allocate a TMSI and answer with LOCATION UPDATING ACCEPT.    Otherwise, we send 
 a regular LOCATION UPDATING REJECT to refuse the mobile to roam to our network.    You can change the reject cause using _--reject-cause_. 

 You can allow everyone to join your network by using the _auth policy accept_ config file option. 


 h3. HLR modification using the telnet interface 


 You can telnet to port 4242 of the machine that runs osmo-nitb and try some of the commands, e.g. for dealing with subscribers. 

 <pre> 

 Then you can type statements like 

 <pre> 
 subscriber imsi 012340123456789 authorized 1 
 </pre> 
  which will enable this subscriber to enter the network 

 <pre> 
 subscriber imsi 012340123456789 extension 5555 
 </pre> 
  which will assign the telephone number 5555 to the subscriber with the specified IMSI 

 <pre> 
 subscriber imsi 012340123456789 name Peter 
 </pre> 
  which will associate the name _Peter_ with the subscriber record 

 <pre> 
 show subscriber imsi 012340123456789 
 </pre> 
  which will show you all information about the respective subscriber 

 <pre> 
  subscriber imsi 012340123456789 sms send test123 
 </pre> 
  which will send a SMS with the content _test123_ to the respective subscriber 


 h3. Raw SQL access 


 Instead of the manual commands on the VTY, you can also directly access the underlying HLR SQL database table. 


 h4. Authorizing a particular IMSI 


 To authorize your mobile station you will need to execute the following comand: 

 <pre> 
 $ sqlite3 hlr.sqlite 
 update Subscriber set authorized=1 where imsi=YOUR_IMSI; 
 </pre> 


 h4. Assigning an extension number IMSI 


 In order to call a phone, you need to assign an extension number (phone number) for the IMSI. 

 In the following example, we assign the extension number _4444_: 

 <pre> 
 $ sqlite3 hlr.sqlite 
 update Subscriber set extension=4444 where imsi=YOUR_IMSI; 
 </pre> 


 h4. finding IMEIs for a given IMSI 


 <pre> 
 $ sqlite3 hlr.sqlite 
 select equipment.imei from equipment,equipmentwatch,subscriber where equipmentwatch.equipment_id=equipment.id and subscriber.id=equipmentwatch.subscriber_id and subscriber.imsi=YOUR_IMSI; 
 </pre> 


 h4. List IMSI to extensions mapping 


 <pre> 
 sqlite3 -line hlr.sqlite3 'select imsi,extension from subscriber;' 
 </pre> 



 h2. Configuration via telnet / VTY 


 <pre> 
 configuration file. For more information, plase see the [[osmo-nitb_VTY]] reference. 


 h2. Common Problems 



 h3. Failed to init database 


 <pre> 
 $ ./osmo-nitb 
 DB: Failed to create connection. 
 DB: Failed to init database. Please check the option settings. 
 </pre> 

 This is most likely caused by one of the following problems 
 * the sqlite3 backend for DBD (dbd-sqlite3) has not been installed 
 * osmo-nitb does not have write permissions to the local directory
Add picture from clipboard (Maximum size: 48.8 MB)