Split stack: Initial commit install/configure

This commit installs the osmo stack daemons and configuration
if the hiera parameter rhizo::osmo_stack is 'split'

Setting this param won't break anything for a nitb based install,
but it will disable running the nitb and run osmo-bsc instead.
This commit is contained in:
Keith Whyte 2020-08-28 17:07:31 +02:00
parent e6e7ff6afe
commit f6395068c8
11 changed files with 598 additions and 1 deletions

View file

@ -0,0 +1,11 @@
[Unit]
Description=Osmocom Media Gateway for MSC (MGW)
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/osmo-mgw -s -c /etc/osmocom/osmo-mgw2.cfg
RestartSec=2
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,15 @@
[Unit]
Description=Osmocom Mobile Switching Center (MSC)
Wants=osmo-hlr.service
Wants=osmo-mgw.service
After=osmo-hlr.service
After=osmo-hnbgw.service
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg -l /var/lib/osmocom/sms.db
RestartSec=2
[Install]
WantedBy=multi-user.target

View file

@ -36,6 +36,10 @@ class rhizo_base {
$site_name = hiera('rhizo::site_name')
$postcode = hiera('rhizo::postcode')
$pbxcode = hiera('rhizo::pbxcode')
# Network Stack
$osmo_stack = hiera('rhizo::osmo_stack', 'nitb')
# network name
$network_name = hiera('rhizo::network_name')
$auth_policy = hiera('rhizo::auth_policy')
@ -193,7 +197,12 @@ class rhizo_base {
include rhizo_base::postgresql
include rhizo_base::freeswitch
include rhizo_base::runit
include rhizo_base::openbsc
unless $osmo_stack == "split" {
include rhizo_base::openbsc
}
if $osmo_stack == "split" {
include rhizo_base::osmocom
}
include rhizo_base::sudo
include rhizo_base::kiwi

View file

@ -0,0 +1,168 @@
# Class: rhizo_base::osmocom
#
# This module manages the Osmocom stack
#
# Parameters: none
#
# Actions:
#
class rhizo_base::osmocom {
$network_name = $rhizo_base::network_name
$mcc = $rhizo_base::mcc
$mnc = $rhizo_base::mnc
$bts = hiera('rhizo::bts')
$smsc_password = $rhizo_base::smsc_password
$smpp_password = $rhizo_base::smpp_password
$mncc_codec = $rhizo_base::mncc_codec
$mncc_ip_address = $rhizo_base::mncc_ip_address
$vpn_ip_address = hiera('rhizo::vpn_ip_address')
$sgsn_ip_address = hiera('rhizo::sgsn_ip_address')
$ggsn_ip_address = hiera('rhizo::ggsn_ip_address')
$repo = hiera('rhizo::osmo_repo', 'latest')
package { [ 'osmo-stp', 'osmo-mgw', 'osmo-sgsn' ]:
ensure => 'installed',
require => Class['rhizo_base::apt']
}
$bsc_version = $repo ? {
'latest' => '1.6.1',
'nightly' => 'latest',
default => '1.6.1',
}
package { [ 'osmo-bsc' ]:
ensure => $bsc_version,
require => Class['rhizo_base::apt'],
notify => Exec['hlr_pragma_wal']
}
package { [ 'osmo-msc' ]:
ensure => 'installed',
require => Class['rhizo_base::apt'],
notify => Exec['sms_pragma_wal']
}
package { [ 'osmo-hlr' ]:
ensure => 'installed',
require => Class['rhizo_base::apt'],
notify => Exec['hlr_pragma_wal']
}
package { [ 'osmo-sip-connector' ]:
ensure => '1.4.1',
require => Class['rhizo_base::apt'],
}
$utils_version = $repo ? {
'latest' => '1.6.1',
'nightly' => 'latest',
default => '1.6.1',
}
package { [ 'osmo-bsc-meas-utils' ]:
ensure => $utils_version,
}
package { [ 'libosmocore-utils' ]:
ensure => 'installed',
}
if $mncc_codec == "AMR" {
$phys_chan = "TCH/H"
} else {
$phys_chan = "TCH/F"
}
unless hiera('rhizo::local_osmobsc_cfg') == "1" {
file { '/etc/osmocom/osmo-bsc.cfg':
ensure => file,
content => template(
'rhizo_base/osmo-bsc-head.erb',
'rhizo_base/osmo-bsc-bts.erb',
'rhizo_base/osmo-bsc-tail.erb'),
}
}
# We used to notify the osmo-nitb on config changes for a restart
# but with the service outage that restarting the split stack entails,
# I don't want to even give puppet the possibility to do that.
file { '/etc/osmocom/osmo-hlr.cfg':
content => template('rhizo_base/osmo-hlr.cfg.erb'),
require => Package['osmo-hlr'],
}
file { '/etc/osmocom/osmo-msc.cfg':
content => template('rhizo_base/osmo-msc.cfg.erb'),
require => Package['osmo-msc'],
}
file { '/etc/osmocom/osmo-mgw.cfg':
content => template('rhizo_base/osmo-mgw.cfg.erb'),
require => Package['osmo-mgw'],
}
file { '/etc/osmocom/osmo-mgw2.cfg':
content => template('rhizo_base/osmo-mgw2.cfg.erb'),
require => Package['osmo-mgw'],
}
file { '/etc/osmocom/osmo-sip-connector.cfg':
content => template('rhizo_base/osmo-sip-connector.cfg.erb'),
require => Package['osmo-sip-connector'],
}
file { '/lib/systemd/system/osmo-msc.service':
ensure => present,
source => 'puppet:///modules/rhizo_base/systemd/osmo-msc.service',
}
file { '/lib/systemd/system/osmo-mgw-msc.service':
ensure => present,
source => 'puppet:///modules/rhizo_base/systemd/osmo-mgw-msc.service',
}
service { [ 'osmo-stp', 'osmo-hlr', 'osmo-bsc',
'osmo-msc', 'osmo-mgw', 'osmo-sgsn',
'osmo-sip-connector' ]:
enable => true,
ensure => 'running'
}
service { 'osmocom-nitb':
provider => 'systemd',
enable => false,
ensure => 'stopped'
}
service { 'osmo-nitb':
provider => 'runit',
ensure => 'stopped'
}
exec { 'hlr_pragma_wal':
command =>
'/usr/bin/sqlite3 /var/lib/osmocom/hlr.db "PRAGMA journal_mode=wal;"',
require => Class['rhizo_base::packages'],
refreshonly => true,
}
exec { 'sms_pragma_wal':
command =>
'/usr/bin/sqlite3 /var/lib/osmocom/sms.db "PRAGMA journal_mode=wal;"',
require => Class['rhizo_base::packages'],
refreshonly => true,
}
exec { 'notify-osmo-restart':
command => '/bin/echo 1 > /tmp/OSMO-dirty',
refreshonly => true,
}
}

View file

@ -0,0 +1,99 @@
<% @bts.each_with_index do |bts, index| -%>
bts <%= index %>
type <%= bts["type"] %>
description <%= bts["name"] %>
band <%= bts["band"] %>
cell_identity 0
location_area_code <%= bts["lac"] %>
base_station_id_code <%= bts["bsic"] %>
ms max power <%= bts["ms_maxp"] %>
cell reselection hysteresis 4
rxlev access min 0
radio-link-timeout 32
channel allocator ascending
rach tx integer 9
rach max transmission 7
channel-description attach 1
channel-description bs-pa-mfrms 5
channel-description bs-ag-blks-res 1
no access-control-class-ramping
access-control-class-ramping-step-interval dynamic
access-control-class-ramping-step-size 1
early-classmark-sending forbidden
early-classmark-sending-3g allowed
ipa unit-id 1000 <%= bts["uid"] %>
oml ipa stream-id 255 line 0
neighbor-list mode automatic
codec-support fr amr
amr tch-f modes 4 5
amr tch-f start-mode 1
amr tch-h modes 4 5
amr tch-h start-mode 1
gprs mode <%= bts["gprs_m"] %>
gprs 11bit_rach_support_for_egprs 0
gprs routing area 21
gprs network-control-order nc0
gprs cell bvci <%= index+2 %>
gprs cell timer blocking-timer 3
gprs cell timer blocking-retries 3
gprs cell timer unblocking-retries 3
gprs cell timer reset-timer 3
gprs cell timer reset-retries 3
gprs cell timer suspend-timer 10
gprs cell timer suspend-retries 3
gprs cell timer resume-timer 10
gprs cell timer resume-retries 3
gprs cell timer capability-update-timer 10
gprs cell timer capability-update-retries 3
gprs nsei 10<%= index+2 %>
gprs ns timer tns-block 3
gprs ns timer tns-block-retries 3
gprs ns timer tns-reset 3
gprs ns timer tns-reset-retries 3
gprs ns timer tns-test 30
gprs ns timer tns-alive 3
gprs ns timer tns-alive-retries 10
gprs nsvc 0 nsvci 10<%= index+2 %>
gprs nsvc 0 local udp port 23<%= bts["lac"] %>
gprs nsvc 0 remote udp port 23001
gprs nsvc 0 remote ip <%= @sgsn_ip_address %>
gprs nsvc 1 nsvci 0
gprs nsvc 1 local udp port 0
gprs nsvc 1 remote udp port 0
gprs nsvc 1 remote ip 0.0.0.0
no force-combined-si
<% if bts["model"] == "2050S" %> depends-on-bts <%= index-1 %>
<% end -%>
<% bts["trx"].each_with_index do |trx, index| -%>
trx <%= index %>
rf_locked 0
arfcn <%= trx["chan"] %>
nominal power <%= bts["nom"] %>
max_power_red <%= bts["red"] %>
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
hopping enabled 0
timeslot 1
phys_chan_config <%= @phys_chan %>
hopping enabled 0
timeslot 2
phys_chan_config <%= @phys_chan %>
hopping enabled 0
timeslot 3
phys_chan_config <%= @phys_chan %>
hopping enabled 0
timeslot 4
phys_chan_config <%= @phys_chan %>
hopping enabled 0
timeslot 5
phys_chan_config <%= @phys_chan %>
hopping enabled 0
timeslot 6
phys_chan_config <%= @phys_chan %>
hopping enabled 0
timeslot 7
phys_chan_config PDCH
hopping enabled 0
<% end -%>
<% end -%>

View file

@ -0,0 +1,77 @@
!
! OsmoBSC (UNKNOWN) configuration by puppet
!!
!
log stderr
logging filter all 1
logging color 1
logging print category-hex 1
logging print category 0
logging timestamp 0
logging print file 1
logging level rll notice
logging level mm notice
logging level rr notice
logging level rsl notice
logging level nm info
logging level pag notice
logging level meas notice
logging level msc notice
logging level ho notice
logging level hodec notice
logging level ref notice
logging level nat notice
logging level ctrl notice
logging level filter debug
logging level pcu debug
logging level lcls notice
logging level chan notice
logging level ts notice
logging level as notice
logging level cbs notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
logging level lmgcp notice
logging level ljibuf notice
logging level lrspro notice
!
stats interval 5
!
line vty
no login
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
ipa bind 172.16.0.1
cs7 instance 0
point-code 0.23.3
network
network country code <%= @mcc %>
mobile network code <%= @mnc %>
encryption a5 1
neci 1
paging any use tch 0
handover 0
handover algorithm 1
handover1 window rxlev averaging 10
handover1 window rxqual averaging 1
handover1 window rxlev neighbor averaging 10
handover1 power budget interval 6
handover1 power budget hysteresis 3
handover1 maximum distance 9999

View file

@ -0,0 +1,28 @@
msc 0
ip.access rtp-base 4000
no bsc-welcome-text
no bsc-msc-lost-text
no bsc-grace-text
codec-list fr3 hr3
type normal
allow-emergency allow
amr-config 12_2k forbidden
amr-config 10_2k forbidden
amr-config 7_95k forbidden
amr-config 7_40k allowed
amr-config 6_70k allowed
amr-config 5_90k allowed
amr-config 5_15k forbidden
amr-config 4_75k forbidden
amr-payload octet-aligned
asp-protocol m3ua
lcls-mode disabled
lcls-codec-mismatch forbidden
mgw remote-ip 127.0.0.1
mgw remote-port 2427
bsc
mid-call-timeout 0
no missing-msc-text
cbc
no remote-ip
no listen-port

View file

@ -0,0 +1,50 @@
!
! OsmoHLR (UNKNOWN) configuration by puppet
!!
!
log stderr
logging filter all 1
logging color 1
logging print category-hex 0
logging print category 1
logging print extended-timestamp 1
logging print level 1
logging print file basename
logging level main notice
logging level db notice
logging level auc notice
logging level ss info
logging level lglobal notice
logging level llapd notice
logging level linp error
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
logging level lmgcp notice
logging level ljibuf notice
logging level lrspro notice
!
stats interval 5
!
line vty
no login
!
ctrl
bind 127.0.0.1
hlr
subscriber-create-on-demand 5 cs
store-imei
gsup
bind ip 127.0.0.1
ussd route prefix *#100# internal own-msisdn
ussd route prefix *#101# internal own-imsi

View file

@ -0,0 +1,17 @@
!
! MGCP (UNKNOWN) configuration by puppet
!
mgcp
bind ip 127.0.0.1
rtp port-range 4002 8001
rtp bind-ip 172.16.0.1
rtp ip-probing
rtp ip-tos 184
bind port 2427
number endpoints 31
loop 0
force-realloc 1
rtcp-omit
rtp-patch ssrc
rtp-patch timestamp
rtp-accept-all 1

View file

@ -0,0 +1,19 @@
!
! MGCP (UNKNOWN) configuration by puppet
!
mgcp
bind ip 127.0.0.2
rtp port-range 8002 10001
rtp bind-ip 172.16.0.1
rtp ip-probing
rtp ip-tos 184
bind port 2428
number endpoints 31
loop 0
force-realloc 1
rtcp-omit
rtp-patch ssrc
rtp-patch timestamp
rtp-accept-all 1
line vty
bind 127.0.0.2

View file

@ -0,0 +1,104 @@
!
! OsmoMSC (UNKNOWN) configuration by puppet
!!
!
log stderr
logging filter all 1
logging color 1
logging print category-hex 1
logging print category 0
logging timestamp 0
logging print file 1
logging level rll notice
logging level cc notice
logging level mm notice
logging level rr notice
logging level mncc notice
logging level pag notice
logging level msc notice
logging level mgcp notice
logging level ho notice
logging level db notice
logging level ref notice
logging level ctrl notice
logging level smpp notice
logging level ranap notice
logging level vlr notice
logging level iucs notice
logging level bssap notice
logging level sgs notice
logging level ss notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
logging level lmgcp notice
logging level ljibuf notice
logging level lrspro notice
!
stats interval 5
!
line vty
no login
!
cs7 instance 0
point-code 0.23.1
network
network country code <%= @mcc %>
mobile network code <%= @mnc %>
short name <%= @network_name %>
long name <%= @network_name %>
encryption a5 0
encryption uea 1 2
authentication optional
rrlp mode none
mm info 1
periodic location update 30
msc
mncc external /tmp/bsc_mncc
mncc guard-timeout 180
ncss guard-timeout 30
no assign-tmsi
cs7-instance-a 0
cs7-instance-iu 0
auth-tuple-max-reuse-count 3
auth-tuple-reuse-on-error 1
check-imei-rqd early
mgw local-port 2728
mgw remote-ip 127.0.0.2
mgw remote-port 2428
mncc-int
default-codec tch-f amr
default-codec tch-h amr
smpp
local-tcp-port 2775
policy closed
smpp-first
esme OSMPP
password <%= @smsc_password %>
default-route
no alert-notifications
esme ISMPP
password <%= @smsc_password %>
no alert-notifications
esme NOTIFY
password <%= @smpp_password %>
hlr
remote-ip 127.0.0.1
remote-port 4222
sgs
local-port 29118
local-ip 0.0.0.0
vlr-name vlr.example.net