Project

General

Profile

OsmoNITB » History » Version 14

laforge, 02/19/2016 10:48 PM

1 12 laforge
[[PageOutline]]
2 9 laforge
= osmo-nitb =
3 3 laforge
4 9 laforge
''osmo-nitb'' (formerly called ''bsc_hack'') is the executable program name of [wiki:OpenBSC] in NITB (network in the box) mode.
5 1 zecke
6 14 laforge
See [wiki:OpenBSC#ConfigurationsModes Configurations and Modes] to understand the difference between OsmoNITB and OsmoBSC mode.
7
8 3 laforge
== Configuration ==
9
10 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.
11 1 zecke
12 6 zecke
You can specify an alternate config file location by using the ''--config-file'' command line argument.
13 1 zecke
14 11 laforge
There are several example configuration files in the openbsc discribution, part of the {{{openbsc/doc/examples}}} directory:
15
 * {{{doc/examples/osmo-nitb/nanobts/openbsc.cfg}}}: A single-TRX nanoBTS configuration
16
 * {{{doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg}}}: A configuration file for a [wiki:nanoBTS/multiTRX] configuration
17
 * {{{doc/examples/osmo-nitb/rbs2308/openbsc.cfg}}}: A configuration file for the [wiki:Ericsson_RBS] model 2308
18
 * {{{doc/examples/osmo-nitb/bs11/openbsc.cfg}}}: Configuration for one BS-11 with a single TRX
19
 * {{{doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg}}}: Configuration for one BS-11 with two TRX
20
 * {{{doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg}}}: Configuration for two BS-11 [wiki:bs11_config#ConfiguringMulti-Dropsetup multi-drop] with two TRX each
21
 * {{{doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg}}}: Configuration for one BS-11 with two TRX, TRX1 using frequency hopping
22 1 zecke
23 10 laforge
For more information, plase see the [wiki:osmo-nitb_VTY] reference.
24 1 zecke
25 6 zecke
== Command Reference ==
26
27 1 zecke
{{{
28 9 laforge
netzing@btsDev:~/openbsc/openbsc/src> ./osmo-nitb --help
29
Usage: osmo-nitb
30 6 zecke
  Some useful help...
31
  -h --help this text
32
  -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable debugging
33
  -s --disable-color
34
  -c --config-file filename The config file to use.
35
  -l --database db-name The database to use
36
  -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.
37
  -p --pcap file  The filename of the pcap file
38
  -T --timestamp Prefix every log line with a timestamp
39 3 laforge
}}}
40
41 6 zecke
=== BS-11 ===
42
43 3 laforge
you will see something like
44
{{{
45
DB: Database initialized.
46
DB: Database prepared.
47
1 device found
48
        id:             0
49
        Dprotocols:     00000018
50
        Bprotocols:     0000000e
51
        protocol:       4
52
        nrbchan:        30
53
        name:           hfc-e1.1
54
activate bchan
55
bootstrapping OML
56 1 zecke
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=0)
57
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=1)
58 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)
59
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=2)
60 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)
61
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=3)
62 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)
63
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=4)
64
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,4) E1=(0,3,0)
65
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=5)
66
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,5) E1=(0,3,1)
67 1 zecke
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=6)
68 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)
69
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=7)
70
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,7) E1=(0,3,3)
71
bootstrapping RSL MCC=1 MNC=1
72 1 zecke
}}}
73
74 4 laforge
=== ip.access nanoBTS ===
75
76 6 zecke
we assume you have a [wiki:nanoBTS] configured with its primary OML link to the IP address of your Linux PC.
77
78 9 laforge
After starting osmo-nitb will just wait for your nanoBTS to connect, which can take quite a while.
79 1 zecke
80 4 laforge
== Dealing with the HLR ==
81
82
We currently use a quite simple sqlite3 database for the HLR.  In fact, it is more than just a HLR, since it actually stores
83
entries even about any subscriber or phone that tries to log into your network.
84
85 6 zecke
We obtain the IMSI and IMEI of every LOCATION UPDATING REQUEST, and then if neccessary create a new entry for the equipment
86 5 laforge
as well as the subscribers in the respective tables.
87 1 zecke
88 4 laforge
The schama looks like:
89
{{{
90
CREATE TABLE Equipment (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, imei NUMERIC UNIQUE NOT NULL, name TEXT);
91
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) );
92
CREATE TABLE Meta (id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT UNIQUE NOT NULL, value TEXT NOT NULL);
93
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);
94
}}}
95
96
If the subscrber.authorized field is set to '1', then we allocate a TMSI and answer with LOCATION UPDATING ACCEPT.  Otherwise, we send
97 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''.
98
99 6 zecke
You can allow everyone to join your network by using the ''auth policy accept'' config file option.
100 1 zecke
101 12 laforge
=== HLR modification using the telnet interface ===
102 1 zecke
103 12 laforge
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.
104
105
First, you would type {{{enable}}} to go from the read-only to the read-write mode of the VTY.
106
107
Then you can type statements like
108
109
{{{
110
subscriber imsi 012340123456789 authorized 1
111
}}}
112
 which will enable this subscriber to enter the network
