Commit Graph

136 Commits

Author SHA1 Message Date
Harald Welte eafe22ca72 SGSN / GMM: Only allow non-roaming IMSIs
As we do not yet use the HLR from the SGSN, we allow all MS to
attach to our GPRS network.  However, if this is running in a public
environment, it could cause service interruption to users of commercial
GPRS networks.

Thus, we now check if the first 5 digits of the IMSI match the MCC/MNC
of the cell that they want to register to.  Thus, any subscribers with
SIM cards from real operators will no longer be accepted.
2010-12-24 15:42:26 +01:00
Harald Welte f6bd340df6 GPRS/GMM: Correctly look up MM Context in RA Update
If a MS changes RA, the RA will arrive in the new cell using the old
TLLI (masked as foreign TLLI).  So we need to look-up the TLLI
in a special way, using the old RA as indicated in the 04.08 GMM
message.

There is still another bug remaining: As we somehow create a new LLC,
the sequence numbers of our responses start from 0 again, which is not
what the MS expects.  This needs to be fixed in a follow-up patch.
2010-12-23 23:38:02 +01:00
Harald Welte c48ac4750d [SGSN] Some IEs in ATTACH REQUEST can be longer in 24.008
The original length checks were based on 04.08, but 24.008 allows
longer IEs.
2010-07-03 21:20:06 +02:00
Harald Welte 4b6ac1edb9 [SGSN] Initial work on GMM authentication and ciphering 2010-07-03 11:09:06 +02:00
Harald Welte d6f582b352 [SGSN] use GPRS_ALGO_GEA0 instead of '0' 2010-07-02 22:56:55 +02:00
Harald Welte 23c13760ca [SGSN] SM: Properly parse APN and PCO Optional IE in PDP CTX ACT REQ 2010-07-02 22:52:04 +02:00
Harald Welte 18d1452a92 [SGSN] Send poper SM and GMM STATUS in case we have no MM CTX 2010-07-02 16:18:18 +02:00
Harald Welte 11ff3e8ec2 [SGSN] Remove old dead code 2010-07-02 10:17:24 +02:00
Harald Welte 19f9e30eb9 [SGSN] Only increment PDP CTX ACT count after check for retransmission 2010-07-02 10:15:49 +02:00
Harald Welte b37515e86b [SGSN] Account for re-transmitted PDP CTX ACT REQ
In case our PDP CTX ACT ACK gets lost on the Gb or Um link,
the MS re-transmits the PDP CTX ACT REQ.  We have to ACK it
again instead of REJecting it..
2010-07-02 10:12:58 +02:00
Harald Welte fd29a1f6cc [SGSN] GMM: Complete value_string for GMM cause values 2010-07-01 12:26:59 +02:00
Harald Welte 875840c603 [SGSN] Fix TLLI (re)assignments
Once The TLLI (or P-TMSI of which it is derived) change has been
confirmed by the MS, we need to unassign the old TLLI but keep
the new TLLI  _without_ re-setting the LLC entity structure such
as VUsend /VUrecv counters.
2010-07-01 11:54:31 +02:00
Harald Welte bd5c91276b [SGSN] MM: Properly communicate TLLI changes / unassignment to LLC 2010-06-28 22:18:53 +02:00
Harald Welte c0d59504b4 [SGSN] Deactivate all PDP contexts on GPRS DETACH 2010-06-28 19:11:41 +02:00
Harald Welte 5bfe499366 [GPRS] SGSN: Pass BSSGP SUSPEND/RESUME up to GMM and alter MMCTX state 2010-06-09 21:40:45 +08:00
Harald Welte f54e7e2102 [GPRS] GMM/SM: Improve error handling by sending STATUS messages 2010-06-09 21:40:45 +08:00
Harald Welte 588d44ee65 [GPRS] Drop all PDP contexts not present in PDP CTX STATUS IE at RA UPD 2010-06-09 21:40:45 +08:00
Harald Welte 60ebc02ba8 [GPRS] SM: Acknowledge PDP CTX DEACT for non-existing PDP CTX
Some phones (notably a Ericsson Mobile Platform based E-TEN M800)
insist on sending PDP CTX DEACT messages for contexts that have already
been deactivated.  The spec doesn't really say what we should do in
this case. But since there is no "reject", we simply acknowledge it.
2010-06-09 21:40:45 +08:00
Harald Welte 807a5d8264 [GPRS] Major LLC / TLLI handling fixes
* separate the LLME and LLE state in the LLC layer
* introduce gprs_llgmm_assign() function for LLGMM-ASSIGN.req primitive
* change QoS profile to match 'real' SGSN
* Update the new TLLI when assigning a P-TMSI

