Adding M1-U options to eNB config

master
Pedro Alvarez 6 years ago committed by Andre Puschmann
parent ebadf3029e
commit 796e3fd707

@ -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 {

@ -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;

@ -241,8 +241,8 @@ bool enb::init(all_args_t *args_)
pdcp.init(&rlc, &rrc, &gtpu, &pdcp_log);
rrc.init(&rrc_cfg, &phy, &mac, &rlc, &pdcp, &s1ap, &gtpu, &rrc_log);
s1ap.init(args->enb.s1ap, &rrc, &s1ap_log);
gtpu.init(args->enb.s1ap.gtp_bind_addr, args->enb.s1ap.mme_addr, &pdcp, &gtpu_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, &gtpu_log, args->expert.enable_mbsfn);
started = true;
return true;
}

@ -145,9 +145,7 @@ void parse_args(all_args_t *args, int argc, char* argv[]) {
bpo::value<int>(&args->expert.mac.sched.nof_ctrl_symbols)->default_value(3),
"Number of control symbols")
/* Expert section */
("expert.metrics_period_secs",
bpo::value<float>(&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<uint32_t>(&args->expert.rrc_inactivity_timer)->default_value(60000),
"Inactivity timer in ms")
("expert.enable_mbsfn",
bpo::value<bool>(&args->expert.enable_mbsfn)->default_value(false),
"enables mbms in the enodeb")
"Enables MBMS in the eNB")
("expert.print_buffer_state",
bpo::value<bool>(&args->expert.print_buffer_state)->default_value(false),
"Prints on the console the buffer state every 10 seconds")
("expert.m1u_multiaddr",
bpo::value<string>(&args->expert.m1u_multiaddr)->default_value("239.255.0.1"),
"M1-U Multicast address the eNB joins.")
("expert.m1u_if_addr",
bpo::value<string>(&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

@ -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");

Loading…
Cancel
Save