From 23cc0ab011eae9acaf645a19d8c36cd46b629870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 9 Jul 2018 11:52:17 +0200 Subject: [PATCH] enb: add bind address for s1ap connection (#128) add s1c_bind_addr config option to specify the local bind address used for S1AP connections instead of using the GTP address. This allows operation on setups with split S1U and S1C networks. --- srsenb/enb.conf.example | 4 ++-- srsenb/hdr/upper/s1ap.h | 1 + srsenb/src/main.cc | 1 + srsenb/src/upper/s1ap.cc | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/srsenb/enb.conf.example b/srsenb/enb.conf.example index 4fa2a5731..1c7c93214 100644 --- a/srsenb/enb.conf.example +++ b/srsenb/enb.conf.example @@ -25,12 +25,12 @@ tac = 0x0007 mcc = 001 mnc = 01 mme_addr = 127.0.1.100 -gtp_bind_addr = 127.0.0.1 +gtp_bind_addr = 127.0.1.1 +s1c_bind_addr = 127.0.1.1 n_prb = 50 #tm = 4 #nof_ports = 2 - ##################################################################### # eNB configuration files # diff --git a/srsenb/hdr/upper/s1ap.h b/srsenb/hdr/upper/s1ap.h index 284b67d03..b686b6583 100644 --- a/srsenb/hdr/upper/s1ap.h +++ b/srsenb/hdr/upper/s1ap.h @@ -49,6 +49,7 @@ typedef struct { uint16_t mnc; // BCD-coded with 0xF filler std::string mme_addr; std::string gtp_bind_addr; + std::string s1c_bind_addr; std::string enb_name; }s1ap_args_t; diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index eab5d4bcf..3622f8d05 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -77,6 +77,7 @@ void parse_args(all_args_t *args, int argc, char* argv[]) { ("enb.mnc", bpo::value(&mnc)->default_value("01"), "Mobile Network Code") ("enb.mme_addr", bpo::value(&args->enb.s1ap.mme_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connnection") ("enb.gtp_bind_addr", bpo::value(&args->enb.s1ap.gtp_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for GTP connection") + ("enb.s1c_bind_addr", bpo::value(&args->enb.s1ap.s1c_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for S1AP connection") ("enb.phy_cell_id", bpo::value(&args->enb.pci)->default_value(0), "Physical Cell Identity (PCI)") ("enb.n_prb", bpo::value(&args->enb.n_prb)->default_value(25), "Number of PRB") ("enb.nof_ports", bpo::value(&args->enb.nof_ports)->default_value(1), "Number of ports") diff --git a/srsenb/src/upper/s1ap.cc b/srsenb/src/upper/s1ap.cc index 8cc4bebda..1e2b25987 100644 --- a/srsenb/src/upper/s1ap.cc +++ b/srsenb/src/upper/s1ap.cc @@ -274,8 +274,8 @@ bool s1ap::connect_mme() memset(&local_addr, 0, sizeof(struct sockaddr_in)); local_addr.sin_family = ADDR_FAMILY; local_addr.sin_port = 0; // Any local port will do - if(inet_pton(AF_INET, args.gtp_bind_addr.c_str(), &(local_addr.sin_addr)) != 1) { - s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.gtp_bind_addr.c_str()); + if(inet_pton(AF_INET, args.s1c_bind_addr.c_str(), &(local_addr.sin_addr)) != 1) { + s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.s1c_bind_addr.c_str()); return false; } bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr));