From 5eb17e28acdd6fba22a1f2e60f4d55aaef18b47a Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 9 Jan 2016 13:13:37 +0100 Subject: 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 --- include/osmo-bts/gsm_data.h | 6 ++++++ include/osmo-bts/phy_link.h | 13 +++++++++++++ 2 files changed, 19 insertions(+) (limited to 'include') 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 { @@ -46,6 +48,14 @@ struct phy_link { uint32_t clock_advance; 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; @@ -98,6 +108,9 @@ struct phy_instance { struct trx_l1h *hdl; bool sw_act_reported; } osmotrx; + struct { + struct l1sched_trx sched; + } virt; struct { /* logical transceiver number within one PHY */ uint32_t trx_id; -- cgit v1.2.3