diff --git a/srsenb/hdr/enb.h b/srsenb/hdr/enb.h index 2f00f5f62..4176fbb82 100644 --- a/srsenb/hdr/enb.h +++ b/srsenb/hdr/enb.h @@ -128,6 +128,8 @@ typedef struct { float metrics_period_secs; bool enable_mbsfn; bool print_buffer_state; + std::string m1u_multiaddr; + std::string m1u_if_addr; }expert_args_t; typedef struct { diff --git a/srsenb/hdr/upper/gtpu.h b/srsenb/hdr/upper/gtpu.h index 3771ec402..b25139a17 100644 --- a/srsenb/hdr/upper/gtpu.h +++ b/srsenb/hdr/upper/gtpu.h @@ -49,7 +49,7 @@ public: gtpu(); - bool init(std::string gtp_bind_addr_, std::string mme_addr_, pdcp_interface_gtpu *pdcp_, srslte::log *gtpu_log_, bool enable_mbsfn = false); + bool init(std::string gtp_bind_addr_, std::string mme_addr_, std::string m1u_multiaddr_, std::string m1u_if_addr_, pdcp_interface_gtpu *pdcp_, srslte::log *gtpu_log_, bool enable_mbsfn = false); void stop(); // gtpu_interface_rrc @@ -70,6 +70,8 @@ private: bool enable_mbsfn; std::string gtp_bind_addr; std::string mme_addr; + std::string m1u_multiaddr; + std::string m1u_if_addr; srsenb::pdcp_interface_gtpu *pdcp; srslte::log *gtpu_log; diff --git a/srsenb/src/enb.cc b/srsenb/src/enb.cc index 23cd63882..a1906400b 100644 --- a/srsenb/src/enb.cc +++ b/srsenb/src/enb.cc @@ -241,8 +241,8 @@ bool enb::init(all_args_t *args_) pdcp.init(&rlc, &rrc, >pu, &pdcp_log); rrc.init(&rrc_cfg, &phy, &mac, &rlc, &pdcp, &s1ap, >pu, &rrc_log); s1ap.init(args->enb.s1ap, &rrc, &s1ap_log); - gtpu.init(args->enb.s1ap.gtp_bind_addr, args->enb.s1ap.mme_addr, &pdcp, >pu_log, args->expert.enable_mbsfn); - + gtpu.init(args->enb.s1ap.gtp_bind_addr, args->enb.s1ap.mme_addr, args->expert.m1u_multiaddr, args->expert.m1u_if_addr, &pdcp, >pu_log, args->expert.enable_mbsfn); + started = true; return true; } diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index d36cf7ef8..c9cecbebd 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -145,9 +145,7 @@ void parse_args(all_args_t *args, int argc, char* argv[]) { bpo::value(&args->expert.mac.sched.nof_ctrl_symbols)->default_value(3), "Number of control symbols") - /* Expert section */ - ("expert.metrics_period_secs", bpo::value(&args->expert.metrics_period_secs)->default_value(1.0), "Periodicity for metrics in seconds") @@ -191,14 +189,22 @@ void parse_args(all_args_t *args, int argc, char* argv[]) { ("expert.rrc_inactivity_timer", bpo::value(&args->expert.rrc_inactivity_timer)->default_value(60000), "Inactivity timer in ms") - + ("expert.enable_mbsfn", bpo::value(&args->expert.enable_mbsfn)->default_value(false), - "enables mbms in the enodeb") + "Enables MBMS in the eNB") ("expert.print_buffer_state", bpo::value(&args->expert.print_buffer_state)->default_value(false), "Prints on the console the buffer state every 10 seconds") + + ("expert.m1u_multiaddr", + bpo::value(&args->expert.m1u_multiaddr)->default_value("239.255.0.1"), + "M1-U Multicast address the eNB joins.") + + ("expert.m1u_if_addr", + bpo::value(&args->expert.m1u_if_addr)->default_value("127.0.1.201"), + "IP address of the interface the eNB will listen for M1-U traffic.") ; // Positional options - config file location diff --git a/srsenb/src/upper/gtpu.cc b/srsenb/src/upper/gtpu.cc index d6cc3fc89..4f4df81b5 100644 --- a/srsenb/src/upper/gtpu.cc +++ b/srsenb/src/upper/gtpu.cc @@ -43,12 +43,14 @@ gtpu::gtpu():mchthread() } -bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, srsenb::pdcp_interface_gtpu* pdcp_, srslte::log* gtpu_log_, bool enable_mbsfn) +bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, std::string m1u_multiaddr_, std::string m1u_if_addr_, srsenb::pdcp_interface_gtpu* pdcp_, srslte::log* gtpu_log_, bool enable_mbsfn) { pdcp = pdcp_; gtpu_log = gtpu_log_; gtp_bind_addr = gtp_bind_addr_; mme_addr = mme_addr_; + m1u_multiaddr = m1u_multiaddr_; + m1u_if_addr = m1u_if_addr_; pool = byte_buffer_pool::get_instance(); @@ -93,8 +95,7 @@ bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, srsenb::pdcp_ void gtpu::stop() { - - if(enable_mbsfn){ + if(enable_mbsfn){ mchthread.stop(); } @@ -327,8 +328,12 @@ bool gtpu::mch_thread::init(pdcp_interface_gtpu *pdcp, srslte::log *gtpu_log) this->pdcp = pdcp; this->gtpu_log = gtpu_log; + +gtpu_log->info("M1-U initialized\n"); +return true; +} struct sockaddr_in bindaddr; - + // Set up sink socket m1u_sd = socket(AF_INET, SOCK_DGRAM, 0); if (m1u_sd < 0) { @@ -350,11 +355,12 @@ bool gtpu::mch_thread::init(pdcp_interface_gtpu *pdcp, srslte::log *gtpu_log) /* Send an ADD MEMBERSHIP message via setsockopt */ struct ip_mreq mreq; - mreq.imr_multiaddr.s_addr = inet_addr("239.255.0.1"); //Multicast address of the service - mreq.imr_interface.s_addr = inet_addr("127.0.1.200"); //Address of the IF the socket will listen to. + mreq.imr_multiaddr.s_addr = inet_addr(m1u_multiaddr.c_str()); //Multicast address of the service + mreq.imr_interface.s_addr = inet_addr(m1u_if_addr.c_str()); //Address of the IF the socket will listen to. if (setsockopt(m1u_sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) { gtpu_log->error("Register musticast group for M1-U\n"); + gtpu_log->error("M1-U infterface IP: %s, M1-U Multicast Address %s\n", m1u_if_addr.c_str(),m1u_multiaddr.c_str()); return false; } gtpu_log->info("M1-U initialized\n");