RangeNetworks / openbts

GSM+GPRS Radio Access Network Node
GNU Affero General Public License v3.0
864 stars 326 forks source link

GGSN PDP Context Activation without PCO #28

Open daniel-starke opened 7 years ago

daniel-starke commented 7 years ago

The protocol configuration options (PCO) sent by the MS in the ACTIVATE PDP CONTEXT REQUEST message is optional according to GSM 24.008 9.5.1. In Ggsn.cpp setPco() we assume, that pcoReq is set. No check is performed to prove that this holds true. OpenBTS simple crashes with a SIGSEGV if pcoReq is empty. The same is done in L3SmMsgActivatePdpContextAccept::smWriteBody() when writing out the ACTIVATE PDP CONTEXT ACCEPT message as defined in GSM 24.008 9.5.2 (PCO is optional here too).

A simple workaround would be to early out setPco() if pcoReq.size() is 0 and only output PCO in smWriteBody() if mPco.size() is >0.

This, however, would leave the MS without a DNS. setPco() could build a PCO if none was received.

jarodcs commented 6 years ago

Hi Daniel ... When you say "OpenBTS simple crashes" ... could it mean that the hole OpenBTS crashes or only GPRS connection? In my case I was able to install OpenBTS on a VM Guest (Ubuntu 16.04) and it works correctly concerning to phone calls and sms, but when establishing the GPRS it is not a certain science. First I configure the iptables, assign the proper DNS to the host, enabling manually the ip_forward (although I don't think this is necessary given that OpenBTS does it at the system start), etc. And then the cellphone I set it up to work only with 2G networks, set it up an APN, I configured OpenBTS GSM.Identity.MCC/MNC to match my simcard's info and cellphone registers correctly on OpenBTS network and it seems also to start working on GPRS (little G appeared on top of screen) and it works fine for some time ... but suddenly it just stops and cellphone appears with no signal but I can see that OpenBTS still working (I even put a spectrum analyzer to sense the signal because I thought that maybe there was no GSM signal at some point) ...

In my country, no signal is Tx on the 1800 band so I configure my cellphone to work on that one and also OpenBTS to Tx on Band 1800 and ARFCN 512 to avoid any noise from other cellphone .. but no ... GPRS still working intermitently ... cellphone attaches to network, PDP context gets on (gprs list shows a change from Idle to Transfer state) ... and one can see the packet flow on the /tmp/GGSN.log but suddenly after some minutes (it can take several or less) it stops ... I wonder why ...

Can anybody give some ideas what to troubleshoot?

Thanks

daniel-starke commented 6 years ago

I meant that the whole application crashes (SIGSEGV = segmentation fault / access violation).