Project

General

Profile

OsmoNITB » History » Version 11

laforge, 02/19/2016 10:48 PM
update sample config fiels

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