blob: 5d6719e9800c51d4eb707dfd591a466995f16522 [file] [log] [blame]
Holger Hans Peter Freyther456fccf2013-02-26 10:54:19 +01001
2IPA SCCP message flow in the BSC
3
4February, 2013 Holger Hans Peter Freyther
5
6CONTENTS
7
81. SCCP inside the IPA header
92. Supported SCCP message types
103. Receiving SCCP messages
114. Sending SCCP messages
12
13
141. SCCP inside the IPA header
15
16Many Soft-MSCs implement something that is called SCCP/lite. This means
17that SCCP messages are transported inside a small multiplexing protocol
18over TCP/IP. This is an alternative to a full SIGTRAN implementation.
19
20The multiplexing protocol is the same as used with the sysmoBTS and the
21ip.access nanoBTS. It is a three byte header with two bytes for the length
22in network byte order and one byte for the type. The type to be used for
23SCCP is 0xFD.
24
25 struct ipa_header {
26 uint16_t length_in_network_order;
27 uint8_t type;
28 } __attribute__((packed));
29
30
31
322. Supported SCCP message types
33
34To implement GSM 08.08 only a subset of SCCP messages need to be implemented.
35For transporting paging and reset messages SCCP UDT messages are used. For
36the connections with a Mobile Station (MS) a SCCP connection is opened. This
37means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1
38and SCCP IT messages are supported.
39
40
413. Receiving SCCP UDT messages
42
43This is an illustration of the flow of messages. The IPA multiplexing protocol
44is used for various protocols. This means there is a central place where the
45multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c
46file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching
47sccp_system_incoming method is called. This function is implemented in the
48libosmo-sccp library.
49
50To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the
51sccp_set_read function to register a callback for UDT messages. The callback
52is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the
53osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages.
54Currently only the reset acknowledge and the paging messages are handled.
55
56The BSC currently does not accept incoming SCCP messages and is only opening
57SCCP connections to the MSC. When opening a connection the callbacks for state
58changes (connection confirmed, released, release complete) are set and a routine
59for handling incoming data. This registration is done in the osmo_bsc_sccp.c
60file and the bsc_create_new_connection method. The name of the callback is
61msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented
62in the osmo_bsc_bssap.c file. This will forward the messages to the right
63Mobile Station (MS).
64
65
664. Sending SCCP messages
67
68There are three parts to sending that will be explained below. The first part
69is to send an entire SCCP frame (which includes the GSM 08.08 data) to the
70MSC. This is done by first registering the low level sending. sccp_system_init
71is called with the function that is responsible for sending a message. The
72msc_sccp_write_ipa will call the msc_queue_write function with the data and
73the right MSC connection. Below the msc_queue_write the IPA header will be
74prepended to the msg and then send to the MSC.
75
76The BSC supports multiple different A-link connections, the decision to pick
77the right MSC is done in this method. It is either done via the SCCP connection
78or the ctx pointer.
79
80When the BSC is starting a BSS RESET message will be sent to the MSC. The reset
81is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with
82the GSM 08.08 data and the connection to use. The libosmo-sccp library will
83embed it into a SCCP UDT message and call the msc_sccp_write_ipa method.
84
85When a new SCCP connection is to be created the bsc_create_new_connection
86in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create
87the context for a SCCP connection. The state and data callback will be used
88to be notified about data and changes. Once the connection is configured the
89bsc_open_connection will be called that will ask the libosmo-sccp library to
90create a SCCP CR message using the sccp_connection_connect method. For active
91connections the sccp_connection_write method will be called.
92
93
94