113
114
{{{
115
subscriber imsi 012340123456789 extension 5555
116
}}}
117
 which will assign the telephone number 5555 to the subscriber with the specified IMSI
118
119
{{{
120
subscriber imsi 012340123456789 name Peter
121
}}}
122
 which will associate the name ''Peter'' with the subscriber record
123
124
{{{
125
show subscriber imsi 012340123456789
126
}}}
127
 which will show you all information about the respective subscriber
128
129
{{{
130
 subscriber imsi 012340123456789 sms send test123
131
}}}
132
 which will send a SMS with the content ''test123'' to the respective subscriber
133
134
=== Raw SQL access ===
135
136
Instead of the manual commands on the VTY, you can also directly access the underlying HLR SQL database table.
137
138
==== Authorizing a particular IMSI ====
139
140 5 laforge
To authorize your mobile station you will need to execute the following comand:
141
142
{{{
143 7 laforge
$ sqlite3 hlr.sqlite
144
update Subscriber set authorized=1 where imsi=YOUR_IMSI;
145 1 zecke
}}}
146 7 laforge
147 12 laforge
==== Assigning an extension number IMSI ====
148 7 laforge
149
In order to call a phone, you need to assign an extension number (phone number) for the IMSI.
150
151
In the following example, we assign the extension number ''4444'':
152
153
{{{
154
$ sqlite3 hlr.sqlite
155 1 zecke
update Subscriber set extension=4444 where imsi=YOUR_IMSI;
156 2 zecke
}}}
157 3 laforge
158 12 laforge
==== finding IMEIs for a given IMSI ====
159 6 zecke
160 3 laforge
{{{
161 1 zecke
$ sqlite3 hlr.sqlite
162 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;
163
}}}
164 1 zecke
165 13 ipse
==== List IMSI to extensions mapping ====
166
167
{{{
168
sqlite3 -line hlr.sqlite3 'select imsi,extension from subscriber;'
169
}}}
170
171 1 zecke
172 12 laforge
== Configuration via telnet / VTY ==
173 8 laforge
174 1 zecke
If you type the commands {{{enable}}} and {{{configure terminal}}}, you can interactively enter commands in the same syntax as the
175 10 laforge
configuration file. For more information, plase see the [wiki:osmo-nitb_VTY] reference.
176 8 laforge
177
== Common Problems ==
178
179
=== Failed to init database ===
180 1 zecke
181 8 laforge
{{{
182 9 laforge
$ ./osmo-nitb
183 8 laforge
DB: Failed to create connection.
184
DB: Failed to init database. Please check the option settings.
185
}}}
186
187
This is most likely caused by one of the following problems
188
 * the sqlite3 backend for DBD (dbd-sqlite3) has not been installed
189 9 laforge
 * osmo-nitb does not have write permissions to the local directory
Add picture from clipboard (Maximum size: 48.8 MB)