gbproxy: remove (moved to own repository)
New repository: https://git.osmocom.org/osmo-gbproxy/ Related: OS#4992 Change-Id: I37f7cebaf2a06bd93627a452f5df44edcfc0f87achanges/91/22591/4
parent
4be5ab3707
commit
901ed14c89
|
@ -41,7 +41,6 @@ ltmain.sh
|
|||
|
||||
# apps and app data
|
||||
src/sgsn/osmo-sgsn
|
||||
src/gbproxy/osmo-gbproxy
|
||||
src/gtphub/osmo-gtphub
|
||||
src/libcommon/gsup_test_client
|
||||
|
||||
|
|
|
@ -259,7 +259,6 @@ AC_OUTPUT(
|
|||
src/Makefile
|
||||
src/gprs/Makefile
|
||||
src/sgsn/Makefile
|
||||
src/gbproxy/Makefile
|
||||
src/gtphub/Makefile
|
||||
tests/Makefile
|
||||
tests/atlocal
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
demonstrate a unblock bug on the GB Proxy..
|
||||
"""
|
||||
|
||||
bts_ns_reset = "\x02\x00\x81\x01\x01\x82\x1f\xe7\x04\x82\x1f\xe7"
|
||||
ns_reset_ack = "\x03\x01\x82\x1f\xe7\x04\x82\x1f\xe7"
|
||||
|
||||
bts_ns_unblock = "\x06"
|
||||
ns_unblock_ack = "\x07"
|
||||
|
||||
bts_bvc_reset_0 = "\x00\x00\x00\x00\x22\x04\x82\x00\x00\x07\x81\x03\x3b\x81\x02"
|
||||
ns_bvc_reset_0_ack = "\x00\x00\x00\x00\x23\x04\x82\x00\x00"
|
||||
|
||||
bts_bvc_reset_8167 = "\x00\x00\x00\x00\x22\x04\x82\x1f\xe7\x07\x81\x08\x08\x88\x72\xf4\x80\x10\x1c\x00\x9c\x40"
|
||||
|
||||
|
||||
import socket
|
||||
socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
socket.bind(("0.0.0.0", 0))
|
||||
socket.setblocking(1)
|
||||
|
||||
|
||||
import sys
|
||||
port = int(sys.argv[1])
|
||||
print "Sending data to port: %d" % port
|
||||
|
||||
def send_and_receive(packet):
|
||||
socket.sendto(packet, ("127.0.0.1", port))
|
||||
|
||||
try:
|
||||
data, addr = socket.recvfrom(4096)
|
||||
except socket.error, e:
|
||||
print "ERROR", e
|
||||
import sys
|
||||
sys.exit(0)
|
||||
return data
|
||||
|
||||
#send stuff once
|
||||
|
||||
to_send = [
|
||||
(bts_ns_reset, ns_reset_ack, "reset ack"),
|
||||
(bts_ns_unblock, ns_unblock_ack, "unblock ack"),
|
||||
(bts_bvc_reset_0, ns_bvc_reset_0_ack, "BVCI=0 reset ack"),
|
||||
]
|
||||
|
||||
|
||||
for (out, inp, type) in to_send:
|
||||
res = send_and_receive(out)
|
||||
if res != inp:
|
||||
print "Failed to get the %s" % type
|
||||
sys.exit(-1)
|
||||
|
||||
import time
|
||||
time.sleep(3)
|
||||
res = send_and_receive(bts_bvc_reset_8167)
|
||||
print "Sent all messages... check wireshark for the last response"
|
|
@ -61,14 +61,6 @@ Group: Productivity/Telephony/Servers
|
|||
%description -n osmo-gtphub
|
||||
Osmocom GTP Hub: Proxy for GTP traffic between multiple SGSNs and GGSNs.
|
||||
|
||||
%package -n osmo-gbproxy
|
||||
Summary: Osmocom GPRS Gb Interface Proxy
|
||||
Group: Productivity/Telephony/Servers
|
||||
|
||||
%description -n osmo-gbproxy
|
||||
The purpose of the Gb proxy is to aggregate the Gb links of multiple
|
||||
BSS's and present them in one Gb link to the SGSN.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
|
@ -95,10 +87,6 @@ make %{?_smp_mflags}
|
|||
%postun -n osmo-gtphub %service_del_postun osmo-gtphub.service
|
||||
%pre -n osmo-gtphub %service_add_pre osmo-gtphub.service
|
||||
%post -n osmo-gtphub %service_add_post osmo-gtphub.service
|
||||
%preun -n osmo-gbproxy %service_del_preun osmo-gbproxy.service
|
||||
%postun -n osmo-gbproxy %service_del_postun osmo-gbproxy.service
|
||||
%pre -n osmo-gbproxy %service_add_pre osmo-gbproxy.service
|
||||
%post -n osmo-gbproxy %service_add_post osmo-gbproxy.service
|
||||
%endif
|
||||
|
||||
%check
|
||||
|
@ -109,7 +97,6 @@ make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
|
|||
%dir %{_docdir}/%{name}/examples
|
||||
%dir %{_docdir}/%{name}/examples/osmo-sgsn
|
||||
%exclude %{_docdir}/%{name}/examples/osmo-gtphub
|
||||
%exclude %{_docdir}/%{name}/examples/osmo-gbproxy
|
||||
%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
|
||||
%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn.cfg
|
||||
%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
|
||||
|
@ -128,13 +115,4 @@ make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
|
|||
%config(noreplace) %{_sysconfdir}/osmocom/osmo-gtphub.cfg
|
||||
%{_unitdir}/osmo-gtphub.service
|
||||
|
||||
%files -n osmo-gbproxy
|
||||
%dir %{_docdir}/%{name}/examples
|
||||
%dir %{_docdir}/%{name}/examples/osmo-gbproxy
|
||||
%{_docdir}/%{name}/examples/osmo-gbproxy/osmo-gbproxy.cfg
|
||||
%{_bindir}/osmo-gbproxy
|
||||
%dir %{_sysconfdir}/osmocom
|
||||
%config(noreplace) %{_sysconfdir}/osmocom/osmo-gbproxy.cfg
|
||||
%{_unitdir}/osmo-gbproxy.service
|
||||
|
||||
%changelog
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
EXTRA_DIST = \
|
||||
osmo-gbproxy.service \
|
||||
osmo-gtphub.service \
|
||||
osmo-sgsn.service
|
||||
|
||||
if HAVE_SYSTEMD
|
||||
SYSTEMD_SERVICES = \
|
||||
osmo-gbproxy.service \
|
||||
osmo-gtphub.service \
|
||||
osmo-sgsn.service
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
[Unit]
|
||||
Description=Osmocom Gb proxy
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/osmo-gbproxy -c /etc/osmocom/osmo-gbproxy.cfg
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
RestartPreventExitStatus=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -53,22 +53,6 @@ Priority: extra
|
|||
Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for Osmocom GTP Hub
|
||||
|
||||
Package: osmo-gbproxy
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Recommends: osmo-sgsn
|
||||
Description: Osmocom GPRS Gb Interface Proxy
|
||||
The purpose of the Gb proxy is to aggregate the Gb links of multiple
|
||||
BSS's and present them in one Gb link to the SGSN.
|
||||
|
||||
Package: osmo-gbproxy-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmo-gbproxy (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for Osmocom GPRS Gb Interface Proxy
|
||||
|
||||
Package: osmo-sgsn-doc
|
||||
Architecture: all
|
||||
Section: doc
|
||||
|
|
|
@ -19,12 +19,10 @@ Files: .gitignore
|
|||
contrib/ipa.py
|
||||
contrib/jenkins.sh
|
||||
contrib/soap.py
|
||||
contrib/systemd/osmo-gbproxy.service
|
||||
contrib/systemd/osmo-sgsn.service
|
||||
contrib/twisted_ipa.py
|
||||
doc/Makefile.am
|
||||
doc/examples/Makefile.am
|
||||
doc/examples/osmo-gbproxy/osmo-gbproxy.cfg
|
||||
doc/examples/osmo-gtphub/gtphub-example.txt
|
||||
doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg
|
||||
doc/examples/osmo-gtphub/osmo-gtphub.cfg
|
||||
|
@ -50,8 +48,6 @@ Files: .gitignore
|
|||
src/gprs/osmo_sgsn.cfg
|
||||
tests/Makefile.am
|
||||
tests/atlocal.in
|
||||
tests/gbproxy/Makefile.am
|
||||
tests/gbproxy/gbproxy_test.ok
|
||||
tests/gprs/Makefile.am
|
||||
tests/gprs/gprs_test.c
|
||||
tests/gprs/gprs_test.ok
|
||||
|
@ -85,10 +81,6 @@ Files: include/osmocom/sgsn/a_reset.h
|
|||
src/gprs/gprs_gb_parse.c
|
||||
src/gprs/gprs_utils.c
|
||||
src/gprs/sgsn_ares.c
|
||||
src/gbproxy/gb_proxy.c
|
||||
src/gbproxy/gb_proxy_main.c
|
||||
src/gbproxy/gb_proxy_peer.c
|
||||
src/gbproxy/gb_proxy_vty.c
|
||||
src/gtphub/gtphub.c
|
||||
src/gtphub/gtphub_main.c
|
||||
src/gtphub/gtphub_vty.c
|
||||
|
@ -139,7 +131,6 @@ License: AGPL-3.0+
|
|||
|
||||
Files: src/gtphub/gtphub_ares.c
|
||||
src/gtphub/gtphub_sock.c
|
||||
tests/gbproxy/gbproxy_test.c
|
||||
Copyright: 2013 Jacob Erlbeck <jerlbeck@sysmocom.de>
|
||||
2013 sysmocom s.f.m.c. GmbH
|
||||
2014 Holger Hans Peter Freyther
|
||||
|
|
|
@ -1,151 +0,0 @@
|
|||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: osmo-gbproxy
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Osmocom GBproxy
|
||||
# Description: A tool to proxy the GPRS Gb interface.
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Harald Welte <laforge@gnumonks.org>
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
NAME=osmo-gbproxy # Introduce the short server's name here
|
||||
DESC="Osmocom GBProxy" # Introduce a short description here
|
||||
DAEMON=/usr/bin/osmo-gbproxy # Introduce the server's location here
|
||||
SCRIPTNAME=/etc/init.d/osmocom-gbproxy
|
||||
CONFIG_FILE=/etc/osmocom/osmocom-gbproxy.cfg
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/osmocom-gbproxy ] && . /etc/default/osmocom-gbproxy
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON_ARGS="-D -c $CONFIG_FILE"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
# Wait for children to finish too if this is a daemon that forks
|
||||
# and if the daemon is only ever run from this initscript.
|
||||
# If the above conditions are not satisfied then add some other code
|
||||
# that waits for the process to drop all resources that could be
|
||||
# needed by services started subsequently. A last resort is to
|
||||
# sleep for some time.
|
||||
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
|
||||
[ "$?" = 2 ] && return 2
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service
|
||||
#
|
||||
do_reload() {
|
||||
#
|
||||
# If the daemon can reload its configuration without
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
#reload|force-reload)
|
||||
#
|
||||
# If do_reload() is not implemented then leave this commented out
|
||||
# and leave 'force-reload' as an alias for 'restart'.
|
||||
#
|
||||
#log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
#do_reload
|
||||
#log_end_msg $?
|
||||
#;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented then remove the
|
||||
# 'force-reload' alias
|
||||
#
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
|
@ -1,4 +0,0 @@
|
|||
etc/osmocom/osmo-gbproxy.cfg
|
||||
lib/systemd/system/osmo-gbproxy.service
|
||||
usr/bin/osmo-gbproxy
|
||||
usr/share/doc/osmo-sgsn/examples/osmo-gbproxy/osmo-gbproxy.cfg usr/share/doc/osmo-gbproxy/examples
|
|
@ -58,7 +58,6 @@ override_dh_auto_configure:
|
|||
override_dh_strip:
|
||||
dh_strip -posmo-sgsn --dbg-package=osmo-sgsn-dbg
|
||||
dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg
|
||||
dh_strip -posmo-gbproxy --dbg-package=osmo-gbproxy-dbg
|
||||
|
||||
# Print test results in case of a failure
|
||||
override_dh_auto_test:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
OSMOCONF_FILES = \
|
||||
osmo-gtphub/osmo-gtphub.cfg \
|
||||
osmo-sgsn/osmo-sgsn.cfg \
|
||||
osmo-gbproxy/osmo-gbproxy.cfg
|
||||
$(NULL)
|
||||
|
||||
osmoconfdir = $(sysconfdir)/osmocom
|
||||
osmoconf_DATA = $(OSMOCONF_FILES)
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
!
|
||||
! OsmoGbProxy (UNKNOWN) configuration saved from vty
|
||||
!!
|
||||
!
|
||||
log stderr
|
||||
logging filter all 1
|
||||
logging color 1
|
||||
logging timestamp 0
|
||||
logging level all debug
|
||||
logging level gprs debug
|
||||
logging level ns info
|
||||
logging level bssgp debug
|
||||
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
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
!
|
||||
ns
|
||||
bind udp local
|
||||
listen 127.0.0.1 23000
|
||||
accept-ipaccess
|
||||
nse 666
|
||||
nsvc ipa local 127.0.0.1 23001 nsvci 666
|
||||
timer tns-block 3
|
||||
timer tns-block-retries 3
|
||||
timer tns-reset 3
|
||||
timer tns-reset-retries 3
|
||||
timer tns-test 30
|
||||
timer tns-alive 3
|
||||
timer tns-alive-retries 10
|
||||
gbproxy
|
||||
sgsn nsei 666
|
||||
core-mobile-country-code 666
|
||||
core-mobile-network-code 6
|
||||
core-access-point-name none match-imsi ^666066|^66607
|
||||
tlli-list max-length 200
|
|
@ -1,32 +0,0 @@
|
|||
!
|
||||
! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty
|
||||
!!
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
!
|
||||
gbproxy
|
||||
nri bitlen 4
|
||||
nri null add 0 4
|
||||
sgsn nsei 101
|
||||
name main
|
||||
nri add 1
|
||||
nri add 11
|
||||
sgsn nsei 102
|
||||
nri add 2
|
||||
nri add 12
|
||||
ns
|
||||
bind udp local
|
||||
listen 127.0.0.100 23000
|
||||
accept-ipaccess
|
||||
nse 101
|
||||
nsvc ipa local 192.168.100.239 7777 nsvci 101
|
||||
nse 102
|
||||
nsvc ipa local 192.168.100.239 7778 nsvci 102
|
||||
timer tns-block 3
|
||||
timer tns-block-retries 3
|
||||
timer tns-reset 3
|
||||
timer tns-reset-retries 3
|
||||
timer tns-test 30
|
||||
timer tns-alive 3
|
||||
timer tns-alive-retries 10
|
|
@ -1,23 +0,0 @@
|
|||
!
|
||||
! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty
|
||||
!!
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
!
|
||||
gbproxy
|
||||
sgsn nsei 101
|
||||
name main
|
||||
ns
|
||||
bind udp local
|
||||
listen 127.0.0.100 23000
|
||||
accept-ipaccess
|
||||
nse 101
|
||||
nsvc ipa local 192.168.100.239 7777 nsvci 101
|
||||
timer tns-block 3
|
||||
timer tns-block-retries 3
|
||||
timer tns-reset 3
|
||||
timer tns-reset-retries 3
|
||||
timer tns-test 30
|
||||
timer tns-alive 3
|
||||
timer tns-alive-retries 10
|
|
@ -1,21 +1,17 @@
|
|||
EXTRA_DIST = osmosgsn-usermanual.adoc \
|
||||
osmosgsn-usermanual-docinfo.xml \
|
||||
osmosgsn-vty-reference.xml \
|
||||
osmogbproxy-usermanual.adoc \
|
||||
osmogbproxy-usermanual-docinfo.xml \
|
||||
regen_doc.sh \
|
||||
chapters \
|
||||
vty \
|
||||
osmogbproxy-vty-reference.xml \
|
||||
vty-osmogbproxy \
|
||||
$(NULL)
|
||||
|
||||
if BUILD_MANUALS
|
||||
ASCIIDOC = osmosgsn-usermanual.adoc osmogbproxy-usermanual.adoc
|
||||
ASCIIDOC = osmosgsn-usermanual.adoc
|
||||
ASCIIDOC_DEPS = $(srcdir)/chapters/*.adoc
|
||||
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc
|
||||
|
||||
VTY_REFERENCE = osmosgsn-vty-reference.xml osmogbproxy-vty-reference.xml
|
||||
VTY_REFERENCE = osmosgsn-vty-reference.xml
|
||||
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
|
||||
|
||||
OSMO_REPOSITORY = osmo-sgsn
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
== Configuring OsmoGbProxy
|
||||
|
||||
OsmoGbProxy requires very little configuration, most of it being the
|
||||
configuration of the NS links.
|
||||
Most config options specific to OsmoGbProxy are related to SGSN pooling and
|
||||
telling the proxy which NSE(s) it should use to talk to the SGSN(s).
|
||||
|
||||
=== Configure the Network Service (NS)
|
||||
|
||||
A detailed description of the NS configuration can be found in <<libosmogb>>.
|
||||
The following config snippets assume the SGSN(s) (NSEI 101 and 102) are using
|
||||
IP-SNS and listen on 10.0.1.1:23000 and 10.0.1.2:23000 respectively.
|
||||
|
||||
This would be the NS config for the SGSN(s):
|
||||
|
||||
.Example: NS configuration example (SGSN)
|
||||
----
|
||||
ns
|
||||
bind udp local
|
||||
listen 10.0.0.1 23000 <1>
|
||||
nse 101 <2>
|
||||
ip-sns 10.0.1.1 23000 <3>
|
||||
nse 102
|
||||
ip-sns 10.0.1.2 23000
|
||||
----
|
||||
<1> Define the local IP/port from which to connect
|
||||
<2> Define an NSE with NSEI
|
||||
<3> Use IP-SNS to connect to the SGSN
|
||||
|
||||
=== Configure an SGSN
|
||||
|
||||
Configuration of a single (non-pooling) SGSN is rather simple.
|
||||
|
||||
.Example: SGSN configuration example
|
||||
----
|
||||
sgsn 101 <1>
|
||||
name Main SGSN <2>
|
||||
----
|
||||
<1> Each SGSN is identified by its NSEI (same as in the NS configuration)
|
||||
<2> An SGSN can optionally have a name. If none is set a default name will be used.
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
[[control]]
|
||||
== Control interface
|
||||
|
||||
The actual protocol is described in <<common-control-if>>, the variables
|
||||
common to all programs using it are described in <<ctrl_common_vars>>. Here we
|
||||
describe variables specific to OsmoGbProxy.
|
||||
|
||||
.Variables available over control interface
|
||||
[options="header",width="100%",cols="20%,5%,5%,50%,20%"]
|
||||
|===
|
||||
|Name|Access|Trap|Value|Comment
|
||||
|nsvc-state|RO|No|"<nsei>,<nsvci>,<local-alive>,<local-blocked>,<remote-role>,<remote-alive>,<remote-blocked>"|See <<nsvc_state>> for details.
|
||||
|gbproxy-state|RO|No|"<nsei>,<bvci>,<mcc>,<mnc>,<lac>,<rac>,<blocked>"|See <<gbproxy_state>> for details.
|
||||
|number-of-peers|RO|No|"<num-of-bss>"|Count of concurrent BSS(BTS) peers.
|
||||
|===
|
||||
|
||||
[[nsvc_state]]
|
||||
=== nsvc-state
|
||||
|
||||
Return the list of active NS-VCs (NS Virtual Circuits), including information
|
||||
on the key parameters, such as NSEI, NSVCI and the local + remote ALIVE
|
||||
and BLOCKED state.
|
||||
|
||||
[[gbproxy_state]]
|
||||
=== gbproxy-state
|
||||
|
||||
Return the list of active Peers, including information on the key
|
||||
parameters, such as NSEI, BVCI, and the MCC-MNC-LAC-RAC of the attached
|
||||
BSS, as well as the overall state (BLOCKED or UNBLOCKED).
|
|
@ -1,113 +0,0 @@
|
|||
[[chapter_details]]
|
||||
== Proxy details
|
||||
|
||||
=== BVC handling
|
||||
|
||||
This section describes in more detail how BVCs are handled in OsmoGbProxy
|
||||
|
||||
If a BSS connects to OsmoGbProxy while the SGSN is not available it will
|
||||
acknowledge the BVC RESET on the signalling BVC, but ignore other messages
|
||||
(especially any PTP BVC RESET).
|
||||
|
||||
.BSS connects to OsmoGbProxy
|
||||
[mscgen]
|
||||
----
|
||||
msc {
|
||||
hscale="1.8";
|
||||
bss1 [label="BSS1"], bss2 [label="BSS2"], gbproxy [label="GbProxy"], sgsn [label="SGSN"];
|
||||
bss1 <=> gbproxy [label="NS link available"];
|
||||
bss1 => gbproxy [label="BVC RESET (BVCI=0)"];
|
||||
gbproxy => bss1 [label="BVC RESET ACK"];
|
||||
bss1 -x gbproxy [label="PTP BVC RESET (ignored)"];
|
||||
}
|
||||
----
|
||||
|
||||
As soon as the SGSN is reachable through NS OsmoGbProxy will send a BVC RESET
|
||||
to the signalling BVC towards the SGSN. After that completes it will reset the
|
||||
signalling BVC of all BSS connections. At this point the BSS will send a BVC
|
||||
RESET for its PTP BVCs which will be forwarded to the SGSN, similarly the PTP
|
||||
BVC RESET ACK from the SGSN will be sent back to the BSS.
|
||||
|
||||
.SGSN connection to OsmoGbProxy
|
||||
[mscgen]
|
||||
----
|
||||
msc {
|
||||
hscale="1.8";
|
||||
bss1 [label="BSS1"], bss2 [label="BSS2"], gbproxy [label="GbProxy"], sgsn [label="SGSN"];
|
||||
gbproxy <=> sgsn [label="NS link available"];
|
||||
gbproxy => sgsn [label="BVC RESET (BVCI=0)"];
|
||||
sgsn => gbproxy [label="BVC RESET ACK"];
|
||||
|
||||
gbproxy => bss1 [label="BVC RESET (BVCI=0)"];
|
||||
bss1 => gbproxy [label="BVC RESET ACK"];
|
||||
bss1 box bss1 [label="PTP BVCs need to be reset"];
|
||||
bss1 => gbproxy [label="PTP BVC RESET (BVCI=x)"];
|
||||
gbproxy => sgsn [label="PTP BVC RESET (BVCI=x)"];
|
||||
sgsn => gbproxy [label="PTP BVC RESET ACK (BVCI=x)"];
|
||||
gbproxy => bss1 [label="PTP BVC RESET ACK (BVCI=x)"];
|
||||
bss2 <=> sgsn [label="BVCI x established"];
|
||||
}
|
||||
----
|
||||
|
||||
The communication on the PTP BVC will then be forwarded between the BSS and the
|
||||
SGSN.
|
||||
|
||||
If a BSS connects while the SGSN is up the PTP BVC RESET will directly be
|
||||
forwarded.
|
||||
|
||||
.BSS connects to OsmoGbProxy
|
||||
[mscgen]
|
||||
----
|
||||
msc {
|
||||
hscale="1.8";
|
||||
bss1 [label="BSS1"], bss2 [label="BSS2"], gbproxy [label="GbProxy"], sgsn [label="SGSN"];
|
||||
bss2 <=> gbproxy [label="NS link available"];
|
||||
bss2 => gbproxy [label="BVC RESET (BVCI=0)"];
|
||||
gbproxy => bss2 [label="BVC RESET ACK"];
|
||||
bss2 => gbproxy [label="PTP BVC RESET (BVCI=y)"];
|
||||
gbproxy => sgsn [label="PTP BVC RESET (BVCI=y)"];
|
||||
sgsn => gbproxy [label="PTP BVC RESET ACK (BVCI=y)"];
|
||||
gbproxy => bss2 [label="PTP BVC RESET ACK (BVCI=y)"];
|
||||
bss2 <=> sgsn [label="BVCI y established"];
|
||||
}
|
||||
----
|
||||
|
||||
If OsmoGbProxy looses the connection to the SGSN it will reset the signalling
|
||||
BVC of all BSS connections. This ensures that the BSS will not send traffic
|
||||
over a PTP BVC before its reset procedure has been completed.
|
||||
|
||||
.SGSN connection fails
|
||||
[mscgen]
|
||||
----
|
||||
msc {
|
||||
hscale="1.8";
|
||||
bss1 [label="BSS1"], bss2 [label="BSS2"], gbproxy [label="GbProxy"], sgsn [label="SGSN"];
|
||||
gbproxy <=> sgsn [label="NS link fails"];
|
||||
gbproxy => bss1 [label="BVC RESET (BVCI=0)"];
|
||||
gbproxy => bss2 [label="BVC RESET (BVCI=0)"];
|
||||
}
|
||||
----
|
||||
|
||||
When the connection to the SGSN is eventually restored the signalling BVC
|
||||
between OsmoGbProxy and SGSN will be reset.
|
||||
|
||||
After that completes OsmoGbProxy will reset the signalling BVC on all BSS NS
|
||||
connections and forward the PTP BVC RESET messages.
|
||||
|
||||
.SGSN connection restored
|
||||
[mscgen]
|
||||
----
|
||||
msc {
|
||||
hscale="1.8";
|
||||
bss1 [label="BSS1"], bss2 [label="BSS2"], gbproxy [label="GbProxy"], sgsn [label="SGSN"];
|
||||
gbproxy <=> sgsn [label="NS link available"];
|
||||
gbproxy => sgsn [label="BVC RESET (BVCI=0)"];
|
||||
sgsn => gbproxy [label="BVC RESET ACK"];
|
||||
gbproxy => bss1 [label="BVC RESET (BVCI=0)"];
|
||||
bss1 => gbproxy [label="BVC RESET ACK"];
|
||||
bss1 box bss1 [label="PTP BVCs need to be reset"];
|
||||
gbproxy => bss2 [label="BVC RESET (BVCI=0)"];
|
||||
bss2 => gbproxy [label="BVC RESET ACK"];
|
||||
bss2 box bss2 [label="PTP BVCs need to be reset"];
|
||||
}
|
||||
----
|
|
@ -1,95 +0,0 @@
|
|||
[[chapter_overview]]
|
||||
== Overview
|
||||
|
||||
IMPORTANT: If you have used an earlier version of OsmoGbProxy please note
|
||||
that support for various features such as PLMN/APN patching, support for a
|
||||
secondary SGSN has been removed.
|
||||
|
||||
=== About OsmoGbProxy
|
||||
|
||||
OsmoGbProxy is the Osmocom proxy for the 3GPP Gb interface. The Gb
|
||||
interface is defined by 3GPP as the protocol between the BSS and the
|
||||
SGSN inside the 2G/2.5G/2.75G packet switched network domain.
|
||||
|
||||
As Osmocom implements a BTS-colocated PCU, there are potentially many
|
||||
Gb interface connections between all those many PCUs in the network
|
||||
and the SGSN. This can be cumbersome to configure/maintain at the
|
||||
SGSN side.
|
||||
|
||||
OsmoGbProxy aggregates many PCU-facing Gb connections into one Gb
|
||||
connection to the SGSN. This is achieved by
|
||||
|
||||
* maintaining separate NS-VCs on the PCU side and on the SGSN side
|
||||
* more or less transparently routing BSSGP peer-to-peer Virtual Circuits
|
||||
(BVCs) through the proxy
|
||||
* having some special handling for the signaling BVC (BVCI=0) which is
|
||||
shared among all the PCUs connected to the proxy
|
||||
|
||||
|
||||
=== Data Model
|
||||
|
||||
==== gbproxy_config
|
||||
|
||||
This contains the parsed configuration of the OsmoGbProxy.
|
||||
|
||||
==== gbproxy_nse
|
||||
|
||||
The remote NS-entity that the proxy interacts with. Includes
|
||||
information about:
|
||||
|
||||
* the [unique] NSEI of the peer
|
||||
* the Routeing Area (RA) of the peer
|
||||
* which side this NSE is facing - SGSN or BSS
|
||||
* the list of BVCs in this NSE
|
||||
|
||||
==== gbproxy_bvc
|
||||
|
||||
A ptp-BVC on an NSE
|
||||
|
||||
* the BVCI of this BVC
|
||||
* the routing area of this BVC
|
||||
* the BVC state machine
|
||||
|
||||
==== gbproxy_cell
|
||||
|
||||
This contains a view of the cell and its associated BVCs
|
||||
|
||||
* the unique BVCI of this cell
|
||||
* the routing area of this cell
|
||||
* one bss-side BVC
|
||||
* one BVC per SGSN in the pool
|
||||
|
||||
==== gbproxy_sgsn
|
||||
|
||||
Represents one SGSN in the pool. Contains:
|
||||
|
||||
* the NSE belonging to this SGSN
|
||||
* a (configurable) name of the SGSN
|
||||
* pool-related configuration of the SGSNs
|
||||
|
||||
==== IMSI cache
|
||||
|
||||
In order to route messages to the correct BSS or SGSN OsmoGbProxy
|
||||
sometimes needs to cache where messages came from.
|
||||
|
||||
In BSS->SGSN direction the IMSI-cache is needed for
|
||||
|
||||
* paging ps reject
|
||||
* dummy paging response
|
||||
|
||||
when SGSN-pooling is enabled and multiple SGSNs are configured. The IMSI
|
||||
contained in a paging ps or dummy paging message is cached together with
|
||||
the originating SGSN/NSE. The answer, which also contains the IMSI, is
|
||||
then routed back to the original SGSN.
|
||||
|
||||
==== TLLI cache
|
||||
|
||||
In SGSN->BSS direction OsmoGbProxy needs a TLLI cache to correctly route the
|
||||
following messages:
|
||||
|
||||
* suspend ack/nack
|
||||
* resume ack/nack
|
||||
|
||||
Suspend/resume are sent over the signalling BVC to the SGSN. OsmoGbProxy saves
|
||||
the TLLI->NSE association in the TLLI cache and routes the ack/nack back to
|
||||
the signalling BVC of the originating NSE.
|
|
@ -1,39 +0,0 @@
|
|||
== Running OsmoGbProxy
|
||||
|
||||
The OsmoGbProxy executable (`osmo-gbproxy`) offers the following command-line
|
||||
options:
|
||||
|
||||
|
||||
=== SYNOPSIS
|
||||
|
||||
*osmo-gbproxy* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-e 'LOGLEVEL'] [-T]
|
||||
|
||||
|
||||
=== OPTIONS
|
||||
|
||||
*-h, --help*::
|
||||
Print a short help message about the supported options
|
||||
*-V, --version*::
|
||||
Print the compile-time version number of the program
|
||||
*-d, --debug 'DBGMASK','DBGLEVELS'*::
|
||||
Set the log subsystems and levels for logging to stderr. This
|
||||
has mostly been superseded by VTY-based logging configuration,
|
||||
see <<logging>> for further information.
|
||||
*-D, --daemonize*::
|
||||
Fork the process as a daemon into background.
|
||||
*-c, --config-file 'CONFIGFILE'*::
|
||||
Specify the file and path name of the configuration file to be
|
||||
used. If none is specified, use `osmo_sgsn.cfg` in the current
|
||||
working directory.
|
||||
*-s, --disable-color*::
|
||||
Disable colors for logging to stderr. This has mostly been
|
||||
deprecated by VTY based logging configuration, see <<logging>>
|
||||
for more information.
|
||||
*-e, --log-level 'LOGLEVEL'*::
|
||||
Set the global log level for logging to stderr. This has mostly
|
||||
been deprecated by VTY based logging configuration, see
|
||||
<<logging>> for more information.
|
||||
*-T, --timestamp*::
|
||||
Enable prefixing each log line on stderr with a timestamp. This
|
||||
has mostly been deprecated by VTY based logging configuration, see
|
||||
<<logging>> for more information.
|
|
@ -1,219 +0,0 @@
|
|||
== SGSN Pooling
|
||||
|
||||
SGSN pooling is described in 3GPP TS 23.236 <<3gpp-ts-23-236>>, and is supported
|
||||
by OsmoGbProxy since early 2021.
|
||||
|
||||
The aim of SGSN pooling is to distribute load from a BSS across multiple SGSNs,
|
||||
which are equivalent and redundant infrastructure for the same core network.
|
||||
|
||||
The main mechanism for SGSN pooling is the TLLI/P-TMSI, which an SGSN hands out
|
||||
to its attached subscribers. Typically 10 bits of the P-TMSI are designated as a
|
||||
Network Resource Identifier (NRI) that identifies the originating SGSN, and
|
||||
allows OsmoGbProxy to direct a subscriber back to the same SGSN instance that
|
||||
previously negotiated the Attach procedure. Typically, the full NRI value
|
||||
range available is divided into N even ranges, where each SGSN is assigned one
|
||||
NRI range.
|
||||
|
||||
Subscribers attaching without a TLLI, or those with unknown NRI value,
|
||||
are evenly distributed across SGSN instances. OsmoGbProxy uses a hash-based
|
||||
approach to distribute load across all connected SGSNs.
|
||||
|
||||
A Paging Response from a subscriber is always returned back to whichever SGSN
|
||||
initiated the Paging, regardless of the Mobile Identity used.
|
||||
|
||||
Finally, a NULL-NRI is a special NRI value that indicates that the SGSN wishes
|
||||
to offload this subscriber to a different SGSN. A NULL-NRI is an arbitrary NRI
|
||||
value that is chosen distinctly for each PLMN served by a BSS, so that a
|
||||
subscriber can be reassigned within that PLMN. Upon (periodic) Location
|
||||
Updating, an offloading SGSN hands out a NULL-NRI value in the assigned TLLI,
|
||||
along with a non-broadcast LAI. The subscriber will notice the LAI mismatch,
|
||||
and immediately re-attempt the attach using the TLLI containing the NULL-NRI.
|
||||
OsmoGbProxy recognises the NULL-NRI and redirects the subscriber to one of the
|
||||
other SGSNs. A prerequisite for this to work well is that the particular SGSN is
|
||||
previously marked as not accepting new subscribers, in OsmoGbProxy's configuration.
|
||||
|
||||
The mechanisms described above make up the NAS node selection function
|
||||
implemented in OsmoGbProxy.
|
||||
|
||||
3GPP TS 23.236 also defines that an offloading SGSN hands subscriber information
|
||||
to the newly assigned SGSN, which takes place outside the scope of OsmoGbProxy.
|
||||
|
||||
=== Configuring SGSN Pooling
|
||||
|
||||
The NRI ranges assigned to each SGSN must match in the OsmoGbProxy and the SGSN
|
||||
configuration. If inconsistent NRI value ranges are configured,
|
||||
attached subscribers would be redirected to SGSN instances that did not perform the
|
||||
attach, possibly rendering the core network unusable.
|
||||
|
||||
==== Connecting Multiple SGSNs
|
||||
|
||||
----
|
||||
# Configure the Network Service
|
||||
ns
|
||||
bind udp sgsn
|
||||
listen 10.0.0.1 23000
|
||||
nse 1
|
||||
ip-sns 10.0.1.1 23000
|
||||
ip-sns 10.0.1.1 23001
|
||||
nse 2
|
||||
ip-sns 10.0.1.2 23000
|
||||
nse 3
|
||||
ip-sns 10.0.1.3 23000
|
||||
# configure NRI value ranges
|
||||
gbproxy
|
||||
nri bitlen 10
|
||||
nri null add 0
|
||||
sgsn 1
|
||||
nri add 1 341
|
||||
sgsn 2
|
||||
nri add 342 682
|
||||
sgsn 3
|
||||
nri add 683 1023
|
||||
----
|
||||
|
||||
==== NRI Value Bit Length
|
||||
|
||||
In OsmGbProxy, the NRI value's bit length is freely configurable from 0 to 15
|
||||
bits. 3GPP TS 23.236 suggests a typical bit length of 10. Setting the length
|
||||
to 0 disables SGSN pooling, this is also the default.
|
||||
The NRI bit length must be identical across the entire SGSN pool.
|
||||
|
||||
Change the NRI value bit length in OsmoGbProxy's VTY configuration like this:
|
||||
|
||||
----
|
||||
gbproxy
|
||||
nri bitlen 10
|
||||
----
|
||||
|
||||
In the TMSI bits, regardless of the NRI bit length, the NRI value always starts
|
||||
just after the most significant octet of a TMSI (most significant bit at TMSI's
|
||||
bit 23).
|
||||
|
||||
==== NULL-NRI
|
||||
|
||||
Since OsmoGbProxy supports serving only one PLMN, NULL-NRI are configured globally.
|
||||
Even though 3GPP TS 23.236 indicates that there is a single NULL-NRI per PLMN,
|
||||
OsmoGbProxy allows configuring multiple NULL-NRI values.
|
||||
|
||||
----
|
||||
network
|
||||
nri null add 0
|
||||
nri null add 423
|
||||
----
|
||||
|
||||
==== Assigning NRI Ranges to SGSNs
|
||||
|
||||
Each SGSN configured in OsmoGbProxy must be assigned a distinct NRI value range.
|
||||
Overlapping NRI value ranges will cause failure to serve subscribers.
|
||||
|
||||
NRI values are typically configured in ranges, here dividing a 10bit range
|
||||
(0..1023) into three equal ranges, while leaving 0 available to be configured
|
||||
as NULL-NRI:
|
||||
|
||||
----
|
||||
sgsn nsei 1
|
||||
nri add 1 341
|
||||
sgsn nsei 2
|
||||
nri add 342 684
|
||||
sgsn nsei 3
|
||||
nri add 685 1023
|
||||
----
|
||||
|
||||
NRI can also be assigned in single values:
|
||||
|
||||
----
|
||||
sgsn nsei 1
|
||||
nri add 23
|
||||
----
|
||||
|
||||
Ranges can be constructed arbitrarily by a sequence of `add` and `del`
|
||||
configurations, here a contrived example:
|
||||
|
||||
----
|
||||
sgsn nsei 1
|
||||
nri add 0 342
|
||||
nri del 23
|
||||
nri del 42 235
|
||||
nri add 1000 1023
|
||||
----
|
||||
|
||||
On the VIEW and ENABLE VTY nodes, `show nri all` shows all SGSNs:
|
||||
|
||||
----
|
||||
OsmoGbProxy> show nri all
|
||||
sgsn nsei 1
|
||||
nri add 1 341
|
||||
sgsn nsei 2
|
||||
nri add 342 684
|
||||
sgsn nsei 3
|
||||
nri add 685 1023
|
||||
----
|
||||
|
||||
When configuring overlapping NRI value ranges across SGSNs, the telnet VTY warns
|
||||
about it, and starting OsmoGbProxy with such a configuration will fail:
|
||||
|
||||
----
|
||||
sgsn nsei 1
|
||||
nri add 1 511
|
||||
sgsn nsei 2
|
||||
nri add 512 1023
|
||||
sgsn nsei 3
|
||||
nri add 500 555
|
||||
----
|
||||
|
||||
This results in:
|
||||
|
||||
----
|
||||
$ osmo-gbproxy
|
||||
% Warning: NSE(00003/SGSN): NRI range [500..555] overlaps between NSE 00003 and NSE 00001. For overlaps, NSE 00001 has higher priority than NSE 00003
|
||||
% Warning: NSE(00003/SGSN): NRI range [500..555] overlaps between NSE 00003 and NSE 00002. For overlaps, NSE 00002 has higher priority than NSE 00003
|
||||
----
|
||||
|
||||
==== SGSN Offloading
|
||||
|
||||
To effectively offload a particular SGSN, it must be marked as no longer taking
|
||||
new subscribers in OsmoGbProxy. This can be achieved in the telnet VTY by:
|
||||
|
||||
----
|
||||
sgsn nsei 1
|
||||
no allow-attach
|
||||
----
|
||||
|
||||
This SGSN will, as long as it is connected, continue to serve subscribers
|
||||
already attached to it: those that yield an NRI matching this SGSN, and those
|
||||
that are being paged by this SGSN. But OsmoGbProxy will no longer direct new
|
||||
subscribers to this SGSN.
|
||||
|
||||
TODO: Is paging response relevant for SGSN?
|
||||
|
||||
To re-enable an SGSN for attaching new subscribers:
|
||||
|
||||
----
|
||||
sgsn nsei 1
|
||||
allow-attach
|
||||
----
|
||||
|
||||
==== Traffic allocation
|
||||
|
||||
In a SGSN pool, osmo-gbproxy is facing the problem of dividing the downlink
|
||||
capacity of a cell towards the SGSN. The BSS advertises the per-BVC capacity
|
||||
by means of the BSSGP FLOW-CONTROL-BVC messages, but as there are multiple
|
||||
SGSN in a pool, they all have to share / divide that total capacity.
|
||||
|
||||
By default, osmo-gbproxy advertises the full capacity to _each_ of the SGSN
|
||||
pool members, which results in significant over-provisioning and can lead to
|
||||
overload situations.
|
||||
|
||||
The administrator can configure the _percentage_ of the overall BSS-advertised
|
||||
capacity that shall be reported to each pool member SGSN using the
|
||||
`pool bvc-flow-control-ratio <1-100>` configuration command.
|
||||
|
||||
A setting of 100 means that each pool member is informed of 100% of the
|
||||
BSS side capacity.
|
||||
|
||||
A setting of 25 means that each pool member is informed of 25% of the
|
||||
BSS side capacity. This would make most sense in a set-up with four
|
||||
SGSN of equal share.
|
||||
|
||||
More complex capacity division schemes are so far not supported by
|
||||
osmo-gbproxy.
|
|
@ -1,46 +0,0 @@
|
|||
<revhistory>
|
||||
<revision>
|
||||
<revnumber>1</revnumber>
|
||||
<date>March 21, 2019</date>
|
||||
<authorinitials>HW</authorinitials>
|
||||
<revremark>
|
||||
Initial version.
|
||||
</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Welte</surname>
|
||||
<email>hwelte@sysmocom.de</email>
|
||||
<authorinitials>HW</authorinitials>
|
||||
<affiliation>
|
||||
<shortaffil>sysmocom</shortaffil>
|
||||
<orgname>sysmocom - s.f.m.c. GmbH</orgname>
|
||||
<jobtitle>Managing Director</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
<copyright>
|
||||
<year>2013-2019</year>
|
||||
<holder>sysmocom - s.f.m.c. GmbH</holder>
|
||||
</copyright>
|
||||
|
||||
<legalnotice>
|
||||
<para>
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU Free Documentation License,
|
||||
Version 1.3 or any later version published by the Free Software
|
||||
Foundation; with no Invariant Sections, no Front-Cover Texts,
|
||||
and no Back-Cover Texts. A copy of the license is included in
|
||||
the section entitled "GNU Free Documentation License".
|
||||
</para>
|
||||
<para>
|
||||
The Asciidoc source code of this manual can be found at
|
||||
<ulink url="https://git.osmocom.org/osmo-sgsn/doc/">
|
||||
https://git.osmocom.org/osmo-sgsn/doc/
|
||||
</ulink>
|
||||
</para>
|
||||
</legalnotice>
|
|
@ -1,36 +0,0 @@
|
|||
:gfdl-enabled:
|
||||
|
||||
OsmoGbProxy User Manual
|
||||
=======================
|
||||
Harald Welte <hwelte@sysmocom.de>
|
||||
|
||||
|
||||
include::./common/chapters/preface.adoc[]
|
||||
|
||||
include::{srcdir}/chapters/gbproxy-overview.adoc[]
|
||||
|
||||
include::{srcdir}/chapters/gbproxy-details.adoc[]
|
||||
|
||||
include::{srcdir}/chapters/gbproxy-running.adoc[]
|
||||
|
||||
include::{srcdir}/chapters/gbproxy-control.adoc[]
|
||||
|
||||
include::./common/chapters/vty.adoc[]
|
||||
|
||||
include::./common/chapters/logging.adoc[]
|
||||
|
||||
include::{srcdir}/chapters/gbproxy-configuration.adoc[]
|
||||
|
||||
include::./common/chapters/gb.adoc[]
|
||||
|
||||
include::./common/chapters/control_if.adoc[]
|
||||
|
||||
//include::{srcdir}/chapters/counters.adoc[]
|
||||
|
||||
include::./common/chapters/port_numbers.adoc[]
|
||||
|
||||
include::./common/chapters/bibliography.adoc[]
|
||||
|
||||
include::./common/chapters/glossary.adoc[]
|
||||
|
||||
include::./common/chapters/gfdl.adoc[]
|
|
@ -1,38 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
ex:ts=2:sw=42sts=2:et
|
||||
-*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
||||
-->
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML 5.0//EN"
|
||||
"http://docbook.org/xml/5.0/dtd/docbook.dtd" [
|
||||
<!ENTITY chapter-vty SYSTEM "./common/chapters/vty.xml" >
|
||||
<!ENTITY sections-vty SYSTEM "generated/docbook_osmogbproxy-vty-reference.xml" >
|
||||
]>
|
||||
|
||||
<book>
|
||||
<info>
|
||||
<revhistory>
|
||||
<revision>
|
||||
<revnumber>v1</revnumber>
|
||||
<date>2nd December 2019</date>
|
||||
<authorinitials>hw</authorinitials>
|
||||
<revremark>Initial</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
<title>OsmoGbProxy VTY Reference</title>
|
||||
|
||||
<copyright>
|
||||
<year>2019</year>
|
||||
</copyright>
|
||||
|
||||
<legalnotice>
|
||||
<para>This work is copyright by <orgname>sysmocom - s.f.m.c. GmbH</orgname>. All rights reserved.
|
||||
</para>
|
||||
</legalnotice>
|
||||
</info>
|
||||
|
||||
<!-- Main chapters-->
|
||||
&chapter-vty;
|
||||
</book>
|
||||
|
|
@ -61,12 +61,6 @@ interact_vty \
|
|||
4245 \
|
||||
osmo-sgsn -c "../examples/osmo-sgsn/osmo-sgsn.cfg"
|
||||
|
||||
interact_vty \
|
||||
"update_vty_reference" \
|
||||
"vty-osmogbproxy/gbproxy_vty_reference.xml" \
|
||||
4246 \
|
||||
osmo-gbproxy -c "../examples/osmo-gbproxy/osmo-gbproxy.cfg"
|
||||
|
||||
interact_vty \
|
||||
"update_counters" \
|
||||
"chapters/counters_generated.adoc" \
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<vtydoc xmlns='urn:osmocom:xml:libosmocore:vty:doc:1.0'>
|
||||
<node id='config-gbproxy'>
|
||||
<description>Configure the Gb proxy</description>
|
||||
</node>
|
||||
</vtydoc>
|
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,6 @@ noinst_HEADERS = \
|
|||
common.h \
|
||||
crc24.h \
|
||||
debug.h \
|
||||
gb_proxy.h \
|
||||
gprs_gb.h \
|
||||
gprs_gb_parse.h \
|
||||
gprs_gmm.h \
|
||||
|
|
|
@ -1,298 +0,0 @@
|
|||
#ifndef _GB_PROXY_H
|
||||
#define _GB_PROXY_H
|
||||
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/core/fsm.h>
|
||||
#include <osmocom/core/hashtable.h>
|
||||
#include <osmocom/gsm/gsm23003.h>
|
||||
#include <osmocom/gsm/gsm23236.h>
|
||||
#include <osmocom/gsm/protocol/gsm_23_003.h>
|
||||
|
||||
#include <osmocom/gprs/gprs_ns2.h>
|
||||
#include <osmocom/vty/command.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define GBPROXY_INIT_VU_GEN_TX 256
|
||||
#define GBPROXY_MAX_NR_SGSN 16
|
||||
|
||||
/* BVCI uses 16 bits */
|
||||
#define BVC_LOG_CTX_FLAG (1<<17)
|
||||
|
||||
struct rate_ctr_group;
|
||||
struct gprs_gb_parse_context;
|
||||
struct tlv_parsed;
|
||||
|
||||
enum gbproxy_global_ctr {
|
||||
GBPROX_GLOB_CTR_INV_BVCI,
|
||||
GBPROX_GLOB_CTR_INV_LAI,
|
||||
GBPROX_GLOB_CTR_INV_RAI,
|
||||
GBPROX_GLOB_CTR_INV_NSEI,
|
||||
GBPROX_GLOB_CTR_PROTO_ERR_BSS,
|
||||
GBPROX_GLOB_CTR_PROTO_ERR_SGSN,
|
||||
GBPROX_GLOB_CTR_NOT_SUPPORTED_BSS,
|
||||
GBPROX_GLOB_CTR_NOT_SUPPORTED_SGSN,
|
||||
GBPROX_GLOB_CTR_RESTART_RESET_SGSN,
|
||||
GBPROX_GLOB_CTR_TX_ERR_SGSN,
|
||||
GBPROX_GLOB_CTR_OTHER_ERR,
|
||||
};
|
||||
|
||||
enum gbproxy_bvc_ctr {
|
||||
GBPROX_PEER_CTR_BLOCKED,
|
||||
GBPROX_PEER_CTR_UNBLOCKED,
|
||||
GBPROX_PEER_CTR_DROPPED,
|
||||
GBPROX_PEER_CTR_INV_NSEI,
|
||||
GBPROX_PEER_CTR_TX_ERR,
|
||||
GBPROX_PEER_CTR_LAST,
|
||||
};
|
||||
|
||||
/* global gb-proxy configuration */
|
||||
struct gbproxy_config {
|
||||
/* NS instance of libosmogb */
|
||||
struct gprs_ns2_inst *nsi;
|
||||
|
||||
struct {
|
||||
/* percentage of BVC flow control advertised to each SGSN in the pool */
|
||||
uint8_t bvc_fc_ratio;
|
||||
/* NRI bitlen and usable NULL-NRI ranges */
|
||||
uint8_t nri_bitlen;
|
||||
struct osmo_nri_ranges *null_nri_ranges;
|
||||
|
||||
/* Used for testing: If not NULL then this SGSN is returned by
|
||||
* gbproxy_sgsn_by_tlli() */
|
||||
struct gbproxy_sgsn *nsf_override;
|
||||
} pool;
|
||||
|
||||
/* hash table of all BSS side Gb peers */
|
||||
DECLARE_HASHTABLE(bss_nses, 8);
|
||||
|
||||
/* hash table of all SGSN-side Gb peers */
|
||||
DECLARE_HASHTABLE(sgsn_nses, 8);
|
||||
|
||||
/* hash table of all gbproxy_cell */
|
||||
DECLARE_HASHTABLE(cells, 8);
|
||||
|
||||
/* tlli<->nse cache used to map SUSPEND/RESUME (N)ACKS */
|
||||
struct {
|
||||
DECLARE_HASHTABLE(entries, 10);
|
||||
struct osmo_timer_list timer;
|
||||
/* Time in seconds that the entries should be valid */
|
||||
uint8_t timeout;
|
||||
} tlli_cache;
|
||||
|
||||
/* imsi<->nse cache used for PAGING REJECT */
|
||||
struct {
|
||||
DECLARE_HASHTABLE(entries, 10);
|
||||
struct osmo_timer_list timer;
|
||||
/* Time in seconds that the entries should be valid */
|
||||
uint8_t timeout;
|
||||
} imsi_cache;
|
||||
|
||||
/* List of all SGSNs */
|
||||
struct llist_head sgsns;
|
||||
|
||||
/* Counter */
|
||||
struct rate_ctr_group *ctrg;
|
||||
};
|
||||
|
||||
/* One Cell within the BSS: Links BSS-side BVC to SGSN-side BVCs */
|
||||
struct gbproxy_cell {
|
||||
/* linked to gbproxy_config.cells hashtable */
|
||||
struct hlist_node list;
|
||||
|
||||
/* point back to the config */
|
||||
struct gbproxy_config *cfg;
|
||||
|
||||
/* BVCI of PTP BVCs associated to this cell */
|
||||
uint16_t bvci;
|
||||
|
||||
/* Routing Area that this BVC is part of (raw 04.08 encoding) */
|
||||
uint8_t ra[6];
|
||||
|
||||
/* pointer to the BSS-side BVC */
|
||||
struct gbproxy_bvc *bss_bvc;
|
||||
|
||||
/* pointers to SGSN-side BVC (one for each pool member) */
|
||||
struct gbproxy_bvc *sgsn_bvc[GBPROXY_MAX_NR_SGSN];
|
||||
};
|
||||
|
||||
/* One BVC inside an NSE */
|
||||
struct gbproxy_bvc {
|
||||
/* linked to gbproxy_nse.bvcs */
|
||||
struct hlist_node list;
|
||||
|
||||
/* The NSE this BVC belongs to */
|
||||
struct gbproxy_nse *nse;
|
||||
|
||||
/* PTP BVCI of this BVC */
|
||||
uint16_t bvci;
|
||||
|
||||
/* Routing Area that this BVC is part of (raw 04.08 encoding) */
|
||||
uint8_t ra[6];
|
||||
|
||||
/* Counter */
|
||||
struct rate_ctr_group *ctrg;
|
||||
|
||||
/* the cell to which this BVC belongs */
|
||||
struct gbproxy_cell *cell;
|
||||
|
||||
/* per-BVC FSM instance */
|
||||
struct osmo_fsm_inst *fi;
|
||||
};
|
||||
|
||||
/* one NS Entity that we interact with (BSS/PCU) */
|
||||
struct gbproxy_nse {
|
||||
/* linked to gbproxy_config.bss_nses */
|
||||
struct hlist_node list;
|
||||
|
||||
/* point back to the config */
|
||||
struct gbproxy_config *cfg;
|
||||
|
||||
/* NSEI of the NSE */
|
||||
uint16_t nsei;
|
||||
|
||||
/* Are we facing towards a SGSN (true) or BSS (false) */
|
||||
bool sgsn_facing;
|
||||
|
||||
/* List of all BVCs in this NSE */
|
||||
DECLARE_HASHTABLE(bvcs, 10);
|
||||
};
|
||||
|
||||
/* SGSN configuration such as pool options (only for NSE where sgsn_facing == true) */
|
||||
struct gbproxy_sgsn {
|
||||
/* linked to gbproxy_config.sgsns */
|
||||
struct llist_head list;
|
||||
|
||||
/* The NSE belonging to this SGSN */
|
||||
struct gbproxy_nse *nse;
|
||||
|
||||
/* Name of the SGSN */
|
||||
char *name;
|
||||
|
||||
/* Pool configuration for the sgsn (only valid if sgsn_facing == true) */
|
||||
struct {
|
||||
bool allow_attach;
|
||||
struct osmo_nri_ranges *nri_ranges;
|
||||
} pool;
|
||||
};
|
||||
|
||||
/* TLLI cache */
|
||||
struct gbproxy_tlli_cache_entry {
|
||||
/* linked to gbproxy_config.tlli_cache.entries */
|
||||
struct hlist_node list;
|
||||
|
||||
/* TLLI of the entry */
|
||||
uint32_t tlli;
|
||||
/* When was this entry last seen */
|
||||
time_t tstamp;
|
||||
/* The Cell this TLLI was last seen */
|
||||
struct gbproxy_nse *nse;
|
||||
};
|
||||
|
||||
/* IMSI cache */
|
||||
struct gbproxy_imsi_cache_entry {
|
||||
/* linked to gbproxy_config.imsi_cache.entries */
|
||||
struct hlist_node list;
|
||||
|
||||
/* IMSI of the entry */
|
||||
char imsi[OSMO_IMSI_BUF_SIZE];
|
||||
/* When was this entry last seen */
|
||||
time_t tstamp;
|
||||
/* The SGSN where the request came from */
|
||||
struct gbproxy_nse *nse;
|
||||
};
|
||||
|
||||
/* Convenience logging macros for NSE/BVC */
|
||||
#define LOGPNSE_CAT(NSE, SUBSYS, LEVEL, FMT, ARGS...) \
|
||||
LOGP(SUBSYS, LEVEL, "NSE(%05u/%s) " FMT, (NSE)->nsei, \
|
||||
(NSE)->sgsn_facing ? "SGSN" : "BSS", ## ARGS)
|
||||
#define LOGPNSE(NSE, LEVEL, FMT, ARGS...) \
|
||||
LOGPNSE_CAT(NSE, DGPRS, LEVEL, FMT, ## ARGS)
|
||||
|
||||
#define LOGPBVC_CAT(BVC, SUBSYS, LEVEL, FMT, ARGS...) \
|
||||
LOGP(SUBSYS, LEVEL, "NSE(%05u/%s)-BVC(%05u/%s) " FMT, (BVC)->nse->nsei, \
|
||||
(BVC)->nse->sgsn_facing ? "SGSN" : "BSS", (BVC)->bvci, \
|
||||
osmo_fsm_inst_state_name((BVC)->fi), ## ARGS)
|
||||
#define LOGPBVC(BVC, LEVEL, FMT, ARGS...) \
|
||||
LOGPBVC_CAT(BVC, DGPRS, LEVEL, FMT, ## ARGS)
|
||||
|
||||
#define LOGPCELL_CAT(CELL, SUBSYS, LEVEL, FMT, ARGS...) \
|
||||
LOGP(SUBSYS, LEVEL, "CELL(%05u) " FMT, (CELL)->bvci, ## ARGS)
|
||||
#define LOGPCELL(CELL, LEVEL, FMT, ARGS...) \
|
||||
LOGPCELL_CAT(CELL, DGPRS, LEVEL, FMT, ## ARGS)
|
||||
|
||||
#define LOGPSGSN_CAT(SGSN, SUBSYS, LEVEL, FMT, ARGS...) \
|
||||
LOGP(SUBSYS, LEVEL, "NSE(%05u)-SGSN(%s) " FMT, (SGSN)->nse->nsei, (SGSN)->name, ## ARGS)
|
||||
#define LOGPSGSN(SGSN, LEVEL, FMT, ARGS...) \
|
||||
LOGPSGSN_CAT(SGSN, DGPRS, LEVEL, FMT, ## ARGS)
|
||||
|
||||
/* gb_proxy_vty .c */
|
||||
|
||||
int gbproxy_vty_init(void);
|
||||
int gbproxy_parse_config(const char *config_file, struct gbproxy_config *cfg);
|
||||
|
||||
/* gb_proxy_ctrl.c */
|
||||
int gb_ctrl_cmds_install(void);
|
||||
|
||||
|
||||
/* gb_proxy.c */
|
||||
int gbproxy_init_config(struct gbproxy_config *cfg);
|
||||
|
||||
/* Main input function for Gb proxy */
|
||||
int gbprox_rcvmsg(void *ctx, struct msgb *msg);
|
||||
|
||||
int gbprox_signal(unsigned int subsys, unsigned int signal,
|
||||
void *handler_data, void *signal_data);
|
||||
|
||||
|
||||
int gprs_ns2_prim_cb(struct osmo_prim_hdr *oph, void *ctx);
|
||||
|
||||
void gbprox_reset(struct gbproxy_config *cfg);
|
||||
|
||||
/* Peer handling */
|
||||
#define NSE_F_SGSN 0x0001
|
||||
#define NSE_F_BSS 0x0002
|
||||
|
||||
struct gbproxy_bvc *gbproxy_bvc_by_bvci(struct gbproxy_nse *nse, uint16_t bvci);
|
||||
struct gbproxy_bvc *gbproxy_bvc_alloc(struct gbproxy_nse *nse, uint16_t bvci);
|
||||
void gbproxy_bvc_free(struct gbproxy_bvc *bvc);
|
||||
int gbproxy_cleanup_bvcs(struct gbproxy_nse *nse, uint16_t bvci);
|
||||
|
||||
struct gbproxy_cell *gbproxy_cell_alloc(struct gbproxy_config *cfg, uint16_t bvci);
|
||||
struct gbproxy_cell *gbproxy_cell_by_bvci(struct gbproxy_config *cfg, uint16_t bvci);
|
||||
void gbproxy_cell_free(struct gbproxy_cell *cell);
|
||||
bool gbproxy_cell_add_sgsn_bvc(struct gbproxy_cell *cell, struct gbproxy_bvc *bvc);
|
||||
|
||||
/* NSE handling */
|
||||
struct gbproxy_nse *gbproxy_nse_alloc(struct gbproxy_config *cfg, uint16_t nsei, bool sgsn_facing);
|
||||
void gbproxy_nse_free(struct gbproxy_nse *nse);
|
||||
struct gbproxy_nse *gbproxy_nse_by_nsei(struct gbproxy_config *cfg, uint16_t nsei, uint32_t flags);
|
||||
struct gbproxy_nse *gbproxy_nse_by_nsei_or_new(struct gbproxy_config *cfg, uint16_t nsei, bool sgsn_facing);
|
||||
struct gbproxy_nse *gbproxy_nse_by_tlli(struct gbproxy_config *cfg, uint32_t tlli);
|
||||
struct gbproxy_nse *gbproxy_nse_by_imsi(struct gbproxy_config *cfg, const char *imsi);
|
||||
|
||||
/* TLLI cache */
|
||||
void gbproxy_tlli_cache_update(struct gbproxy_nse *nse, uint32_t tlli);
|
||||
void gbproxy_tlli_cache_remove(struct gbproxy_config *cfg, uint32_t tlli);
|
||||
int gbproxy_tlli_cache_cleanup(struct gbproxy_config *cfg);
|
||||
|
||||
/* IMSI cache */
|
||||
void gbproxy_imsi_cache_update(struct gbproxy_nse *nse, const char *imsi);
|
||||
void gbproxy_imsi_cache_remove(struct gbproxy_config *cfg, const char *imsi);
|
||||
int gbproxy_imsi_cache_cleanup(struct gbproxy_config *cfg);
|
||||
|
||||
/* SGSN handling */
|
||||
struct gbproxy_sgsn *gbproxy_sgsn_alloc(struct gbproxy_config *cfg, uint16_t nsei, const char *name);
|
||||
void gbproxy_sgsn_free(struct gbproxy_sgsn *sgsn);
|
||||
struct gbproxy_sgsn *gbproxy_sgsn_by_name(struct gbproxy_config *cfg, const char *name);
|
||||
struct gbproxy_sgsn *gbproxy_sgsn_by_nsei(struct gbproxy_config *cfg, uint16_t nsei);
|
||||
struct gbproxy_sgsn *gbproxy_sgsn_by_nsei_or_new(struct gbproxy_config *cfg, uint16_t nsei);
|
||||
struct gbproxy_sgsn *gbproxy_sgsn_by_nri(struct gbproxy_config *cfg, uint16_t nri, bool *null_nri);
|
||||
struct gbproxy_sgsn *gbproxy_sgsn_by_tlli(struct gbproxy_config *cfg, struct gbproxy_sgsn *sgsn_avoid,
|
||||
uint32_t tlli);
|
||||
|
||||
#endif
|
|
@ -16,18 +16,16 @@
|
|||
|
||||
|
||||
app_configs = {
|
||||
"gbproxy": ["doc/examples/osmo-gbproxy/osmo-gbproxy.cfg"],
|
||||
"sgsn": ["doc/examples/osmo-sgsn/osmo-sgsn.cfg"],
|
||||
"gtphub": ["doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg"]
|
||||
}
|
||||
|
||||
|
||||
apps = [(4246, "src/gbproxy/osmo-gbproxy", "OsmoGbProxy", "gbproxy"),
|
||||
(4245, "src/sgsn/osmo-sgsn", "OsmoSGSN", "sgsn"),
|
||||
apps = [(4245, "src/sgsn/osmo-sgsn", "OsmoSGSN", "sgsn"),
|
||||
(4253, "src/gtphub/osmo-gtphub", "OsmoGTPhub", "gtphub")
|
||||
]
|
||||
|
||||
vty_command = ["./src/sgsn/osmo-sgsn", "-c",
|
||||
"doc/examples/osmo-sgsn/osmo-sgsn.cfg"]
|
||||
|
||||
vty_app = apps[1]
|
||||
vty_app = apps[0]
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
SUBDIRS = \
|
||||
gprs \
|
||||
sgsn \
|
||||
gbproxy \
|
||||
gtphub \
|
||||
$(NULL)
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
AM_CPPFLAGS = \
|
||||
$(all_includes) \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_builddir) \
|
||||