Adding M1-U options to eNB config

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

@ -128,6 +128,8 @@ typedef struct {
float metrics_period_secs; float metrics_period_secs;
bool enable_mbsfn; bool enable_mbsfn;
bool print_buffer_state; bool print_buffer_state;
std::string m1u_multiaddr;
std::string m1u_if_addr;
}expert_args_t; }expert_args_t;
typedef struct { typedef struct {

@ -49,7 +49,7 @@ public:
gtpu(); 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(); void stop();
// gtpu_interface_rrc // gtpu_interface_rrc
@ -70,6 +70,8 @@ private:
bool enable_mbsfn; bool enable_mbsfn;
std::string gtp_bind_addr; std::string gtp_bind_addr;
std::string mme_addr; std::string mme_addr;
std::string m1u_multiaddr;
std::string m1u_if_addr;
srsenb::pdcp_interface_gtpu *pdcp; srsenb::pdcp_interface_gtpu *pdcp;
srslte::log *gtpu_log; srslte::log *gtpu_log;

@ -241,7 +241,7 @@ bool enb::init(all_args_t *args_)
pdcp.init(&rlc, &rrc, &gtpu, &pdcp_log); pdcp.init(&rlc, &rrc, &gtpu, &pdcp_log);
rrc.init(&rrc_cfg, &phy, &mac, &rlc, &pdcp, &s1ap, &gtpu, &rrc_log); rrc.init(&rrc_cfg, &phy, &mac, &rlc, &pdcp, &s1ap, &gtpu, &rrc_log);
s1ap.init(args->enb.s1ap, &rrc, &s1ap_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; started = true;
return 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), bpo::value<int>(&args->expert.mac.sched.nof_ctrl_symbols)->default_value(3),
"Number of control symbols") "Number of control symbols")
/* Expert section */ /* Expert section */
("expert.metrics_period_secs", ("expert.metrics_period_secs",
bpo::value<float>(&args->expert.metrics_period_secs)->default_value(1.0), bpo::value<float>(&args->expert.metrics_period_secs)->default_value(1.0),
"Periodicity for metrics in seconds") "Periodicity for metrics in seconds")
@ -194,11 +192,19 @@ void parse_args(all_args_t *args, int argc, char* argv[]) {
("expert.enable_mbsfn", ("expert.enable_mbsfn",
bpo::value<bool>(&args->expert.enable_mbsfn)->default_value(false), bpo::value<bool>(&args->expert.enable_mbsfn)->default_value(false),
"enables mbms in the enodeb") "Enables MBMS in the eNB")
("expert.print_buffer_state", ("expert.print_buffer_state",
bpo::value<bool>(&args->expert.print_buffer_state)->default_value(false), bpo::value<bool>(&args->expert.print_buffer_state)->default_value(false),
"Prints on the console the buffer state every 10 seconds") "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 // 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_; pdcp = pdcp_;
gtpu_log = gtpu_log_; gtpu_log = gtpu_log_;
gtp_bind_addr = gtp_bind_addr_; gtp_bind_addr = gtp_bind_addr_;
mme_addr = mme_addr_; mme_addr = mme_addr_;
m1u_multiaddr = m1u_multiaddr_;
m1u_if_addr = m1u_if_addr_;
pool = byte_buffer_pool::get_instance(); 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() void gtpu::stop()
{ {
if(enable_mbsfn){
if(enable_mbsfn){
mchthread.stop(); mchthread.stop();
} }
@ -327,6 +328,10 @@ bool gtpu::mch_thread::init(pdcp_interface_gtpu *pdcp, srslte::log *gtpu_log)
this->pdcp = pdcp; this->pdcp = pdcp;
this->gtpu_log = gtpu_log; this->gtpu_log = gtpu_log;
gtpu_log->info("M1-U initialized\n");
return true;
}
struct sockaddr_in bindaddr; struct sockaddr_in bindaddr;
// Set up sink socket // Set up sink socket
@ -350,11 +355,12 @@ bool gtpu::mch_thread::init(pdcp_interface_gtpu *pdcp, srslte::log *gtpu_log)
/* Send an ADD MEMBERSHIP message via setsockopt */ /* Send an ADD MEMBERSHIP message via setsockopt */
struct ip_mreq mreq; struct ip_mreq mreq;
mreq.imr_multiaddr.s_addr = inet_addr("239.255.0.1"); //Multicast address of the service mreq.imr_multiaddr.s_addr = inet_addr(m1u_multiaddr.c_str()); //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_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, if (setsockopt(m1u_sd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
&mreq, sizeof(mreq)) < 0) { &mreq, sizeof(mreq)) < 0) {
gtpu_log->error("Register musticast group for M1-U\n"); 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; return false;
} }
gtpu_log->info("M1-U initialized\n"); gtpu_log->info("M1-U initialized\n");

Loading…
Cancel
Save