summaryrefslogtreecommitdiffstats
path: root/openbsc/doc/channel_release.txt
blob: c9cdfebca8086c17694f74bdbcd87f0f3217452f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
GSM 04.08 7.1.7 / 9.1.7		RR CHANNEL RELESE

RSL 08.58 3.4 / ?		RLL Link Release Request

RSL 08.58 4.6 / 8.4.5		DEACTivate SACCH
	* Deactivate SACCH according to Channel Release Proc 04.08
	* to be sent after RR CHANNEL RELEASE is sent to MS

RSL 08.58 4.7 / 8.4.14		RF CHANnel RELease
	* tells the BTS to release a radio channel
	* "when an activated radio channel is no longer needed"
	* BTS responds with RF CHANnel RELease ACKnowledge


GSM 04.08 3.4.13: RR connection release procedure

* network sends RR CHANNEL RELEASE to MS on the DCCH
  * start T3109
  * deactivate SACCH
* MS disconnects main signalling link (by sending DISC)
  * all other data links are disconnected by local end link release
* network receives DISC (BTS sends RLL REL IND to BSC)
  * stop T3109
  * start T3111 
* when T3111 times out, the network can reuse the channls
* if T3109 times out, the network deactivates the channels 
  and can reuse them
  * this probably means simply RF CHANnel RELease


== Implementation in OpenBSC ==

There are two possible reasons a gsm_subscriber_connection
will be released. One is a network failure, the other is
the completion of an operation/transaction.

=== Failure ===
The BSC API will call the gsm_04_08.c:gsm0408_clear_request callback
and the MSC part will release all transactions, operations and such
and the channels will be released as error case.

=== Success ===
Every time an 'operation' or 'transaction' is finished msc_release_connection
will be called and it will determine if the gsm_subscriber_connection can
be released.

In case it can be released bsc_api.c:gsm0808_clear will be called
which will release all lchan's associated with the connection. For the
primary channel a SACH Deactivate will be send with the release
reason NORMAL RELEASE.


bsc_api.c:gsm0808_clear
	* Release a channel used for handover
	* Release the primary lchan with normal release, SACH deactivate

chan_alloc.c:lchan_release(chan, sacch_deactivate, reason)
	* Start the release procedure. It is working in steps with callbacks
	  coming from the abis_rsl.c code.
	* Release all SAPI's > 0 as local end (The BTS should send a
	  REL_CONF a message)
	* Send SACH Deactivate on SAPI=0 if required.
	* Start T3109 (stop it when the main signalling link is disconnected)
	  or when the channel released. On timeout start the error handling.
	* abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are
	  released and after T3111 has timed out or there is an error.

RX of RELease INDication:
        * Calls internal rsl_handle_release which might release the RF.

RX of RELease CONFirmation:
        * Calls internal rsl_handle_release which might release the RF.

* RX of RF_CHAN_REL_ACK
	* call lchan_free()


=== Integration with SMS ===

* RX of CP_ERROR or unimplemented MT
	* trigger trans_free() which will msc_release_connection()

* CP TC1* expired while waiting for CP-ACK
	* trigger trans_free() which will msc_release_connection()

* RX of RP_ERROR
	* trigger trans_free() which will msc_release_connection()
	
* TX of CP-ACK in MT DELIVER
	* trigger trans_free() which will msc_release_connection()

* RX of CP-ACK in MO SUBMIT
	* trigger trans_free() which will msc_release_connection()