blob: 8f90a1a1db1447a739813c19b4516bac51bb8f15 [file] [log] [blame]
Harald Welte51cfec02019-04-03 09:18:44 +02001== osmo-remsim-client-st2
Harald Welte5bae20b2019-04-01 09:36:42 +02002
Harald Welte35f2b202019-04-01 11:01:51 +02003The client interfaces with GSM phones / modems via dedicated "Card
4Emulation" devices such as the Osmocom SIMtrace2 or sysmocom sysmoQMOD
5board + firmware. This hardware implements the ISO7816-3 electrical
6interface and protocol handling and passes any TPDU headers received
Harald Welte51cfec02019-04-03 09:18:44 +02007from the phone/modem to `osmo-remsim-client` for further processing of
8the TPDUs associated to the given APDU transfer.
Harald Welte35f2b202019-04-01 11:01:51 +02009
Harald Welte51cfec02019-04-03 09:18:44 +020010`osmo-remsim-client` connects via a RSPRO control connection to
11`osmo-remsim-server` at startup and registers itself. It will receive
12configuration data such as the `osmo-remsim-bankd` IP+Port and the
13ClientId from `osmo-remsim-server`.
Harald Welte35f2b202019-04-01 11:01:51 +020014
Harald Welte51cfec02019-04-03 09:18:44 +020015After receiving the configuration, `osmo-remsim-client` will establish a
16RSPRO data connection to the `osmo-remsim-bankd` IP:Port.
Harald Welte35f2b202019-04-01 11:01:51 +020017
18As the USB interface for remote SIM in simtrace2.git uses one interface
19per slot, we can implement the client in blocking mode, i.e. use
20blocking I/O on the TCP/RSPRO side. This simplifies the code compared
21to a more complex async implementation.
22
Harald Welte5bae20b2019-04-01 09:36:42 +020023=== Running
24
Harald Welte51cfec02019-04-03 09:18:44 +020025osmo-remsim-client-st2 currently has the following command-line options:
Harald Welte5bae20b2019-04-01 09:36:42 +020026
27==== SYNOPSIS
28
Harald Welte51cfec02019-04-03 09:18:44 +020029*osmo-remsim-client-st2* [...]
Harald Welte5bae20b2019-04-01 09:36:42 +020030
31==== OPTIONS
32
33*-h, --help*::
34 Print a short help message about the supported options
35*-s, --server-host A.B.C.D*::
Harald Welte51cfec02019-04-03 09:18:44 +020036 Specify the remote IP address / hostname of the `osmo-remsim-server` to
37 which this client shall establish its RSPRO control connection
Harald Welte5bae20b2019-04-01 09:36:42 +020038*-p, --server-port <1-65535>*::
Harald Welte51cfec02019-04-03 09:18:44 +020039 Specify the remote TCP port number of the `osmo-remsim-server` to which
40 this client shall establish its RSPRO control connection
Harald Welte5bae20b2019-04-01 09:36:42 +020041*-c, --client-id <1-65535>*::
42 Specify the numeric client identifier of the SIM bank this bankd
Harald Welte51cfec02019-04-03 09:18:44 +020043 instance operates. The tuple of client-id and client-slot must be
44 unique among all clients connecting to the same `osmo-remsim-server`.
Harald Welte5bae20b2019-04-01 09:36:42 +020045*-n, --client-slot <0-65535>*::
46 Specify the slot number served within this client. The tuple of
47 client-id and client-slot must be unique among all clients connecting
Harald Welte51cfec02019-04-03 09:18:44 +020048 to the same `osmo-remsim-server`.
Harald Welte5bae20b2019-04-01 09:36:42 +020049*-i, --gsmtap-ip A.B.C.D*::
50 Specify the IP address (if any) to which APDU traces are sent in
51 GSMTAP format (useful for debugging; supported by wireshark).
52*-k, --keep-running*::
Harald Welte51cfec02019-04-03 09:18:44 +020053 Specify if the `osmo-remsim-client` should terminate after handling one
Harald Welte5bae20b2019-04-01 09:36:42 +020054 session, or whether it should keep running. Fast respawn (i.e. no
55 --keep-running) is probably the more robust option at this point.
56*-V, --usb-vendor*::
57 Specify the USB Vendor ID of the USB device served by this client,
58 use e.g. 0x1d50 for SIMtrace2, sysmoQMOD and OWHW.
59*-P, --usb-product*::
60 Specify the USB Product ID of the USB device served by this client,
61 use e.g. 0x4004 for sysmoQMOD.
62*-C, --usb-config*::
63 Specify the USB Cofiguration number of the USB device served by this
64 client. Default will use current configuration of the device.
65*-I, --usb-interface*::
66 Specify the USB Interface number (within active configuration) of the
67 USB device served by this client. Default will use FIXME.
68*-S, --usb-altsetting*::
69 Specify the USB Alternate Setting to be used within the USB Interface
70 of the USB device served by this client. Default will use FIXME.
71*-A, --usb-address <0-255>*::
72 Specify the USB Address of the USB device served by this client. This
73 is useful in case multiple identical USB devices are attached to the
74 same host. However, the address changed at every re-enumeration and
75 it's therefor recommended to use the USB path (see below).
76*-H, --usb-path*::
77 Specify the USB path of the USB device served by this client. This is
78 usefule to disambiguate between multiple identical USB devices
79 attached to the same host. You don't need this if you have only one
80 SIM emulation device attached to your system.
81*-a, --atr HEXSTRING*::
82 Specify the initial ATR to be communicated to the modem/phone. Can
Harald Welte51cfec02019-04-03 09:18:44 +020083 and will later be overridden by the ATR as specified by
84 `osmo-remsim-bankd` once a card has been mapped to this client.
Harald Welte5bae20b2019-04-01 09:36:42 +020085
Joachim Steiger68f95102019-07-03 19:03:24 +020086==== Examples
87.remsim-server is on 10.2.3.4, sysmoQMOD on usb bus, all 4 modems:
88----
89osmo-remsim-client-st2 -s 10.2.3.4 -V 1d50 -P 4004 -C 1 -I 0 -H 2-1.1 -c 0 -n 0
90osmo-remsim-client-st2 -s 10.2.3.4 -V 1d50 -P 4004 -C 1 -I 1 -H 2-1.1 -c 0 -n 1
91osmo-remsim-client-st2 -s 10.2.3.4 -V 1d50 -P 4004 -C 1 -I 0 -H 2-1.4 -c 0 -n 2
92osmo-remsim-client-st2 -s 10.2.3.4 -V 1d50 -P 4004 -C 1 -I 1 -H 2-1.4 -c 0 -n 3
93----
94
Harald Welte5bae20b2019-04-01 09:36:42 +020095=== Logging
96
Harald Welte51cfec02019-04-03 09:18:44 +020097`osmo-remsim-client` currently logs to stdout only, and the logging
98verbosity is not yet configurable. However, as the libosmocore logging
99framework is used, extending this is an easy modification.