aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-29 02:14:39 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-29 02:31:17 +0200
commite03a44c044b55192e5b26b945774b858abfff1c7 (patch)
tree5f800532ce01762b59b6d5b9af4384e938cdee6e
downloadOpenBSC-Bootstrap-e03a44c044b55192e5b26b945774b858abfff1c7.tar.xz
OpenBSC-Bootstrap-e03a44c044b55192e5b26b945774b858abfff1c7.zip
Initial commit.
-rw-r--r--README.md21
-rw-r--r--open-bsc.cfg86
-rw-r--r--osmo-bts.cfg22
-rwxr-xr-xstart.sh43
4 files changed, 172 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ef311e3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,21 @@
+Network from Scratch on Gentoo
+==============================
+
+#### 1. Add these to `package.keywords` (in `/etc/portage`):
+
+ =net-wireless/openbsc-9999 **
+ =net-wireless/osmobts-9999 **
+ =net-wireless/osmotrx-9999 **
+ =net-libs/libosmo-abis-9999 **
+
+#### 2. Make sure your portage tree is up to date, and emerge the right packages:
+
+ $ sudo emerge --sync
+ $ sudo emerge openbsc osmobts osmotrx
+
+#### 3. Customize config files.
+
+* arfcn should be for a spectrum for which you have a license
+* read documentation for all values
+
+#### 4. Use `start.sh` in this repo.
diff --git a/open-bsc.cfg b/open-bsc.cfg
new file mode 100644
index 0000000..f7a0d7b
--- /dev/null
+++ b/open-bsc.cfg
@@ -0,0 +1,86 @@
+e1_input
+ e1_line 0 driver ipa
+ e1_line 0 port 0
+network
+ network country code 001
+ mobile network code 01
+ short name OpenBSC
+ long name OpenBSC
+ auth policy accept-all
+ location updating reject cause 13
+ encryption a5 0
+ neci 1
+ paging any use tch 0
+ rrlp mode ms-based
+ mm info 1
+ handover 0
+ handover window rxlev averaging 10
+ handover window rxqual averaging 1
+ handover window rxlev neighbor averaging 10
+ handover power budget interval 6
+ handover power budget hysteresis 3
+ handover maximum distance 9999
+ timer t3101 10
+ timer t3103 0
+ timer t3105 0
+ timer t3107 0
+ timer t3109 0
+ timer t3111 0
+ timer t3113 60
+ timer t3115 0
+ timer t3117 0
+ timer t3119 0
+ timer t3122 10
+ timer t3141 0
+ dtx-used 0
+ subscriber-keep-in-ram 0
+ bts 0
+ type sysmobts
+ band GSM900
+ cell_identity 0
+ location_area_code 1
+ training_sequence_code 7
+ base_station_id_code 63
+ ms max power 33
+ cell reselection hysteresis 4
+ rxlev access min 0
+ periodic location update 30
+ channel allocator descending
+ rach tx integer 9
+ rach max transmission 7
+ channel-descrption attach 1
+ channel-descrption bs-pa-mfrms 5
+ channel-descrption bs-ag-blks-res 1
+ ip.access unit_id 1801 0
+ oml ip.access stream_id 255 line 0
+ neighbor-list mode automatic
+ trx 0
+ rf_locked 0
+ arfcn 1
+ nominal power 0
+ max_power_red 0
+ rsl e1 tei 0
+ timeslot 0
+ phys_chan_config CCCH+SDCCH4
+ hopping enabled 0
+ timeslot 1
+ phys_chan_config TCH/F
+ hopping enabled 0
+ timeslot 2
+ phys_chan_config TCH/F
+ hopping enabled 0
+ timeslot 3
+ phys_chan_config TCH/F
+ hopping enabled 0
+ timeslot 4
+ phys_chan_config TCH/F
+ hopping enabled 0
+ timeslot 5
+ phys_chan_config TCH/F
+ hopping enabled 0
+ timeslot 6
+ phys_chan_config TCH/F
+ hopping enabled 0
+ timeslot 7
+ phys_chan_config TCH/F
+ hopping enabled 0
diff --git a/osmo-bts.cfg b/osmo-bts.cfg
new file mode 100644
index 0000000..1848ae1
--- /dev/null
+++ b/osmo-bts.cfg
@@ -0,0 +1,22 @@
+bts 0
+ band GSM900
+ ipa unit-id 1801 0
+ oml remote-ip 127.0.0.1
+ rtp bind-ip 127.0.0.1
+ rtp jitter-buffer 0
+ paging lifetime 0
+ gsmtap-sapi bcch
+ gsmtap-sapi ccch
+ gsmtap-sapi rach
+ gsmtap-sapi agch
+ gsmtap-sapi pch
+ gsmtap-sapi sdcch
+ gsmtap-sapi pacch
+ gsmtap-sapi pdtch
+ gsmtap-sapi sacch
+ fn-advance 20
+ ms-power-loop -10
+ timing-advance-loop
+ trx 0
+ rxgain 0
+ power 0
diff --git a/start.sh b/start.sh
new file mode 100755
index 0000000..cc9e27e
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+config_dir="$(readlink -f "$(dirname "$0")")"
+openbsc_config="$config_dir/open-bsc.cfg"
+osmobts_config="$config_dir/osmo-bts.cfg"
+hlr_db="$config_dir/hlr.sqlite3"
+window_title="GSM"
+lcr=""
+
+[[ $1 == "lcr" ]] && lcr="-m"
+
+tmux new-session -s "$window_title" -n close-me -d
+
+tmux new-window -n OpenBSC -t "$window_title"
+tmux send-keys -t OpenBSC "osmo-nitb -c '$openbsc_config' -l '$hlr_db' -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM $lcr" Enter
+
+tmux new-window -n OsmoBTS -t "$window_title"
+tmux send-keys -t OsmoBTS "osmobts-trx -c '$osmobts_config'" Enter
+
+if [[ -n $lcr ]]; then
+ tmux new-window -n LCR -t "$window_title"
+ tmux send-keys -t LCR "/usr/sbin/lcr start" Enter
+fi
+
+tmux new-window -n OsmoTRX -t "$window_title"
+tmux send-keys -t OsmoTRX "osmo-trx" Enter
+
+tmux new-window -n BSC-Control -t "$window_title"
+tmux send-keys -t BSC-Control "while ! /sbin/ss -n -l -t state listening src \"*:4242\" | grep -q :4242; do sleep 0.5; done; telnet 127.0.0.1 4242" Enter
+
+tmux new-window -n BTS-Control -t "$window_title"
+tmux send-keys -t BTS-Control "while ! /sbin/ss -n -l -t state listening src \"*:4241\" | grep -q :4241; do sleep 0.5; done; telnet 127.0.0.1 4241" Enter
+
+tmux new-window -n HLR -t "$window_title"
+tmux send-keys -t HLR "watch -t -n 1 \"sqlite3 -column -header '$hlr_db' 'SELECT * from Subscriber ORDER BY expire_lu DESC'\"" Enter
+
+tmux set-option -t "$window_title" status on
+tmux set-option -t "$window_title" set-titles on
+tmux set-option -t "$window_title" set-titles-string "GSM Base Station"
+tmux set-option -t "$window_title" status-right ""
+tmux kill-window -t close-me
+tmux select-window -t OpenBSC
+tmux attach -t "$window_title"