diff --git a/NEWS.md b/NEWS.md index 9a2f0c0b..9ae490b3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,18 @@ erGW - 3GPP GGSN and PDN-GW in Erlang ===================================== +Version 2.0.0 - 02 Aug 2018 +---------------------------- + +* Rewrite user plane interface to use control and user plane separation + of EPC nodes (CUPS) architecture, compatible [UPF implementation](https://github.com/travelping/vpp/tree/feature/upf) +* Drop tetrapak build support +* Support Erlang OTP 20.1 through 21.0 +* Implement NAPTR based node selection +* IPv6 control and user plane support +* Beta quality features: + * S11 / SAE-GW + Version 1.16.0 - 03 Oct 2017 ---------------------------- diff --git a/README.md b/README.md index a4febe53..a368269c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ erGW - 3GPP GGSN and PDN-GW in Erlang [![Coverage Status][coveralls badge]][coveralls] [![Erlang Versions][erlang version badge]][travis] -This is a 3GPP GGSN and PDN-GW implemented in Erlang. It strives to eventually support all the functionality as defined by [3GPP TS 23.002](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=728) Section 4.1.3.1 for the GGSN and Section 4.1.4.2.2 for the PDN-GW. +This is a 3GPP GGSN and PDN-GW implemented in Erlang. It strives to eventually support all the functionality as defined by [3GPP TS 23.002](http://www.3gpp.org/dynareport/23002.htm) Section 4.1.3.1 for the GGSN and Section 4.1.4.2.2 for the PDN-GW. IMPLEMENTED FEATURES -------------------- @@ -33,6 +33,12 @@ for them are not guaranteed to work across versions. Check [CONFIG.md](CONFIG.md * rate limiting, defaults to 100 requests/second * metrics, see [METRICS.md](METRICS.md) +USER PLANE +---------- + +erGW usese the 3GPP control and user plane separation of EPC nodes architecture as layed out +in [3GPP TS 23.214](http://www.3gpp.org/dynareport/23244.htm) and [3GPP TS 29.244](http://www.3gpp.org/dynareport/29244.htm). + RADIUS over Gi/SGi ------------------ @@ -67,10 +73,9 @@ Using rebar: RUNNING ------- -A erGW installation needs a data path provider to handle the GTP-U path. This instance can be installed on the same host or a different host. +A erGW installation needs a user plane provider to handle the GTP-U path. This instance can be installed on the same host or a different host. -* for a data path suitable for GGSN/PGW see: [GTP-u-KMod](https://github.com/travelping/gtp_u_kmod) -* for a data path suitable for GTPhub see: [GTP-u-EDP](https://github.com/travelping/gtp_u_edp) +A suitable user plane node based on [VPP](https://wiki.fd.io/view/VPP) can be found at [VPP-UFP](https://github.com/travelping/vpp/tree/feature/upf). erGW can be started with the normal Erlang command line tools, e.g.: @@ -84,71 +89,190 @@ Eshell V8.0.3 (abort with ^G) This requires a suitable ergw.config, e.g.: - [{setup, [{data_dir, "/var/lib/ergw"}, - {log_dir, "/var/log/gtp-c-node"} %% NOTE: lager is not using this - ]}, - - {ergw, [{sockets, - [{irx, [{type, 'gtp-c'}, - {ip, {192,0,2,16}}, - {netdev, "grx"}, - freebind - ]}, - {grx, [{type, 'gtp-u'}, - {node, 'gtp-u-node@localhost'}, - {name, 'grx'}]} - ]}, - - {vrfs, - [{upstream, [{pools, [{{10, 180, 0, 1}, {10, 180, 255, 254}, 32}, - {{16#8001, 0, 0, 0, 0, 0, 0, 0}, {16#8001, 0, 0, 16#FFFF, 0, 0, 0, 0}, 64} - ]}, - {'MS-Primary-DNS-Server', {8,8,8,8}}, - {'MS-Secondary-DNS-Server', {8,8,4,4}}, - {'MS-Primary-NBNS-Server', {127,0,0,1}}, - {'MS-Secondary-NBNS-Server', {127,0,0,1}} - ]} - ]}, - - {handlers, - [{gn, [{handler, pgw_s5s8}, - {sockets, [irx]}, - {data_paths, [grx]}, - {aaa, [{'Username', - [{default, ['IMSI', <<"@">>, 'APN']}]}]} - ]}, - {s5s8, [{handler, pgw_s5s8}, - {sockets, [irx]}, - {data_paths, [grx]} - ]} - ]}, - - {apns, - [{[<<"example">>, <<"net">>], [{vrf, upstream}]} - ]} - ]}, - - {ergw_aaa, [ - %% {ergw_aaa_provider, {ergw_aaa_mock, [{shared_secret, <<"MySecret">>}]}} - {ergw_aaa_provider, - {ergw_aaa_radius, - [{nas_identifier,<<"nas01.example.com">>}, - {radius_auth_server,{{192,0,2,32},1812,<<"secret">>}}, - {radius_acct_server,{{192,0,2,32},1813,<<"secret">>}} - ]} - } - ]}, - - {lager, [ - {log_root, "/var/log/gtp-c-node"}, - {colored, true}, - {handlers, [ - {lager_console_backend, debug}, - {lager_file_backend, [{file, "error.log"}, {level, error}]}, - {lager_file_backend, [{file, "console.log"}, {level, debug}]} - ]} - ]} - ]. +```erlang +%-*-Erlang-*- +[{setup, [{data_dir, "/var/lib/ergw"}, + {log_dir, "/var/log/gtp-c-node"} %% NOTE: lager is not using this + ]}, + + {ergw, [{'$setup_vars', + [{"ORIGIN", {value, "epc.mnc001.mcc001.3gppnetwork.org"}}]}, + {plmn_id, {<<"001">>, <<"01">>}}, + + {http_api, + [{port, 8080}, + {ip, {0,0,0,0}} + ]}, + + {sockets, + [{'cp-socket', + [{type, 'gtp-u'}, + {vrf, cp}, + {ip, {127,0,0,1}}, + freebind, + {reuseaddr, true} + ]}, + {irx, [{type, 'gtp-c'}, + {vrf, epc}, + {ip, {127,0,0,1}}, + {reuseaddr, true} + ]} + ]}, + + {vrfs, + [{sgi, [{pools, [{{10, 106, 0, 1}, {10, 106, 255, 254}, 32}, + {{16#8001, 0, 0, 0, 0, 0, 0, 0}, + {16#8001, 0, 0, 16#FFFF, 0, 0, 0, 0}, 64} + ]}, + {'MS-Primary-DNS-Server', {8,8,8,8}}, + {'MS-Secondary-DNS-Server', {8,8,4,4}}, + {'MS-Primary-NBNS-Server', {127,0,0,1}}, + {'MS-Secondary-NBNS-Server', {127,0,0,1}} + ]} + ]}, + + {sx_socket, + [{node, 'ergw'}, + {name, 'ergw'}, + {socket, 'cp-socket'}, + {ip, {127,0,0,1}}, + freebind + ]}, + + {handlers, + [{'h1', [{handler, pgw_s5s8}, + {protocol, gn}, + {sockets, [irx]}, + {node_selection, [default]} + ]}, + {'h2', [{handler, pgw_s5s8}, + {protocol, s5s8}, + {sockets, [irx]}, + {node_selection, [default]} + ]} + ]}, + + {apns, + [{[<<"tpip">>, <<"net">>], [{vrf, sgi}]}, + {[<<"APN1">>], [{vrf, sgi}]} + ]}, + + {node_selection, + [{default, + {static, + [ + %% APN NAPTR alternative + {"_default.apn.$ORIGIN", {300,64536}, + [{"x-3gpp-upf","x-sxb"}], + "topon.sx.prox01.$ORIGIN"}, + + %% A/AAAA record alternatives + {"topon.sx.prox01.$ORIGIN", [{127,0,0,1}], []} + ] + } + } + ] + }, + + {nodes, + [{default, + [{vrfs, + [{cp, [{features, ['CP-Function']}]}, + {epc, [{features, ['Access']}]}, + {sgi, [{features, ['SGi-LAN']}]}] + }] + }] + } + ]}, + +%% {exometer_core, [{reporters, [{exometer_report_netdata, []}]}]}, + + {ergw_aaa, + [{handlers, + [{ergw_aaa_static, + [{'NAS-Identifier', <<"NAS-Identifier">>}, + {'Acct-Interim-Interval', 600}, + {'Framed-Protocol', 'PPP'}, + {'Service-Type', 'Framed-User'}, + {'Node-Id', <<"PGW-001">>}, + {'Charging-Rule-Base-Name', <<"cr-01">>}, + {rules, #{'Default' => + #{'Rating-Group' => [3000], + 'Flow-Information' => + [#{'Flow-Description' => [<<"permit out ip from any to assigned">>], + 'Flow-Direction' => [1] %% DownLink + }, + #{'Flow-Description' => [<<"permit out ip from any to assigned">>], + 'Flow-Direction' => [2] %% UpLink + }], + 'Metering-Method' => [1], + 'Precedence' => [100] + } + } + } + ]} + ]}, + + {services, + [{'Default', [{handler, 'ergw_aaa_static'}]} + ]}, + + {apps, + [{default, + [{session, ['Default']}, + {procedures, [{authenticate, []}, + {authorize, []}, + {start, []}, + {interim, []}, + {stop, []} + ]} + ]} + ]} + ]}, + + {hackney, [ + {mod_metrics, exometer} + ]}, + + {jobs, [{samplers, + [{cpu_feedback, jobs_sampler_cpu, []} + ]}, + {queues, + [{path_restart, + [{regulators, [{counter, [{limit, 100}]}]}, + {modifiers, [{cpu_feedback, 10}]} %% 10 = % increment by which to modify the limit + ]}, + {create, + [{max_time, 5000}, %% max 5 seconds + {regulators, [{rate, [{limit, 100}]}]}, + {modifiers, [{cpu_feedback, 10}]} %% 10 = % increment by which to modify the limit + ]}, + {delete, + [{regulators, [{counter, [{limit, 100}]}]}, + {modifiers, [{cpu_feedback, 10}]} %% 10 = % increment by which to modify the limit + ]}, + {other, + [{max_time, 10000}, %% max 10 seconds + {regulators, [{rate, [{limit, 1000}]}]}, + {modifiers, [{cpu_feedback, 10}]} %% 10 = % increment by which to modify the limit + ]} + ]} + ]}, + + {lager, [ + {log_root, "/var/log/gtp-c-node"}, + {colored, true}, + {error_logger_redirect, true}, + {crash_log, "crash.log"}, + {error_logger_hwm, 5000}, + {handlers, [ + {lager_console_backend, [{level, debug}]}, + {lager_file_backend, [{file, "error.log"}, {level, error}]}, + {lager_file_backend, [{file, "console.log"}, {level, debug}]} + ]} + ]} +]. +``` The configuration is documented in [CONFIG.md](CONFIG.md) @@ -161,4 +285,4 @@ See [Installing on Ubuntu 16.04](https://github.com/travelping/ergw-gtp-c-node#i [travis badge]: https://img.shields.io/travis/travelping/ergw/master.svg?style=flat-square [coveralls]: https://coveralls.io/github/travelping/ergw [coveralls badge]: https://img.shields.io/coveralls/travelping/ergw/master.svg?style=flat-square -[erlang version badge]: https://img.shields.io/badge/erlang-R20.0%20to%2021.0-blue.svg?style=flat-square +[erlang version badge]: https://img.shields.io/badge/erlang-R20.1%20to%2021.0-blue.svg?style=flat-square diff --git a/rebar.config b/rebar.config index 32a97774..c22d2f73 100644 --- a/rebar.config +++ b/rebar.config @@ -13,10 +13,10 @@ {stacktrace_compat, "1.0.0"}, {erlando, {git, "https://github.com/travelping/erlando.git", {tag, "1.0.2"}}}, {netdata, {git, "https://github.com/RoadRunnr/erl_netdata.git", {ref, "cbd6eaf"}}}, - {gtplib, {git, "https://github.com/travelping/gtplib.git", {branch, "master"}}}, - {pfcplib, {git, "https://github.com/travelping/pfcplib.git", {branch, "master"}}}, + {gtplib, {git, "https://github.com/travelping/gtplib.git", {tag, "1.3.0"}}}, + {pfcplib, {git, "https://github.com/travelping/pfcplib.git", {tag, "1.0.0"}}}, {gen_socket, {git, "git://github.com/travelping/gen_socket", {ref, "195a427"}}}, - {ergw_aaa, {git, "git://github.com/travelping/ergw_aaa", {branch, "feature/rf"}}} + {ergw_aaa, {git, "git://github.com/travelping/ergw_aaa", {tag, "3.0.0"}}} ]}. {minimum_otp_vsn, "20.1"}. diff --git a/rebar.lock b/rebar.lock index 54f6e26e..b75b6482 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,5 +1,5 @@ {"1.1.0", -[{<<"bear">>,{pkg,<<"bear">>,<<"0.8.5">>},2}, +[{<<"bear">>,{pkg,<<"bear">>,<<"0.8.7">>},2}, {<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.4.0">>},0}, {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.3.0">>},1}, {<<"eradius">>, @@ -8,14 +8,14 @@ 1}, {<<"ergw_aaa">>, {git,"git://github.com/travelping/ergw_aaa", - {ref,"84825c203135c7524a993eb2bef431eca440ec20"}}, + {ref,"927d8b16a4bbe22b6b90138fe677bfa18f4beda9"}}, 0}, {<<"erlando">>, {git,"https://github.com/travelping/erlando.git", {ref,"737fbd691e85b89fe5503089e102454b585e25d1"}}, 0}, {<<"exometer_core">>,{pkg,<<"exometer_core">>,<<"1.5.2">>},0}, - {<<"folsom">>,{pkg,<<"folsom">>,<<"0.8.5">>},1}, + {<<"folsom">>,{pkg,<<"folsom">>,<<"0.8.7">>},1}, {<<"gen_socket">>, {git,"git://github.com/travelping/gen_socket", {ref,"195a42700ba15b7ddc26a49865abcdaa627eba33"}}, @@ -23,7 +23,7 @@ {<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1}, {<<"gtplib">>, {git,"https://github.com/travelping/gtplib.git", - {ref,"10085740f9abaa9c72083c668712d438fffd8e59"}}, + {ref,"78dd11d54dcccc58f04397a49b7e2dfede5fdfd7"}}, 0}, {<<"hut">>,{pkg,<<"hut">>,<<"1.2.0">>},1}, {<<"jobs">>,{pkg,<<"jobs">>,<<"0.7.1">>},0}, @@ -36,7 +36,7 @@ {<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.0.0">>},1}, {<<"pfcplib">>, {git,"https://github.com/travelping/pfcplib.git", - {ref,"6229b42231ae70524aa8361b46b456516a242cb1"}}, + {ref,"e1d35c499a92df45cd6810faee5bc8195231d4b7"}}, 0}, {<<"pmod_transform">>, {git,"git://github.com/erlang/pmod_transform.git", @@ -44,26 +44,22 @@ 1}, {<<"ppp">>, {git,"git://github.com/travelping/ppp", - {ref,"2192d576c537b9d7bd32e2a4d4d1e067cc8350e2"}}, + {ref,"b5e3aeff690a7bc70cd1ef9cfc046dfb4ea26e5e"}}, 1}, - {<<"proper">>, - {git,"git://github.com/manopapad/proper.git", - {ref,"a112a2d64b2b1bfbea780e139980711dfe99b431"}}, - 2}, {<<"ranch">>,{pkg,<<"ranch">>,<<"1.5.0">>},1}, {<<"regine">>, {git,"https://github.com/travelping/regine.git", - {ref,"4c63d24ff798c785beb30d1447ace27611761dce"}}, + {ref,"2d2c0c2606cb68377c6b41bb0f2ea6bbe98927e8"}}, 2}, {<<"setup">>,{pkg,<<"setup">>,<<"2.0.2">>},0}, {<<"stacktrace_compat">>,{pkg,<<"stacktrace_compat">>,<<"1.0.0">>},0}]}. [ {pkg_hash,[ - {<<"bear">>, <<"E95FCA1627CD9E15BAF93CE0A52AFF16917BAF325F0EE65B88CD715376CD2344">>}, + {<<"bear">>, <<"16264309AE5D005D03718A5C82641FCC259C9E8F09ADEB6FD79CA4271168656F">>}, {<<"cowboy">>, <<"F1B72FABE9C8A5FC64AC5AC85FB65474D64733D1DF52A26FAD5D4BA3D9F70A9F">>}, {<<"cowlib">>, <<"BBD58EF537904E4F7C1DD62E6AA8BC831C8183CE4EFA9BD1150164FE15BE4CAA">>}, {<<"exometer_core">>, <<"62A99A361BA8A14D53857D4C716A191E810299D2F43C5C981EB7B086C0BFCCE1">>}, - {<<"folsom">>, <<"94A027B56FE84FEED264F9B33CB4C6AC9A801FAD84B87DBDA0836CE83C3B8D69">>}, + {<<"folsom">>, <<"A885F0AEEE4C84270954C88A55A5A473D6B2C7493E32FFDC5765412DD555A951">>}, {<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>}, {<<"hut">>, <<"0089DF0FAA2827C605BBADA88153F24FFF5EA7A4BE32ECF0250A7FDC2719CAFB">>}, {<<"jobs">>, <<"132E4BED856CE774B008B31C1AA809C17FA6C2C20BE03E010ACE273CA057A5DE">>},