aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmo-bts
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-09 13:13:37 +0100
committerHarald Welte <laforge@gnumonks.org>2017-07-13 19:34:17 +0000
commit5eb17e28acdd6fba22a1f2e60f4d55aaef18b47a (patch)
tree7e2e6dd96ce541fb4fda6ae3694ba27d971e1033 /include/osmo-bts
parent152c2f489cd214b1a400b158df2b8726f779358a (diff)
VIRT-PHY: Initial check-in of a new virtual BTS
This patch adds a virtual physical layer designed to simulate the Um air interface between BTS and MS. It does so by encapsulating MAC blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP streams, both in uplink and in downlink. The purpose of this is enable testing without any radio hardware or related licenses. OsmocomBB has recently received as similar patch-set, adding a virty_phy executable that can be run on a PC instead of the classic 'layer1' firmware on a real phone. Using GSMTAP means that one can use unmodified wireshark to decode the messages exchanged on the virtual Um layer. This code was originally started by Harald in January 2016, continued by Sebastian Stumpf in late 2016 and early 2017, and finally completed by Harald in July 2017. Change-Id: I1bf7670975b1e367c1c62983020865a043542622
Diffstat (limited to 'include/osmo-bts')
-rw-r--r--include/osmo-bts/gsm_data.h6
-rw-r--r--include/osmo-bts/phy_link.h13
2 files changed, 19 insertions, 0 deletions
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index c513b279..aeac4b29 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -114,6 +114,12 @@ struct gsm_bts_role_bts {
struct {
char *sock_path;
} pcu;
+
+ struct {
+ uint32_t last_fn;
+ struct timeval tv_clock;
+ struct osmo_timer_list fn_timer;
+ } vbts;
};
enum lchan_ciph_state {
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index 4c7ff348..d8d3c6b4 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -10,11 +10,13 @@
#include "btsconfig.h"
struct gsm_bts_trx;
+struct virt_um_inst;
enum phy_link_type {
PHY_LINK_T_NONE,
PHY_LINK_T_SYSMOBTS,
PHY_LINK_T_OSMOTRX,
+ PHY_LINK_T_VIRTUAL,
};
enum phy_link_state {
@@ -47,6 +49,14 @@ struct phy_link {
uint32_t rts_advance;
} osmotrx;
struct {
+ char *mcast_dev; /* Network device for multicast */
+ char *bts_mcast_group; /* BTS are listening to this group */
+ uint16_t bts_mcast_port;
+ char *ms_mcast_group; /* MS are listening to this group */
+ uint16_t ms_mcast_port;
+ struct virt_um_inst *virt_um;
+ } virt;
+ struct {
/* MAC address of the PHY */
struct sockaddr_ll phy_addr;
/* Network device name */
@@ -99,6 +109,9 @@ struct phy_instance {
bool sw_act_reported;
} osmotrx;
struct {
+ struct l1sched_trx sched;
+ } virt;
+ struct {
/* logical transceiver number within one PHY */
uint32_t trx_id;
/* trx lock state variable */