The result now is that the LLC layer is notified of TLLI changes, which in turn
means it doesn't allocate a new LLE structure every TLLI change, which again
in turn means that the UI frame sequence number does not reset to zero.

As a result, MS should no longer ignore frames based on wrong UI sequence number.
2010-06-01 11:57:13 +02:00
Harald Welte dce1255d8f [GPRS] GMM: Set LLC 'C/R' bit when sending IDENTITY REQUEST
Commands initiatied by the SGSN have to set C/R = 1
2010-05-31 22:31:04 +02:00
Harald Welte 56a0145dd8 [GPRS] Include IMSI and DRX params in BSSGP DL-UD
When we send a downlink unit-data request via BSSGP, there is a lot
of information that needs to be copied from the mm context, such as
the IMSI, DRX parametes, MS radio access parameters, ...

This is a quite strange layering violation, since we now need to pass
a pointer to the MM ctx from GMM through LLC into BSSGP :(
2010-05-31 22:12:30 +02:00
Harald Welte c2e8cc4a10 [GPRS] Implement TMSI reallocation and timers 3350 + 3370
Our state transitions and timers now reflect 04.08 for GMM much
better than before.  Also, we allocate a new P-TMSI on every ATTACH
and RA UPDATE, as some phones seem to get confused if they don't
get a P-TMSI.
2010-05-31 20:23:38 +02:00
Harald Welte b12aa4b1ee [GPRS] GMM: Add some FIXME's to the code 2010-05-30 20:28:22 +02:00
Harald Welte ab1d5626ac [GPRS] SGSN: use GGSN IP address from config file, disable TMSI allocation 2010-05-18 19:58:38 +02:00
Harald Welte cd4dd4d7ff [GPRS] fix numerous compiler warnings 2010-05-18 17:20:49 +02:00
Harald Welte 6463c0799c [GPRS] SGSN: TMSI allocation 2010-05-18 17:04:55 +02:00
Harald Welte 4e38ac7a8a [GPRS] SGSN: Correctly set upper 4 bits of PDP address to 0
It's really strange.  In GTP those 4 bits are 1, in 04.08 they are
zero.  Otherwise the IE is exactly the same :/
2010-05-18 14:51:18 +02:00
Harald Welte 3c0b9b9c2a [GPRS] SGSN: Make sure the PCO from GGSN are passed to the MS 2010-05-18 14:36:11 +02:00
Harald Welte 77289c202f [GPRS] SGSN: properly delete a PDP context after receiving PDP CTX DEACT REQ 2010-05-18 14:32:29 +02:00
Harald Welte 55e0df7c43 [GPRS] SGSN: Don't use GGSN-provided QoS as the MS doesn't like it 2010-05-18 13:20:08 +02:00
Harald Welte 68b99a4a08 [GPRS] fix null pointer dereference in GMM 2010-05-18 12:05:42 +02:00
Harald Welte 8acd88f369 [GPRS] SGSN: Include rate counters in MM Context 2010-05-18 10:57:45 +02:00
Harald Welte 6abf94e420 [GPRS] Properly connect GPRS SM with LIBGTP for PDP context activation
* store LLC SAPI as part of PDP ctx
* store NSEI + BVCI as part of MM ctx
* export gsm48_tx_gsm_act_pdp_acc() and call it from sgsn_libgtp.c
* create and use gsm48_tx_gsm_act_pdp_rej for error cases
* print SAPI as part of VTY show pdp
2010-05-18 10:35:06 +02:00
Harald Welte d193cb327a [GPRS] More work on a real SGSN 2010-05-17 22:58:03 +02:00
Harald Welte 2720e7310d [GPRS] Initial untested support for libgtp
libgtp of the OpenGGSN project will allow us to speak the GTPv0/v1
protocol of the interface between SGSN and GGSN.

This commit includes code for the main libgtp integration (file
descriptor, select loop, timer) as well as code to encode/send
a CREATE PDP CONTEXT request.
2010-05-17 00:44:57 +02:00
Harald Welte 24c9fc1700 [GPRS] Rename gsm_04_08_gprs.c to gprs_gmm.c
GMM refers to GPRS Mobility Management.
2010-05-13 21:29:11 +02:00