blob: 8862dd97b98de0680eea7ed85f761d96358cc0b7 [file] [log] [blame]
Neels Hofmeyr71e5a822018-05-26 23:53:31 +02001# Handover between cells, intra-BSC
2msc {
3 hscale=3;
4 ms [label="MS"], bts [label="BTS"], bsc[label="BSC"], bsc_gscon[label="BSC conn FSM"], bsc_mgcp[label="BSC mgcp FSM"], mgw[label="MGW"];
5
6 ms note mgw [label="intra-BSC Handover sequence"];
7
8 bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];
9 bsc box bsc [label="bsc_handover_start(): init conn->ho"];
10 bsc -> bsc_gscon [label="GSCON_EV_HO_START"];
11 bsc <- bsc_gscon [label="bsc_handover_start_gscon()"];
12
13 bsc box bsc [label="lchan_alloc(): pick available lchan"];
14 bsc box bsc [label="rsl_chan_activate_lchan()"];
15
16 --- [label="is the chosen lchan on dynamic timeslot that is currently used as PDCH?"];
17 bts <= bsc [label="i) RSL RF Chan Release of PDCH (Osmocom dyn TS)"];
18 bts <= bsc [label="OR ii) RSL PDCH Deact (ip.access dyn TS)"];
19 bsc -> bsc_gscon [label="bsc_handover_start_gscon() returns early"];
20 bsc_gscon abox bsc_gscon [label="ST_WAIT_HO_COMPL (no timeout, relies on T3103 below)"];
21 ...;
22 bts note bsc_gscon [linecolor="red",
Neels Hofmeyrc8658ac2018-05-26 23:53:31 +020023 label="Osmocom style dyn TS use lchan->act_timer to watch over RF Chan Release, but there
24 seems to be no timer watching over PDCH Deact!"];
Neels Hofmeyr71e5a822018-05-26 23:53:31 +020025 ...;
26 bts => bsc [label="i) RSL RF Chan Release ACK (Osmocom dyn TS)"];
27 bts => bsc [label="OR ii) RSL PDCH Deact ACK (ip.access dyn TS)"];
28 bsc box bsc [label="rsl_chan_activate_lchan() re-invoked"];
29 bts <= bsc [label="RSL Chan Activ"];
30 --- [label="else (no dyn TS switchover)"];
31
32 bts <= bsc [label="RSL Chan Activ"];
33 bsc -> bsc_gscon [label="bsc_handover_start_gscon() returns"];
34 ---;
35 bsc_gscon abox bsc_gscon [label="ST_WAIT_HO_COMPL (no timeout, relies on T3103 below)"];
36
37 ...;
38 bts note bsc_gscon [linecolor="red",
39 label="There seems to be no timer watching out for RSL Chan Activ ACK/NACK!"];
40 ...;
41 bts => bsc [label="RSL Chan Activ ACK"];
Neels Hofmeyrc8658ac2018-05-26 23:53:31 +020042 bsc box bsc [label="rsl_rx_chan_act_ack()"];
43 bsc box bsc [label="Stop lchan->act_timer"];
44 bsc box bsc [label="lchan->state = LCHAN_S_ACTIVE"];
Neels Hofmeyr71e5a822018-05-26 23:53:31 +020045 bsc -> bsc [label="S_LCHAN_ACTIVATE_ACK"];
46 bsc box bsc [label="handover_logic.c ho_logic_sig_cb()"];
47 bsc box bsc [label="ho_chan_activ_ack()"];
48 bsc note bsc [label="gsm48_send_ho_cmd()"];
49 ms <= bsc [label="RR Handover Command"];
50 bsc abox bsc [label="start T3103"];
51 --- [label="is BTS using IPA Abis? (osmo-bts, ip.access)"];
52 bts <= bsc [label="IPACC CRCX"];
53 bsc -> bsc [label="ho_chan_activ_ack() returns"];
54 bts note bsc [linecolor="red",
55 label="There seems to be no timer watching over IPACC CRCX ACK/NACK!
56 If no response is received, we simply ignore that fact and carry on as if
57 everything was fine."];
58 ...;
59 bts note bsc [label="The IPACC CRCX and MDCX ACKs may come back at any time:
60 before or after the Handover Detect, before or after Handover Complete."];
61 bts note bsc_mgcp [linecolor="red",
62 label="The CRCX ACK contains vital information for routing the RTP stream.
63 If the CRCX ACK were very slow, we would not know which RTP/RTPC ports
64 to point the MGW at, below at mgcp_conn_modify()!
65 Even though this being unrealistic, we must make sure to receive a CRCX ACK."];
66 ...;
67 bsc box bsc [label="osmo_bsc_audio.c"];
68 bts => bsc [label="IPACC CRCX ACK"];
69 bts <= bsc [label="IPACC MDCX"];
70 ...;
71 bts note bsc [linecolor="red",
72 label="There seems to be no timer watching over IPACC MDCX ACK/NACK!
73 If no response is received, we simply ignore that fact and carry on as if
74 everything was fine."];
75 ...;
76 bts => bsc [label="IPACC MDCX ACK"];
77 bts note bsc [label="IPACC MDCX ACK triggers no events or actions"];
78 ---;
79
80 ...;
81 ms => bsc [label="RR Handover Detect"];
82 bsc -> bsc [label="S_LCHAN_HANDOVER_DETECT"];
83 bsc box bsc [label="ho_rsl_detect(): no action, only logging"];
84 bsc note bsc_gscon [label="Handover Detect triggers no events or actions"];
85 bsc note bsc_gscon [linecolor="red",
86 label="upon Handover Detect, we should already start re-routing the RTP!
87 Instead we wait for Handover Complete."];
88
89 ...;
90 ms => bsc [label="RR Handover Complete"];
91 bsc -> bsc [label="S_LCHAN_HANDOVER_COMPL"];
92 bsc box bsc [label="handover_logic.c ho_logic_sig_cb()"];
93 bsc box bsc [label="ho_gsm48_ho_compl()"];
94 bsc box bsc [label="stop T3103"];
95 bts note bsc_gscon [label="If anything goes wrong from this point on, we will not move back
96 to the old lchan: would be pointless after Handover Complete."];
97 bsc note bsc [label="officially take over new lchan: conn->lchan = ho->new_lchan"];
98
99 --- [label="Release old lchan"];
100 bsc box bsc [label="_lchan_handle_release(sacch_deact=0)"];
101 bsc box bsc [label="rsl_release_sapis_from(start=1)"];
102 bts <= bsc [label="RSL Release Request (Local End)..."];
103 bts <= bsc [label="...for each SAPI except link_id=0"];
104 bsc box bsc [label="rsl_release_request(link_id=0)"];
105 bts <= bsc [label="RSL Release Request (Local End) for link_id=0"];
106 bsc box bsc [label="_lchan_handle_release() returns here, the remaining release is asynchronous;
107 see `End: 'Release old lchan'` below."];
108 ...;
109 bts note bsc_gscon [linecolor="red",
110 label="There seems to be no timer watching over RSL Release Request!"];
111 ...;
112 bts => bsc [label="RSL Release Confirm..."];
113 bts => bsc [label="...for each SAPI and link_id=0"];
114 bsc abox bsc [label="start T3111"];
115 ...;
116 bsc box bsc [label="T3111 expires"];
117 bsc abox bsc [label="Start lchan->act_timer with lchan_deact_tmr_cb"];
118 bts <= bsc [label="RSL RF Channel Release"];
119 ...;
120 --- [label="On timeout"];
121 bsc box bsc [label="lchan_deact_tmr_cb()"];
122 bsc box bsc [label="rsl_lchan_mark_broken(): state=LCHAN_S_BROKEN"];
123 bsc box bsc [label="lchan_free()"];
124 bsc -> bsc [label="S_LCHAN_UNEXPECTED_RELEASE"];
125 bsc box bsc [label="bsc_api.c handle_release()"];
126 bsc box bsc [label="bsc->clear_request()"];
127 bsc box bsc [label="bsc_clear_request encodes a BSSMAP Clear Request message and passes it on
128 to the conn FSM as data argument via:"];
129 bsc -> bsc_gscon [label="GSCON_EV_TX_SCCP"];
130 bsc_gscon rbox bsc_gscon [label="BSSMAP Clear Request to MSC"];
131 bsc note bsc_gscon [linecolor="red",
132 label="During Handover, we actually release the entire conn just because we failed to
133 gracefully release the old lchan. That is obviously nonsense."];
134 bsc note bsc [label="Stop T3101 (but was not active in this code path)"];
135 bsc -> bsc [label="S_CHALLOC_FREED"];
136 --- [label="End: 'On timeout'"];
137 ...;
138 bts => bsc [label="RSL RF Channel Release Ack"];
Neels Hofmeyrc8658ac2018-05-26 23:53:31 +0200139 bsc box bsc [label="Stop lchan->act_timer"];
140 bsc box bsc [label="Stop lchan->T3111"];
Neels Hofmeyr71e5a822018-05-26 23:53:31 +0200141 ---;
142
143 bsc box bsc [label="still in ho_gsm48_ho_compl()"];
144 bsc note bsc [label="handover_free(), conn->ho = NULL"];
145 bsc -> bsc_gscon [label="GSCON_EV_HO_COMPL"];
146 bsc note bsc_gscon [linecolor="orange",
147 label="Handover information is cleared before signalling the conn FSM.
148 That means the conn FSM cannot possibly log sensible information about exactly
149 which Handover has just completed."];
150
151 bsc_gscon abox bsc_gscon [label="ST_WAIT_MDCX_BTS_HO
152 (MGCP_MGW_TIMEOUT=4s with MGCP_MGW_HO_TIMEOUT_TIMER_NR)"];
153
154 bsc_gscon -> bsc_mgcp [label="mgcp_conn_modify()"];
155 bsc_mgcp note bsc_mgcp [label="mgcp FSM that was established for old lchan, for BTS side"];
156 bsc_mgcp => mgw [label="MDCX (for BTS)"];
157 ...;
158 bsc_gscon note mgw [
159 label="If we get no MDCX ACK, the MGCP FSM terminates, and emits GSCON_EV_MGW_FAIL_BTS.
160 Besides invalidating the MGCP FSM pointer, this event has no
161 effect in ST_WAIT_MDCX_BTS_HO, and we rely on above conn FSM
162 timeout instead."];
163 bsc_gscon note bsc_gscon [linecolor="red",
164 label="A timeout of ST_WAIT_MDCX_BTS_HO simply transitions back to ST_ACTIVE!
165 Even though the MGW failed, we carry on as if everything were fine."];
166 ...;
167 bsc_mgcp <= mgw [label="MDCX OK"];
168 bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_MDCX_RESP_BTS"];
169 bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];
170}