Commit Graph

11 Commits

Author SHA1 Message Date
Vadim Yanitskiy 6fa80f274e fake_trx/burst_fwd.py: FIX: apply TA value correctly
If field randomization is disabled, Timing Advance value
indicated by MS would be ignored. Let's fix this by
separating the TA calculation code.

Change-Id: If43d5823fc33efc2f1649ea941ab6f619bb6f5e7
2018-03-01 01:52:04 +07:00
Vadim Yanitskiy 81896a8328 fake_trx/burst_fwd.py: disable field randomization by default
Both RSSI and ToA fields randomization is only required in some
specific test / use cases, so let's disable it by default.

Change-Id: I94835a840b6239f2c05197292825cb26977d0216
2018-02-28 22:37:41 +07:00
Vadim Yanitskiy 3da6166111 fake_trx/burst_fwd.py: calculate both RSSI and ToA separately
In order to be able to simulate and randomize both RSSI and ToA
values for Uplink and Downlink separately, let's calculate them
in separate methods of the BurstForwarder.

Change-Id: Ia2031f22f2b549c799c782d0c8c8d0691fb6f18c
2018-02-28 22:36:53 +07:00
Vadim Yanitskiy f09989b1fb fake_trx: handle SETTA (Timing Advance) indicated by MS
Timing Advance value is a timing correction value, indicated by
the network to MS, which is used to compensate UL signal delay.
In other words, the network instructs a phone to transmit bursts
N=TA symbol periods earlier than expected.

Since we are in virtual environment, let's use TA value to
calculate the ToA (Timing of Arrival) value for BTS.

Change-Id: Ie5833a9f221587bbcac10f0b223ead9c1cbda72b
2018-02-28 22:34:36 +07:00
Vadim Yanitskiy 9fc30a4102 fake_trx/data_msg.py: use integer math for ToA
In order to avoid both float arithmetic as well as loosing any
precision, let's use integer math fot ToA (Timing of Arrival),
i.e. let's express ToA values in units of 1/256 symbol periods.

Change-Id: I56b88740f4d782ac7591fc096d1969514784a4e1
2018-02-28 22:33:35 +07:00
Vadim Yanitskiy cbd3d76df9 fake_trx/burst_fwd.py: drop useless set_slot() method
Change-Id: I721c87758f04a1962427341eb1b2d47cfdd3f780
2018-02-28 22:33:35 +07:00
Vadim Yanitskiy f35413691d fake_trx/burst_fwd.py: use DATAMSG transformation API
As the DATAMSG classes were introduced, let's use them.
This approach abstracts one from dealing with raw bytes.

Also, now BurstForwarder randomizes both RSSI and ToA values,
as this feature is supported from-the-box by the DATAMSG_TRX2L1.

Change-Id: Ib15018eab749150e244914dab4b6e433ce0c9209
2018-02-27 07:08:47 +07:00
Vadim Yanitskiy 87e5f67f66 fake_trx: implement simple freq. filter
Change-Id: Ifbeaebeaf68a88c07a05b672502f503ab7b890f2
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy b4da181c39 fake_trx: handle SETSLOT command from BB
Change-Id: I152486377ecd6777dbae7024e5d12cfdbcb17628
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy a692cacdfc fake_trx/burst_fwd.py: append two unused bytes at the end
Change-Id: I1d7ed076d93b37699520ee2a31c42c177f966865
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 3187c8e68d target/fake_trx: initial release of virtual transceiver
This is a set of tools for creating a virtual Um-interface between
OsmocomBB and OsmoBTS. It may be extremely useful for testing and
development of GSM stack, including both sides (MS and BTS). This
software implements OsmoTRX (Osmocom's fork of OpenBTS transceiver)
style clock (CLCK), control (CTRL) and data interfaces. So, OsmoBTS
source code doesn't require any modifications, while for OsmocomBB
you will need to use a new application - trxcon, which can be found
in the 'fixeria/sdr_phy' branch until one is merged to master.

Brief description of available applications:

  - fake_trx.py - main application, that allows to connect both
    OsmocomBB and OsmoBTS without actual RF hardware. Currently
    only a single MS may work with a single BTS.

  - clck_gen.py - a peripheral tool aimed to emulate TDMA frame
    clock generator. Could be used for testing and clock
    synchronization of multiple applications. It should be noted,
    that one relays on generic system timer (via Python), so
    a random clock jitter takes place.

  - ctrl_cmd.py - another peripheral tool, which could be used
    for sending CTRL commands directly in manual mode, and also
    for application fuzzing.

Change-Id: Ib1fb80682002ac85a72fa6abef459a4c44f4ab97
2017-11-19 17:35:07 +07:00