lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

June 2024

  • 1 participants
  • 1566 discussions
[S] Change in libosmo-abis[master]: README.md: cosmetic: fix a typo
by laforge 05 Jun '24

05 Jun '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/37015?usp=email ) Change subject: README.md: cosmetic: fix a typo ...................................................................... README.md: cosmetic: fix a typo Change-Id: I3ed7df467f1cbd769a5a367771a69e578c2075e3 --- M README.md 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/README.md b/README.md index 2622c9f..ef7783d 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Our coding standards are described at <https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards> -We us a gerrit based patch submission/review process for managing +We use a Gerrit based patch submission/review process for managing contributions. Please see <https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for more details -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/37015?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I3ed7df467f1cbd769a5a367771a69e578c2075e3 Gerrit-Change-Number: 37015 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-s1gw[master]: config/sys.config: add default environment params
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37047?usp=email ) Change subject: config/sys.config: add default environment params ...................................................................... config/sys.config: add default environment params Change-Id: Ie5ec9f62d77407152e18ea3c20cf401151fa6aea --- M config/sys.config M src/osmo_s1gw_sup.erl 2 files changed, 22 insertions(+), 3 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/config/sys.config b/config/sys.config index dcace60..8055631 100644 --- a/config/sys.config +++ b/config/sys.config @@ -1,6 +1,16 @@ %% -*- erlang -*- -[{kernel, +[%% =========================================== + %% application config + %% =========================================== + {osmo_s1gw, + [{s1gw_bind_addr, "127.0.1.1"}, %% S1GW bind address for incoming eNB connections + {mme_addr, "127.0.2.1"} %% MME address for outgoing connections + ]}, + %% =========================================== + %% kernel config + %% =========================================== + {kernel, [{logger_level, info}, {logger, [{handler, default, logger_std_h, diff --git a/src/osmo_s1gw_sup.erl b/src/osmo_s1gw_sup.erl index a62f266..4c93756 100644 --- a/src/osmo_s1gw_sup.erl +++ b/src/osmo_s1gw_sup.erl @@ -8,9 +8,9 @@ -define(SERVER, ?MODULE). -define(ENV_APP_NAME, osmo_s1gw). --define(ENV_DEFAULT_S1GW_BIND_ADDR, "0.0.0.0"). +-define(ENV_DEFAULT_S1GW_BIND_ADDR, "127.0.1.1"). -define(ENV_DEFAULT_S1GW_BIND_PORT, ?S1AP_PORT). --define(ENV_DEFAULT_MME_ADDR, "127.0.0.1"). +-define(ENV_DEFAULT_MME_ADDR, "127.0.2.1"). -define(ENV_DEFAULT_MME_PORT, ?S1AP_PORT). %% ------------------------------------------------------------------ -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37047?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ie5ec9f62d77407152e18ea3c20cf401151fa6aea Gerrit-Change-Number: 37047 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-s1gw[master]: sctp_client: support explicitly setting local address
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37048?usp=email ) Change subject: sctp_client: support explicitly setting local address ...................................................................... sctp_client: support explicitly setting local address Change-Id: I96c0cecb855d11066cbb1f7e43f70fb532e473f3 --- M config/sys.config M src/osmo_s1gw_sup.erl M src/sctp_client.erl M src/sctp_proxy.erl 4 files changed, 44 insertions(+), 20 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/config/sys.config b/config/sys.config index 8055631..6904d65 100644 --- a/config/sys.config +++ b/config/sys.config @@ -1,15 +1,23 @@ %% -*- erlang -*- -[%% =========================================== +[%% ================================================================================ %% application config - %% =========================================== + %% + %% eNB S1GW + %% +-----+ +----------------+ + %% | ... | --> | s1gw_bind_addr | MME + %% +-----+ +----------------+ +-----------------+ + %% | mme_loc_addr | --> | mme_rem_addr | + %% +----------------+ +-----------------+ + %% ================================================================================ {osmo_s1gw, [{s1gw_bind_addr, "127.0.1.1"}, %% S1GW bind address for incoming eNB connections - {mme_addr, "127.0.2.1"} %% MME address for outgoing connections + {mme_loc_addr, "127.0.2.1"}, %% local address for outgoing connections to the MME + {mme_rem_addr, "127.0.2.10"} %% remote address for outgoing connections to the MME ]}, - %% =========================================== + %% ================================================================================ %% kernel config - %% =========================================== + %% ================================================================================ {kernel, [{logger_level, info}, {logger, diff --git a/src/osmo_s1gw_sup.erl b/src/osmo_s1gw_sup.erl index 4c93756..87ec9bf 100644 --- a/src/osmo_s1gw_sup.erl +++ b/src/osmo_s1gw_sup.erl @@ -10,8 +10,9 @@ -define(ENV_APP_NAME, osmo_s1gw). -define(ENV_DEFAULT_S1GW_BIND_ADDR, "127.0.1.1"). -define(ENV_DEFAULT_S1GW_BIND_PORT, ?S1AP_PORT). --define(ENV_DEFAULT_MME_ADDR, "127.0.2.1"). --define(ENV_DEFAULT_MME_PORT, ?S1AP_PORT). +-define(ENV_DEFAULT_MME_LOC_ADDR, "127.0.2.1"). +-define(ENV_DEFAULT_MME_REM_ADDR, "127.0.2.10"). +-define(ENV_DEFAULT_MME_REM_PORT, ?S1AP_PORT). %% ------------------------------------------------------------------ %% supervisor API @@ -24,11 +25,12 @@ init([]) -> S1GWBindAddr = get_env(s1gw_bind_addr, ?ENV_DEFAULT_S1GW_BIND_ADDR), S1GWBindPort = get_env(s1gw_bind_port, ?ENV_DEFAULT_S1GW_BIND_PORT), - MmeAddr = get_env(mme_addr, ?ENV_DEFAULT_MME_ADDR), - MmePort = get_env(mme_port, ?ENV_DEFAULT_MME_PORT), + MmeLocAddr = get_env(mme_loc_addr, ?ENV_DEFAULT_MME_LOC_ADDR), + MmeRemAddr = get_env(mme_rem_addr, ?ENV_DEFAULT_MME_REM_ADDR), + MmeRemPort = get_env(mme_rem_port, ?ENV_DEFAULT_MME_REM_PORT), SctpServer = {sctp_server, {sctp_server, start_link, [S1GWBindAddr, S1GWBindPort, - {MmeAddr, MmePort}]}, + {{MmeLocAddr, MmeRemAddr}, MmeRemPort}]}, permanent, 5000, worker, diff --git a/src/sctp_client.erl b/src/sctp_client.erl index 908afcd..fe96f30 100644 --- a/src/sctp_client.erl +++ b/src/sctp_client.erl @@ -16,15 +16,24 @@ %% ------------------------------------------------------------------ connect() -> - connect(localhost). + connect({any, localhost}). -connect(Host) -> - connect(Host, ?S1AP_PORT). +connect(LocRemAddr) -> + connect(LocRemAddr, ?S1AP_PORT). -connect(Host, Port) -> - {ok, Sock} = gen_sctp:open([{type, seqpacket}, +connect({LocAddrStr, RemAddr}, Port) when is_list(LocAddrStr) -> + {ok, LocAddr} = inet:parse_address(LocAddrStr), + connect({LocAddr, RemAddr}, Port); + +connect({LocAddr, RemAddrStr}, Port) when is_list(RemAddrStr) -> + {ok, RemAddr} = inet:parse_address(RemAddrStr), + connect({LocAddr, RemAddr}, Port); + +connect({LocAddr, RemAddr}, Port) -> + {ok, Sock} = gen_sctp:open([{ip, LocAddr}, + {type, seqpacket}, {active, true}]), - gen_sctp:connect_init(Sock, Host, Port, []), + gen_sctp:connect_init(Sock, RemAddr, Port, []), {ok, Sock}. diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl index 43cb081..2cc6165 100644 --- a/src/sctp_proxy.erl +++ b/src/sctp_proxy.erl @@ -34,10 +34,6 @@ %% gen_statem API %% ------------------------------------------------------------------ -init([Aid, MmeAddrStr, MmePort]) when is_list(MmeAddrStr) -> - {ok, MmeAddr} = inet:parse_address(MmeAddrStr), - init([Aid, MmeAddr, MmePort]); - init([Aid, MmeAddr, MmePort]) -> {ok, connecting, #{enb_aid => Aid, -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37048?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I96c0cecb855d11066cbb1f7e43f70fb532e473f3 Gerrit-Change-Number: 37048 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-s1gw[master]: s1ap_proxy: properly patch transportLayerAddress
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37049?usp=email ) Change subject: s1ap_proxy: properly patch transportLayerAddress ...................................................................... s1ap_proxy: properly patch transportLayerAddress Change-Id: Iffcf6842147bcbc665689196c5ded6dfa1a066fa --- M src/s1ap_proxy.erl M test/s1ap_proxy_test.erl 2 files changed, 20 insertions(+), 6 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index a78f084..48f3565 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -93,7 +93,9 @@ handle_ie(#'ProtocolIE-Field'{id = ?'id-E-RABToBeSetupItemBearerSUReq', value = Content}) -> - Content#'E-RABToBeSetupItemBearerSUReq'{transportLayerAddress = transp_layer_addr()}; + %% eNB -> MME direction: we pass our MME facing local address + TLA = transp_layer_addr(mme_loc_addr), + Content#'E-RABToBeSetupItemBearerSUReq'{transportLayerAddress = TLA}; %% E-RAB SETUP RESPONSE related IEs handle_ie(#'ProtocolIE-Field'{id = ?'id-E-RABSetupListBearerSURes', @@ -103,7 +105,9 @@ handle_ie(#'ProtocolIE-Field'{id = ?'id-E-RABSetupItemBearerSURes', value = Content}) -> - Content#'E-RABSetupItemBearerSURes'{transportLayerAddress = transp_layer_addr()}; + %% MME -> eNB direction: we pass our eNB facing local address + TLA = transp_layer_addr(s1gw_bind_addr), + Content#'E-RABSetupItemBearerSURes'{transportLayerAddress = TLA}; %% Catch-all variant, which should not be called normally handle_ie(#'ProtocolIE-Field'{value = Content} = IE) -> @@ -131,8 +135,9 @@ %% GTP-U IP address (TransportLayerAddress) to be used while patching -transp_layer_addr() -> - AddrStr = application:get_env(osmo_s1gw, transp_layer_addr, "255.255.255.255"), +-spec transp_layer_addr(atom()) -> binary(). +transp_layer_addr(EnvParam) -> + {ok, AddrStr} = application:get_env(osmo_s1gw, EnvParam), {ok, Addr} = inet:parse_address(AddrStr), %% sadly, there exists inet:ntoa/1, but not inet:aton/1 list_to_binary(tuple_to_list(Addr)). diff --git a/test/s1ap_proxy_test.erl b/test/s1ap_proxy_test.erl index 408f468..0c4bbbf 100644 --- a/test/s1ap_proxy_test.erl +++ b/test/s1ap_proxy_test.erl @@ -57,7 +57,7 @@ ExpTLA = << 16#7f, 16#00, 16#00, 16#01 >>, ExpData = e_rab_setup_req_pdu(ExpTLA, TEID), - application:set_env(osmo_s1gw, transp_layer_addr, "127.0.0.1"), + application:set_env(osmo_s1gw, mme_loc_addr, "127.0.0.1"), ?assertEqual(ExpData, s1ap_proxy:handle_pdu(OrigData)). @@ -82,7 +82,7 @@ ExpTLA = << 16#7f, 16#00, 16#00, 16#01 >>, ExpData = e_rab_setup_rsp_pdu(ExpTLA, TEID), - application:set_env(osmo_s1gw, transp_layer_addr, "127.0.0.1"), + application:set_env(osmo_s1gw, s1gw_bind_addr, "127.0.0.1"), ?assertEqual(ExpData, s1ap_proxy:handle_pdu(OrigData)). %% vim:set ts=4 sw=4 et: -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37049?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Iffcf6842147bcbc665689196c5ded6dfa1a066fa Gerrit-Change-Number: 37049 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-s1gw[master]: osmo_s1gw: add main/1 for rebar's escriptize target
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37050?usp=email ) Change subject: osmo_s1gw: add main/1 for rebar's escriptize target ...................................................................... osmo_s1gw: add main/1 for rebar's escriptize target Change-Id: Icb20a3c32fe4236522ccbc83d322b248a074580c --- A src/osmo_s1gw.erl 1 file changed, 18 insertions(+), 0 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/src/osmo_s1gw.erl b/src/osmo_s1gw.erl new file mode 100644 index 0000000..737fc16 --- /dev/null +++ b/src/osmo_s1gw.erl @@ -0,0 +1,9 @@ +-module(osmo_s1gw). + +-export([main/1]). + +main(_Args) -> + application:ensure_all_started(?MODULE), + timer:sleep(infinity). + +%% vim:set ts=4 sw=4 et: -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37050?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Icb20a3c32fe4236522ccbc83d322b248a074580c Gerrit-Change-Number: 37050 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-s1gw[master]: rebar.config: cosmetic: reformat, add vim modeline
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37051?usp=email ) Change subject: rebar.config: cosmetic: reformat, add vim modeline ...................................................................... rebar.config: cosmetic: reformat, add vim modeline Change-Id: If93630d6e0a89512beeb27723bf7a56deb49e9c5 --- M rebar.config 1 file changed, 21 insertions(+), 11 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/rebar.config b/rebar.config index 57da0ba..d6c6b0a 100644 --- a/rebar.config +++ b/rebar.config @@ -4,20 +4,21 @@ {minimum_otp_vsn, "25.2.3"}. -{deps, [ - {logger_color_formatter, {git, "https://github.com/rlipscombe/logger_color_formatter.git", {tag, "0.5.0"}}} -]}. +{deps, [{logger_color_formatter, + {git, "https://github.com/rlipscombe/logger_color_formatter.git", {tag, "0.5.0"}}} + ]}. -{plugins, [ - {provider_asn1, ".*", {git, "https://github.com/knusbaum/provider_asn1.git", {tag, "0.4.0"}}} -]}. +{plugins, [{provider_asn1, ".*", + {git, "https://github.com/knusbaum/provider_asn1.git", {tag, "0.4.0"}}} + ]}. {asn1_args, [{verbose, false}, {encoding, per}]}. {xref_checks, [undefined_function_calls, undefined_functions, - deprecated_function_calls, deprecated_functions]}. + deprecated_function_calls, deprecated_functions]}. -{dialyzer, [ - {plt_extra_apps, [kernel, stdlib, erts, tools, inets, compiler]}, - {warnings, [no_improper_lists]} -]}. +{dialyzer, [{plt_extra_apps, [kernel, stdlib, erts, tools, inets, compiler]}, + {warnings, [no_improper_lists]} + ]}. + +%% vim:set ts=4 sw=4 et: -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37051?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: If93630d6e0a89512beeb27723bf7a56deb49e9c5 Gerrit-Change-Number: 37051 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-s1gw[master]: rebar.config: add escript and relx parameters
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37052?usp=email ) Change subject: rebar.config: add escript and relx parameters ...................................................................... rebar.config: add escript and relx parameters Change-Id: I204aba4a0fdd678d2e6f5ab588c8c42ef3e44678 --- M rebar.config 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/rebar.config b/rebar.config index d6c6b0a..db88c7e 100644 --- a/rebar.config +++ b/rebar.config @@ -21,4 +21,14 @@ {warnings, [no_improper_lists]} ]}. +{escript_incl_apps, [osmo_s1gw]}. +{escript_main_app, osmo_s1gw}. +{escript_name, "osmo-s1gw"}. + +{relx, [{release, {"osmo-s1gw", "0.1.0"}, [osmo_s1gw]}, + {sys_config, "./config/sys.config"}, + {dev_mode, true}, + {include_erts, false}, + {extended_start_script, true}]}. + %% vim:set ts=4 sw=4 et: -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37052?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I204aba4a0fdd678d2e6f5ab588c8c42ef3e44678 Gerrit-Change-Number: 37052 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-s1gw[master]: README.md: initial version
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37053?usp=email ) Change subject: README.md: initial version ...................................................................... README.md: initial version Change-Id: Ifed0146b1bf609756e967e7c6b9ed159d29dfbf0 --- A README.md 1 file changed, 144 insertions(+), 0 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/README.md b/README.md new file mode 100644 index 0000000..c5d30b2 --- /dev/null +++ b/README.md @@ -0,0 +1,135 @@ +osmo-s1gw +========= + +This is an S1AP (S1 Application Protocol) Gateway implementation in Erlang for +the 3GPP EPC (Evolved Packet Core) based (4G/LTE) networks. It is part of the +[Osmocom](https://osmocom.org/) Open Source Mobile Communications project. + +S1AP is a protocol "spoken" between the eNB and the MME. The S1GW is useful in +scenarios when eNB(s) and the MME co-exist in separate networks and thus unable +to access each other directly. This is basically a proxy, accepting incoming +connections from eNB(s), establishing the associated outgoing connections +to the MME, and forwarding S1AP PDUs back and forth. + +``` + (network A) | + | + +-------------+ +-------------+ + | osmo-s1gw | | MME | ++--------+ +-------------+ +-------------+ +| eNB(1) | --> | | --> | | ++--------+ | | | | + | | | | ++--------+ | | | | +| eNB(2) | --> | | --> | | ++--------+ | | | | + | | | | ++--------+ | | | | +| eNB(N) | --> | | --> | | ++--------+ +-------------+ +-------------+ + | + | (network B) +``` + + +Homepage +-------- + +This project does not have its own homepage yet, unlike many other +[Osmocom projects](https://osmocom.org/projects/). + + +GIT Repository +-------------- + +You can clone from the official osmo-s1gw.git repository using + +``` +$ git clone https://gitea.osmocom.org/erlang/osmo-s1gw +``` + +There is a web interface at <https://gitea.osmocom.org/erlang/osmo-s1gw> + + +Documentation +------------- + +Once the project reaches a usable milestone, we will be working on a +user manual. Stay tuned. + + +Contributing +------------ + +Our coding standards are described at +<https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards>. + +We use a Gerrit based patch submission/review process for managing +contributions. Please see +<https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for +more details. + +The current patch queue for osmo-s1gw can be seen at +<https://gerrit.osmocom.org/#/q/project:erlang/osmo-s1gw+status:open>. + + +Building +-------- + +Install erlang and rebar3 packages (not "rebar", that's version 2! You may need +to compile it from source in some distros). + +``` +$ rebar3 asn compile +$ rebar3 compile +$ rebar3 escriptize +``` + + +Testing +------- + +Unit tests can be run this way: + +``` +$ rebar3 eunit +``` + + +Running +------- + +Once `osmo_s1gw` is built, you can start it this way: + +``` +$ rebar3 shell --config config/sys.config +``` + + +Configuration +------------- + +The default configuration can be found in +[config/sys.config](config/sys.config). + +The existing parameters can be represented as follows: + +``` + eNB S1GW ++-----+ +----------------+ +| ... | --> | s1gw_bind_addr | MME ++-----+ +----------------+ +-----------------+ + | mme_loc_addr | --> | mme_rem_addr | + +----------------+ +-----------------+ +``` + +* `s1gw_bind_addr` - S1GW bind address for incoming eNB connections +* `mme_loc_addr` - local address for outgoing connections to the MME +* `mme_rem_addr` - remote address for outgoing connections to the MME + +Logging can be configured in the `kernel` section: + +* `{logger_level, info}` - logging level (one of `emergency | alert | + critical | error | warning | notice | + info | debug`) +* `#{formatter => { ... }` - logging formatting configuration -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37053?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ifed0146b1bf609756e967e7c6b9ed159d29dfbf0 Gerrit-Change-Number: 37053 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-s1gw[master]: Decode S1AP PDUs and log them while forwarding
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37039?usp=email ) Change subject: Decode S1AP PDUs and log them while forwarding ...................................................................... Decode S1AP PDUs and log them while forwarding Change-Id: Iac1db3dbbf9b72fbd301b4c4133df3cb8c85cf89 --- A src/s1ap_proxy.erl M src/sctp_proxy.erl 2 files changed, 44 insertions(+), 2 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl new file mode 100644 index 0000000..62701ef --- /dev/null +++ b/src/s1ap_proxy.erl @@ -0,0 +1,31 @@ +-module(s1ap_proxy). + +-export([handle_pdu/1]). + +%% ------------------------------------------------------------------ +%% public API +%% ------------------------------------------------------------------ + +%% Process an S1AP PDU +handle_pdu(Data) -> + case decode_pdu(Data) of + {ok, Pdu} -> + logger:info("S1AP PDU: ~p", [Pdu]), + Data; + {error, {asn1, Error}} -> + logger:error("S1AP PDU decoding failed: ~p", [Error]), + Data + end. + + +%% ------------------------------------------------------------------ +%% private API +%% ------------------------------------------------------------------ + +%% Decode an S1AP PDU +-spec decode_pdu(binary()) -> {ok, tuple()} | + {error, {asn1, tuple()}}. +decode_pdu(Data) -> + 'S1AP-PDU-Descriptions':decode('S1AP-PDU', Data). + +%% vim:set ts=4 sw=4 et: diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl index e09720c..2cc6165 100644 --- a/src/sctp_proxy.erl +++ b/src/sctp_proxy.erl @@ -121,7 +121,8 @@ {[#sctp_sndrcvinfo{assoc_id = Aid}], Data}}, S) -> logger:info("MME connection (id=~p, ~p:~p) Rx ~p", [Aid, MmeAddr, MmePort, Data]), - sctp_server:send_data(maps:get(enb_aid, S), Data), + sctp_server:send_data(maps:get(enb_aid, S), + s1ap_proxy:handle_pdu(Data)), {keep_state, S}; %% Catch-all for other kinds of SCTP events @@ -160,7 +161,8 @@ %% Send a single message to the MME sctp_send(#{sock := Sock, mme_aid := Aid}, Data) -> - sctp_client:send_data({Sock, Aid}, Data). + sctp_client:send_data({Sock, Aid}, + s1ap_proxy:handle_pdu(Data)). %% Send pending messages to the MME -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37039?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Iac1db3dbbf9b72fbd301b4c4133df3cb8c85cf89 Gerrit-Change-Number: 37039 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-s1gw[master]: Move S1AP constants into a header file
by osmith 05 Jun '24

05 Jun '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37041?usp=email ) Change subject: Move S1AP constants into a header file ...................................................................... Move S1AP constants into a header file Change-Id: I8f06d11f984fe47b7ee0a3ed43532861cbae1dd0 --- A include/s1ap.hrl M src/sctp_client.erl M src/sctp_server.erl 3 files changed, 20 insertions(+), 10 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/include/s1ap.hrl b/include/s1ap.hrl new file mode 100644 index 0000000..479af3a --- /dev/null +++ b/include/s1ap.hrl @@ -0,0 +1,5 @@ +-define(S1AP_PORT, 36412). +-define(S1AP_SCTP_PPID, 18). +-define(S1AP_SCTP_STREAM, 0). + +%% vim:set ts=4 sw=4 et: diff --git a/src/sctp_client.erl b/src/sctp_client.erl index 67c7069..908afcd 100644 --- a/src/sctp_client.erl +++ b/src/sctp_client.erl @@ -9,9 +9,7 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/include/inet_sctp.hrl"). --define(S1AP_PORT, 36412). --define(S1AP_PPID, 18). --define(SCTP_STREAM, 0). +-include("s1ap.hrl"). %% ------------------------------------------------------------------ %% public API @@ -31,8 +29,8 @@ send_data({Sock, Aid}, Data) -> - gen_sctp:send(Sock, #sctp_sndrcvinfo{stream = ?SCTP_STREAM, - ppid = ?S1AP_PPID, + gen_sctp:send(Sock, #sctp_sndrcvinfo{stream = ?S1AP_SCTP_STREAM, + ppid = ?S1AP_SCTP_PPID, assoc_id = Aid}, Data). diff --git a/src/sctp_server.erl b/src/sctp_server.erl index f032492..48583c5 100644 --- a/src/sctp_server.erl +++ b/src/sctp_server.erl @@ -13,9 +13,7 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/include/inet_sctp.hrl"). --define(S1AP_PORT, 36412). --define(S1AP_PPID, 18). --define(SCTP_STREAM, 0). +-include("s1ap.hrl"). -record(server_state, {sock, clients}). -record(client_state, {addr_port, pid}). @@ -65,8 +63,8 @@ handle_cast({send_data, Aid, Data}, State) -> gen_sctp:send(State#server_state.sock, - #sctp_sndrcvinfo{stream = ?SCTP_STREAM, - ppid = ?S1AP_PPID, + #sctp_sndrcvinfo{stream = ?S1AP_SCTP_STREAM, + ppid = ?S1AP_SCTP_PPID, assoc_id = Aid}, Data), {noreply, State}; -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37041?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I8f06d11f984fe47b7ee0a3ed43532861cbae1dd0 Gerrit-Change-Number: 37041 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.