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