There is a custom protocol, which was first introduced in OpenBTS (https://github.com/RangeNetworks/openbts/blob/master/TRXManager/README.TRXManager) project to exchange control messages, clock indications and GSM bursts between BTS and transceiver. The protocol has no any concrete name, but you might often see something like "TRX Interface". OsmoTRX, being an Osmocom fork of OpenBTS transceiver, also does use this way of communication with OsmoBTS.
The protocol defines three interfaces which are basically three separate UDP connections:
- CLCK (Clock Interface, TRXC) is used to deliver clock indications from the RF hardware (usually SDR) to the upper layers (e.g. OsmoBTS).
- CTRL (Control Interface, TRXC) is used by the upper layers to configure transceiver, for example to set RX / TX frequencies, gain values and so on. The control communication here is based on ASCII commands followed by corresponding responses, just like in HTTP. Each command starts with "CMD", while each response starts with "RSP" and has a status code.
- DATA (Data Interface, TRXD) is a bidirectional interface, which carries received bursts from transceiver and to be transmitted bursts to transceiver. Each burst is being accompanied by a small header with some GSM info, such as TDMA frame and timeslot number.
The trxcon application¶
OsmocomBB was also extended to support the protocol described above in order to make the higher level applications (e.g. mobile) able to 'speak' not only with Calypso based phones, but also with different kind of transceivers, such as FakeTRX and GRGSM TRX. The first one allows you to connect the L2&3 applications directly to OsmoBTS without actual RF hardware. The second is a GNU Radio based transceiver for SDR. See the corresponding wiki pages for more details.
The original way of communication between a L2&3 application and Calypso based phone was HDLC over a serial link. This link is implemented in the 'osmocon' application, which is responsible for the firmware loading process and message forwarding between the both sides. For TRX Interface, there is another application called 'trxcon'. Just like osmocon, one provides a UNIX-socket ('/tmp/osmocom_l2' by default) to the higher level applications. At the same time, there is a lot of differences from osmocon, which make the application more complex.
[TODO: the application stricture picture here]
The application is designed like a bridge. One side is the L1CTL interface, which is used to communicate with the L2&3 applications. Another is TRX interface for 'speaking' with a transceiver. But the heart of trxcon application is GSM TDMA scheduler, which was ported from OsmoBTS. In a few words, the are two main tasks performed by scheduler. First task is to collect bursts coming from transceiver, perform GSM 05.03 decoding and forward GSM L3 payloads to the higher layers. The second one is to encode the GSM L3 messages coming from the upper layers into bursts and send them to transceiver. Of course, scheduler is also keeping itself more or less synchronized with the current BTS clock.
The trxcon application is a part of 'master' branch now. Public read-only access is available via:
$ git clone https://gitea.osmocom.org/phone-side/osmocom-bb
You can browse it via https://gitea.osmocom.org/phone-side/osmocom-bb
The source code can be found in 'src/host/trxcon/'.
The only dependency of this application is libosmocore. Make sure you have the latest version and update it if required.
Configuration and Build¶
There are two ways of building the application. The simplest way is:
$ cd osmocom-bb/src/ $ make nofirmware
This command will build all host applications including trxcon, but without the firmware.
If you wish to build only trxcon application, use:
$ cd osmocom-bb/src/ $ make trxcon
Finally, it's possible to configure and build everything manually:
$ cd osmocom-bb/src/host/trxcon/ $ autoreconf -i $ ./configure $ make
First, start the transceiver you're going to work with. See corresponding documentation for more details. Pay your attention to the host and base port used by transceiver.
Run trxcon without any arguments:
$ cd osmocom-bb/src/host/trxcon/ $ ./trxcon
You should see something like that:
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. <0001> l1ctl_link.c:235 Init L1CTL link (/tmp/osmocom_l2) <0003> trx_if.c:633 Init transceiver interface <0005> sched_trx.c:113 Init scheduler <0000> trxcon.c:270 Init complete
Then start required L2&3 application (e.g. mobile), and enjoy!
- SCH frame synchronization
- GSM 05.03 encoding / decoding
- Combined and non-combined CCCH
- TCH Half Rate channel support
- TCH Full Rate channel
- Frequency Hopping
- Power measurement
- A5/X ciphering
- SMS and USSD
Working in progress:
- Adaptive Multi-Rate (AMR)
- Multiple MS support
- GPRS / EDGE support
- CSD support