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 is the first patch of the series. The first two patches are
improvements of the log output and are independent of the 3rd patch in
terms of code - proposed logging improvements just make it easier to
debug issues with MNCC cause codes.
The code is also a part of the achemeris/mncc_cause_fixes_master branch.
--
Regards,
Alexander Chemeris.
CEO, Fairwaves, Inc.
https://fairwaves.co
Previously we were sending a generic "Resource unavailable" cause code making
it impossible to distinguish real error cases from a regular radio link failure.
This was the reason for many "unknown" call errors we've seen at Rhizomatica
installations. Now they are properly classified as non-erroneous call failures.
The code is also a part of the achemeris/mncc_cause_fixes_master branch.
--
Regards,
Alexander Chemeris.
CEO, Fairwaves, Inc.
https://fairwaves.co
Sponsored-by: On-Waves ehf
---
openbsc/doc/osmocom-authn-protocol.txt | 191 +++++++++++++++++++++++++++++++++
1 file changed, 191 insertions(+)
create mode 100644 openbsc/doc/osmocom-authn-protocol.txt
diff --git a/openbsc/doc/osmocom-authn-protocol.txt b/openbsc/doc/osmocom-authn-protocol.txt
new file mode 100644
index 0000000..660fdb6
--- /dev/null
+++ b/openbsc/doc/osmocom-authn-protocol.txt
@@ -0,0 +1,191 @@
+
+ Osmocom Authentication Protocol (OAP)
+
+1. General
+
+This document describes the remote protocol that is used by the SGSN and MAP
+proxy to authenticate each other. The protocol and the messages are designed
+after the corresponding MAP messages (see GSM 09.02) with the following
+differences:
+
+ - The encoding uses TLV structures instead of ASN.1 encodings
+ - Segmentation is not used
+
+See the specification of the Gr interface (GSM 03.60).
+
+1.1. Connection
+
+The protocol expects that a reliable, ordered, packet boundaries preserving
+connection is used (e.g. IPA over TCP). The remote peer is either a service
+that understands the protocol natively or a wrapper service that maps the
+messages to/from real MAP messages that can be used to directly communicate
+with an HLR.
+
+1.2. Using IPA
+
+By default, the following identifiers should be used:
+ - IPA protocol: 0xee (OSMO)
+ - IPA OSMO protocol extension: 0x06
+
+2. Procedures
+
+Ideal communication sequence:
+
+ SGSN MAP
+ | |
+ | Register (Id) |
+ |----------------------------------->|
+ | |
+ | Challenge (RAND+AUTN) |
+ |<-----------------------------------|
+ | |
+ | Challenge Result (SRES) |
+ |----------------------------------->|
+ | |
+ | Register Result |
+ |<-----------------------------------|
+
+2.1. Register
+
+The SGSN sends a REGISTER_REQ message containing an SGSN identifier number.
+
+2.2. Challenge
+
+The OAP server (optionally) sends a CHALLENGE_REQ to the SGSN, containing
+random bytes and a milenage authentication token generated from these random
+bytes, using a shared secret, to authenticate itself to the OAP client (SGSN).
+The server may omit this challenge entirely, based on its configuration, and
+immediately reply with a Register Result response. If the SGSN cannot be
+registered (e.g. id is invalid), the server sends a REGISTER_ERR response.
+
+2.3. Challenge Result
+
+When the SGSN has received a Challenge, it may verify the server's
+authenticity, and reply with a CHALLENGE_RES message. This shall contain SRES
+(and Kc?) authentication tokens generated by milenage from the same random
+bytes received from the server and the same shared secet. If the SGSN cannot
+verify the server's authenticity, it shall instead send a CHALLENGE_ERR
+message.
+
+2.4. Register Result
+
+The MAP sends a REGISTER_RES message to indicate that registration has been
+successful. If the MAP proxy cannot register the SGSN (e.g. invalid challenge
+response), it sends a REGISTER_ERR message.
+
+3. Message Format
+
+3.1. General
+
+Every message is based on the following message format
+
+ IEI Info Element Type Pres. Format Length
+ Message type 4.2.1 M V 1
+
+The receiver shall be able to receive IEs in any order. Unknown IEs shall be
+ignored.
+
+3.2.1. Register Request
+
+SGSN -> Network peer
+
+ IEI Info Element Type Pres. Format Length
+ Message type 4.2.1 M V 1
+ 30 SGSN Id big endian int (2 oct) M TLV 4
+
+3.2.2. Register Error
+
+Network peer -> SGSN
+
+ IEI Info Element Type Pres. Format Length
+ Message type 4.2.1 M V 1
+ 02 Cause GMM cause, M TLV 3
+ 04.08: 10.5.5.14
+
+3.2.6. Register Result
+
+Network peer -> SGSN
+
+ IEI Info Element Type Pres. Format Length
+ Message type 4.2.1 M V 1
+
+3.2.3. Challenge
+
+Network peer -> SGSN
+
+ IEI Info Element Type Pres. Format Length
+ Message type 4.2.1 M V 1
+ 20 RAND octet string (16) M TLV 18
+ 23 AUTN octet string (16) M TLV 18
+
+3.2.4. Challenge Error
+
+SGSN -> Network peer
+
+ IEI Info Element Type Pres. Format Length
+ Message type 4.2.1 M V 1
+ 02 Cause GMM cause, M TLV 3
+ 04.08: 10.5.5.14
+
+3.2.5. Challenge Result
+
+SGSN -> Network peer
+
+ IEI Info Element Type Pres. Format Length
+ Message type 4.2.1 M V 1
+ 21 SRES octet string (4) M TLV 6
+ 22 Kc octet string (8) M TLV 10
+
+4. Information Elements
+
+4.1. General
+
+[...]
+
+4.2.1. Message Type
+
+ +---------------------------------------------------+
+ | 8 7 6 5 4 3 2 1 |
+ | |
+ | 0 0 0 0 0 1 0 0 - Register Request |
+ | 0 0 0 0 0 1 0 1 - Register Error |
+ | 0 0 0 0 0 1 1 0 - Register Result |
+ | |
+ | 0 0 0 0 1 0 0 0 - Challenge Request |
+ | 0 0 0 0 1 0 0 1 - Challenge Error |
+ | 0 0 0 0 1 0 1 0 - Challenge Result |
+ | |
+ +---------------------------------------------------+
+
+4.2.2. IE Identifier (informational)
+
+These are the standard values for the IEI.
+
+ +---------------------------------------------------------+
+ | IEI Info Element Type |
+ | |
+ | 0x02 Cause GMM cause, 04.08: 10.5.5.14 |
+ | 0x20 RAND octet string |
+ | 0x21 SRES octet string |
+ | 0x22 Kc octet string |
+ | 0x23 AUTN octet string |
+ | 0x30 SGSN Id big endian int (2 octets) |
+ +---------------------------------------------------------+
+
+4.2.3. SGSN Id
+
+ 8 7 6 5 4 3 2 1
+ +-----------------------------------------------------+
+ | | SGSN Id IEI | octet 1
+ +-----------------------------------------------------+
+ | Length of SGSN Id IE contents (2) | octet 2
+ +-----------------------------------------------------+
+ | SGSN Id number, most significant byte | octet 3
+ +-----------------------------------------------------+
+ | SGSN Id number, least significant byte | octet 4
+ +-----------------------------------------------------+
+
+The SGSN Id number shall be interpreted as an unsigned 16bit integer, where 0
+indicates an invalid / unset Id.
+
+
--
2.1.4
Добрый день!
Может кто подскажет, что может быть. Развернули openBSC на USRP B210 SDR без
использования asterIsk - все работает - звоним, друг друга слышим.
(Используем Ubuntu)
Подключили использование asterisk по мануалу
http://openbsc.osmocom.org/trac/wiki/Ettus_USRP_B2xx_family
После установки вызов не устанавливается - прерывается.
Может подскажете, что может быть - перепробовали разные конфигурации
С уважением,
Юрий
Hi all,
it seems like there is some work in the kernel network stack to have a
generic multiplexor/demultiplexor for protocols that implement
message-based semantics over TCP:
http://thread.gmane.org/gmane.linux.network/378365
They don't implement a specific messaging protocol, but the userspace
program can BPF to let the kernel muxer know how to find the length
of the message.
This seems like conceptually it is suitable for actually implementing an
IPA multiplex inside the kernel and then get e.g. Abis OML and RSL on
different sockets.
Not that we urgently need anything like this, but I just wanted to point
it out, in case somebody is interestd in it.
--
- Harald Welte <laforge(a)gnumonks.org>
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
From: Holger Hans Peter Freyther <holger(a)moiji-mobile.com>
The signature of mr_config and the BSC implementation didn't
match and the compiler was warning about it:
osmo_bsc_api.c:530:2: warning: initialization from incompatible pointer type
.mr_config = bsc_mr_config,
^
osmo_bsc_api.c:530:2: warning: (near initialization for ‘bsc_handler.mr_config’)
Change the mr_config again and provide an implementation
that will set the ms and bts data structure. It would be
better to put the size outside of the IE but I am not going
to change it right now. It would also be nice to either move
the AMR setting into the "nitb" structure or have the msc
data be used _after_ the bts settings. This needs to be
cleaned up in the next step.
Manually verified by placing a MO call and checking that
both the channel mode modify and the mode modify request
contain the multi rate config with the rate mr config
(length two bytes, version 1, icmi==1, no start mode being
set).
---
openbsc/include/openbsc/bsc_api.h | 2 +-
openbsc/src/libbsc/bsc_api.c | 2 +-
openbsc/src/osmo-bsc/osmo_bsc_api.c | 36 +++++++++++++++++++++++++-----------
3 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/openbsc/include/openbsc/bsc_api.h b/openbsc/include/openbsc/bsc_api.h
index a70d765..a3d12f2 100644
--- a/openbsc/include/openbsc/bsc_api.h
+++ b/openbsc/include/openbsc/bsc_api.h
@@ -40,7 +40,7 @@ struct bsc_api {
* not implemented AMR5.9 will be used.
*/
void (*mr_config)(struct gsm_subscriber_connection *conn,
- uint8_t *mr_ms_lv, uint8_t *mr_bts_lv);
+ struct gsm_lchan *lchan, int full_rate);
};
int bsc_api_init(struct gsm_network *network, struct bsc_api *api);
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index e157eb9..504f044 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -163,7 +163,7 @@ static void handle_mr_config(struct gsm_subscriber_connection *conn,
struct gsm48_multi_rate_conf *mr_conf;
if (api->mr_config)
- return api->mr_config(conn, lchan->mr_ms_lv, lchan->mr_bts_lv);
+ return api->mr_config(conn, lchan, full_rate);
if (full_rate)
mr = &lchan->ts->trx->bts->mr_full;
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/openbsc/src/osmo-bsc/osmo_bsc_api.c
index 00a10b3..fbeed77 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_api.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_api.c
@@ -491,9 +491,10 @@ static void bsc_cm_update(struct gsm_subscriber_connection *conn,
}
static void bsc_mr_config(struct gsm_subscriber_connection *conn,
- struct gsm48_multi_rate_conf *conf)
+ struct gsm_lchan *lchan, int full_rate)
{
struct osmo_msc_data *msc;
+ struct gsm48_multi_rate_conf *ms_conf, *bts_conf;
if (!conn->sccp_con) {
LOGP(DMSC, LOGL_ERROR,
@@ -504,18 +505,31 @@ static void bsc_mr_config(struct gsm_subscriber_connection *conn,
msc = conn->sccp_con->msc;
- conf->ver = 1;
- conf->icmi = 1;
+ /* initialize the data structure */
+ lchan->mr_ms_lv[0] = sizeof(*ms_conf);
+ lchan->mr_bts_lv[0] = sizeof(*bts_conf);
+ ms_conf = (struct gsm48_multi_rate_conf *) &lchan->mr_ms_lv[1];
+ bts_conf = (struct gsm48_multi_rate_conf *) &lchan->mr_bts_lv[1];
+ memset(ms_conf, 0, sizeof(*ms_conf));
+ memset(bts_conf, 0, sizeof(*bts_conf));
+
+ bts_conf->ver = ms_conf->ver = 1;
+ bts_conf->icmi = ms_conf->icmi = 1;
/* maybe gcc see's it is copy of _one_ byte */
- conf->m4_75 = msc->amr_conf.m4_75;
- conf->m5_15 = msc->amr_conf.m5_15;
- conf->m5_90 = msc->amr_conf.m5_90;
- conf->m6_70 = msc->amr_conf.m6_70;
- conf->m7_40 = msc->amr_conf.m7_40;
- conf->m7_95 = msc->amr_conf.m7_95;
- conf->m10_2 = msc->amr_conf.m10_2;
- conf->m12_2 = msc->amr_conf.m12_2;
+ bts_conf->m4_75 = ms_conf->m4_75 = msc->amr_conf.m4_75;
+ bts_conf->m5_15 = ms_conf->m5_15 = msc->amr_conf.m5_15;
+ bts_conf->m5_90 = ms_conf->m5_90 = msc->amr_conf.m5_90;
+ bts_conf->m6_70 = ms_conf->m6_70 = msc->amr_conf.m6_70;
+ bts_conf->m7_40 = ms_conf->m7_40 = msc->amr_conf.m7_40;
+ bts_conf->m7_95 = ms_conf->m7_95 = msc->amr_conf.m7_95;
+ if (full_rate) {
+ bts_conf->m10_2 = ms_conf->m10_2 = msc->amr_conf.m10_2;
+ bts_conf->m12_2 = ms_conf->m12_2 = msc->amr_conf.m12_2;
+ }
+
+ /* now copy this into the bts structure */
+ memcpy(lchan->mr_bts_lv, lchan->mr_ms_lv, sizeof(lchan->mr_ms_lv));
}
static struct bsc_api bsc_handler = {
--
2.3.5