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