Seungju Kim | 1 Aug 2011 19:30

GPRS issue after idle

Hello,I got everything up and running. Including EDGE data.

The throughput of the data from the osmo-sgsn is pretty good. But recently I have spotted a problem with the SGSN.

The sgsn loses the phones SNDCP entity after idling or making a phone call.

 

Please see the log from the sgsn

http://pastebin.com/2W9dZdvW

 

Harald Welte | 2 Aug 2011 12:09

Re: GSM <at> Camp 2011 preparations

Hi all,

this is hopefully the last and final update before the Camp.

I'm happy that we now have the license and all the equipment required.

Please check http://openbsc.osmocom.org/trac/wiki/CCC_Camp_2011 for the
current plan.

Special thanks to Dieter Spaar for his effort to support the Nokia
Metrosite in OpenBSC on very short advance notice.  

(More thanks on http://events.ccc.de/camp/2011/wiki/GSM)

Regards,
	Harald
--

-- 
- Harald Welte <laforge <at> gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

Pierre Pronchery | 3 Aug 2011 04:53
Gravatar

Packages in pkgsrc-wip (for NetBSD and more)

			Hi openbsc <at> ,

for the record I have just packaged libosmocore 0.1.30 and OpenBSC
0.9.13 in pkgsrc-wip, as released by Harald about 5 months ago, see:
http://openbsc.osmocom.org/trac/wiki/Tarballs
and
http://cvsweb.netbsd.se/cgi-bin/bsdweb.cgi/wip/libosmocore/
http://cvsweb.netbsd.se/cgi-bin/bsdweb.cgi/wip/openbsc/

I had to apply a few changes, patches are found in the two links above
(not all of them good enough to be pushed though).

Unfortunately OpenBSC is probably not useful on NetBSD at the moment,
except with the isdn4bsd patches maybe (which I don't think are
maintained anymore). pkgsrc can be useful on Linux distributions though.

HTH anyway,
--

-- 
khorben

Holger Hans Peter Freyther | 3 Aug 2011 10:31
Picon

Re: Packages in pkgsrc-wip (for NetBSD and more)

On 08/03/2011 04:53 AM, Pierre Pronchery wrote:
> 			Hi openbsc <at> ,

> 
> Unfortunately OpenBSC is probably not useful on NetBSD at the moment,
> except with the isdn4bsd patches maybe (which I don't think are
> maintained anymore). pkgsrc can be useful on Linux distributions though.
>

Hi,

OpenBSC supports various BTS that connect via IP. I am feeling a bit sorry
that you took 5 month old code. Is there a policy to only build from released
tarballs? E.g. the debian packages are created from the git repository (a
specific tag though).

thanks for the packaging and again sorry you were forced to use old code

holger

Pierre Pronchery | 3 Aug 2011 18:36
Gravatar

Re: Packages in pkgsrc-wip (for NetBSD and more)

			Hi openbsc <at> ,

replying to Holger (I wasn't subscribed to the list yet)

On 03/08/2011 04:53, Pierre Pronchery wrote:
> 
> for the record I have just packaged libosmocore 0.1.30 and OpenBSC
> 0.9.13 in pkgsrc-wip, as released by Harald about 5 months ago [...]

There is no policy to build from released tarballs, it was just easier
for me for the time being. It's good to hear that OpenBSC can be useful
without ISDN cards, even though I do not have the relevant hardware at
my disposal currently.

I'll try to package more recent versions when I get the chance.

Cheers!
--

-- 
khorben

Harald Welte | 4 Aug 2011 13:13

Re: GPRS issue after idle

Hi!

On Tue, Aug 02, 2011 at 02:30:14AM +0900, Seungju Kim wrote:
> Hello,I got everything up and running. Including EDGE data.
> 
> The throughput of the data from the osmo-sgsn is pretty good. But recently I
> have spotted a problem with the SGSN.
> 
> The sgsn loses the phones SNDCP entity after idling or making a phone call.
> http://pastebin.com/2W9dZdvW

Interesting.  I have not yet observed this, as most likely my phones
don't include the "PDP Context Status IE" (TS 24.008 / 10.5.7.1).

Using this IE, the phone can tell the network "I think I still have PDP
contexts for the following NSAPIs active".  The network  then checks if
it has the smae view, and silently deletes all PDP contexts for other
NSAPIs.

It seems that the current code is interpreting the IE the wrong way.

We interpret it as an uint16_t, do ntohs() and it is 0x2000.
Apparently NSAPI 5 was active befor (your log snippet is a bit short):

<0002> gprs_gmm.c:884 Dropping PDP context for NSAPI=5 due to PDP CTX STATUS IE= 0x2000
<0014> sgsn_libgtp.c:212 Delete PDP Context
<0014> sgsn_libgtp.c:389 PDP Context was deleted

If I'm looking at Chapter 10.5.7.1, it seems the encoding is a bit odd,
i.e. actually the byte ordering is little endian!

Can you try the patch below and see if the problem is fixed?

--

-- 
- Harald Welte <laforge <at> gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)
Seungju Kim | 4 Aug 2011 16:17

RE: GPRS issue after idle

Hi!
I tested the patch but the problem still exists :(
Here is the new log from sgsn : http://pastebin.com/3PBKQwR5
If it helps, I am using an iPhone 4 with OpenBSC running under Debian 6 i686
VMWare.

-----Original Message-----
From: openbsc-bounces <at> lists.osmocom.org
[mailto:openbsc-bounces <at> lists.osmocom.org] On Behalf Of Harald Welte
Sent: Thursday, August 04, 2011 8:14 PM
To: Seungju Kim
Cc: openbsc <at> lists.osmocom.org
Subject: Re: GPRS issue after idle

Hi!

On Tue, Aug 02, 2011 at 02:30:14AM +0900, Seungju Kim wrote:
> Hello,I got everything up and running. Including EDGE data.
> 
> The throughput of the data from the osmo-sgsn is pretty good. But 
> recently I have spotted a problem with the SGSN.
> 
> The sgsn loses the phones SNDCP entity after idling or making a phone
call.
> http://pastebin.com/2W9dZdvW

Interesting.  I have not yet observed this, as most likely my phones don't
include the "PDP Context Status IE" (TS 24.008 / 10.5.7.1).

Using this IE, the phone can tell the network "I think I still have PDP
contexts for the following NSAPIs active".  The network  then checks if it
has the smae view, and silently deletes all PDP contexts for other NSAPIs.

It seems that the current code is interpreting the IE the wrong way.

We interpret it as an uint16_t, do ntohs() and it is 0x2000.
Apparently NSAPI 5 was active befor (your log snippet is a bit short):

<0002> gprs_gmm.c:884 Dropping PDP context for NSAPI=5 due to PDP CTX STATUS
IE= 0x2000 <0014> sgsn_libgtp.c:212 Delete PDP Context <0014>
sgsn_libgtp.c:389 PDP Context was deleted

If I'm looking at Chapter 10.5.7.1, it seems the encoding is a bit odd, i.e.
actually the byte ordering is little endian!

Can you try the patch below and see if the problem is fixed?

--

-- 
- Harald Welte <laforge <at> gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

Harald Welte | 5 Aug 2011 08:05

Re: GPRS issue after idle

On Thu, Aug 04, 2011 at 11:17:18PM +0900, Seungju Kim wrote:
> Hi!
> I tested the patch but the problem still exists :(
> Here is the new log from sgsn : http://pastebin.com/3PBKQwR5

Then my patch is still wrong.  Please look at 24.008 / Section 10.5.7.1
and make sure the code parses the field correctly, i.e. as indicated in
the specs.

0x2000 == 0010 0000 0000 0000
corresponding SAPI:
	            1111 11
          7654 3210 5432 1098

i.e. the bit that is set _is_ NSAPI5.  This means, the code should _not_
release the PDP context for NSAPI5.  But due to erroneous parsing, it
_thinks_ that NSAPI5 is not set and it needs to be released.

Regards,
	Harald

--

-- 
- Harald Welte <laforge <at> gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

Seungju Kim | 5 Aug 2011 17:58

Re: GPRS issue after idle

Alright, I see.
I just made an ugly hack and applied to my working copy.
So far it seems fine. Now my phone does not lose it's PDP context while making a phone call.
I'll be working on for some not ugly fix, but all these bits are confusing me haha.

Envoyé de mon iPhone

Le Aug 5, 2011 à 3:05 PM, Harald Welte <laforge <at> gnumonks.org> a écrit :

> On Thu, Aug 04, 2011 at 11:17:18PM +0900, Seungju Kim wrote:
>> Hi!
>> I tested the patch but the problem still exists :(
>> Here is the new log from sgsn : http://pastebin.com/3PBKQwR5
> 
> Then my patch is still wrong.  Please look at 24.008 / Section 10.5.7.1
> and make sure the code parses the field correctly, i.e. as indicated in
> the specs.
> 
> 0x2000 == 0010 0000 0000 0000
> corresponding SAPI:
>                1111 11
>          7654 3210 5432 1098
> 
> i.e. the bit that is set _is_ NSAPI5.  This means, the code should _not_
> release the PDP context for NSAPI5.  But due to erroneous parsing, it
> _thinks_ that NSAPI5 is not set and it needs to be released.
> 
> Regards,
>    Harald
> 
> -- 
> - Harald Welte <laforge <at> gnumonks.org>           http://laforge.gnumonks.org/
> ============================================================================
> "Privacy in residential applications is a desirable marketing option."
>                                                  (ETSI EN 300 175-7 Ch. A6)
> 

Harald Welte | 5 Aug 2011 21:22

Re: GPRS issue after idle

Hi,

On Sat, Aug 06, 2011 at 12:58:00AM +0900, Seungju Kim wrote:
> Alright, I see.
> I just made an ugly hack and applied to my working copy.
> So far it seems fine. Now my phone does not lose it's PDP context while making a phone call.
> I'll be working on for some not ugly fix, but all these bits are confusing me haha.

can you try the attached patch?  It should parse it correctly, without
the double-byte-swapping of the last patch.
--

-- 
- Harald Welte <laforge <at> gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

Gmane