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 do use this way of communication with OsmoBTS.
In general, this protocol defines three interfaces which are basicly UDP sockets:
- CLCK (Clock Interface) is used to deliver clock indications from actual RF hardware to the upper layers (e.g. OsmoBTS).
- CTRL (Control Interface) is used by 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 message starts with "CMD", while each response message starts with "RSP" and has a status code.
- DATA (Data Interface) 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 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.
For now, the trxcon application is a part of 'fixeria/trx' branch. Public read-only access is available via:
$ git clone git://git.osmocom.org/osmocom-bb -b fixeria/trx
You can browse it via cgit: http://cgit.osmocom.org/osmocom-bb/log/?h=fixeria/trx
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:
Copyright (C) 2016-2017 by Vadim Yanitskiy 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
- Power measurement
- SMS and USSD
Working in progress:
- TCH Full Rate channel support
- TCH Half Rate channel support
- Adaptive Multi-Rate (AMR)
- A5/X ciphering support
- Frequency Hopping
- Multiple MS support
- GPRS / EDGE support
- CSD support
- Burst / L3 frame capture to file
- Burst / L3 frame injection