blob: 059182bb29bf2bec7d6376dc7241e52f7881de79 [file] [log] [blame]
Harald Welte5103ea02020-03-04 15:31:58 +01001[[rspro]]
Harald Welte3c4d0062019-03-31 18:55:18 +02002== RSPRO
3
4*RSPRO*, the *Remote SIM Protocol*, is an osmo-remsim specific,
5non-standard communications protocol used between the elements of the
6osmo-remsim system.
7
8It is specified in ASN.1 syntax (see `asn1/RSPRO.asn` in the
9`osmo-remsim` source code) and uses BER (Basic Encoding Rules) on the
10transport level.
11
Harald Welteddbe43a2020-03-04 15:30:37 +010012WARNING: RSPRO and its underlying transport layer both operate in plain-text,
13There is no authentication or encryption built into the protocol. It is
14assumed that the protocol is only spoken over trusted, controlled IP
15networks, such as inside a VPN or a closed / private corporate network.
16
Harald Welte3c4d0062019-03-31 18:55:18 +020017=== Underlying Transport Layer
18
19RSPRO uses TCP as an underlying transport protocol. As TCP doesn't
20preserve message boundaries, the IPA multiplex is used as intermediate
21layer between TCP and the BER-encoded RSPRO PDU.
22
23For more information about the IPA multiplex, see the related chapter
24in http://ftp.osmocom.org/docs/latest/osmobts-abis.pdf
25
26RSPRO uses the IPA CCM PING/PONG messages for keep-alive and detection
27of dead/stale connections. The compiled-in defaults transmits one IPA
28PING every 30s and waits 10s for a response from the peer before
29declaring the connection as dead.
30
31=== RSPRO PDU
32
33An RsproPDU consists of:
34
35* *version* of the protocol (v2 is current)
36* *tag* specified by the sender, echoed back by the receiver in
37 its response so the server can map responses back to a specific
38 request
39* *msg* the actual RSPRO Message (union/choice)
40
41=== RSPRO Operations
42
43Each RSPRO Operation typically (unless specified othewise) consists of a
44Request and Response pair.
45
46==== ConnectBank
47
48This is used by `remsim-bankd` to identify itself to `remsim-server` and
49to establish a logical connection between the two elements.
50
51==== ConnectClient
52
53This is used by `remsim-client` to identify itself to `remsim-server`
54and to establish a logical connection between the two elements.
55
56==== CreateMapping
57
58This is used by `remsim-server` to install a slot mapping in a
59`remsim-bankd`.
60
61==== RemoveMapping
62
63This is used by `remsim-server` to remove a slot mapping from a
64`remsim-bankd`.
65
66==== ConfigClientId
67
68This is used by `remsim-server` to dynamically configure a ClientID in a
69`remsim-client`. This mode is currently not supported yet, each client
70must have a locally-configured ClientID.
71
72==== ConfigClientBank
73
74This is used by `remsim-server` to inform a `remsim-client` about the
75details (bankd ID, slot number, IP address, TCP port) of a the
76`remsim-bankd` to which it shall connect.
77
78==== ErrorInd
79
80This is a generic error indication that can be sent by any RSRPO entity.
81
82==== SetAtr
83
84This is used by `remsim-bankd` to inform the `remsim-client` about the
85ATR of the card, so that `remsim-client` can replicate that ATR when
86answering to the reset of the SIM card interface of the phone/modem.
87
88==== TpduModemToCard
89
90This is used by `remsim-client` to transfer a command TPDU/APDU from the
91phone/modem to the SIM card in `remsim-bankd`
92
93==== TpduCardToModem
94
95This is used by `remsim-bankd` to transfer a response TPDU/APDU from the
96SIM card back to the phone/modem at `remsim-client`.
97
98==== ClientSlotStatusInd
99
100This is used by `remsim-client` to report the status of a given slot.
101
102==== BankSlotStatusInd
103
104This is used by `remsim-bankd` to report the status of a given slot.