Project

General

Profile

OsmoNITB » History » Version 4

laforge, 02/19/2016 10:48 PM
more information about usage

1 1 zecke
= BSC Hack =
2
3 3 laforge
''bsc_hack'' is the program executable name of [wiki:OpenBSC]. We call it that way, since it is still pretty much a big hack, despite having
4
gone a long way in quite a short amount of time.
5
6
== Configuration ==
7
8
Currently, there is no configuration file.  A lot of the configuration is thus compiled-in.  Almost all of the values that you might want to
9
tweak are inside the bsc_hack.c file itself, where you can find things like the BCCH filling (SYSTEM INFORMATION) messages and the like.
10
11
== Reference ==
12
13
=== BS-11 ===
14
15
Basically, there are currently just two modes of operation supported
16
{{{
17 4 laforge
$ ./bsc_hack -t bs11 --arfcn 123
18 3 laforge
}}}
19
will assume you have a [wiki:BS11 BS-11] connected to the first mISDN E1 card and have configured
20
 * OML signalling on the full 64kbps E1 timeslot 1 
21
  * verify this by [wiki:bs11_config] ''query''
22
  * make sure you pass '''dslot=1''' when loading hfcmulti.ko
23
 * OML TEI 25
24
  * verify this by [wiki:bs11_config] ''query''
25
26
you will see something like
27
{{{
28
DB: Database initialized.
29
DB: Database prepared.
30
1 device found
31
        id:             0
32
        Dprotocols:     00000018
33
        Bprotocols:     0000000e
34
        protocol:       4
35
        nrbchan:        30
36
        name:           hfc-e1.1
37
activate bchan
38
bootstrapping OML
39
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=0)
40
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=1)
41
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,1) E1=(0,2,1)
42
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=2)
43
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,2) E1=(0,2,2)
44
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=3)
45
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,3) E1=(0,2,3)
46
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=4)
47
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,4) E1=(0,3,0)
48
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=5)
49
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,5) E1=(0,3,1)
50
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=6)
51
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,6) E1=(0,3,2)
52
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1376 Set Chan Attr (bts=0,trx=0,ts=7)
53
Thu Feb 19 04:22:48 2009 <0020> abis_nm.c:1315 CONNECT TERR TRAF Um=(0,0,7) E1=(0,3,3)
54
bootstrapping RSL MCC=1 MNC=1
55
}}}
56
57
=== ip.access nanoBTS ===
58
{{{
59 4 laforge
$ ./bsc_hack -t nanogsm900 --arfcn 122
60 3 laforge
}}}
61
will assume you have a [wiki:nanoBTS] configured with its primary OML link to the IP address of your Linux PC.
62
63
After starting bsc_hack will just wait for your nanoBTS to connect, which can take quite a while.
64
65
NOTE: Due to some problems with OML initialization after the first boot of a nanoBTS, you may have to re-start bsc_hack a number of times
66 1 zecke
until you get it working.
67
68 4 laforge
=== Options ===
69
70
{{{
71
Usage: bsc_hack
72
  Some useful help...
73
  -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable debugging
74
  -s --disable-color
75
  -n --network-code number(MNC) 
76
  -c --country-code number (MCC) 
77
  -f --arfcn number The frequency ARFCN
78
  -l --database db-name The database to use
79
  -a --authorize-everyone Allow everyone into the network.
80
  -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.
81
  -p --pcap file  The filename of the pcap file
82
  -t --bts-type type The BTS type (bs11, nanobts900, nanobts1800)
83
  -h --help this text
84
}}}
85
86
87 1 zecke
== Dealing with the HLR ==
88
89 4 laforge
We currently use a quite simple sqlite3 database for the HLR.  In fact, it is more than just a HLR, since it actually stores
90
entries even about any subscriber or phone that tries to log into your network.
91
92
We basically obtain the IMSI and IMEI of every LOCATION UPDATING REQUEST, and then if neccessary create a new entry for the equipment
93
as well as the subscribers in the respective tables.
94
95 1 zecke
{{{
96 4 laforge
CREATE TABLE Equipment (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, imei NUMERIC UNIQUE NOT NULL, name TEXT);
97
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) );
98
CREATE TABLE Meta (id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT UNIQUE NOT NULL, value TEXT NOT NULL);
99
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);
100
}}}
101
102
If the subscrber.authorized field is set to '1', then we allocate a TMSI and answer with LOCATION UPDATING ACCEPT.  Otherwise, we send
103
a regular LOCATION UPDATING REJECT to refuse the mobile to roam to our network.  You can change the reject cause using ''--reject-cause''.
104
105
You can allow everyone to join your network by using the ''--authorize-everyone'' commandline opion.
106
107
To authorize your mobile station you will need to execute the following comand:
108
109
{{{
110 1 zecke
sqlite3 hlr.sqlite
111 2 zecke
update Subscriber set authorized=1 where imsi=YOUR_IMSI;
112
}}}
113 3 laforge
114 4 laforge
== Using the telnet interface ==
115 3 laforge
116
You can telnet to port 4242 of the machine that runs bsc_hack and try some of the commands.
117
118
We are planning a lot of work in this area, so documenting the old commands will not be very productive.
Add picture from clipboard (Maximum size: 48.8 MB)