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
Hi, I am using OsmoSGSN in topology with OpenGGSN and proprietary simulator
of BSS. There was a problem with an implementation of Network service,
cause Network Service implementation in the simulator of BSS is based on
different release of 3GPP standard (3GPP TS 48. 016 v7. 4. 0
(2008-04)/Network service (Release 7))...and the problem is that in
IP-subnetwork, which I am using there is no use for RESET or UNBLOCK
procedure, so I had to do a PATCH in gprs_ns.c, which was needed to
complete succesful connection between sim-bss and OsmoSGSN:
switch (nsh->pdu_type) {
case NS_PDUT_ALIVE:
+++ LOGP(DNS, LOGL_INFO, "Rx NS ALIVE\n");
+++ /*mark NS-VC as alive*/
+++ (*nsvc)->state = NSE_S_ALIVE;
+++ (*nsvc)->remote_state = NSE_S_ALIVE;
+++ /*initiate TEST procedure: Send ALIVE_ACK and start timer*/
+++ rc = gprs_ns_tx_simple((*nsvc), NS_PDUT_ALIVE_ACK);
+++ nsvc_start_timer((*nsvc), NSVC_TIMER_TNS_TEST);
+++ break;
.
.
.
}
another PATCH I needed to do was to change a little bit procedure for
allocation of P-TMSI in procedure uint32_t sgsn_alloc_ptmsi(void) in
gprs_sgsn.c
uint32_t sgsn_alloc_ptmsi(void)
{
struct sgsn_mm_ctx *mm;
uint32_t ptmsi;
restart:
+++ ptmsi = rand() | 0xc0000000; /*because of GPRS IMSI
ATTACH*/
llist_for_each_entry(mm, &sgsn_mm_ctxts, list) {
if (mm->p_tmsi == ptmsi)
goto restart;
}
return ptmsi;
}
because in GPRS IMSI ATTACH in message ATTACH COMPLETE (3GPP 24.008,
23.003, 48.018) there is new TLLI==new allocated P-TMSI and I need local
TLLI, so I had to do it this way
regards Michal
Dear Andreas, Harald,
I don't really know much about the bit order of TRAU frames but
the trau_test.c is causing an out of bounds access to the gsm_fr_map.
Re-produce (GCC >= 3.8 or clang >= 3.2 required):
$ make clean && make CFLAGS+="-ggdb3 -Og -fsanitize=address"
$ cd tests/trau
$ ./trau_test
Issue:
Breakpoint 1, 0xb69e7810 in __asan_report_error () from /usr/lib/i386-linux-gnu/libasan.so.0
(gdb) bt
#0 0xb69e7810 in __asan_report_error () from /usr/lib/i386-linux-gnu/libasan.so.0
#1 0xb69e08cf in __asan_report_load1 () from /usr/lib/i386-linux-gnu/libasan.so.0
#2 0x0804c4e7 in trau_encode_fr (tf=tf@entry=0xbffff530,
data=data@entry=0xbffff700 <incomplete sequence \320>) at trau_mux.c:441
#3 0x08048e06 in test_trau_fr_efr (data=<optimized out>,
data@entry=0xbffff700 <incomplete sequence \320>) at trau_test.c:35
#4 0x080494bf in main () at trau_test.c:70
(gdb) frame2
Undefined command: "frame2". Try "help".
(gdb) frame 2
#2 0x0804c4e7 in trau_encode_fr (tf=tf@entry=0xbffff530,
data=data@entry=0xbffff700 <incomplete sequence \320>) at trau_mux.c:441
441 k = gsm_fr_map[++l]-1;
(gdb) p l
$1 = 76
(gdb) p l
$2 = 76
(gdb) p sizeof(gsm_fr_map)
$3 = 76
Please fix as soon as possible as I would like to enable ASAN checking on
the jenkins as soon as possible.
kind regards
holger
Hello,
if the network iniates a data transfer it will page the MS to open a TBF and
since this paging happens over the CCCH it can only ask the MS to use one PDCH
initially.
With this patch (and if there are more PDCH ts available) the PCU will
remember that it can upgrade to use multiple timeslots and send a downlink
assignment with the new timeslot allocation over the TBF.
Regards,
Daniel
--
- Daniel Willmann <dwillmann(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Schivelbeiner Str. 5
* 10439 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte
From: Holger Hans Peter Freyther <holger(a)moiji-mobile.com>
Looking at the code it seemed possible that a channel would
transition from BROKEN to NONE. Or worse from NONE to BROKEN.
Start the timer _after_ the channel has been released.
---
openbsc/src/libbsc/abis_rsl.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 5d40794..984fa7e 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -52,6 +52,7 @@ enum sacch_deact {
};
static int rsl_send_imm_assignment(struct gsm_lchan *lchan);
+static void error_timeout_cb(void *data);
static void send_lchan_signal(int sig_no, struct gsm_lchan *lchan,
struct gsm_meas_rep *resp)
@@ -64,9 +65,15 @@ static void send_lchan_signal(int sig_no, struct gsm_lchan *lchan,
static void do_lchan_free(struct gsm_lchan *lchan)
{
- /* we have an error timer pending to release that */
- if (lchan->state != LCHAN_S_REL_ERR)
+ /* We start the error timer to make the channel available again */
+ if (lchan->state == LCHAN_S_REL_ERR) {
+ lchan->error_timer.data = lchan;
+ lchan->error_timer.cb = error_timeout_cb;
+ osmo_timer_schedule(&lchan->error_timer,
+ lchan->ts->trx->bts->network->T3111 + 2, 0);
+ } else {
rsl_lchan_set_state(lchan, LCHAN_S_NONE);
+ }
lchan_free(lchan);
}
@@ -679,8 +686,6 @@ static int rsl_rf_chan_release(struct gsm_lchan *lchan, int error,
DEBUGP(DRSL, "%s RF Channel Release CMD due error %d\n", gsm_lchan_name(lchan), error);
if (error) {
- struct e1inp_sign_link *sign_link = msg->dst;
-
/*
* FIXME: GSM 04.08 gives us two options for the abnormal
* chanel release. This can be either like in the non-existent
@@ -708,10 +713,6 @@ static int rsl_rf_chan_release(struct gsm_lchan *lchan, int error,
* TODO: start T3109 now.
*/
rsl_lchan_set_state(lchan, LCHAN_S_REL_ERR);
- lchan->error_timer.data = lchan;
- lchan->error_timer.cb = error_timeout_cb;
- osmo_timer_schedule(&lchan->error_timer,
- sign_link->trx->bts->network->T3111 + 2, 0);
}
/* Start another timer or assume the BTS sends a ACK/NACK? */
--
1.9.1
Hello,
I updated my OpenBSC repo today and found that the GPRS is not working
properly with the newest osmo-nitb.
I tried several different versions of osmo-nitb and osmo-sgsn to localize
the problem and concluded that osmo-nitb is causing the issue.
The phone can attach to GPRS and PDP context request is accepted, but the
phone still cannot send or receive data.
<000f> sgsn_libgtp.c:126 Create PDP Context
<000f> sgsn_libgtp.c:379 libgtp cb_conf(type=16, cause=128, pdp=0xb733cea0,
cbp=0x8839230)
<000f> sgsn_libgtp.c:265 Received CREATE PDP CTX CONF, cause=128(Request
accepted)
<0013> gprs_sndcp.c:297 SNSM-ACTIVATE.ind (lle=0x8838568 TLLI=d527d1cf,
SAPI=3, NSAPI=5)
<0011> gprs_bssgp.c:503 BSSGP BVCI=0 TLLI=d527d1cf Rx LLC DISCARDED
<0011> gprs_bssgp.c:376 BSSGP TLLI=0xd527d1cf Rx UPLINK-UNITDATA
<0012> gprs_llc.c:551 LLC SAPI=1 C FCS=0xd9c320CMD=UI DATA
<0011> gprs_bssgp.c:503 BSSGP BVCI=0 TLLI=d527d1cf Rx LLC DISCARDED
<0011> gprs_bssgp.c:376 BSSGP TLLI=0xd527d1cf Rx UPLINK-UNITDATA
<0012> gprs_llc.c:551 LLC SAPI=1 C FCS=0x26346bCMD=UI DATA
<0011> gprs_bssgp.c:503 BSSGP BVCI=0 TLLI=d527d1cf Rx LLC DISCARDED
<0011> gprs_bssgp.c:376 BSSGP TLLI=0xd527d1cf Rx UPLINK-UNITDATA
<0012> gprs_llc.c:551 LLC SAPI=1 C FCS=0x4a642eCMD=UI DATA
Please let me know if you need more logs or packet dump.
I will be reverting to older revisions to find out when exactly it got
broken
Regards,
Pierre
From: Holger Hans Peter Freyther <holger(a)moiji-mobile.com>
The code would have used an uninitialized current_time in case
"now" was not NULL. As now is const and timersub expects a non
const parameter I decided to copy now into current_time.
Fixes: CID #1040661
---
src/timer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/timer.c b/src/timer.c
index 5988aef..c8376c8 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -141,10 +141,10 @@ int osmo_timer_remaining(const struct osmo_timer_list *timer,
{
struct timeval current_time;
- if (!now) {
+ if (!now)
gettimeofday(¤t_time, NULL);
- now = ¤t_time;
- }
+ else
+ current_time = *now;
timersub(&timer->timeout, ¤t_time, remaining);
--
1.9.1
In rtcp_sdes_cname_mangle when skipping over additional zeroes at the
end of a chunk we should not read past the actual message (rtcp_end).
Fixes CID #1206579
---
openbsc/src/libtrau/rtp_proxy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c
index 122daf2..1567323 100644
--- a/openbsc/src/libtrau/rtp_proxy.c
+++ b/openbsc/src/libtrau/rtp_proxy.c
@@ -374,7 +374,7 @@ static int rtcp_sdes_cname_mangle(struct msgb *msg, struct rtcp_hdr *rh,
tag = *cur++;
if (tag == 0) {
/* end of chunk, skip additional zero */
- while (*cur++ == 0) { }
+ while ((*cur++ == 0) && (cur < rtcp_end)) { }
break;
}
len = *cur++;
--
1.8.4.2