Dear List,
I am in the process of creating the Wiki page for Ettus B200/B210 with OpenBSC, GPRS and Asterisk.
I am quite close, both data and calls are working, but the voice calls are half sided. The downlink direction works, but the uplink does not.
I tried without Asterisk and LCR (between two phones) and still the calls are half sided.
In the mean time I got these messages in the Osmo-BTS log:
<0006> scheduler.c:276 PH-DATA.req: chan_nr=0x0a link_id=0x00 fn=1284768 ts=2 tr x=0
<0006> scheduler.c:1036 TCH/F has not been served !! No prim for trx=0 ts=1 at f n=1284764 to transmit.
<0006> scheduler.c:1036 TCH/F has not been served !! No prim for trx=0 ts=2 at f n=1284764 to transmit.
<0006> scheduler.c:379 TCH RTS.ind: chan=TCH/F chan_nr=0x09 fn=1284772 ts=1 trx= 0
<0006> scheduler.c:276 PH-DATA.req: chan_nr=0x09 link_id=0x00 fn=1284772 ts=1 tr x=0
<0006> scheduler.c:379 TCH RTS.ind: chan=TCH/F chan_nr=0x0a fn=1284772 ts=2 trx= 0
<0006> scheduler.c:276 PH-DATA.req: chan_nr=0x0a link_id=0x00 fn=1284772 ts=2 tr x=0
<0006> scheduler.c:1036 TCH/F has not been served !! No prim for trx=0 ts=1 at f n=1284768 to transmit.
<0006> scheduler.c:1036 TCH/F has not been served !! No prim for trx=0 ts=2 at f n=1284768 to transmit.
SMS and GPRS seems to be fine.
If someone have any idea, I would love to hear it. :-)
Thanks!
Csaba
Hi all,
This patch set adds to libosmocore an optimized Viterbi decodeer for
architecture specific (Intel SSE) and non-specific cases. The
implementation covers codes with constraint lengths of K=5 and K=7 and
rates 1/4 to 3/4, which make up the majority of GSM use cases. Speedup
from the current implementation is in the range of 5 to 20 depending on
the processor and code type. API is unchanged.
Tested on Haswell (i7-4770K) and Atom (D2550). Additional test codes
from osmo-bts are included. Further tests for AWGN bit-error-rate
and benchmarks can be found in the following repository.
https://github.com/ttsou/osmo-conv-test
Here are some examples.
Bit error test for GPRS CS2 with SNR of 5 dB and 100000 bursts.
$ ./conv_test -c 2 -e -r 5 -i 100000
=================================================
[+] Testing: GPRS CS2
[.] Specs: (N=2, K=5, non-recursive, flushed, not punctured)
[.] Input length : ret = 290 exp = 290 -> OK
[.] Output length : ret = 588 exp = 588 -> OK
[.] BER tests:
[..] Testing base:
[..] Input BER.......................... 0.042443
[..] Output BER......................... 0.000006
[..] Output FER......................... 0.001350 (135)
[..] Testing SIMD:
[..] Input BER.......................... 0.042460
[..] Output BER......................... 0.000005
[..] Output FER......................... 0.001240 (124)
Timed AFS benchmark with 8 threads and 100000 bursts per thread.
$ ./conv_test -b -c 10 -j 8 -i 100000
=================================================
[+] Testing: GSM TCH/AFS 6.7
[.] Specs: (N=4, K=5, recursive, flushed, punctured)
[.] Input length : ret = 140 exp = 140 -> OK
[.] Output length : ret = 448 exp = 448 -> OK
[.] Performance benchmark:
[..] Encoding / Decoding 800000 bursts on 8 thread(s):
[..] Testing base:
[..] Elapsed time....................... 4.320001 secs
[..] Rate............................... 25.925920 Mbps
[..] Testing SIMD:
[..] Elapsed time....................... 0.458272 secs
[..] Rate............................... 244.396341 Mbps
[..] Speedup............................ 9.426718
-TT
This commit adds this predicate function which can be used to
avoid the execution of code if a certain log level is not enabled.
The function will only return 0 (false), if it is sure that a logging
call for the same facility and level will not produce any output.
This safety criterion shall ensure, that no logging output is lost
due to the use of this predicate as a guard. On the other hand, even
if the predicate returns != 0 (true), no logging output might get
generated by a similar logging command.
Note that the current implementation is not focussed on performance,
which could be improved by using a lookup table instead of iterating
through every target.
Sponsored-by: On-Waves ehf
---
include/osmocom/core/logging.h | 1 +
src/logging.c | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index 1c159d0..290b33d 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -198,6 +198,7 @@ void logp2(int subsys, unsigned int level, const char *file,
int line, int cont, const char *format, ...)
__attribute__ ((format (printf, 6, 7)));
int log_init(const struct log_info *inf, void *talloc_ctx);
+int log_check_level(int subsys, unsigned int level);
/* context management */
void log_reset_context(void);
diff --git a/src/logging.c b/src/logging.c
index 876964a..c7b1999 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -865,4 +865,43 @@ int log_init(const struct log_info *inf, void *ctx)
return 0;
}
+/*! \brief Check whether a log entry will be generated.
+ * \returns != 0 if a log entry might get generated by at least one target */
+int log_check_level(int subsys, unsigned int level)
+{
+ struct log_target *tar;
+
+ if (subsys < 0)
+ subsys = subsys_lib2index(subsys);
+
+ if (subsys > osmo_log_info->num_cat)
+ subsys = DLGLOBAL;
+
+ /* TODO: The following could/should be cached (update on config) */
+
+ llist_for_each_entry(tar, &osmo_log_target_list, entry) {
+ struct log_category *category;
+
+ category = &tar->categories[subsys];
+ /* subsystem is not supposed to be logged */
+ if (!category->enabled)
+ continue;
+
+ /* Check the global log level */
+ if (tar->loglevel != 0 && level < tar->loglevel)
+ continue;
+
+ /* Check the category log level */
+ if (tar->loglevel == 0 && category->loglevel != 0 &&
+ level < category->loglevel)
+ continue;
+
+ /* This might get logged (ignoring filters) */
+ return 1;
+ }
+
+ /* We are sure, that this will not be logged. */
+ return 0;
+}
+
/*! @} */
--
1.9.1
Hi,
here are some patches that I produced while compiling some osmocom
projects and its dependencies on a new box.
Most of them are trivialities that prevent compiler warnings.
The patch for openbsc though fixes a bug that prevents the build when
libgtp from openggsn is not present on the system.
Kind regards,
-Alex
Hi,
I like code-review around mailinglists (mostly everybody can read and learn from
comments or code), it shows that people collaborate and that we move forward.
What I don't like about the current workflow is that we need to manually close things
in patchwork after applying/rejecting/ignoring a patch and that to see if it compiles and
works are done after the review and by the person that applies the changes.
In other projects I have used Gerrit and besides it being a Java monster found it
quite okay to use. One strength is that one can directly push the changes for a branch
for review, the other is that Jenkins and Gerrit can collaborate. This means that after
a commit is pushed make, make check, make distcheck can be executed. Comments
will always be attached to a line and not be lost due me quoting and removing parts
of the mail.
What I am not sure about:
* How do the email notifications look like? E.g. do we just get a "Somebody has
commented" mail or do we get diff + comment sent here? In OpenOCD I see there
is an email with the diff[1] but no mail with the comments.
* Shall we support direct pushes? I think specially in the beginning we should but
the branch name for that would change.
* A change that impacts libopenbsc+OpenBSC is difficult to represent. It would break
"the" build but I don't see any other way.
Is there enough consensus to give it a try?
holger
[1] http://sourceforge.net/p/openocd/mailman/message/34646766/
Hi list,
after a code review session between Holger and me, I've now merged the
gtphub branch to master, completely. You can't miss the endless sequence
of commits that have just come in on master.
This is not to say that the code is glorified beyond doubt.
Please do review, if you can spare the time.
Thanks,
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Holger Freyther, Harald Welte
These functions originate from openbsc/src/gprs but are generic
msgb helper functions.
msgb_copy: This function allocates a new msgb, copies the data
buffer of msg, and adjusts the pointers (incl. l1h-l4h)
accordingly.
msgb_resize_area:
This resizes a sub area of the msgb data and adjusts the
pointers (incl. l1h-l4h) accordingly.
Sponsored-by: On-Waves ehf
---
include/osmocom/core/msgb.h | 3 ++
src/msgb.c | 88 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 91 insertions(+)
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 644a639..21e363a 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -74,6 +74,9 @@ extern struct msgb *msgb_dequeue(struct llist_head *queue);
extern void msgb_reset(struct msgb *m);
uint16_t msgb_length(const struct msgb *msg);
extern const char *msgb_hexdump(const struct msgb *msg);
+extern int msgb_resize_area(struct msgb *msg, uint8_t *area,
+ size_t old_size, size_t new_size);
+extern struct msgb *msgb_copy(const struct msgb *msg, const char *name);
#ifdef MSGB_DEBUG
#include <osmocom/core/panic.h>
diff --git a/src/msgb.c b/src/msgb.c
index b2fe1d2..a257479 100644
--- a/src/msgb.c
+++ b/src/msgb.c
@@ -153,6 +153,94 @@ void msgb_set_talloc_ctx(void *ctx)
tall_msgb_ctx = ctx;
}
+/*! \brief Copy an msgb.
+ *
+ * This function allocates a new msgb, copies the data buffer of msg,
+ * and adjusts the pointers (incl l1h-l4h) accordingly. The cb part
+ * is not copied.
+ * \param[in] msg The old msgb object
+ * \param[in] name Human-readable name to be associated with msgb
+ */
+struct msgb *msgb_copy(const struct msgb *msg, const char *name)
+{
+ struct msgb *new_msg;
+
+ new_msg = msgb_alloc(msg->data_len, name);
+ if (!new_msg)
+ return NULL;
+
+ /* copy data */
+ memcpy(new_msg->_data, msg->_data, new_msg->data_len);
+
+ /* copy header */
+ new_msg->len = msg->len;
+ new_msg->data += msg->data - msg->_data;
+ new_msg->head += msg->head - msg->_data;
+ new_msg->tail += msg->tail - msg->_data;
+
+ if (msg->l1h)
+ new_msg->l1h = new_msg->_data + (msg->l1h - msg->_data);
+ if (msg->l2h)
+ new_msg->l2h = new_msg->_data + (msg->l2h - msg->_data);
+ if (msg->l3h)
+ new_msg->l3h = new_msg->_data + (msg->l3h - msg->_data);
+ if (msg->l4h)
+ new_msg->l4h = new_msg->_data + (msg->l4h - msg->_data);
+
+ return new_msg;
+}
+
+/*! \brief Resize an area within an msgb
+ *
+ * This resizes a sub area of the msgb data and adjusts the pointers (incl
+ * l1h-l4h) accordingly. The cb part is not updated. If the area is extended,
+ * the contents of the extension is undefined. The complete sub area must be a
+ * part of [data,tail].
+ *
+ * \param[inout] msg The msgb object
+ * \param[in] area A pointer to the sub-area
+ * \param[in] old_size The old size of the sub-area
+ * \param[in] new_size The new size of the sub-area
+ * \returns 0 on success, -1 if there is not enough space to extend the area
+ */
+int msgb_resize_area(struct msgb *msg, uint8_t *area,
+ size_t old_size, size_t new_size)
+{
+ int rc;
+ uint8_t *rest = area + old_size;
+ int rest_len = msg->len - old_size - (area - msg->data);
+ int delta_size = (int)new_size - (int)old_size;
+
+ if (area < msg->data || rest > msg->tail)
+ MSGB_ABORT(msg, "Sub area is not fully contained in the msg data\n");
+
+ if (delta_size == 0)
+ return 0;
+
+ if (delta_size > 0) {
+ rc = msgb_trim(msg, msg->len + delta_size);
+ if (rc < 0)
+ return rc;
+ }
+
+ memmove(area + new_size, area + old_size, rest_len);
+
+ if (msg->l1h >= rest)
+ msg->l1h += delta_size;
+ if (msg->l2h >= rest)
+ msg->l2h += delta_size;
+ if (msg->l3h >= rest)
+ msg->l3h += delta_size;
+ if (msg->l4h >= rest)
+ msg->l4h += delta_size;
+
+ if (delta_size < 0)
+ msgb_trim(msg, msg->len + delta_size);
+
+ return 0;
+}
+
+
/*! \brief Return a (static) buffer containing a hexdump of the msg
* \param[in] msg message buffer
* \returns a pointer to a static char array
--
1.9.1
Hi all,
libosmocore can't be installed with GNU Radio's pybombs currently. The
reason is that libosmocore requires libtalloc which isn't installed
automatically by pybombs. Manually the problem can be solved by
installing libtalloc-dev package. It would be good to fix the pybombs
recipe however. I would do this simply by adding libtalloc-dev to
dependencies but I don't know if this is proper solution from your point
of view.
Can you (libosmocore developers) fix the recipe or tell me how to fix it
appropriately?
Best Regards,
Piotr Krysik
Hi,
I have a problem with my sysmoBTS.I restored the system using a
sysmocom-recovery.ubi and executing a sysmocom-restore from a backup file
.tar. Everything was apparently ok but the RF Active led is switched off,
without transmision, and the state of the BTS is not normal.
First of all with a serial conexion I received this message:
fpgadl: Error: INIT_B LOW during programming
and checking the state I get the parameters:
OpenBSC> show bts 0
BTS 0 is of nanobts type in band DCS1800, has CI 0 LAC 1, BSIC 63, TSC 7
and 1 TRX
Description: (null)
MS Max power: 15 dBm
Minimum Rx Level for Access: -110 dBm
Cell Reselection Hysteresis: 4 dBm
RACH TX-Integer: 9
RACH Max transmissions: 7
Channel Description Attachment: yes
Channel Description BS-PA-MFRMS: 5
Channel Description BS-AG_BLKS-RES: 1
System Information present: 0x00000000, static: 0x00000000
Unit ID: 1801/0/0, OML Stream ID 0xff
NM State: Oper 'NULL', Admin 'unknown 0x0', Avail 'Power off'
Site Mgr NM State: Oper 'NULL', Admin 'unknown 0x0', Avail 'Power off'
GPRS NSE: Oper 'NULL', Admin 'unknown 0x0', Avail 'Power off'
GPRS CELL: Oper 'NULL', Admin 'unknown 0x0', Avail 'Power off'
GPRS NSVC0: Oper 'NULL', Admin 'unknown 0x0', Avail 'Power off'
GPRS NSVC1: Oper 'NULL', Admin 'unknown 0x0', Avail 'Power off'
Paging: 0 pending requests, 20 free slots
OML Link state: disconnected.
Current Channel Load:
OpenBSC>
OpenBSC> show trx 0 0
TRX 0 of BTS 0 is on ARFCN 514
Description: (null)
RF Nominal Power: 23 dBm, reduced by 20 dB, resulting BS power: 3 dBm
NM State: Oper 'NULL', Admin 'Unlocked', Avail 'Power off'
Baseband Transceiver NM State: Oper 'NULL', Admin 'unknown 0x0', Avail
'Power off'
ip.access stream ID: 0x00
OpenBSC>
I would be very grateful for some idea for recovering the states to 'Enable'
Thanks so much.
Diego.
Hi,
it would be great to do some PCU testing at the congress.
Branch: jerlbeck/master
PCU Configuration: example config
NITB/BSC Configuration: At least 2 adjacent PDCH
Interesting VTY commands
- show tbf all
- show ms all
- show ms imsi SOME_IMSI
Other things to look at:
- PCU load (CPU)
Please keep me informed on how it works. I'll be able to investigate or
fix things on Mon and Tue (and maybe on Sun).
Thanks and have fun
Jacob
--
- Jacob Erlbeck <jerlbeck(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte
Dear list,
As of today, I revised and updated the Wiki page for Ettus SDRs.
https://openbsc.osmocom.org/trac/wiki/Ettus_USRP_B2xx_family
What is tested:
- Voice calls (MO and MT with full rate)
- Interconnect with Asterisk (voice call routing and interconnecting GSM calls to SIP or other telephony technologies)
- SMS (MO and MT)
- GPRS
What needs to be tested:
- Voice calls with half rate and AMR
If someone can go through it and revise it, that would be nice.
Regards,
Csaba
Dear Jacob,
Today I started to update my setup to latest master for all the Osmocom projects and hit a compile error with Osmo-PCU:
root@D6420:~/newer_osmocom/osmo-pcu# make
Making all in src
make[1]: Entering directory `/root/newer_osmocom/osmo-pcu/src'
CXX gprs_debug.lo
CXX csn1.lo
CXX gsm_rlcmac.lo
CXX gprs_bssgp_pcu.lo
In file included from /usr/local/include/osmocom/gsm/prim.h:3:0,
from /usr/local/include/osmocom/gprs/gprs_bssgp.h:8,
from ./gprs_bssgp_pcu.h:32,
from gprs_bssgp_pcu.cpp:22:
/usr/local/include/osmocom/core/prim.h:23:27: error: uninitialized const 'osmo_prim_op_names' [-fpermissive]
const struct value_string osmo_prim_op_names[5];
^
In file included from /usr/local/include/osmocom/core/msgb.h:24:0,
from /usr/local/include/osmocom/gprs/gprs_ns.h:8,
from ./gprs_bssgp_pcu.h:31,
from gprs_bssgp_pcu.cpp:22:
/usr/local/include/osmocom/core/utils.h:22:8: note: 'const struct value_string' has no user-provided default constructor
struct value_string {
^
/usr/local/include/osmocom/core/utils.h:23:15: note: and the implicitly-defined constructor does not initialize 'unsigned int value_string::value'
unsigned int value; /*!< \brief numeric value */
^
make[1]: *** [gprs_bssgp_pcu.lo] Error 1
make[1]: Leaving directory `/root/newer_osmocom/osmo-pcu/src'
make: *** [all-recursive] Error 1
I can see that you moving some parts from openbsc to the core library, probably that process is not yet finsihed (or merged to master) and that is causing this problem.
Just wanted to give some feedback and notify the list about this.
Regards,
Csaba
Commit 86ec3118 ("msgb: Let msgb_hexdump be more tolerant") added new format
warnings to my 64bit build of libosmocore.
It's not a pressing matter, really, but the libosmocore build is otherwise
clean of such warnings so it'd be nice to keep it that way.
This patch fixes the warnings by using PRIdPTR. That seems to be the Correct
Way to fix it, but I'm a bit unsure.
Thanks for any thoughts!
Neels Hofmeyr (1):
Fix some recently added formats on 64bit
src/msgb.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--
2.1.4
Hi.
This patch is for osmo-iuh.
Without it the build only works on machines that have the needed headers in
the default search path for includes.
Otherwise the build fails like this:
> gcc -DPACKAGE_NAME=\"osmo-iuh\" -DPACKAGE_TARNAME=\"osmo-iuh\" -DPACKAGE_VERSION=\"0.0\" -DPACKAGE_STRING=\"osmo-iuh\ 0.0\" -DPACKAGE_BUGREPORT=\"\ openbsc(a)lists.osmocom.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"osmo-iuh\" -DVERSION=\"0.0\" -DSTDC_HEADERS=1 -I. -I/home/blackbit/usr/stow/libasn1c/include/ -I/home/blackbit/usr/stow/libasn1c/include/asn1c -I. -g -O2 -MT Criticality.o -MD -MP -MF $depbase.Tpo -c -o Criticality.o Criticality.c &&\
> mv -f $depbase.Tpo $depbase.Po
> In file included from Criticality.h:50:0,
> from Criticality.c:8:
> /home/blackbit/usr/stow/libasn1c/include/asn1c/asn_internal.h:18:33: fatal error: osmocom/core/talloc.h: No such file or directory
> compilation terminated.
Kind regards,
-Alex
Hi,
I have followed the steps as in Multi-BTS with Osmocom and a single UmTRX
<http://umtrx.org/multi-bts-with-osmocom-and-a-single-umtrx/> but I wasn't
able to get the right results. I was able to get both TX transmitting the
broadcast channel but when I try to connect my phone, only BTS0 works fine.
When I try to change the BTS unit_id, I noticed that only the BTS having
the lower unit_id would work while the other one only transmits broadcast
signals (ex: unit_id 1801 works if I have 1801 and 1802).
Any ideas what could be the problem ?
Thank you,
<http://umtrx.org/multi-bts-with-osmocom-and-a-single-umtrx/>
FYI: Last night I
a) merged the SCTP support for libosmo-netif to master
b) moved the sua code from osmo-iuh into the libosmo-sccp repository,
where we now build a shared libosmo-sigtran.so, which will be linked by
the MSC, SGSN and HNB-GW code for the IuCS/IuPS interface.
Unlike the spec demands, we will not use SCCP in M3UA in SCTP here, but
will use SUA in SCTP as a simplification.
Furthermore, the SUA code in libosmo-sigtran does not yet
a) fully implement all the correct state machine transitions and
inactivity timers (this is to be done)
b) implement the ASP management state machines
This is done as a short-cut as we initially only want to communicate
between our own network elements. What's important is that we can use
wireshark for decoding the protocol stacking that we use, and that the
SCCP USER SAP is specified in a way that will enable us to put SCCP+M3UA
or other sigtran dialects underneath the RANAP code in the future, as
needed.
Regards,
Harald
--
- Harald Welte <hwelte(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte
Hi,
so in osmo-iuh, we're using the libre asn1c, the generated sources found
in e.g. src/hnbap/. But I do find the dirs:
./asn1/rua/ffasn1c
./asn1/ranap/ffasn1c
./asn1/hnbap/ffasn1c
that kind of look like we were using the ffasn1c compiler.
Those are obsolete, right? Remove?
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Holger Freyther, Harald Welte
This series imports Pablo Neira Ayuso original gtp-kernel support patch
unmodified to master and applies some fixes ontop of it.
The last patch in the series then add network namespace support to it.
This state is in sync with gtp-kernel patch I posted a few minutes ago.
Andreas
--
Andreas Schultz (3):
ggsn: update gpt-kernel logging to libosmocore
ggsn: fix autotool pkg-config invokation
ggsn: add network namespace support
Pablo Neira Ayuso (1):
ggsn: add support for GTP kernel data encapsulation
configure.ac | 15 ++++
ggsn/Makefile.am | 11 ++-
ggsn/cmdline.c | 48 +++++++++-
ggsn/cmdline.ggo | 4 +
ggsn/cmdline.h | 8 ++
ggsn/ggsn.c | 52 ++++++++++-
ggsn/gtp-kernel.c | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
ggsn/gtp-kernel.h | 53 +++++++++++
lib/Makefile.am | 4 +-
lib/netns.c | 135 ++++++++++++++++++++++++++++
lib/netns.h | 26 ++++++
11 files changed, 607 insertions(+), 7 deletions(-)
create mode 100644 ggsn/gtp-kernel.c
create mode 100644 ggsn/gtp-kernel.h
create mode 100644 lib/netns.c
create mode 100644 lib/netns.h
--
2.5.0
On Thu Nov 5 09:05:15 UTC 2015, Harald Welte wrote:
>> RuntimeError: SW match failed ! Expected 9000 and got 6a86.
> According to ISO 7816-4, this 6a86 means 'incorrect P1 or P2
> parameter'.
>> At this point I don't have any more ideas what to try, if anyone would
>> have any suggestions I would apreciate it.
> Please activate (or hack some code for) tracing the actual APDUs that
> pySim excahnges with the card. IIRC, pySim already has that option.
> Once you see the raw APDUs, you can compare their encoding
> (particularly
> P1/P2) with those described in the relevant ETSI/3GPP (U)SIM
> specifications.
I enhanced my local copy of pySim (zecke/tmp) to show the raw PDUs.
And I added a method to check the Status of the PIN and ADM register.
On one card I messed up the ADM, so pySim-prog.py shows
whey query for SIM 1:
> send_apdu_raw -> 00200001
< received status word 63c3
So that is SW1='63' with SW2='CX': Counter (verification failed: 'X'
indicates the number of further allowed retries
Which means I have three more attempts for the PIN1, but
> send_apdu_raw -> 0020000A
< received status word 63c0
Ahhrg, I do not have any additional attempt to verify the ADM-Key.
Trying to verify ADM results in
> send_apdu_raw -> 0020000A083132333435363738
< received status word 6983
an ugly SW1='69' with SW2='83': Authentication method blocked.
So I can no longer verify the ADM-Key on that card.
--> Is there any way to unblock the card?
On the second card I was able to successfully verify the ADM and change
the IMSI...
Cheers,
Flo
By the example of osmo-sgsn, package osmo-gtphub for debian.
Sponsored-by: On-Waves ehi
---
debian/control | 14 +++
debian/osmocom-gtphub.default | 2 +
debian/osmocom-gtphub.examples | 1 +
debian/osmocom-gtphub.init | 150 +++++++++++++++++++++++
debian/osmocom-gtphub.install | 1 +
debian/rules | 1 +
openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg | 23 ++++
7 files changed, 192 insertions(+)
create mode 100644 debian/osmocom-gtphub.default
create mode 100644 debian/osmocom-gtphub.examples
create mode 100755 debian/osmocom-gtphub.init
create mode 100644 debian/osmocom-gtphub.install
create mode 100644 openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg
diff --git a/debian/control b/debian/control
index 2447d29..53b6908 100644
--- a/debian/control
+++ b/debian/control
@@ -50,6 +50,12 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Osmocom Base Station Controller Network Address Translation
Network address translation for BSC.
+Package: osmocom-gtphub
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Osmocom GTP hub
+ Proxy for comms between SGSN and GGSN.
+
Package: osmocom-bsc-dbg
Architecture: any
Section: debug
@@ -105,3 +111,11 @@ Priority: extra
Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends}
Description: Debug symbols for the OpenBSC Network Address Translation
Make debugging possible
+
+Package: osmocom-gtphub-dbg
+Architecture: any
+Section: debug
+Priority: extra
+Depends: osmocom-gtphub (= ${binary:Version}), ${misc:Depends}
+Description: Debug symbols for Osmocom GTP hub
+ Make debugging possible
diff --git a/debian/osmocom-gtphub.default b/debian/osmocom-gtphub.default
new file mode 100644
index 0000000..6af82da
--- /dev/null
+++ b/debian/osmocom-gtphub.default
@@ -0,0 +1,2 @@
+CONFIG_FILE="/etc/osmocom/osmo-gtphub.cfg"
+
diff --git a/debian/osmocom-gtphub.examples b/debian/osmocom-gtphub.examples
new file mode 100644
index 0000000..48c2dc0
--- /dev/null
+++ b/debian/osmocom-gtphub.examples
@@ -0,0 +1 @@
+openbsc/doc/examples/osmo-gtphub
diff --git a/debian/osmocom-gtphub.init b/debian/osmocom-gtphub.init
new file mode 100755
index 0000000..4dc67b3
--- /dev/null
+++ b/debian/osmocom-gtphub.init
@@ -0,0 +1,150 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: osmo-gtphub
+# Required-Start: $network $local_fs
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Osmocom GTP hub
+# Description: Osmocom GTP hub
+### END INIT INFO
+
+# Author: Neels Hofmeyr <nhofmeyr(a)sysmocom.de>
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+NAME=osmo-gtphub # Introduce the short server's name here
+DESC="Osmocom GTP hub" # Introduce a short description here
+DAEMON=/usr/bin/osmo-gtphub # Introduce the server's location here
+SCRIPTNAME=/etc/init.d/osmocom-gtphub
+
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/osmocom-gtphub ] && . /etc/default/osmocom-gtphub
+
+# 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="$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
+
+:
diff --git a/debian/osmocom-gtphub.install b/debian/osmocom-gtphub.install
new file mode 100644
index 0000000..908c1a5
--- /dev/null
+++ b/debian/osmocom-gtphub.install
@@ -0,0 +1 @@
+/usr/bin/osmo-gtphub
diff --git a/debian/rules b/debian/rules
index 8047b79..62518d9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -34,6 +34,7 @@ override_dh_strip:
dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg
dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg
dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg
+ dh_strip -posmocom-gtphub --dbg-package=osmocom-gtphub-dbg
override_dh_auto_configure:
echo $(VERSION) > openbsc/.tarball-version
diff --git a/openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg
new file mode 100644
index 0000000..c9bb4cf
--- /dev/null
+++ b/openbsc/doc/examples/osmo-gtphub/osmo-gtphub.cfg
@@ -0,0 +1,23 @@
+!
+! Osmocom gtphub configuration
+!
+
+line vty
+ no login
+
+gtphub
+ ! Local addresses to listen on and send from, each on standard ports
+ ! 2123 and 2152. Setting these addresses is mandatory.
+ bind-to-sgsns 127.0.0.1
+ bind-to-ggsns 127.0.0.2
+
+ ! Local nonstandard ports or separate IPs:
+ !bind-to-sgsns ctrl 127.0.0.1 2342 user 127.0.0.1 4223
+
+ ! Proxy: unconditionally direct all traffic to...
+ !ggsn-proxy 127.0.0.3
+ !sgsn-proxy 127.0.0.4
+
+ ! Proxy with nonstandard ports or separate IPs:
+ !ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152
+
--
2.1.4
Hi all,
I've been working on a small python tool that can be used to attach to
the MNCC interface of OsmoNITB. It implements the 04.08 CC state
machine with our MNCC primitives, including support for RTP bridge mode
of the voice streams.
The immediate first use case for this was to be able to automatically,
reproducibly and quickly generate MT calls to a set of known MSISDNs and
load all 14 TCH/H channels of a single-TRX BTS. It will connect the MT
calls in pairs, so you end up with 7 MS-to-MS calls. Other use cases
are expected to be added shortly.
The first working version of the tool is available from
http://git.osmocom.org/mncc-python/
or
git clone git://git.osmocom.org/mncc-python
The code is pretty hacky in some places. That's partially due to the
fact that I'm much more familiar in the C, Perl and Erlang world than in
python. Still I thought it's a good idea to do it in python to enable
more people to use/edit/contribute to it.
I'm happy for review / cleanup suggestion by people with more Python-foo
than I have.
Architecturally, I decided to do things a bit erlang-like, where we have
finite state machines in an actor models, and message passing between
the actors. This is what happens with the GsmCallFsm()'s, which are
created by the GsmCallConnector() representing both legs of a call and
the MnccActor() that wraps the MNCC socket towards OsmoNITB.
The actual encoding/decodng of MNCC messages is auto-generated from the
mncc header file #defines, enums and c-structures by means of ctypes
code generation.
mncc_test.py currently drops you into a python shell where you can e.g.
start more / new calls by calling functions like
connect_call("7839", "3802")
from that shell. Exiting the shell by quit() or Ctrl+C will terminate
all call FSMs and terminate.
--
- Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
Dear Alexander,
I started to write the Wiki page for Meas_web.
During this I just realized that because of some outstanding merges the installation of this tool is painfully complicated.
In order to make things easier, I suggest to merge the meas_json part into OpenBSC master:
http://cgit.osmocom.org/openbsc/log/?h=achemeris/meas_json
Regards,
Csaba
>> +#ifndef OSMO_IS_LITTLE_ENDIAN
>> + #define OSMO_IS_LITTLE_ENDIAN 0
>> +#endif
>
> I am surprised by this hunk. Our endian.h should define both macros. I think I used
> the vim search to search for a typo in one of the branches (BSD vs. Linux, LE vs. BE)
> but it looks good. Do you remember why this was needed?
It isn't needed. It was just added out of habit to make sure it is defined when
it is being checked further down.
You can remove it, it won't make any difference.
Ruben
Hello, Harald, thanks for the answer.
first of all, CalypsoBTS is not an active / maintained / stable solution
> but more lik an (mindbogglingly amazing!) Hack.
Yes, I know that CalypsoBTS is not stable solution. But currently I am a
student and I have no so much money to buy anything more powerful.
Furthermore, I am interested in this for research purposes only, not for
creating public land mobile networks.
As you are the first person to report using the code to this list for
> quite some time, it would be great if you had some time to re-base, test
> and submit it.
As I previously said, I also tested master branches. Here are the results:
* When I start OsmoBTS I often see this message in OpenBSC log: "Lost some
E1 TEI link: X X" from bsc_init.c. In this case my MS can not connect to
the test network and I have to restart OsmoBTS until this message will no
hide.
* When the Location Update process I always see this error:
"input/ipaccess.c:277 Bad signalling message,sign_link returned error". But
a phone successfully registers in the network.
* SMS, USSD and Silent SMS works fine.
* When TS1 assigned TCH/H I can call to another ms or LCR. DTMF works.
* When TS1 assigned TCH/F I can use FR codec and call to LCR.
* PDCH does not work on this BTS.
* RRLP works.
* ISMI detach works but as in case of Location Update I see "Bad signalling
message..." error.
* It seems, the network works more stable when battery capacity is 100% and
backlight is disabled.
If I understood correctly, osmobts-trx was just moved from obsolete
repository to the master. Now I am reading the source code and trying to
fix this bugs.
I have one thing in my mind for a long time. Is it possible to serve a PDCH
lchan on TS1 instead of TCH (in case of this "powerful" BTS)? I have tested
OsmoSGSN+OpenGGSN with one PDCH channel on TS1, but it did not work.
With best regards,
Яницкий Вадим.
2015-12-06 18:14 GMT+06:00 Harald Welte <laforge(a)gnumonks.org>:
> Hi Vadim,
>>
>> first of all, CalypsoBTS is not an active / maintained / stable solution
>> but more lik an (mindbogglingly amazing!) Hack.
>>
>> On Sat, Dec 05, 2015 at 06:32:45PM +0600, Вадим Яницкий wrote:
>> > When I use jolly/multi-trx branch of libosmo-abis, jolly/testing branch
>> of
>> > OpenBSC and jolly/trx branch of OsmoBTS my network works very unstable.
>>
>> I'm sorry to say that none of the branches you refer to are maintained
>> by anyone at this point. It would be great if somebody interested in
>> that code (i.e. using it) could forward-port it onto current master.
>> Now tat l1sap and osmo-bts-trx is in osmo-bts master, this should be
>> relatively straight forward.
>>
>> It's really sad for us to see that people are continuing to use
>> old/outdated non-master, rather than rebasing + submitting their changes
>> for inclusion. It always makes me tempte to remove some of those
>> branches from the repo, ort at least rename them to something like
>> 'outdated'.
>>
>> As you are the first person to report using the code to this list for
>> quite some time, it would be great if you had some time to re-base, test
>> and submit it.
>>
>> --
>> - Harald Welte <laforge(a)gnumonks.org>
>> http://laforge.gnumonks.org/
>>
>> ============================================================================
>> "Privacy in residential applications is a desirable marketing option."
>> (ETSI EN 300 175-7 Ch.
>> A6)
>>
>
>
Hi,
While building the package for Debian, apparently there is a problem
related to big-endian architectures.
Please see the logs here:
https://buildd.debian.org/status/fetch.php?pkg=libosmocore&arch=powerpc&ver…
and
https://buildd.debian.org/status/package.php?p=libosmocore
It is related to the test case for smscb and the struct gsm341_ms_message:
+++ /«PKGBUILDDIR»/tests/testsuite.dir/at-groups/7/stdout 2015-12-05
15:51:53.463182812 +0000
@@ -1,4 +1,4 @@
-(srl) GS: 1 MSG_CODE: 1 UPDATE: 0
+(srl) GS: 0 MSG_CODE: 256 UPDATE: 1
(msg) msg_id: 1293
-(dcs) group: 1 language: 0
+(dcs) group: 0 language: 1
(pge) page total: 1 current: 1
7. testsuite.at:45: 7. smscb (testsuite.at:45): FAILED (testsuite.at:48)
Could you please suggest how we should fix this so that the package
also can build for powerpc and other big-endian architectures?
Thank you very much in advance.
Ruben
Hi all,
I've been doing some profiling on osmo-bts recently (on sysmobts
hardware, which has only a relatively slow ARM926 CPU core), and the two
things that show up most are:
* msgb_alloc() -> talloc_zero() -> malloc
this can be alleviated somewhat by using talloc pools. For some
reason the pools don't remove all of the malloc() calls.
* vfprintf() and friends, from logp() statements. The sad part is that
calls like gsm_lchan_name() are of course executed beefore the call
into logp(), at which point the vfprintf/sprintf/... for arguments has
already been executed, and only the last/final one hasn't happened
yet.
Here we can do two things: Calls like gsm_lchan_name() don't need to
happen all the time, as the lchan name is static and can be generated
once at the time gsm_lchan is created. I implemented that in osmo-bts
(and openbsc, as it's from gsm_data_shared).
The second idea would be to expand the LOGP() macro a bit in a way to
ensure the the checking whether the log line is enabled _before_ the
arguments (and thus associated function calls) are evaluated. Any
ideas on that?
After a brief look at osmo-pcu profiling, it looks like in the
attached picture. We cannot do much about the __copy_to_user_std,
do_select and core_sys_select, as those are kernel side.
However, there again we see vfprintf and friends, mostly via
gprs_rlcmac_tbf::name() - and of course the msgb_alloc() and msgb_free()
going through talloc and finally malloc.
So the same strategies as above could (and probably should) be applied
to osmo-pcu.
Regards,
Harald
--
- Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
Hi all!
This is the announcement for the re-incarnation of our bi-weekly
Osmocom Berlin Meeting.
Dec 09, 8pm @ CCC Berlin, Marienstr. 11, 10117 Berlin
There is no formal presentation this time, but
* there will be SIMtrace equipment in case somebody wants to play with
it there will be a sysmoBTS with OsmoBTS, OsmoPCU, OsmoNITB, OsmoSGSN
and OpenGGSN if somebody wants to play with it
* there will be Huawei Femtocells to play with
The meeting is open to anyone interested in mobile communications. You
do not have to be involved with the Osmocom projects in order to attend.
Anyone interested in mobile communications protocols is welcome.
If you are interested to show up, feel free to do so. The meeting is
"free as in free beer", despite no actual free beer being around ;)
More information can be found at
http://openbsc.osmocom.org/trac/wiki/OsmocomMeeting/Berlin
Regards,
Harald
--
- Harald Welte <laforge(a)gnumonks.org>
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
Hi list,
I'm merging the last commits from the neels/gtphub branch to master
(Holger agrees). I will direct my attention to other topics for the time
being -- we're waiting for a live testing setup.
ATM, I would see gtphub's maturity as "alpha": I believe it works as
intended, but all testing so far, even though done with real equipment,
was in a controlled test environment.
If anyone would like to give it a spin, we'd appreciate any feedback.
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Holger Freyther, Harald Welte
Dear list,
I just appear to have a strange UE behavior where the UE tries to Attach (both CS and PS), the Osmo-SGSN sends an Attach accept, but the UE never responds with an Attach complete, instead after 10 seconds it tries to re-attach.
I had an issue quite similar like this earlies where the UE requests for some IEs or the SGSN sends soething the UE don't like.
The point is, I would like to do protocol trace between the SGSN and the PCU, and I managed to see the traffic with Wireshark, but it was not able to dissect/recognise the protocols over the UDP layer.
Can someone please help me how to configure Wireshark to be able to dissect the involved protocols?
Thanks!
Csaba
Dear Neels,
Today just grabbed the latest OpenBSC master, and got this compile error:
Making all in gtphub
make[3]: Entering directory `/root/new_osmocom/openbsc/openbsc/tests/gtphub'
CC gtphub_test.o
CC ../../src/gprs/gtphub.o
../../src/gprs/gtphub.c:2191:1: fatal error: opening dependency file .deps/../../src/gprs/gtphub.Tpo: No such file or directory
}
^
compilation terminated.
make[3]: *** [../../src/gprs/gtphub.o] Error 1
make[3]: Leaving directory `/root/new_osmocom/openbsc/openbsc/tests/gtphub'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/new_osmocom/openbsc/openbsc/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/new_osmocom/openbsc/openbsc'
make: *** [all] Error 2
Do you have any idea why is this happening?
Regards,
Csaba