Project

General

Profile

OsmoNITB » History » Version 9

laforge, 02/19/2016 10:48 PM
rename bsc_hack to osmo-nitb in page text

1 9 laforge
= osmo-nitb =
2 3 laforge
3 9 laforge
''osmo-nitb'' (formerly called ''bsc_hack'') is the executable program name of [wiki:OpenBSC] in NITB (network in the box) mode.
4 1 zecke
5 3 laforge
== Configuration ==
6
7 9 laforge
OpenBSC has a configuration file.  The default config file name is ''openbsc.cfg'' in the current working directory of the osmo-nitb process.
8 1 zecke
9 6 zecke
You can specify an alternate config file location by using the ''--config-file'' command line argument.
10 1 zecke
11 6 zecke
There are several example configuration files in the openbsc discribution:
12
 * openbsc.cfg.1-1: Configuration for one BS-11 with a single TRX
13
 * openbsc.cfg.1-2: Configuration for one BS-11 with two TRX
14
 * openbsc.cfg.2-2: Configuration for two BS-11 (multi-drop) with two TRX each
15
 * openbsc.cfg.nanobts: Configuration for a nanoBTS 1800
16 1 zecke
17 6 zecke
For more information, plase see the [wiki:bsc_hack_VTY] reference.
18 1 zecke
19 6 zecke
== Command Reference ==
20
21 1 zecke
{{{
22 9 laforge
netzing@btsDev:~/openbsc/openbsc/src> ./osmo-nitb --help
23
Usage: osmo-nitb
24 6 zecke
  Some useful help...
25
  -h --help this text
26
  -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable debugging
27
  -s --disable-color
28
  -c --config-file filename The config file to use.
29
  -l --database db-name The database to use
30
  -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.
31
  -p --pcap file  The filename of the pcap file
32
  -T --timestamp Prefix every log line with a timestamp
33 3 laforge
}}}
34
35 6 zecke
=== BS-11 ===
36
37 3 laforge
you will see something like
38
{{{
39
DB: Database initialized.
40
DB: Database prepared.
41
1 device found
42
        id:             0
43
        Dprotocols:     00000018
44
        Bprotocols:     0000000e
45
        protocol:       4
46
        nrbchan:        30
47
        name:           hfc-e1.1
48
activate bchan
49
bootstrapping OML
50 1 zecke
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=0)
51
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=1)
52 4 laforge
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,1) E1=(0,2,1)
53
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=2)
54 1 zecke
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,2) E1=(0,2,2)
55
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=3)
56 4 laforge
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,3) E1=(0,2,3)
57
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=4)
58
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,4) E1=(0,3,0)
59
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=5)
60
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,5) E1=(0,3,1)
61 1 zecke
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=6)
62 4 laforge
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,6) E1=(0,3,2)
63
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=7)
64
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,7) E1=(0,3,3)
65
bootstrapping RSL MCC=1 MNC=1
66 1 zecke
}}}
67
68 4 laforge
=== ip.access nanoBTS ===
69
70 6 zecke
we assume you have a [wiki:nanoBTS] configured with its primary OML link to the IP address of your Linux PC.
71
72 9 laforge
After starting osmo-nitb will just wait for your nanoBTS to connect, which can take quite a while.
73 1 zecke
74 4 laforge
== Dealing with the HLR ==
75
76
We currently use a quite simple sqlite3 database for the HLR.  In fact, it is more than just a HLR, since it actually stores
77
entries even about any subscriber or phone that tries to log into your network.
78
79 6 zecke
We obtain the IMSI and IMEI of every LOCATION UPDATING REQUEST, and then if neccessary create a new entry for the equipment
80 5 laforge
as well as the subscribers in the respective tables.
81 1 zecke
82 4 laforge
The schama looks like:
83
{{{
84
CREATE TABLE Equipment (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, imei NUMERIC UNIQUE NOT NULL, name TEXT);
85
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) );
86
CREATE TABLE Meta (id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT UNIQUE NOT NULL, value TEXT NOT NULL);
87
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);
88
}}}
89
90
If the subscrber.authorized field is set to '1', then we allocate a TMSI and answer with LOCATION UPDATING ACCEPT.  Otherwise, we send
91 5 laforge
a regular LOCATION UPDATING REJECT to refuse the mobile to roam to our network.  You can change the reject cause using ''--reject-cause''.
92
93 6 zecke
You can allow everyone to join your network by using the ''auth policy accept'' config file option.
94 4 laforge
95
=== Authorizing a particular IMSI ===
96 1 zecke
97 2 zecke
To authorize your mobile station you will need to execute the following comand:
98 5 laforge
99
{{{
100 6 zecke
$ sqlite3 hlr.sqlite
101 5 laforge
update Subscriber set authorized=1 where imsi=YOUR_IMSI;
102
}}}
103
104 7 laforge
=== Assigning an extension number IMSI ===
105
106
In order to call a phone, you need to assign an extension number (phone number) for the IMSI.
107
108
In the following example, we assign the extension number ''4444'':
109
110
{{{
111
$ sqlite3 hlr.sqlite
112
update Subscriber set extension=4444 where imsi=YOUR_IMSI;
113
}}}
114
115 2 zecke
=== finding IMEIs for a given IMSI ===
116 3 laforge
117 1 zecke
{{{
118 6 zecke
$ sqlite3 hlr.sqlite
119 3 laforge
select equipment.imei from equipment,equipmentwatch,subscriber where equipmentwatch.equipment_id=equipment.id and subscriber.id=equipmentwatch.subscriber_id and subscriber.imsi=YOUR_IMSI;
120
}}}
121
122 1 zecke
== Using the telnet interface ==
123
124 9 laforge
You can telnet to port 4242 of the machine that runs osmo-nitb and try some of the commands.
125 8 laforge
126 1 zecke
If you type the commands {{{enable}}} and {{{configure terminal}}}, you can interactively enter commands in the same syntax as the
127 8 laforge
configuration file. For more information, plase see the [wiki:bsc_hack_VTY] reference.
128
129
== Common Problems ==
130
131
=== Failed to init database ===
132 1 zecke
133 8 laforge
{{{
134 9 laforge
$ ./osmo-nitb
135 8 laforge
DB: Failed to create connection.
136
DB: Failed to init database. Please check the option settings.
137
}}}
138
139
This is most likely caused by one of the following problems
140
 * the sqlite3 backend for DBD (dbd-sqlite3) has not been installed
141 9 laforge
 * osmo-nitb does not have write permissions to the local directory
Add picture from clipboard (Maximum size: 48.8 MB)