Compare commits

...

239 Commits

Author SHA1 Message Date
Sukchan Lee
9087a480a8 Update document for v2.4.8 2022-06-12 17:06:36 +09:00
Sukchan Lee
9d43646816 Release v2.4.8 2022-06-12 16:29:24 +09:00
Sukchan Lee
240c10888d [GTP] Fixed bugs if gNB changed (#1515, #1586) 2022-06-12 15:54:27 +09:00
Sukchan Lee
9c3b7dfe4b Added RRCEstablishmentCause to Test-Msg Param 2022-06-12 14:32:53 +09:00
Sukchan Lee
2aa40ca8c8 [PFCP] Added Data Status IE (#1582) 2022-06-12 09:02:59 +09:00
Sukchan Lee
12353178fb Upgrade PFCP to v16.9.1 (#1581) 2022-06-11 23:51:00 +09:00
Sukchan Lee
b98c2c13f6 [SUCI] Handling exceptions for invalid RI (#1570)
If Routing Indicator is wrong, we forcely set to '0'.
2022-06-10 23:19:00 +09:00
Sukchan Lee
9d94b33c7b meson: Rollback libmicrohttpd >= 0.9.40
Ubuntu 18.04 (bionic) should continue to be supported until April 2023.
So I modified mhd_server to support older versions of libmicrohttpd.
2022-06-10 21:35:37 +09:00
Sukchan Lee
6c5a8a135a Reorder smf_gtp_node objects free (#1593)
smf_gtp_node_pool were properly freed.

However, the seqence was wrong, so we got a warning message.

To solve this problem, I've moved smf_gtp_node_alloc/free
from gtp_path.[ch] to context.[ch]
2022-06-10 21:08:15 +09:00
Pau Espin Pedrol
b116630fe8 meson: Depend explicitly on libmicrohttpd >=0.9.61 (#1595)
Recent commit re-enabling SBI HTTP/1.1 support
(10bdf39505cf525b95886c140b3c2e82e7427d29) started using libmicrohttpd's
API MHD_create_response_from_buffer_with_free_callback(), which is only
available starting from v0.9.61.
As a result, compilation in xUbuntu 18.04 started failing with errors
about the function not being found, since it ships with libmicrohttpd
v0.9.59.
Depending on 0.9.61 is fine since it's quite old (november 2018) and all
major current distros should for sure have an >= one. Let's simply bump
the version check so that it fails in an informative manner.
2022-06-10 20:53:55 +09:00
Pau Espin Pedrol
28089e2b59 [SMF] Fix smf_gtp_node objects not freed during shutdown (#1593) 2022-06-10 00:06:13 +09:00
Sukchan Lee
b1e7477904 [CORE] Improve logging error in PFCP (#1591) 2022-06-09 23:36:33 +09:00
Pau Espin Pedrol
5238771295 [CORE] Improve logging error in ogs_gtp_sendto() (#1591) 2022-06-09 23:32:11 +09:00
Carlos Giraldo
cfe21c61da Structure AMF and MME metrics code similar to SMF (#1590)
* AMF metrics initial support

* MME metrics initial support

* set amf/mme metrics.[c|h] similar to smf
2022-06-09 21:39:03 +09:00
Sukchan Lee
0b97954208 Re-added to handle an exceptional case (#1589) 2022-06-09 21:35:59 +09:00
Bostjan Meglic
5084f6a71d [AMF] Add support for SUCI protection schemes A and B (#1589)
For null protection scheme the SUCI needs to be BCD encoded. Whereas for
protection scheme profiles A and B the SUCI needs to be converted from
hexadecimal to ASCII.

This still needs the support for protection schemes A and B in UDM to
work.
2022-06-09 21:27:58 +09:00
Carlos Giraldo
109949d335 MME initial metrics support (#1587) 2022-06-09 06:23:51 +09:00
Pau Espin Pedrol
9e25482d99 [SMF] Gn: Fixes handling/transmitting APN-AMBR IE (#1588) 2022-06-09 06:22:56 +09:00
Carlos Giraldo
816575dc8d AMF metrics initial support (#1585) 2022-06-08 17:54:46 +09:00
Pau Espin Pedrol
28e40a0f1b Initial metrics support based on Prometheus (#1571)
* Initial metrics support based on Prometheus

This commit introduces initial support for metrics in open5gs.

The metrics code is added as libogsmetrics (lib/metrics/), with a well
defined opaque API to manage different types of metrics, allowing for
different implementations for different technologies to scrap the
metrics (placed as lib/metrics/<impl>/. The implementation is right now
selected at build time, in order to be able to opt-out the related dependencies
for users not interested in the features. 2 implementations are already
provided in this commit to start with:
* void: Default implementation. Empty stubs, acts as a NOOP.
* prometheus: open5gs processes become Prometheus servers, offering
  states through an http server to the Prometheus scrappers. Relies on
  libprom (prometheus-client-ci [1] project) to track the metrics and format
  them during export, and libmicrohttpd to make the export possible through
  HTTP.

[1] https://github.com/digitalocean/prometheus-client-c

The prometheus-client-c is not well maintained nowadays in upstream, and
furthermore it uses a quite peculiar mixture of build systems (autolib
on the main dir, cmake for libprom in a subdir). This makes it difficult
to have it widely available in distros, and difficult to find it if it
is installed in the system. Hence, the best is to include it as a
meson subproject like we already do for freeDiameter. An open5gs fork is
requried in order to have an extra patch adding a top-level
CMakeList.txt in order to be able to includ eit from open5gs's meson
build. Furthermore, this allows adding bugfixes to the subproject if any
are found in the future.

* [SMF] Initial metrics support

* [SMF] Add metrics at gtp_node level

* docs: Add tutorial documenting metrics with Prometheus
2022-06-08 05:51:02 +09:00
Pau Espin Pedrol
a9badd5520 GTP, SMF: More dec/enc improvements in QoS Profile IE MBR and GBRE fields (#1584) 2022-06-07 22:13:53 +09:00
Sukchan Lee
18cca7f5e4 Re-enabling HTTP/1.1 (#1570) 2022-06-06 22:20:52 +09:00
Sukchan Lee
828fa23d16 Increase Apply Action size to 2 bytes (#1581) 2022-06-06 21:12:18 +09:00
mitmitmitm
a6abe1fffb [NRF] Don't abort if there are too many registered NF instances (#1579)
Reply with an error instead.
2022-06-06 20:54:59 +09:00
Pau Espin Pedrol
7dd5d27a71 [GTPv1] Several QoS Profile IE enc/dec fixes and improvements (#1575) 2022-06-03 06:56:28 +09:00
Pau Espin Pedrol
e32139009b [SMF] Gn: Avoid building QoS Profile IE twice in UpdatePdpContextResp (#1574) 2022-06-03 01:02:14 +09:00
Pau Espin Pedrol
502a886e43 [CORE] ogs-sockaddr: Fix trailing whitespace (#1573) 2022-06-02 20:20:16 +09:00
Pau Espin Pedrol
d99382d5bc [CORE] Improve log error messages in ogs_ipsubnet() (#1572) 2022-06-02 20:19:55 +09:00
Sukchan Lee
8b3fa5ff9f Follow-up the contribution #1566, #1567 2022-05-31 21:44:53 +09:00
Pau Espin Pedrol
e1e8018919 [SMF] Avoid crash if Create{Session,PdpContext}Resp fails to be sent (#1566)
* [SMF] Gn: Drop unreachable return line

* [SMF] Avoid crash if Create{Session,PdpContext}Resp fails to be sent

Crash spotted in a running open5gs-smfd process, triggered by:
ERROR: ogs_gtp_sendto() failed (1:Operation not permitted) (../lib/gtp/path.c:119)
ERROR: ogs_gtp_xact_commit: Expectation `rv == OGS_OK' failed. (../lib/gtp/xact.c:730)
ERROR: smf_gtp2_send_create_session_response: Expectation `rv == OGS_OK' failed. (../src/smf/gtp-path.c:451)
FATAL: smf_gsm_state_wait_pfcp_establishment: Assertion `OGS_OK == smf_gtp2_send_create_session_response( sess, gtp_xact)' failed. (../src/smf/gsm-sm.c:676)

* [SMF] Avoid crash if Delete{Sesson,PdpContext}Resp fails to be sent

Let's simply continuing with release of the session, there's not much we
can do about it. Peer will eventually realize the conn is no longer
there.
2022-05-31 21:27:42 +09:00
Pau Espin Pedrol
c2bda0b576 [GTP] Several fixes and improvements around ogs_gtp_xact_find_by_xid (#1567)
* [GTP] Add missing msg types to ogs_gtp_xact_get_stage()

* [GTP] Avoid returning wrong xact by xif if none found

* [GTP] Avoid crash if ogs_gtp_xact_get_stage() fails

* [GTP] Rename s/ogs_gtp_xact_get_stage/ogs_gtp2_xact_get_stage/
2022-05-31 21:24:00 +09:00
Sukchan Lee
b6f2146594 [SGWC] Update remote PGW GTPv2-C address (#1560)
In Create Sesion Response, we updated remote PGW GTPv2-C address.
2022-05-28 17:06:36 +09:00
Miguel
78b1dc77ff Update open5gs-dbctl (#1562)
I added four additional commands which are useful in case not using the GUI (add UE using a specific APN, add UE using a specific slice and APN, modify a slice adding an APN, modify an UE adding a new slice + APN)
2022-05-28 11:10:03 +09:00
endika
de0ba3f9dc fix tipo in amf logs (#1558) 2022-05-26 20:12:30 +09:00
Pau Espin Pedrol
c18e9f32cb [PGW] Gy+PFCP improvements (#1555)
* [SMF] Gy,PFCP: Improve {Time,Volume} {Threshold,Quota} handling

* [UPF] Implement URR Usage Report for ValidityTime/TimeQuota/TimeThreshold

* [UPF] Implement Usage report trigger for Volume Quota/Threshold

* [SMF] Set Gy Reporting-Reason based on PFCP Report Trigger
2022-05-24 22:54:30 +09:00
Bostjan Meglic
2c2ce143a3 Fix minor typos (#1554)
* Fix minor typo in log output

* Remove unused struct members
2022-05-24 21:01:54 +09:00
Sukchan Lee
933f0b04c7 [TEST] Added IPv6 in GTPU (#1515) 2022-05-23 23:51:02 +09:00
Sukchan Lee
7d496e182b Update document for v2.4.7 2022-05-21 19:48:56 +09:00
Sukchan Lee
dd845a2bb2 Release v2.4.7 2022-05-21 19:22:11 +09:00
Sukchan Lee
1679f57ac7 [CORE] fix the linked-list bug (#1187) 2022-05-21 18:54:42 +09:00
Pau Espin Pedrol
b6fe640641 [SMF] Gy CCR: Clarify use of Reporting-Request and set it to FINAL in TERMINATION_REQ (#1552) 2022-05-21 06:00:56 +09:00
Sukchan Lee
a6927e18e6 [SBI] fixed mem leak SessionManagement (#1551) 2022-05-21 17:51:31 +09:00
Bostjan Meglic
8efa364f89 Change handling of SessionManagementSubscriptionData as an array (#1551)
According to the following standards the response to the endpoint
/nudm-sdm/${supi}/sm-data should be an array of
SessionManagementSubscriptionData objects, instead of only one object.

TS 29.503 version 16.6.0
TS 29.505 version 16.4.0

UDR now responds to the request with only item in the array.
UDM copies all items as is.
SMF uses only the first item in the array, even if there are more
present.
2022-05-20 17:33:49 +09:00
Pau Espin Pedrol
43a7259781 [SMF] Prevent concurrent access to ogs_pool allocating smf_event (#1546) 2022-05-20 05:57:27 +09:00
Supreeth Herle
aba1867902 Fix AN-Trusted AVP sent in CCR (#1542)
AN-Trusted AVP is only relevant for non-3GPP access networks e.g. WLAN.
This commit adds a check for non-3GPP access network in order to include
AN-Trusted AVP in CCR or not.
Also, clears the M bit for AN-trusted AVP as per TS 29.212 version 16.4.0, Table 5.4.0.1
2022-05-19 13:25:49 +09:00
Sukchan Lee
12d189af07 Document Update 2022-05-17 23:37:41 +09:00
Sukchan Lee
d6c8d49ef4 Update Document for v2.4.6 2022-05-17 23:30:16 +09:00
Sukchan Lee
1983d9d7a7 Release v2.4.6 2022-05-17 22:44:05 +09:00
Sukchan Lee
6710c13a44 update it 2022-05-17 21:44:52 +09:00
Sukchan Lee
67fd2efd76 [HOTFIX] Receive PTI information 2022-05-18 16:04:51 +09:00
Sukchan Lee
c6c8dc1256 [PFCP] Support Multi-CP with One-UP
A problem occurred when there was one SGWU/UPF and multiple SGWC/SMF.

When SGWU and UPF create a session, if the SEID is the same,
the existing session information is used without creating an additional session.

These problems were solved by using the F-SEID including IP information
in the process of checking the existing session.
2022-05-18 10:29:58 +09:00
Pau Espin Pedrol
46621538af [SMF] Improve 3GPP-User-Location-Info in Gn,Gx,Gy (#1539)
* [GTP] Fix trailing whitespace

* [SMF] Improve 3GPP-User-Location-Info in Gn,Gx,Gy
2022-05-17 10:29:11 +09:00
Sukchan Lee
b2f2016a67 Fix the compile error 2022-05-15 23:40:51 +09:00
Sukchan Lee
e0a487f479 [SMF] Optimiza Session Modification Message
For video in VoNR, multiple QosFlow is required in one session.

In the past, since only one Session Modification Message was supported,
QoS-Flow was put into several Session Messages one by one and processed.

Now that multiple QoS-Flows can be supported,
it is optimized to process one session modification message.
2022-05-15 23:35:41 +09:00
Sukchan Lee
a7e2a071e0 Merge branch 'main' of https://github.com/open5gs/open5gs into main 2022-05-15 22:38:38 +09:00
Sukchan Lee
f97f5f794d Merge branch 'althea-net-sctp_crash_upstream' into main 2022-05-15 22:38:29 +09:00
Sukchan Lee
afc562f7d5 [MME] refine Pull Request (#1497) 2022-05-15 22:37:38 +09:00
Sukchan Lee
478723203f Merge branch 'sctp_crash_upstream' of https://github.com/althea-net/open5gs into althea-net-sctp_crash_upstream 2022-05-15 22:22:01 +09:00
Sukchan Lee
c391ac1334 [SMF] Apply 5G Core into GSM (#1498) 2022-05-15 06:27:54 +09:00
Pau Espin Pedrol
fe7f9d85bb [SMF] Store IMEI from GTPv1C/2C and append AVP in Gy CCR (#1535) 2022-05-14 21:32:32 +09:00
Pau Espin Pedrol
c5715d6695 [SMF] Gy CCR: append 3GPP-RAT-Type AVP (#1536) 2022-05-14 06:15:28 +09:00
Sukchan Lee
bb4a8f34d4 [AMF] Fix the bug NGResetAck (#1525) 2022-05-14 02:43:01 +09:00
Sukchan Lee
71572ae563 [PFCP] fixed memcpy (#1531)
dnn ‘memcpy’ reading 808 bytes from a region of size 128
2022-05-13 18:26:54 +09:00
Sukchan Lee
e2159b1240 [SMF] memory free Charging Characteristics (#1532) 2022-05-13 18:18:04 +09:00
Pau Espin Pedrol
99f59be5d7 [SMF] Store Charging Characteristics IE from GTPv1C/2C and append AVP in Gy CCR (#1532) 2022-05-13 06:32:20 +09:00
Sukchan Lee
4d2f7726b9 X2 handover with SGW change (#1367, #1459) 2022-05-12 22:52:36 +09:00
Pau Espin Pedrol
11d4be1779 [SMF] Store Selection Mode IE from GTPv1C/2C and append as 3GPP-Selection-Mode AVP in Gy CCR (#1530)
* [GTPv1C] Make Selection Mode IE uint8

* [SMF] Store Selection Mode in GTPv1C and GTPv2C

* [SMF] Gy CCR: append 3GPP-Selection-Mode AVP
2022-05-12 22:43:12 +09:00
Pau Espin Pedrol
5d478e2488 Pespin/pr (#1529)
* [SMF] rename function s/gtp/gtp2/

* [SMF] Store GTPC version in session

So far we always depended on an xact being present in the code path in
order to know which kind of session it is (GTPv1C vs GTPv2C). Let's
instead store that information in smf_sess_t so that we have it always
available in an easy way.

* [SMF] Move smf_sess_t GTPv1C specifics into gtp substruct

* [SMF] Gy CCR: append 3GPP-NSAPI AVP
2022-05-12 21:42:45 +09:00
Sukchan Lee
333e53d0dd Update sponsor size 2022-05-11 20:45:16 +09:00
Sukchan Lee
53a96022d9 Merge branch 'main' of https://github.com/open5gs/open5gs into main 2022-05-11 20:40:19 +09:00
Sukchan Lee
908d5884dc Add Telet Sponsor 2022-05-11 20:40:03 +09:00
Pau Espin Pedrol
e8d6b0be20 [SMF] Append PDP-Address AVP to Gy CCR msg (#1527)
* [SMF] Append PDP-Address AVP to Gy CCR msg

* [SMF] Gy CCR: Move some AVPs under Service-Information/PS-Information

They belong there. Nokia infocenter documentation seems to be document
the possibility to configure its software to have it in top level, but
that's not what 3GPP TS 32.299 states, so let's stick to it.

* [SMF] Gy CCR: append 3GPP-PDP-Type AVP

* [SMF] Gy CCR: append 3GPP-Charging-Id AVP

* [SMF] Gy CCR: append SGSN-Address AVP

* [SMF] Gy CCR: append GGSN-Address AVP
2022-05-11 15:53:24 +09:00
Sukchan Lee
7a9d06097e [PFCP] fix the unnecessary code (#1523) 2022-05-10 22:58:19 +09:00
Pau Espin Pedrol
3a28ddce37 [PFCP] Fix typo in log line (#1526) 2022-05-10 22:40:32 +09:00
Supreeth Herle
6ffdce598a Fix attach reject when ULA subscription data does not contain MSISDN (#1524)
Issue:
When the ULA - Subscription Data does not contain MSISDN, the Create Session Request
from MME to SGW does not contain MSISDN IE resulting in SMF throwing following log

smf        | 05/09 15:20:53.683: [smf] ERROR: No MSISDN (../src/smf/s5c-handler.c:82)
sgwc       | 05/09 15:20:53.683: [sgwc] ERROR: No Context in TEID (../src/sgwc/s5c-handler.c:104)
mme        | 05/09 15:20:53.683: [mme] ERROR: No Context in TEID (../src/mme/mme-s11-handler.c:122)

As per 3GPP TS 29.274 version 16.5.0, table 7.2.1-1: MSISDN IE shall only be included
in Create Session Request if its provided in subscription data from the HSS. This commit
fixes this by removing the mandatory MSISDN IE check in SMF.
2022-05-10 21:23:03 +09:00
Sukchan Lee
6e81564972 Add new sponsor 2022-05-05 00:06:24 +09:00
Pau Espin Pedrol
76fecdb54e [SMF] Store MSISDN from GTPC and pass it in Gy CCR (#1519) 2022-05-04 05:37:44 +09:00
Pau Espin Pedrol
aa6f3ef8d6 [SMF] gn-handler: Fix typo in error message (#1517) 2022-05-03 21:14:19 +09:00
Sukchan Lee
3508e09a41 [GTPU] IPv6 RS/RA with QFI Extended Header (#1506) 2022-04-30 11:50:30 +09:00
Sukchan Lee
b558da30c6 [GTPU] Fixed to Send Unnecessary EndMarker (#1506) 2022-04-30 10:23:12 +09:00
Sukchan Lee
de2ecd6400 [GTP2] Fixed handling multi-bearer messages(#1498) 2022-04-29 21:28:16 +09:00
Abderaouf KHICHANE
41f743af62 update instructions for adding a subscriber with Python (#1507) 2022-04-27 21:36:34 +09:00
Sukchan Lee
d50a5a44f9 [SBI] cJSON v1.7.7 -> v1.7.15 (#1503) 2022-04-23 02:42:53 +09:00
Pau Espin Pedrol
2de12e32f4 [SMF] Integrate session tear down cycle into sess->sm (#1500)
* [SMF] smf_sm.c Fix indentation

* [SMF] gsm-sm: log fsm events

* [SMF] Integrate session tear down cycle into sess->sm
2022-04-20 21:42:18 +09:00
Spencer Sevilla
23ef30553e initial draft of sctp crash fix 2022-04-18 11:56:43 -07:00
Sukchan Lee
79de674fd8 [PFCP] F-TEID allocation by SMF (#1466) 2022-04-16 14:08:56 +09:00
Pau Espin Pedrol
5f979d0cc3 [SMF] Parallelize Gx+Gy CCR Initial (#1491)
There's no real need to having to wait until Gx is processed in order to
set up Gy. This speeds up time required to set up the UE session.
2022-04-15 07:00:32 +09:00
Sukchan Lee
433d5f6bf3 Distinguish the type of session creation 2022-04-14 17:34:55 +09:00
Sukchan Lee
80cd9d725f [SBI] fixed HTTP2 header values is 0 (#1488) 2022-04-14 11:28:37 +09:00
Sukchan Lee
28746c1cd8 [SMF] Change gtp_message to gtp2_message in SM 2022-04-14 11:20:10 +09:00
Sukchan Lee
bb5d497298 [SMF] fix an invalid error GTP message 2022-04-14 11:18:21 +09:00
Sukchan Lee
079bb5c40e Remove sctp test in MacOSX CI (#1489) 2022-04-14 10:31:20 +09:00
Pau Espin Pedrol
e61b469489 [SMF] Inegrate session setup cycle into sess->sm (#1489)
It allows for much better control on the lifecycle of the session, and
already shows some missing tear down paths in case of errors.
It also clarifies the existence of "sess" pointer in several paths.

The code also becomes clearer overall, since all the transitions and
logic to send next messages are put together.

Tear down of the session will be integrated into gsm-sm in a follow-up
patch.

The 5gc session setup is only partially moved to gsm-sm, and left as an
exercise for users wishin to improve 5gc support.
2022-04-14 10:30:58 +09:00
Pau Espin Pedrol
e3da7c9934 Rename GTPv2C specifics to gtp2 prefix (#1485)
In the past only GTPv2C was supported, and had the "gtp" generic prefix.
Later on, GTPv1C support was added, and "gtp1" prefix was used.
Let's move GTPv2C specific bits to have "gtp2" prefix too, and leave
"gtp" prefix for generic stuff among different GTP versions.
2022-04-13 07:07:39 +09:00
Supreeth Herle
8c22d8a20c Send EMM Cause when Attach Request type is not same as HSS Network-Access-Mode (#1484)
This commit adds EMM Cause to Attach accept message when
Attach Request has COMBINED EPS IMSI ATTACH but the HSS
Network-Access-Mode is configure for EPS ONLY.
2022-04-13 07:06:49 +09:00
Sukchan Lee
e5ff03b249 [SBI] Change the reference count (#1440)
Change the client's reference count method
to use the same method as nf_instance
2022-04-10 20:09:27 +09:00
Sukchan Lee
49c34605db [SBI] fixed the SMF discover bug (#1440) 2022-04-09 13:24:40 +09:00
Sukchan Lee
ff242cd6ea [Gy] Follow-up PRs (#1479) 2022-04-09 10:41:02 +09:00
Pau Espin Pedrol
2be12903cb [SMF] Introduce optional Gy interface support (#1479)
The use of the Gy interface (SMF acting as CTF towards an OCS node) is
mandated through configuration file. Default value "enable: auto" will
only make use of it in case a Diameter peer announcing support for the
Credit-Control Application is found.

Upon subscriber session creation, and after auth check over Gx, the SMF
will create a Gy session with the OCS and only after that step the SMF
will accept the session back to the subscriber.
The OCS may then grant some traffic volumes/time and ask to be notified
back with updated measurements.
In order to get the measurements, the SMF relies on PFCP URR configured
to the UPF through Session Repoort Request messages.
When closing the subscriber session, the SMF will also terminate the Gy
session at the OCS.

So far only some specifics parts of the Gy interface as well as the PFCP
side are implemented. Those should be enough to at least have
volume/time thresholds granted by the OCS, which then will be able to
track subsriber resource use.

This patch doesn't implement the OCS side of the Gy interface, that's
left as a future exercise. The interface was tested using an OCS
emulator implemented in TTCN-3 [1]

[1] https://cgit.osmocom.org/osmo-ttcn3-hacks/
2022-04-09 08:26:28 +09:00
Pau Espin Pedrol
7455424d29 Fix trailing whitespace (#1478) 2022-04-09 08:19:59 +09:00
Sukchan Lee
832ab156e9 Revert "Revert "Functionality for send sms with using IMS service. (#1477)""
This reverts commit b732d7bcc5.
2022-04-09 00:45:37 +09:00
Sukchan Lee
0b3df3e3db Revert "Introduce Gy interface (#1471)"
This reverts commit 106f2729c3.
2022-04-09 00:45:26 +09:00
Sukchan Lee
b5ad0feffc Revert "[Gy] use WARN log-level if No Gy Diameter Peer"
This reverts commit 05551f120f.
2022-04-09 00:45:14 +09:00
Sukchan Lee
b732d7bcc5 Revert "Functionality for send sms with using IMS service. (#1477)"
This reverts commit aa6368132e.
2022-04-09 00:42:43 +09:00
Sukchan Lee
05551f120f [Gy] use WARN log-level if No Gy Diameter Peer 2022-04-09 00:39:21 +09:00
Pau Espin Pedrol
106f2729c3 Introduce Gy interface (#1471)
TODO:

* Use an event for the report, like SMF_EVT_N4_TIMER?

*  Properly set Service identifier in Gy CCR

* SMF: Properly set pkt/octet volumes in Gy CCR
** Update when receiving PFCP Modify Response.

* Figure out best way to require Gy through config file in open5gs-smfd.

* Create a new sess-sm.c which handles smf_sess_t state through
  Gx+Gy+PFCP creation, modification and tear down. This way we can do
stuff in parallel, for instance Gx+Gy. It will alsoavoid duplicating
some code paths due to Gy being optional.
2022-04-09 00:08:58 +09:00
EugeneBogush
aa6368132e Functionality for send sms with using IMS service. (#1477)
* Update

* update

* Update

* update

* new version of profile for send sms

* update

* update

Co-authored-by: root <root@lfv.unassigned-domain>
Co-authored-by: eug <eug@lfv.unassigned-domain>
2022-04-08 23:20:06 +09:00
Pau Espin Pedrol
fb8ebcdbea [UPF] Add initial support for URR Usage Report (#1476) 2022-04-08 23:10:42 +09:00
Pau Espin Pedrol
52672cff65 [DIAM] Add Gy interface support to lib/diameter (#1474)
This commit adds required blocks in lib/diameter to be able to handle Gy
messages later in open5gs apps.

The Gy interface is mainly decribed in 3GPP TS 32.299  and 3GPP TS
32.251, which in turn refers to Diameter protcols defined in RFC4006.
This interface allows charging managment through an external OCS node.
2022-04-08 21:13:02 +09:00
Pau Espin Pedrol
0df2e9f0ba [UPF] cosmetic: Fix trailing whitespace (#1473) 2022-04-08 21:12:52 +09:00
Pau Espin Pedrol
77f7bb7af7 [PFCP] Use proper IE to signal triggers in Usage Report (#1472)
The "Report Triggers" is sent SMF->UPF to tell in which situations a
report should be sent.
The "Usage Report Trigger" is sent UPF->SMF to indicate which situation
triggered the report.
2022-04-08 21:12:42 +09:00
Pau Espin Pedrol
8286b1c417 [SMF] Gx: Fix crash receiving DIAMETER_UNABLE_TO_DELIVER (#1469) 2022-04-06 23:57:55 +09:00
Pau Espin Pedrol
5be48be634 [SMF] Gx: Prevent sending Gx messages to non-PCRF Diameter peers (#1468) 2022-04-06 20:48:26 +09:00
Sukchan Lee
110a63fdfa [SMF] Handle for PCRF not to respond (#1445) 2022-04-03 22:49:12 +09:00
Sukchan Lee
e213f65406 Improve data-path performance using talloc_pool()
allocate a talloc pool for GTP to ensure it doesn't have to go back
to the libc malloc all the time.
2022-04-02 13:36:23 +09:00
Sukchan Lee
1c9a48bfb1 [Doc] Update CentOS Stream 8 (#1450) 2022-04-01 22:33:49 +09:00
Sukchan Lee
77f66e1f0e Migrating to CentOS Stream 8 in Vagrant (#1450) 2022-04-01 22:28:32 +09:00
Sukchan Lee
3121d183f0 [HSS/PCF] Store IMEISV instead of IMEI (#1464) 2022-04-02 00:46:05 +09:00
Sukchan Lee
8f603e2049 [WebUI] Added IMEI in View (#1464) 2022-04-01 20:08:20 +09:00
Sukchan Lee
35201f6ed1 Fix the MacOSX CI (#1454) 2022-03-31 23:06:52 +09:00
Sukchan Lee
24d20bb20b Update automatic CI (#1454) 2022-03-31 22:55:27 +09:00
Sukchan Lee
f2aa15d99f Added MacOSX to the Running OS for CI (#1454) 2022-03-31 21:31:10 +09:00
Sukchan Lee
c76c7d597d Oops! Rollback Meson Continuous integration 2022-03-31 20:26:58 +09:00
Sukchan Lee
9c4287f467 update it1 2022-03-31 20:24:31 +09:00
Sukchan Lee
2def8bb31b update it 2022-03-31 19:51:51 +09:00
EugeneBogush
f557fc8eaa Add/update current imei of UE in subscriber profile (#1464)
* first commit

* fix

Co-authored-by: root <root@lfv.unassigned-domain>
2022-03-31 19:35:30 +09:00
Sukchan Lee
82241f5b84 Added Meson Continuous Integration (#1454) 2022-04-01 02:31:57 +09:00
Pau Espin Pedrol
fbfb72c1b7 [PFCP] Support multiple Usage Report IEs in all messages (#1461)
* [PFCP] Properly check down_data_report inclusion building SessionReportRequest

* [PFCP] Support multiple Usage Report IEs in all messages
2022-03-31 09:43:35 +09:00
Sukchan Lee
038fb680f4 Revert configuration for backward compatibility 2022-03-31 02:15:13 +09:00
Sukchan Lee
da8c934326 [Test] Fix the SBI running[1] 2022-03-28 23:09:24 +09:00
Sukchan Lee
88016a769f [SMF] fix missing initialization memory (#1458) 2022-03-28 22:22:24 +09:00
Pau Espin Pedrol
acd6610508 [SMF] Gx: Add Destination-Host AVP to CCR (#1458)
Catch Origin-Host during CCA and set it as Destination-Host during
subsequent CCRs. This way we ensure UPDATE/TERMINATION Requests are sent
back explicitly to the same Diameter peer. Moreover, it seems
freediameter relies on this AVP to properly send the message over the
correct SCTP association when several diameter peers are available.
2022-03-28 22:00:28 +09:00
Pau Espin Pedrol
4b8d3a845a [PFCP] Support associating multiple URRs to a PDR (#1456)
* [PFCP] Fix trailing whitespace in message generation files

* [PFCP] message gen: Support multiple URR ID IEs in Create PDR group

* [PFCP] Support associating multiple URRs to a PDR

According to 3GPP TS 29.244:
"""
A PDR shall contain:
- zero, one or more URRs, which contains instructions related to traffic measurement and reporting.
"""
2022-03-28 21:56:58 +09:00
Sukchan Lee
825b06b6e0 Update document for v2.4.5 2022-03-27 20:12:30 +09:00
Sukchan Lee
12c656efd0 Improve Slice/DNN selection (#1438), (#1440) 2022-03-27 17:50:31 +09:00
Sukchan Lee
ced37a6201 fix the slice issues (#1438), (#1440) 2022-03-26 23:53:53 +09:00
Pau Espin Pedrol
38e2dee17f [PFCP] Handle Measurement Information in Create/Update URR IEs (#1453) 2022-03-26 00:33:32 +09:00
Pau Espin Pedrol
89636fa8d3 [PFCP] Handle Measurement Information in Create/Update URR IEs (#1452) 2022-03-26 00:07:34 +09:00
Pau Espin Pedrol
cc0d147f5c Fix trailing whitespace (#1451) 2022-03-25 23:35:27 +09:00
Pau Espin Pedrol
12bac7a917 [PFCP] Avoid requiring optional fields in Update URR IE (#1449) 2022-03-25 05:58:40 +09:00
Sukchan Lee
41553de7a4 [MME] Exception handle - APN duplicated (#1431) 2022-03-24 21:52:42 +09:00
Sukchan Lee
2cb06b3085 remove pool related configuration (#1431) 2022-03-23 15:14:18 +09:00
Sukchan Lee
224d1caca1 change log-level WARNING to INFO 2022-03-22 22:52:10 +09:00
Sukchan Lee
37af21a88d [MEM] fix the pkbuf problem (#1431) 2022-03-22 22:47:45 +09:00
Sukchan Lee
fe5fd0f760 Update sponsors 2022-03-19 20:26:49 +09:00
Pau Espin Pedrol
ab5f47ef59 [SMF] PFCP Session Report Req: Allow receiving multiple bits in Report Type (#1442)
3GPP TS 29.244 sec 8.2.21 "Report Type" states:
At least one bit shall be set to "1". Several bits may be set to "1".
2022-03-17 16:23:43 +09:00
Sukchan Lee
72ecd1c005 [SMF] Remove T_RELEASE_HOLDING timer 2022-03-17 16:07:19 +09:00
Pau Espin Pedrol
7f6f35fe6f [UPF] Improve logging around IP spoofing (#1441)
* [UPF] Fix Trailing whitespace

* [UPF] Improve logging around IP spoofing

Related: https://github.com/open5gs/open5gs/issues/1435
2022-03-16 21:59:50 +09:00
Sukchan Lee
bf77318602 [MME] re-factor to check a piggybacked ESM (#1431) 2022-03-16 20:48:48 +09:00
Sukchan Lee
a6ec206998 Change EPERM to OGS_EPERM (#1436,#1404) 2022-03-16 20:32:19 +09:00
Pau Espin Pedrol
f060da45d5 [CORE] time: Add APIs to manage NTP 32-bit timestamps (#1439)
These will be further needed in PFCP in the future, as well as in other
Diameter based interfaces (such as Gy).
Let's put all implementation details in APIs so that devs don't need to
care about those details every time.
2022-03-16 11:25:30 +09:00
Pau Espin Pedrol
80ce991aa6 [CORE] Improve SO_BINDTODEVICE error log line (#1436) 2022-03-16 11:25:21 +09:00
Sukchan Lee
bcf53124d5 Improve the socket option configuration (#1404)
o GTP-C Option (Default)
  - so_bindtodevice : NULL

  gtpc:
    addr: 127.0.0.7
    option:
      so_bindtodevice: vrf-blue

o GTP-U Option (Default)
  - so_bindtodevice : NULL

  gtpu:
    addr: 127.0.0.7
    option:
      so_bindtodevice: vrf-blue

o PFCP Option (Default)
  - so_bindtodevice : NULL

  pfcp:
    addr: 127.0.0.7
    option:
      so_bindtodevice: vrf-blue

o SBI Option (Default)
  - tcp_nodelay : true
  - so_linger.l_onoff : false

  sbi:
    addr: 127.0.0.10
    option:
      tcp_nodelay: false
      so_linger:
        l_onoff: true
        l_linger: 10

o NGAP Option (Default)
  - sctp_nodelay : true
  - so_linger.l_onoff : false
ngap:
  addr: 127.0.0.5
  option:
    stcp_nodelay: false
    so_linger:
      l_onoff: true
      l_linger: 10

o NGAP SCTP Option (Default)
  - spp_hbinterval : 5000 (5secs)
  - spp_sackdelay : 200 (200ms)
  - srto_initial : 3000 (3secs)
  - srto_min : 1000 (1sec)
  - srto_max : 5000 (5secs)
  - sinit_num_ostreams : 30
  - sinit_max_instreams : 65535
  - sinit_max_attempts : 4
  - sinit_max_init_timeo : 8000(8secs)
ngap:
  addr: 127.0.0.5
  option:
    sctp:
      spp_hbinterval : 5000
      spp_sackdelay : 200
      srto_initial : 3000
      srto_min : 1000
      srto_max : 5000
      sinit_num_ostreams : 30
      sinit_max_instreams : 65535
      sinit_max_attempts : 4
      sinit_max_init_timeo : 8000
2022-03-15 22:03:50 +09:00
Pau Espin Pedrol
73836c063c [UPF] Fix log typo, trailing whitespace (#1434) 2022-03-15 13:34:32 +09:00
Pau Espin Pedrol
dd5abb79b4 [PFCP] Fix wrong endianess enc of some URR values (#1433)
* [PFCP] Fix trailing whitespace

* [PFCP] Fix wrong endianess enc of some URR values

u32 tlvs are already converted to big endian automatically. Manually
doing so ends up in double conversion and hence in wrong endianness
being sent over the wire.
Similar issue was also fixed recently in the PFCP decoding path.
Related: https://github.com/open5gs/open5gs/issues/1349
2022-03-15 13:34:22 +09:00
Pau Espin Pedrol
5b81802be9 [Gx] Fix trailing whitespace (#1420) 2022-03-08 21:50:20 +09:00
Pau Espin Pedrol
4388f9bf3a [Gx] Use OGS_DIAM_GX_APPLICATION_ID define instead of hardcoded val (#1419) 2022-03-08 21:50:05 +09:00
Sukchan Lee
c1fc25958c Change default to bindtodevice:false 2022-03-08 19:49:16 +09:00
Sukchan Lee
914bb0a40f Merge branch 'sysmocom-pespin/vrf' into main 2022-03-07 22:44:23 +09:00
Sukchan Lee
253e2ad98a [GTP/PFCP] Support VRF (#1404) 2022-03-07 22:43:18 +09:00
Sukchan Lee
c2d10772c6 Merge branch 'pespin/vrf' of https://github.com/sysmocom/open5gs into sysmocom-pespin/vrf 2022-03-07 22:43:10 +09:00
Sukchan Lee
f848785360 Update document (#1412) 2022-03-05 18:50:25 +09:00
Sukchan Lee
a1be48ed50 [SGW-C] fix the crash (#1353) 2022-03-05 11:27:22 +09:00
Sukchan Lee
896370c2e4 [MME] Oops! Remove redundant warning (#1411) 2022-03-04 23:49:45 +09:00
Sukchan Lee
9bf8a84b81 [SGWC] fix the crash (#1353) 2022-03-05 02:58:53 +09:00
Sukchan Lee
79e34260da [SGWC] fix the crash (#1353) 2022-03-03 23:17:28 +09:00
Pau Espin Pedrol
7bddc92322 [GTP] Support binding socket to device
This is useful, among other possible applications, to make use of VRFs [1],
in this case for GTP-C and GTP-U traffic in the PGW.

The bind_dev field is added to the ogs_socknode_t so that it's easy to
extend its use into lots of other sockets being set up based on config
file information.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/vrf.rst
2022-03-02 20:07:51 +01:00
Sukchan Lee
ed3444eef5 Need to increase NF ref_count
1. UE registered and PDU established.
2. PCF does not receive Heartbeat.
 - PCF De-registered state.
 - Since PDU is established, SMF should not remove NF instance
3. PCF re-registered.
 - HERE, WE NEED TO INCREASE NF REFERENCE COUNT.
   Otherwise, NF instance will be removed if PCF is de-registered state
4. UE sends PDU release request.
5. Because SMF knows PCF NF instance, SMF can send PCF delete
2022-03-01 22:02:02 +09:00
Sukchan Lee
3217e93124 [LINUX] initialize struct epoll_event (#1399) 2022-03-01 21:03:27 +09:00
ji3k54j062k7
19120acadc modify building from source md file (#1403)
Signed-off-by: ji3k54j062k7 <ji3k54g4j062k7@gmail.com>
2022-03-01 20:18:47 +09:00
Pau Espin Pedrol
d06acc7f37 Fix trailing whitespace (#1402) 2022-03-01 17:13:40 +09:00
Supreeth Herle
bc69ddfc6d [SMF]: Fix Framed-IPv6-Prefix AVP length in CCR (#1398) 2022-03-01 17:11:28 +09:00
Sukchan Lee
d54e8a43ce [PCRF] Fix Framed-IPv6 Prefix in CCR (#1398) 2022-03-01 17:09:47 +09:00
Pau Espin Pedrol
ba3a046c62 [SMF] Avoid crash if smf_ue_pool is full (1024 UEs) (#1397) 2022-02-28 21:27:27 +09:00
Sukchan Lee
efe37c1e84 [ASN1C] asn.1 issues in NGAP (#1394 from @nkout)
mouse07410/asn1c#89
Found when tried to encode NGAP_CauseRadioNetwork_release_due_to_pre_emption

mouse07410/asn1c#90
Found when tried to decode messages encoded with newer schema
2022-02-26 16:09:38 +09:00
Supreeth Herle
03280d1f5a Fix prefix length in Gx CCR Framed-IPv6-Prefix AVP (#1396)
As per 3GPP TS 23.401 version 15.12.0, section 5.3.1.2.2
The PDN GW allocates a globally unique /64
IPv6 prefix via Router Advertisement to a given UE.

After the UE has received the Router Advertisement message, it
constructs a full IPv6 address via IPv6 Stateless Address
autoconfiguration in accordance with RFC 4862 using the interface
identifier assigned by PDN GW.

For stateless address autoconfiguration however, the UE can
choose any interface identifier to generate IPv6 addresses, other
than link-local, without involving the network.

And, from section 5.3.1.1, Both EPS network elements and UE shall
support the following mechanisms:

/64 IPv6 prefix allocation via IPv6 Stateless Address
autoconfiguration according to RFC 4862, if IPv6 is
supported.
2022-02-26 15:25:08 +09:00
Pau Espin Pedrol
51a75cde26 Pespin/pr (#1395)
* [SMF] Gn: Avoid assert crash if no PDP resources available

* [SMF] Gn: Rearrange IE handling order in CreatePDPContextRequest

Let's handle the GTPC remote addr + TEID first, since those should be
used in the CreatePDPContextResponse ideally if available.

Let's then handle parsing of all IEs not related to bearers/UserPlane,
then those missing, and finally do all the IP resource allocation.
2022-02-25 22:39:44 +09:00
Supreeth Herle
52bc4be547 Bugfix packet filter for pre rel11 LTE devices (#1393)
* Fix conversion from IPFilterRule to packet filter

As per 3GPP TS 24.008, following Packet filter component type identifier
are not supported on the LTE pre release-11 UEs:

IPv4 local address type
IPv6 remote address/prefix length type
IPv6 local address/prefix length type

And,
IPv6 remote address/prefix length type and
IPv6 local address/prefix length type shall be used when both MS and
Network support Local Address in TFTs.

This commit add logic to omit adding local address in packet filters
for compatibility with pre-release LTE 11 devices. The following parameter
could be used to toggle omit/no to omit behavior.

parameter:
	no_ipv4v6_local_addr_in_packet_filter: <true/false>

* Remove logic of supporting pre-release LTE 11 devices in PCRF
2022-02-25 22:11:51 +09:00
Pau Espin Pedrol
3b6da3ddb2 [GTPv1C] Fix sequm not added to EchoResponse and VersionNotSupported (#1390)
According to TS 29.060 they should be added.

section 7.6:
"if it is a request for which a response has been defined, shall be sent
with a Sequence Number"

section 8.2:
"""
Sequence number flag (S) shall be set to "1"
...
For GTP-C messages not having a defined response message for a request
message, i.e. for messages Version Not Supported, RAN Information Relay
and Supported Extension Headers Notification, the Sequence Number shall
be ignored by the receiver.
"
2022-02-24 23:38:52 +09:00
Pau Espin Pedrol
dbd9e8bd78 [GTPv1C] Set EUA spare field to '1111' as per spec (#1388) 2022-02-24 06:03:54 +09:00
Pau Espin Pedrol
3833a73a14 [SMF] incorrect GTPv1C cause with changed APN (#1387) 2022-02-23 20:48:36 +09:00
Sukchan Lee
953a7321c6 [SMF] fix the crash in VoLTE test (#1383) 2022-02-23 20:31:28 +09:00
Pau Espin Pedrol
5ad1b188e4 [SMF] UpdatePDPContext: forward update of remote TEID+IPaddr to UPF (#1383)
* [SMF] typo fixes in commented code

* [SMF] Fix early err return handling UpdatePDPContextRequest

* [SMF] UpdatePDPContext: forward update of remote TEID+IPaddr to UPF

Updating the remote GTP-U IP address and/or TEID on the GGSN is a common
practice, used for instance by an SGSN in a UTRAN network to connect an
HNB(GW) to exchange GTP-U directly with the GGSN. It is also used in
general when doing handovers.
When receiving a UpdatePDPContext with the new address, we need to
forward the update to the UPF so that it takes it into account when
forwarding packets.

This patch only implements updating the information towards the UPF when
GTPv1C is used. Similar approach for GTPv2C (upon receival of Modify
Bearer Request) is still unimplemented.

Related: https://github.com/open5gs/open5gs/issues/1367
2022-02-23 20:21:33 +09:00
Sukchan Lee
af3db1770f [SMF] incorrect GTP cause with changed APN (#1360)
SMF setting incorrect Cause when answering
with a changed APN type IPv4v6 ->IPv4/IPv6
2022-02-23 20:16:04 +09:00
Sukchan Lee
d61127afcc [SMF] fix the seperate DNS in PCO IPCP (#1358) 2022-02-23 17:38:07 +09:00
Pau Espin Pedrol
882548de11 [SMF] UpdPDPCtxRsp: Fix adding 2 IP addresses to one GSN Address IE (#1382)
In the event we have 2 local IP addresses available for use, put the one
having same IP version in "GGSN Address *" IE, and the one with the
other IP version in "Alternative GGSN Address *" IE.

Same fix was applied recently to CreatePDPContextResponse.
2022-02-22 07:00:14 +09:00
Pau Espin Pedrol
b0fc06ab6c Fix trailing whitespace (#1381) 2022-02-22 07:00:06 +09:00
Pau Espin Pedrol
b7698810ac [SMF] s/'Context not found'/'Non-existent'/ in {Update,Delete}PdpContextResponse (#1379)
TS 29.060 sections 7.3.4 and 7.3.6 specify the possible cause values for
UpdatePdpContextResponse and DeletePdpContextResponse.
Together with section 8.2, it becomes clear that 'Non-existent' cause
should be sent instead of 'Context not found' one in those cases.
2022-02-21 22:18:39 +09:00
Sukchan Lee
e3fa731c4a [SBI] fix the timezone string converter (#1376) 2022-02-20 20:18:32 +09:00
Sukchan Lee
420c1d5ad3 [SMF] fix the PCO bug (#1357, #1358)
- SMF can handle PCO ID PAP (0xc023)
- SMF adds DNS servers to PCO IPCP only if UE requested
2022-02-19 16:05:07 +09:00
Sukchan Lee
b4f382d360 [MEM] fix pkbuf problem in multi-threads (#1353)
We should use talloc in multi-threads instead of pkbuf.
Now, pkbuf library only uses single-thread environment.
2022-02-19 09:47:44 +09:00
Pau Espin Pedrol
137ed99dd5 [GTPv1C] Send conditional IE Reordering Required in CreatePDPCtxResp (#1374)
It seems to be actually mandatory in GGSN->SGN directon, though it is
ignored in Release99 upwards. Let's hardcode it to 0 for now, should be
fine in the majority of cases.
2022-02-19 06:36:54 +09:00
Pau Espin Pedrol
f7999a2cad [GTPv1C] Fix outer message length field containing wrong value (#1373)
The mandatory part of the header must be excluded from the header, that
is flags(1)+type(1)+length(2)+teid(4) = 8 bytes.
2022-02-19 06:36:40 +09:00
Pau Espin Pedrol
2056a5b500 [PCRF] Fix trailing whitespace (#1372) 2022-02-19 06:33:46 +09:00
Pau Espin Pedrol
8b1bdf42a2 [SMF] Fix adding 2 IP addresses to one GSN Address IE (#1371)
In the event we have 2 local IP addresses available for use, put the one
having same IP version in "GGSN Address *" IE, and the one with the
other IP version in "Alternative GGSN Address *" IE.
2022-02-19 06:33:19 +09:00
Pau Espin Pedrol
8cc70694db Introduce Gn interface (GTPv1C) Support to PGW (#1351)
* [CORE] tlv: Store mode in ogs_tlv_t

This allows specifying the format of the IE for each individual IE,
hence allowing messages containing IEs formatted in different ways.

This is needed in order to support parsing GTPv1-C, since messages
contain IEs with different structure (TLV vs TV). Hence, this is a
preparation patch to add support for parsing TVs in ogs-tlv.c/.h.

* [CORE] tlv: Support parsing msg with both TLV and TV in it

IEs of type TV are sometimes used in GTPv1-C. Current tlv parser/builder
doesn't provide with ways to parse messages which contain TV formatted
IEs. This patch adds the relevant types and ways to encode/decode them.

Furthermore, the current parser/builder allows parsing/building messages
containing the exact same format in all its IEs. A new parser function
is added which allows parsing messages of different types (TV, TLV)
mixed in the same message. In order to be able to do so, it uses the
general msg_mode passed to it in order to know the general TLV format
(in essence, the length of the Tag field, and also the length of the
Length field if applicable each IE).

Looking up the instance in the TLV description is left undone and
hadcoded to 0, since the only user so far requiring this API is GTPv1-C,
which has no instances.

* [CORE] tlv: Support repeated tag+instance parsing TLV message

In GTPv2C, repeated IEs (same tag) are easily differentiated by the
Instance byte, which provides info to match different decoded
structures. In GTPv1C though, there's no Instance byte, and we still
encounter repeated IEs (like GSN Address in Create PDP Context Request).
Hence, the TLV decoder needs to be updated to track count of IEs found
(identified by tag+instance, where instance is always 0 in GTPv1C) and
get the proper description index + offset into the decoded structure.

* [GTP]: Move GTPv2-C specifics to its own libgtp subdir

This will allow adding GTPv1-C code by the side. Most GTPv2 code is left
in this patch as "gtp" instead of renaming it to "gtp2" in order to
avoid massive changes. It can be done at a later stage if wanted.

* [GTP] Support generating GTPv1-C messages

* [SMF] Add Gn interface support

This patch introduces GTPv1C support to open5gs-smfd. With it,
open5gs-becomes a GGSN too, where SGSN can connect to, hence supporting
GERAN and UTRAN networks.
2022-02-18 22:23:45 +09:00
Sukchan Lee
3eab4be135 fix MacOSX compile error (#1354, #1355) 2022-02-18 22:00:57 +09:00
Matthew Johnson
7df65e832e Relax systemd requirements (#1368)
* [configs] Remove requires systemd-networkd dep from smfd service

The smf no longer has (never had?) a dependency on systemd-networkd,
and can start and remain operational without systemd-networkd
specifically running.

* [configs] Relax upf dependency on systemd-networkd

The upf relies on systemd-networkd to create the ogstun interface, but
does not communicate with it at runtime. It currently has a "Requires"
dependency specified, which means that the upf will be stopped if
systemd-networkd is ever stopped. Since the upf doesn't actually care
if systemd-networkd is later stopped after ogstun is created, it can
use the weaker "Wants" dependency type, which allows it to keep
running even if systemd-networkd were to be stopped.

Regardless, since it does rely on systemd-networkd specifically to
create the ogstun interface, it should sequence itself "After"
systemd-networkd has been started.

Since the true dependency is ogstun, not systemd-networkd, a cleaner
approach would depend on the specific tunnel device being
available. Systemd exposes this information via device units, but I'm
not sure if they are always consistently named across platforms.
2022-02-16 17:56:14 +09:00
Matthew Johnson
c0ffe1ffe4 Systemd sequencing (#1366)
* [configs] Do not require ogstun for system online

Systemd-networkd will wait for all managed interfaces to be configured
before determining the system is online. Since the ogstun and upf are
more logically an application rather than a system networking service,
don't wait for them to be configured by default.

This breaks the circular dependency between the userspace cellular
core network services and the system's network, which will allow the
cellular core network services to sequence themselves cleanly after
the system's network is up and configured.

* [configs] Sequence network-dependent units after network-online

Since open5gs targets platforms with both ifupdown (debian) and
systemd-networkd (Ubuntu) as core networking providers, this commit
sequences network-dependent core network components after the generic
network-online.target instead of one of the specific provider
targets. This allows the core network to operate correctly with both
systemd-networkd and ifupdown (networking), and fixes the issue
observed in https://github.com/open5gs/open5gs/issues/826 where some
platforms may fail to start cleanly.
2022-02-15 22:33:33 +09:00
Pau Espin Pedrol
757285bf25 Fix trailing whitespace (#1365)
* [SMF] Fix trailing whitespace

* [CORE] Fix trailing whitespace

* [GTP] Fix trailing whitespace
2022-02-14 20:11:04 +09:00
Sukchan Lee
906e7c5046 [UPF] Consider RS message for IP spoofing (#1354) 2022-02-14 20:07:08 +09:00
Sukchan Lee
0e1ab26ee5 Check if Source IP address spoofing (#1354, #1355) 2022-02-14 17:34:22 +09:00
Sukchan Lee
6e30f97097 Fixed typo in Airspan gNodeB 2022-02-13 20:19:21 +09:00
Sukchan Lee
4145b8b543 Added Airpsan 5G commercial gNodeB to the tested 2022-02-12 14:43:14 +09:00
Sukchan Lee
ffcd92c2f3 [SBI] Remove Accept-Encoding in HTTP client 2022-02-12 14:40:48 +09:00
Sukchan Lee
900e888dc1 [SBI] fix crash when no mandatory item (#1350)
NRF crashed if NFService does not have a versions.
Versions are mandatory, we've modified the SBI interface for the safety.
2022-02-05 20:20:45 +09:00
Sukchan Lee
acfcbda8fa [PFCP] remove be32toh() in TLV u32 leaf (#1349) 2022-02-04 00:26:27 +09:00
Pau Espin Pedrol
5fff69306f logging improvements (#1348)
* [SMF] Fix typo in debug message

* [SMF] Add debug messages to follow messages received in N4
2022-02-02 23:23:12 +09:00
Sukchan Lee
9b7ebf9927 Update document 2022-02-01 15:17:04 +09:00
Sukchan Lee
4018833b3a Relase v2.4.4 2022-02-01 15:07:24 +09:00
Sukchan Lee
8bc584ce80 [CX] Update test code 2022-02-01 14:51:54 +09:00
Sukchan Lee
a7d164c28d [NRF] fix the crash (#1347)
`reqNfInstanceId` is optional in the Subscription.
So, we need to consider it.
2022-01-31 23:19:26 +09:00
Sukchan Lee
83d56fe40d [ALL] Fix the memory leak (#1282) 2022-01-31 22:58:52 +09:00
Sukchan Lee
340b23af94 [SMF] Fixed case without transportLayerAddr(#1341)
Fixed the crash if TransportLayerAddress in GTPTunnel does not exist
2022-01-26 08:09:26 +09:00
Sukchan Lee
3b275edec7 [SBI] Remove one octet length in FQDN (#1333) 2022-01-23 13:49:03 +09:00
Sukchan Lee
866ae78f5e [NRF] fix the crash for invalid FQDN (#1333) 2022-01-22 09:34:38 +09:00
Pau Espin Pedrol
68407efa16 [CORE] tlv_test: Fix trailing whitespace (#1337) 2022-01-22 06:44:08 +09:00
Pau Espin Pedrol
c071bf3c6d [CORE]: tlv: Fix trailing whitespace (#1334) 2022-01-21 21:41:36 +09:00
Sukchan Lee
23647f643b [FQDN] fix the fqdn_parse bug (#1335) 2022-01-21 21:32:35 +09:00
Sukchan Lee
99d03f9d03 Document release v2.4.3 2022-01-20 17:22:10 +09:00
Sukchan Lee
9215b69ee1 Release v2.4.3 2022-01-20 17:12:51 +09:00
Sukchan Lee
0ff9c3e297 Update document srsRAN (#1326, #1322) 2022-01-19 21:39:37 +09:00
Sukchan Lee
776892e09d [PFCP] xact: avoid exporting internal (#1329) 2022-01-19 20:03:28 +09:00
Pau Espin Pedrol
ed3a3a527a [GTP] xact: Avoid exporting internally used functions (#1329)
* [GTP] xact: Fix trailing whitespace

* [GTP] xact: Avoid exporting internally used functions

This simplifies the API header hiding unneeded APIs from external
components, and lets the compiler further optimize by
marking the functions as static.

* [GTP] xact: Drop unused API ogs_gtp_xact_find

After making it static, it became clear to the compiler that this
function is not used anywhere, warning about it. Let's drop it.
2022-01-19 19:54:44 +09:00
Sukchan Lee
8955fdcd5d [SBI] FQDN bug from talloc (#1328) 2022-01-19 17:10:39 +09:00
Pau Espin Pedrol
b3ac5b35eb [SMF] Fix potential null pointer dereference (#1324)
* [SMF] Fix potential null pointer dereference

Pointer "sess" was first dereferenced and later on checked for nullness.
This is clearly wrong. Rearrange the code path to make sure the check is
done first, then dereferenced.

* gitignore: Add subprojects/libtins

* cosmetic: Fix whitespace
2022-01-18 11:23:40 +09:00
Sukchan Lee
79239d8eff [IMPORTANT] changed network_access_mode: 0 (#1323)
The network access mode of HSS has been changed to 0 (Packet and Circuit).

Versions of MME prior to v2.4.2 did not use this value. Open5GS set
the attach result of Attach Complete message as it is by looking
at the attach type of the Attach Request message.

Now, if the network access mode of HSS is set to 2 (Only Packet),
this value is affected by MME from v2.4.3. Regardless of the attach type
of the Attach Request, the MME will set EPS Only to the attach result
of Attach Complete.
2022-01-16 12:35:55 +09:00
Sukchan Lee
522e835101 Update document v2.4.2 2022-01-14 21:03:27 +09:00
Sukchan Lee
13dbdb1b18 Release v2.4.2 2022-01-14 20:46:44 +09:00
Sukchan Lee
e4f864c1f5 Change IPv6 Prefix (#1321) 2022-01-14 11:53:15 +09:00
Julian Lemmerich
f75e51ca46 changed default ipv6 prefix to 2001:db8:cafe:: (#1321)
to be compliant with RFC3849
2022-01-14 11:50:27 +09:00
Sukchan Lee
ea6675879c [ALL] GNB/NF Memory pool from 32 to 64 2022-01-13 17:55:36 +09:00
Sukchan Lee
fdddeaca98 [S6A] Change PUR-Flags to Optional (#1298) 2022-01-13 17:53:54 +09:00
Sukchan Lee
bbd1412a9e [SMF] change log-level from WARN to ERR (#1313) 2022-01-12 20:06:26 +09:00
Sukchan Lee
cfd0193bbd [PCRF] fix the crash in flow->description (#1313) 2022-01-12 10:15:36 +09:00
Sukchan Lee
2ed35f245d Fix the ciphered test program 2022-01-08 12:26:23 +09:00
Sukchan Lee
070cdbc657 [ALL] fix the epoll(map) crash (#1311) 2022-01-06 22:28:24 +09:00
Sukchan Lee
715e4c0b50 Shall cipher in the NAS message container IE
3GPP TS 24.501 version 16.6.0 Release 16
4.4 NAS security
4.4.6 Protection of initial NAS signalling messages

1) the UE needs to send non-cleartext IEs in a REGISTRATION REQUEST
or SERVICE REQUEST message, the UE includes the entire REGISTRATION
REQUEST or SERVICE REQUEST message (i.e. containing both cleartext IEs
and non-cleartext IEs) in the NAS message container IE and shall cipher
the value part of the NAS message container IE. The UE shall then send
a REGISTRATION REQUEST or SERVICE REQUEST message containing
the cleartext IEs and the NAS message container IE;
2022-01-05 22:39:06 +09:00
Sukchan Lee
5e5a61b982 Update document for v2.4.1 2022-01-04 17:58:47 +09:00
834 changed files with 41184 additions and 14536 deletions

77
.github/workflows/meson-ci.yml vendored Normal file
View File

@@ -0,0 +1,77 @@
name: Meson Continuous Integration
on: [push, pull_request]
jobs:
macos-latest:
name: Build and Test on MacOS Latest
runs-on: macos-latest
steps:
- name: Install MongoDB with Package Manager
run: |
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community
- name: Create the TUN device with the interface name `ogstun`.
run: |
sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
- name: Install the dependencies for building the source code.
run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson
- name: Check out repository code
uses: actions/checkout@main
- name: Setup Meson Build
run: PATH="/usr/local/opt/bison/bin:$PATH" meson setup build
env:
CC: gcc
- name : Build Open5GS
run: ninja -C build
- name: Test Open5GS
run: sudo meson test -C build -v crypt unit
ubuntu-latest:
name: Build and Test on Ubuntu Latest
runs-on: ubuntu-latest
services:
mongodb:
image: mongo
ports:
- 27017:27017
steps:
- name: Create the TUN device with the interface name `ogstun`.
run: |
sudo ip tuntap add name ogstun mode tun
sudo ip addr add 10.45.0.1/16 dev ogstun
sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
sudo ip link set ogstun up
- name: Install the dependencies for building the source code.
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools python3-wheel ninja-build build-essential flex bison git libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev libyaml-dev libnghttp2-dev libmicrohttpd-dev libcurl4-gnutls-dev libnghttp2-dev libtins-dev libtalloc-dev meson
- name: Check out repository code
uses: actions/checkout@main
- name: Setup Meson Build
run: meson setup build
env:
CC: gcc
- name : Build Open5GS
run: ninja -C build
- name: Test Open5GS
run: meson test -C build -v

4
.gitignore vendored
View File

@@ -1,5 +1,7 @@
# This directory is fetched during first build and is present in this directory
subprojects/freeDiameter
subprojects/libtins
subprojects/prometheus-client-c
subprojects/usrsctp
webui/.next
webui/.next

View File

@@ -2,13 +2,26 @@
If you find Open5GS useful for work, please consider supporting this Open Source project by [Becoming a sponsor](https://github.com/sponsors/acetcom). To manage the funding transactions transparently, you can donate through [OpenCollective](https://opencollective.com/open5gs).
<h3 align="center">Platinum Sponsors</h3>
<table align="center">
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://teletresearch.com/" target="_blank">
<img width="400px" src="https://open5gs.org/assets/img/Telet-logo-v2.png">
</a>
</td>
</tr>
</tbody>
</table>
<h3 align="center">Gold Sponsors</h3>
<table>
<table align="center">
<tbody>
<tr>
<td align="center" valign="middle">
<a href="http://wavemobile.com/" target="_blank">
<img width="260px" src="https://open5gs.org/assets/img/Wavemobile-Logo-Mark-RGB.png">
<img width="222px" src="https://open5gs.org/assets/img/Wavemobile-Logo-Mark-RGB.png">
</a>
</td>
</tr>
@@ -16,14 +29,9 @@ If you find Open5GS useful for work, please consider supporting this Open Source
</table>
<h3 align="center">Silver Sponsors</h3>
<table>
<table align="center">
<tbody>
<tr>
<td align="center" valign="middle" width="222px">
<a href="https://www.auctionsoftware.com/" target="_blank">
<img src="https://open5gs.org/assets/img/asLogonew.png">
</a>
</td>
<td align="center" valign="middle" width="222px">
<a href="https://nextepc.com/" target="_blank">
<img src="https://open5gs.org/assets/img/nextepc_logo.jpg">
@@ -34,13 +42,13 @@ If you find Open5GS useful for work, please consider supporting this Open Source
<img src="https://open5gs.org/assets/img/triple_logo.png">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle" width="222px">
<a href="https://sdr.eee.strath.ac.uk/" target="_blank">
<img src="https://open5gs.org/assets/img/strath.png">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle" width="222px">
<a href="https://skylarkwireless.com/" target="_blank">
<img src="https://open5gs.org/assets/img/SkylarkWireless-420x78-Web2-R.png">
@@ -51,21 +59,21 @@ If you find Open5GS useful for work, please consider supporting this Open Source
<img src="https://open5gs.org/assets/img/sysmocom-logo-only.png">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle" width="222px">
<a href="https://www.p1sec.com/" target="_blank">
<img src="https://open5gs.org/assets/img/2021-logo-P1.svg">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle" width="222px">
<a href="https://www.ng-voice.com/" target="_blank">
<img src="https://open5gs.org/assets/img/ng-voice-logo_color.png">
</a>
</td>
<td align="center" valign="middle" width="222px">
<a href="https://www.peratonlabs.com/" target="_blank">
<img src="https://open5gs.org/assets/img/peraton-labs-logo-full-color.png">
<a href="http://www.bristol.ac.uk/engineering/research/smart/" target="_blank">
<img src="https://open5gs.org/assets/img/smart-internet-lab.png">
</a>
</td>
</tr>

View File

@@ -80,7 +80,7 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -148,7 +148,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
hss:
freeDiameter:

View File

@@ -114,7 +114,7 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -182,7 +182,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
hss:
freeDiameter:

View File

@@ -80,7 +80,7 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -150,7 +150,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
hss:
freeDiameter:

View File

@@ -73,6 +73,18 @@ logger:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.5
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
# <NGAP Server>>
#
# o NGAP Server(all address avaiable)
@@ -96,6 +108,43 @@ logger:
# ngap:
# dev: eth0
#
# o NGAP Option (Default)
# - sctp_nodelay : true
# - so_linger.l_onoff : false
#
# ngap:
# addr: 127.0.0.5
# option:
# stcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
# o NGAP SCTP Option (Default)
# - spp_hbinterval : 5000 (5secs)
# - spp_sackdelay : 200 (200ms)
# - srto_initial : 3000 (3secs)
# - srto_min : 1000 (1sec)
# - srto_max : 5000 (5secs)
# - sinit_num_ostreams : 30
# - sinit_max_instreams : 65535
# - sinit_max_attempts : 4
# - sinit_max_init_timeo : 8000(8secs)
#
# ngap:
# addr: 127.0.0.5
# option:
# sctp:
# spp_hbinterval : 5000
# spp_sackdelay : 200
# srto_initial : 3000
# srto_min : 1000
# srto_max : 5000
# sinit_num_ostreams : 30
# sinit_max_instreams : 65535
# sinit_max_attempts : 4
# sinit_max_init_timeo : 8000
#
# <GUAMI>
#
# o Multiple GUAMI
@@ -232,6 +281,18 @@ amf:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
- addr:
@@ -259,54 +320,15 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
# usrsctp:
# udp_port : 9899
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# sockopt:
# no_delay : true
#
sockopt:
#
# sctp:
# heartbit_interval : 5000 (5secs)
# sack_delay : 200 (200ms)
# rto_initial : 3000 (3secs)
# rto_min : 1000 (1sec)
# rto_max : 5000 (5secs)
# max_num_of_ostreams : 30
# max_num_of_istreams : 65535
# max_attempts : 4
# max_initial_timeout : 8000(8secs)
# usrsctp_udp_port : 9899
#
sctp:
usrsctp:
#
# time:
@@ -336,3 +358,17 @@ sctp:
# handover:
# duration: 500
time:
#
# metrics:
#
# <Metrics Server>
#
# o Metrics Server(http://<any address>:9090)
# metrics:
# addr: 0.0.0.0
# port: 9090
#
metrics:
addr: 0.0.0.0
port: 9090

View File

@@ -73,6 +73,18 @@ logger:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.11
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
ausf:
sbi:
- addr: 127.0.0.11
@@ -104,6 +116,18 @@ ausf:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
- addr:
@@ -114,9 +138,6 @@ nrf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -134,34 +155,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -75,6 +75,18 @@ logger:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.15
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
bsf:
sbi:
- addr: 127.0.0.15
@@ -106,6 +118,18 @@ bsf:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
- addr:
@@ -116,9 +140,6 @@ nrf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -136,34 +157,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -26,12 +26,11 @@ logger:
hss:
freeDiameter: @sysconfdir@/freeDiameter/hss.conf
# sms_over_ims: "sip:smsc.mnc001.mcc001.3gppnetwork.org:7060;transport=tcp"
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -49,30 +48,6 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:

View File

@@ -47,6 +47,43 @@ logger:
# s1ap:
# dev: eth0
#
# o S1AP Option (Default)
# - sctp_nodelay : true
# - so_linger.l_onoff : false
#
# s1ap:
# addr: 127.0.0.2
# option:
# stcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
# o S1AP SCTP Option (Default)
# - spp_hbinterval : 5000 (5secs)
# - spp_sackdelay : 200 (200ms)
# - srto_initial : 3000 (3secs)
# - srto_min : 1000 (1sec)
# - srto_max : 5000 (5secs)
# - sinit_num_ostreams : 30
# - sinit_max_instreams : 65535
# - sinit_max_attempts : 4
# - sinit_max_init_timeo : 8000(8secs)
#
# s1ap:
# addr: 127.0.0.2
# option:
# sctp:
# spp_hbinterval : 5000
# spp_sackdelay : 200
# srto_initial : 3000
# srto_min : 1000
# srto_max : 5000
# sinit_num_ostreams : 30
# sinit_max_instreams : 65535
# sinit_max_attempts : 4
# sinit_max_init_timeo : 8000
#
# <GTP-C Server>>
#
# o GTP-C Server(all address avaiable)
@@ -357,54 +394,15 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
# usrsctp:
# udp_port : 9899
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# sockopt:
# no_delay : true
#
sockopt:
#
# sctp:
# heartbit_interval : 5000 (5secs)
# sack_delay : 200 (200ms)
# rto_initial : 3000 (3secs)
# rto_min : 1000 (1sec)
# rto_max : 5000 (5secs)
# max_num_of_ostreams : 30
# max_num_of_istreams : 65535
# max_attempts : 4
# max_initial_timeout : 8000(8secs)
# usrsctp_udp_port : 9899
#
sctp:
usrsctp:
#
# time:
@@ -423,3 +421,17 @@ sctp:
# handover:
# duration: 500
time:
#
# metrics:
#
# <Metrics Server>
#
# o Metrics Server(http://<any address>:9090)
# metrics:
# addr: 0.0.0.0
# port: 9090
#
metrics:
addr: 0.0.0.0
port: 9090

View File

@@ -65,6 +65,18 @@ logger:
# sbi:
# dev: eth0
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
addr:
@@ -75,9 +87,6 @@ nrf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -95,34 +104,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -73,6 +73,18 @@ logger:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.14
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
# <List of avaiable Network Slice Instance(NSI)>
#
# o One NSI
@@ -110,6 +122,18 @@ logger:
# s_nssai:
# sst: 1
# sd: 009000
#
# o NSI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# nsi:
# addr: ::1
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
nssf:
sbi:
- addr: 127.0.0.14
@@ -156,9 +180,6 @@ nrf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -176,34 +197,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -75,6 +75,18 @@ logger:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.13
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
pcf:
sbi:
- addr: 127.0.0.13
@@ -106,6 +118,18 @@ pcf:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
- addr:
@@ -116,9 +140,6 @@ nrf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -136,34 +157,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -28,9 +28,6 @@ pcrf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -40,11 +37,6 @@ pcrf:
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
# prefer_ipv4: true
#
# o Legacy support for pre-release LTE 11 devices to do calling
# - Replace IPv4/v6 local addr field in AAR Media-Subcomponent AVP
# by 'any local port'
# no_ipv4v6_local_addr_in_packet_filter: true
#
parameter:
#
@@ -53,30 +45,6 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:

View File

@@ -38,6 +38,14 @@ logger:
# - addr: 127.0.0.3
# - addr: fd69:f21d:873c:fa::2
#
# o GTP-C Option (Default)
# - so_bindtodevice : NULL
#
# gtpc:
# addr: 127.0.0.3
# option:
# so_bindtodevice: vrf-blue
#
# <PFCP Server>
#
# o PFCP Server(127.0.0.3:8805, ::1:8805)
@@ -49,6 +57,14 @@ logger:
# pfcp:
# name: localhost
#
# o PFCP Option (Default)
# - so_bindtodevice : NULL
#
# pfcp:
# addr: 127.0.0.3
# option:
# so_bindtodevice: vrf-blue
#
sgwc:
gtpc:
- addr: 127.0.0.3
@@ -109,9 +125,6 @@ sgwu:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -132,34 +145,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -35,6 +35,14 @@ logger:
# pfcp:
# - name: localhost
#
# o PFCP Option (Default)
# - so_bindtodevice : NULL
#
# pfcp:
# addr: 127.0.0.6
# option:
# so_bindtodevice: vrf-blue
#
# <GTP-U Server>
#
# o GTP-U Server(127.0.0.6:2152, [::1]:2152)
@@ -80,6 +88,14 @@ logger:
# - dev: ens3
# advertise: sgw1.epc.mnc001.mcc001.3gppnetwork.org
#
# o GTP-U Option (Default)
# - so_bindtodevice : NULL
#
# gtpu:
# addr: 127.0.0.6
# option:
# so_bindtodevice: vrf-blue
#
sgwu:
pfcp:
- addr: 127.0.0.6
@@ -101,9 +117,6 @@ sgwc:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -121,34 +134,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -73,6 +73,18 @@ logger:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.4
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
# <PFCP Server>
#
# o PFCP Server(127.0.0.4:8805, ::1:8805)
@@ -84,6 +96,14 @@ logger:
# pfcp:
# name: localhost
#
# o PFCP Option (Default)
# - so_bindtodevice : NULL
#
# pfcp:
# addr: 127.0.0.4
# option:
# so_bindtodevice: vrf-blue
#
# <GTP-C Server>
#
# o GTP-C Server(127.0.0.4:2123, [fd69:f21d:873c:fa::3]:2123)
@@ -98,6 +118,14 @@ logger:
# - addr: 127.0.0.4
# - addr: fd69:f21d:873c:fa::3
#
# o GTP-C Option (Default)
# - so_bindtodevice : NULL
#
# gtpc:
# addr: 127.0.0.4
# option:
# so_bindtodevice: vrf-blue
#
# <GTP-U Server>>
#
# o GTP-U Server(127.0.0.4:2152, [::1]:2152)
@@ -109,6 +137,14 @@ logger:
# gtpu:
# name: localhost
#
# o GTP-U Option (Default)
# - so_bindtodevice : NULL
#
# gtpu:
# addr: 127.0.0.4
# option:
# so_bindtodevice: vrf-blue
#
# <Subnet for UE Pool>
#
# o IPv4 Pool
@@ -118,20 +154,20 @@ logger:
# o IPv4/IPv6 Pool
# subnet:
# - addr: 10.45.0.1/16
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
#
#
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:230:babe::1/48
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:db8:babe::1/48
# ; If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash.
#
# subnet:
# - addr: 10.45.0.1/16
# dnn: internet
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
# dnn: internet
# - addr: 10.46.0.1/16
# dnn: ims
# - addr: 2001:230:babe::1/48
# - addr: 2001:db8:babe::1/48
# dnn: ims
#
# o Specific DNN/APN with the FALLBACK SUBNET(10.47.0.1/16)
@@ -166,10 +202,10 @@ logger:
# range:
# - 10.45.0.100-10.45.0.200
# - 10.45.1.100-10.45.1.200
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
# range:
# - 2001:230:cafe:a0::0-2001:230:cafe:b0::0
# - 2001:230:cafe:c0::0-2001:230:cafe:d0::0
# - 2001:db8:cafe:a0::0-2001:db8:cafe:b0::0
# - 2001:db8:cafe:c0::0-2001:db8:cafe:d0::0
#
# <Domain Name Server>
#
@@ -197,6 +233,19 @@ logger:
# - 127.0.0.1
# - ::1
#
# <CTF>
#
# o Gy interface parameters towards OCS.
# o enabled:
# o auto: Default. Use Gy only if OCS available among Diameter peers
# o yes: Use Gy always;
# reject subscribers if no OCS available among Diameter peers
# o no: Don't use Gy interface if there is an OCS available
#
# ctf:
# enabled: auto|yes|no
#
#
# <SMF Selection - 5G Core only>
# 1. SMF sends SmfInfo(S-NSSAI, DNN, TAI) to the NRF
# 2. NRF responds to AMF with SmfInfo during NF-Discovery.
@@ -325,7 +374,7 @@ logger:
# mcc: 901
# mnc: 70
# tac: 99
#
#
smf:
sbi:
@@ -342,13 +391,15 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
- 2001:4860:4860::8888
- 2001:4860:4860::8844
mtu: 1400
ctf:
enabled: auto
freeDiameter: @sysconfdir@/freeDiameter/smf.conf
#
@@ -377,6 +428,18 @@ smf:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
- addr:
@@ -390,7 +453,7 @@ nrf:
# <PFCP Client>>
#
# o PFCP Client(127.0.0.7:8805)
#
#
# pfcp:
# addr: 127.0.0.7
#
@@ -443,9 +506,6 @@ upf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -458,6 +518,10 @@ upf:
# o Disable selection of UPF PFCP in Round-Robin manner
# no_pfcp_rr_select: true
#
# o Legacy support for pre-release LTE 11 devices
# - Omits adding local address in packet filters for compatibility
# no_ipv4v6_local_addr_in_packet_filter: true
#
parameter:
#
@@ -466,34 +530,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#
@@ -523,3 +563,17 @@ pool:
# handover:
# duration: 500
time:
#
# metrics:
#
# <Metrics Server>
#
# o Metrics Server(http://<any address>:9090)
# metrics:
# addr: 0.0.0.0
# port: 9090
#
metrics:
addr: 0.0.0.0
port: 9090

View File

@@ -73,6 +73,18 @@ logger:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.12
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
udm:
sbi:
- addr: 127.0.0.12
@@ -104,6 +116,18 @@ udm:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
- addr:
@@ -114,9 +138,6 @@ nrf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -134,34 +155,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -75,6 +75,18 @@ logger:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.20
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
udr:
sbi:
- addr: 127.0.0.20
@@ -106,6 +118,18 @@ udr:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
- addr:
@@ -116,9 +140,6 @@ nrf:
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
@@ -136,34 +157,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -35,6 +35,14 @@ logger:
# pfcp:
# name: localhost
#
# o PFCP Option (Default)
# - so_bindtodevice : NULL
#
# pfcp:
# addr: 127.0.0.7
# option:
# so_bindtodevice: vrf-blue
#
# <GTP-U Server>>
#
# o GTP-U Server(127.0.0.7:2152, [::1]:2152)
@@ -80,6 +88,14 @@ logger:
# - dev: ens3
# advertise: upf1.5gc.mnc001.mcc001.3gppnetwork.org
#
# o GTP-U Option (Default)
# - so_bindtodevice : NULL
#
# gtpu:
# addr: 127.0.0.7
# option:
# so_bindtodevice: vrf-blue
#
# <Subnet for UE network>
#
# Note that you need to setup your UE network using TUN device.
@@ -93,30 +109,30 @@ logger:
#
# o IPv4/IPv6 Pool
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
#
# subnet:
# - addr: 10.45.0.1/16
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
#
#
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:230:babe::1/48
# All other APNs use 10.45.0.1/16, 2001:230:cafe::1/48
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:db8:babe::1/48
# All other APNs use 10.45.0.1/16, 2001:db8:cafe::1/48
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add 10.46.0.1/16 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun
#
# ; If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash.
#
# subnet:
# - addr: 10.45.0.1/16
# dnn: internet
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
# dnn: internet
# - addr: 10.46.0.1/16
# dnn: ims
# - addr: 2001:230:babe::1/48
# - addr: 2001:db8:babe::1/48
# dnn: ims
#
# o Specific DNN/APN with the FALLBACK SUBNET(10.47.0.1/16)
@@ -131,20 +147,20 @@ logger:
#
# o Multiple Devices (default: ogstun)
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun2
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun2
# $ sudo ip addr add 10.46.0.1/16 dev ogstun3
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun3
# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun3
#
# subnet:
# - addr: 10.45.0.1/16
# dnn: internet
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
# dnn: internet
# dev: ogstun2
# - addr: 10.46.0.1/16
# dnn: ims
# dev: ogstun3
# - addr: 2001:230:babe::1/48
# - addr: 2001:db8:babe::1/48
# dnn: ims
# dev: ogstun3
#
@@ -155,7 +171,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
#
# smf:
@@ -192,34 +208,10 @@ parameter:
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
# gnb: 64
#
max:
#
# pool:
#
# o The default memory pool size was set assuming 1024 UEs.
# To connect more UEs, you need to increase the size further.
#
# - Pool-size 128 => 65536 Number
# - Pool-size 256 => 16384 Number
# - Pool-size 512 => 4096 Number
# - Pool-size 1024 => 1024 Number
# - Pool-size 2048 => 512 Number
# - Pool-size 8192 => 128 Number
# - Pool-size 1024*1024 => 8 Number
#
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#

View File

@@ -80,7 +80,7 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -148,7 +148,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
hss:
freeDiameter:

View File

@@ -80,7 +80,7 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -152,7 +152,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
hss:
freeDiameter:

View File

@@ -80,7 +80,7 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -148,7 +148,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
hss:
freeDiameter:

View File

@@ -3,4 +3,7 @@ Name=ogstun
[Network]
Address=10.45.0.1/16
Address=2001:230:cafe::1/48
Address=2001:db8:cafe::1/48
[Link]
RequiredForOnline=false

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Open5GS AMF Daemon
After=networking.service
After=network-online.target
[Service]
Type=simple

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Open5GS AUSF Daemon
After=networking.service
After=network-online.target
[Service]
Type=simple

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Open5GS MME Daemon
After=networking.service
After=network-online.target
[Service]
Type=simple

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Open5GS NSSF Daemon
After=networking.service
After=network-online.target
[Service]
Type=simple

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Open5GS SGW-C Daemon
After=networking.service
After=network-online.target
[Service]
Type=simple

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Open5GS SGW-U Daemon
After=networking.service
After=network-online.target
[Service]
Type=simple

View File

@@ -1,7 +1,6 @@
[Unit]
Description=Open5GS SMF Daemon
After=networking.service
Requires=systemd-networkd.service
After=network-online.target
[Service]
Type=simple

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Open5GS UDM Daemon
After=networking.service
After=network-online.target
[Service]
Type=simple

View File

@@ -1,7 +1,7 @@
[Unit]
Description=Open5GS UPF Daemon
After=networking.service
Requires=systemd-networkd.service
After=network-online.target systemd-networkd.service
Wants=systemd-networkd.service
[Service]
Type=simple

View File

@@ -44,15 +44,15 @@ mme:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 001
mnc: 01
mcc: 901
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 001
mnc: 01
tac: 12345
mcc: 901
mnc: 70
tac: 1
security:
integrity_order : [ EIA2, EIA1, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
@@ -80,7 +80,7 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -115,20 +115,20 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 001
mnc: 01
mcc: 901
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 001
mnc: 01
mcc: 901
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 001
mnc: 01
mcc: 901
mnc: 70
s_nssai:
- sst: 1
security:
@@ -151,7 +151,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
hss:
freeDiameter:

View File

@@ -80,7 +80,7 @@ smf:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -151,7 +151,7 @@ upf:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
hss:
freeDiameter:

198
debian/changelog vendored
View File

@@ -1,3 +1,201 @@
open5gs (2.4.8) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:28:51 +0900
open5gs (2.4.8~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:27:13 +0900
open5gs (2.4.8~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:23:05 +0900
open5gs (2.4.8~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:22:04 +0900
open5gs (2.4.8~impish) impish; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:19:27 +0900
open5gs (2.4.7) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:20:07 +0900
open5gs (2.4.7~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:19:10 +0900
open5gs (2.4.7~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:18:11 +0900
open5gs (2.4.7~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:17:08 +0900
open5gs (2.4.7~impish) impish; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:14:58 +0900
open5gs (2.4.6) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 17 May 2022 22:41:32 +0900
open5gs (2.4.6~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 17 May 2022 22:40:16 +0900
open5gs (2.4.6~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 17 May 2022 22:38:38 +0900
open5gs (2.4.6~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 17 May 2022 22:37:22 +0900
open5gs (2.4.6~impish) impish; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 17 May 2022 22:34:40 +0900
open5gs (2.4.5) unstable; urgency=medium
* GTP-1C(GGSN) provided by sysmocom
-- Sukchan Lee <acetcom@gmail.com> Sun, 27 Mar 2022 18:41:04 +0900
open5gs (2.4.5~focal) focal; urgency=medium
* GTP-1C(GGSN) provided by sysmocom
-- Sukchan Lee <acetcom@gmail.com> Sun, 27 Mar 2022 18:40:06 +0900
open5gs (2.4.5~bionic) bionic; urgency=medium
* GTP-1C(GGSN) provided by sysmocom
-- Sukchan Lee <acetcom@gmail.com> Sun, 27 Mar 2022 18:38:55 +0900
open5gs (2.4.5~impish) impish; urgency=medium
* GTP-1C(GGSN) provided by sysmocom
-- Sukchan Lee <acetcom@gmail.com> Sun, 27 Mar 2022 18:37:40 +0900
open5gs (2.4.4) unstable; urgency=medium
* Fixed Memory leak
-- Sukchan Lee <acetcom@gmail.com> Tue, 01 Feb 2022 15:03:37 +0900
open5gs (2.4.4~focal) focal; urgency=medium
* Fixed Memory leak
-- Sukchan Lee <acetcom@gmail.com> Tue, 01 Feb 2022 15:02:35 +0900
open5gs (2.4.4~bionic) bionic; urgency=medium
* Fixed Memory leak
-- Sukchan Lee <acetcom@gmail.com> Tue, 01 Feb 2022 15:01:31 +0900
open5gs (2.4.4~impish) impish; urgency=medium
* Fixed Memory leak
-- Sukchan Lee <acetcom@gmail.com> Tue, 01 Feb 2022 14:58:13 +0900
open5gs (2.4.3) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 20 Jan 2022 17:09:51 +0900
open5gs (2.4.3~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 20 Jan 2022 17:08:55 +0900
open5gs (2.4.3~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 20 Jan 2022 17:08:01 +0900
open5gs (2.4.3~hirsute) hirsute; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 20 Jan 2022 17:06:53 +0900
open5gs (2.4.3~impish) impish; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 20 Jan 2022 17:05:35 +0900
open5gs (2.4.2) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 14 Jan 2022 20:39:46 +0900
open5gs (2.4.2~impish) impish; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 14 Jan 2022 20:38:43 +0900
open5gs (2.4.2~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 14 Jan 2022 20:37:33 +0900
open5gs (2.4.2~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 14 Jan 2022 20:36:17 +0900
open5gs (2.4.2~hirsute) hirsute; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 14 Jan 2022 20:34:57 +0900
open5gs (2.4.1) unstable; urgency=medium
* Use talloc & S1AP/NGAP r16.7.0

View File

@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
fi
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
ip addr add 10.45.0.1/16 dev ogstun
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:230:cafe::1/48 dev ogstun
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:db8:cafe::1/48 dev ogstun
ip link set ogstun up

View File

@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
fi
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
ip addr add 10.45.0.1/16 dev ogstun
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:230:cafe::1/48 dev ogstun
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:db8:cafe::1/48 dev ogstun
ip link set ogstun up

View File

@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
fi
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
ip addr add 10.45.0.1/16 dev ogstun
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:230:cafe::1/48 dev ogstun
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:db8:cafe::1/48 dev ogstun
ip link set ogstun up

View File

@@ -67,7 +67,7 @@ services:
volumes:
- home:/home/${USER}
- ${HOME}:/mnt
- /tmp/.X11-unix:/tmp/.X11-unix
# - /tmp/.X11-unix:/tmp/.X11-unix
# - /etc/localtime:/etc/localtime:ro
# - /usr/share/zoneinfo/Europe/Helsinki:/etc/localtime:ro
hostname: open5gs-dev

View File

@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
fi
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
ip addr add 10.45.0.1/16 dev ogstun
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:230:cafe::1/48 dev ogstun
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:db8:cafe::1/48 dev ogstun
ip link set ogstun up

View File

@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
fi
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
ip addr add 10.45.0.1/16 dev ogstun
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:230:cafe::1/48 dev ogstun
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
ip addr add 2001:db8:cafe::1/48 dev ogstun
ip link set ogstun up

View File

@@ -73,7 +73,7 @@ With the exception of the SMF and UPF, all config files for the 5G SA core funct
#### Ubuntu
*Ubuntu* makes it easy to install Open5GS as shown below,
*Ubuntu* makes it easy to install Open5GS as shown below.
```bash
$ sudo apt update
@@ -111,6 +111,8 @@ https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbunt
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_21.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_21.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_22.04/
```
#### openSUSE
@@ -147,6 +149,8 @@ https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_18.
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_21.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_21.10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_22.04/
```
@@ -343,7 +347,7 @@ upf:
+ - addr: 10.11.0.7 # for external gNB - a local address that can be reached by the gNB
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
```
@@ -423,7 +427,7 @@ $ sudo sysctl -w net.ipv6.conf.all.forwarding=1
### Add NAT Rule
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
```

View File

@@ -30,7 +30,7 @@ Create the TUN device with the interface name `ogstun`.
```bash
$ sudo ip tuntap add name ogstun mode tun
$ sudo ip addr add 10.45.0.1/16 dev ogstun
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
$ sudo ip link set ogstun up
```
@@ -148,7 +148,7 @@ $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
+ - addr: 10.11.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
```
##### 4G EPC
@@ -210,7 +210,6 @@ If you modify the config files while Open5GS daemons are running, please restart
---
```bash
$ cd install/bin/
$ ./install/bin/open5gs-mmed
Open5GS daemon v2.1.0
@@ -466,7 +465,7 @@ $ sudo sysctl -w net.ipv6.conf.all.forwarding=1
### Add NAT Rule
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
```
**Note:** The above assumes you do not have any existing rules in the filter and nat tables. If a program such as docker has already set up rules, you may need to add the Open5GS related rules differently.

View File

@@ -124,7 +124,7 @@ $ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
+ - addr: 10.10.0.4
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
@@ -282,7 +281,7 @@
#
upf:
@@ -217,7 +217,7 @@ $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
+ - addr: 10.11.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
```
After changing conf files, please restart Open5GS daemons.

View File

@@ -10,6 +10,8 @@ If you have tested radio hardware from a vendor not listed with Open5GS, please
### Commercial 5G
---
* Airspan 5G OpenRange vCU + Airspan 5G OpenRange vDU + Airspan 5G OpenRANGE06 AirVelocity 2700 RU
* Airspan AirSpeed 2900
* Airspan AirStrand 2200
* LIONS RANathon O-CU and O-DU + RANathon RS8601 Indoor O-RU + RANathon XG8600 Fronthaul Gateway
* NOKIA AEQE (SW: 5G20A)
* NOKIA AEQD (SW: 5G20A)
@@ -40,6 +42,8 @@ If you have tested radio hardware from a vendor not listed with Open5GS, please
* Nokia FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power
* Nokia FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz
* Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0
* Nokia FW2FA Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 39
* Nokia FWGR Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 1
* Ruckus Q710 and Q910
### 4G/5G Software Stacks + SDRs

View File

@@ -67,7 +67,7 @@ $ sudo sh -c "cat << EOF > /etc/systemd/network/99-open5gs.network
Name=ogstun
[Network]
Address=10.45.0.1/16
Address=2001:230:cafe::1/48
Address=2001:db8:cafe::1/48
EOF"
```
@@ -84,7 +84,7 @@ Make sure it is set up properly.
$ ifconfig ogstun
ogstun: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.45.0.1 netmask 255.255.0.0 destination 10.45.0.1
inet6 2001:230:cafe::1 prefixlen 64 scopeid 0x0<global>
inet6 2001:db8:cafe::1 prefixlen 64 scopeid 0x0<global>
inet6 fe80::e86e:86d8:ea24:f8ee prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)

View File

@@ -3,10 +3,10 @@ title: CentOS
head_inline: "<style> .blue { color: blue; } </style>"
---
This guide is based on **CentOS 8** Distribution.
This guide is based on **CentOS Stream 8** Distribution.
{: .blue}
## Install **CentOS 8** from Vagrant box (optional)
## Install **CentOS Stream 8** from Vagrant box (optional)
---
Vagrant provides a simple way to create and deploy Virtual Machines from
pre-built images using VirtualBox, libvirt, or VMWare as a hypervisor engine.
@@ -20,13 +20,13 @@ The instructions to install Vagrant are provided at
[vagrantup.com](https://www.vagrantup.com/).
### Create a CentOS 8 Virtual Machine using Vagrant
### Create a CentOS Stream 8 Virtual Machine using Vagrant
---
Use the supplied `Vagrantfile` in the `vagrant` directory to create the
virtual machine.
Note that this Vagrantfile is identical to the base CentOS 8 box, with
Note that this Vagrantfile is identical to the base CentOS Stream 8 box, with
the exception that the amount of virtual memory has been increased to 1GB:
```bash
@@ -37,7 +37,7 @@ vagrant up --provider virtualbox
### Log into the newly created CentOS VM
---
Use SSH to log into the CentOS 8 VM:
Use SSH to log into the CentOS Stream 8 VM:
```bash
vagrant ssh
@@ -45,20 +45,20 @@ vagrant ssh
Note that the Open5GS source is *not* copied into the VM. The instructions
below provide the step by step instructions for setting up Open5GS for
either a bare metal or virtual CentOS 8 system.
either a bare metal or virtual CentOS Stream 8 system.
The rest of the commands below are performed inside the CentOS VM as the
user 'vagrant', or on your bare metal CentOS 8 system as any normal user.
user 'vagrant', or on your bare metal CentOS Stream 8 system as any normal user.
## Install prerequisite packages to build and run Open5GS
---
### Enable CentOS 8 PowerTools repository
### Enable CentOS Stream 8 PowerTools repository
---
```bash
$ sudo dnf install 'dnf-command(config-manager)'
$ sudo dnf config-manager --set-enabled PowerTools
$ sudo dnf config-manager --set-enabled powertools
```
### Enable the Extra Packages for Enterprise Linux
@@ -86,13 +86,13 @@ $ sudo dnf config-manager --set-enabled elrepo-testing
Create a repository file to install the MongoDB packages:
```bash
$ sudo sh -c 'cat << EOF > /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
$ sudo sh -c 'cat << EOF > /etc/yum.repos.d/mongodb-org-3.6.repo
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/3.4/x86_64/
baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
EOF'
```
@@ -105,20 +105,13 @@ $ sudo dnf -y install mongodb-org
### Install the dependencies for building the source code.
---
Open5GS requires several packages which are not installed by default in
a base CentOS 8 installation.
a base CentOS Stream 8 installation.
```bash
$ sudo dnf install python3 meson ninja-build gcc gcc-c++ flex bison git lksctp-tools-devel libidn-devel gnutls-devel libgcrypt-devel openssl-devel cyrus-sasl-devel libyaml-devel mongo-c-driver-devel libmicrohttpd-devel libcurl-devel libnghttp2-devel libtalloc-devel
```
### Install the SCTP kernel module in kernel-modules-extra.
---
```bash
$ sudo dnf install kernel-modules-extra
```
### Install iproute IP interface tools.
---
@@ -126,6 +119,15 @@ $ sudo dnf install kernel-modules-extra
$ sudo dnf install iproute
```
### Install the SCTP kernel module in kernel-modules-extra.
---
```bash
$ sudo dnf install kernel-modules-extra
$ sudo rm /etc/modprobe.d/sctp-blacklist.conf
$ sudo rm /etc/modprobe.d/sctp_diag-blacklist.conf
```
### Update all installed packages to the latest versions.
---
@@ -141,11 +143,27 @@ after this step to ensure that you are running this new kernel version.
This is important when you try to load the SCTP kernel module later.
```bash
[vm] $ sudo reboot
[host] $ vagrant halt
[host] $ vagrant up --provider virtualbox
[host] $ # ssh back into the VM after it reboots...
[host] $ vagrant ssh
```
### Check the SCTP kernel module
---
Open5GS requires the Linux SCTP kernel module to be loaded in the kernel.
In the CentOS Stream 8 Vagrant box SCTP is not loaded into the kernel automatically
so must be installed as follows:
```bash
$ checksctp
SCTP supported
$ sudo modprobe sctp
$ # Check that SCTP was loaded successfully:
$ sudo dmesg | grep sctp
[ 639.971360] sctp: Hash tables configured (bind 256/256)
```
## Build Open5GS from Source
---
@@ -236,7 +254,7 @@ Set the IP address on the `ogstun` TUN interface.
```bash
$ sudo ip addr add 10.45.0.1/16 dev ogstun
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
```
Make sure it is set up properly.
@@ -252,19 +270,6 @@ to configure the TUN device as follows:
`$ sudo ./misc/netconf.sh`
{: .notice--info}
### Install the SCTP kernel module
---
Open5GS requires the Linux SCTP kernel module to be loaded in the kernel.
In the CentOS 8 Vagrant box SCTP is not loaded into the kernel automatically
so must be installed as follows:
```bash
$ sudo modprobe sctp
$ # Check that SCTP was loaded successfully:
$ sudo dmesg | grep sctp
[ 639.971360] sctp: Hash tables configured (bind 256/256)
```
## Testing Open5GS
---

View File

@@ -52,7 +52,7 @@ You are now ready to set the IP address on TUN device.
```bash
$ sudo ip addr add 10.45.0.1/16 dev ogstun
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
```
Make sure it is set up properly.

View File

@@ -76,7 +76,7 @@ Enable IP forwarding & Masquerading
$ sudo sysctl -w net.inet.ip.forwarding=1
$ sudo sysctl -w net.inet6.ip6.forwarding=1
$ sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
$ sudo sh -c "echo 'nat on {en0} from 2001:230:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
$ sudo sh -c "echo 'nat on {en0} from 2001:db8:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
$ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
```

View File

@@ -76,7 +76,7 @@ Enable IP forwarding & Masquerading
$ sudo sysctl -w net.inet.ip.forwarding=1
$ sudo sysctl -w net.inet6.ip6.forwarding=1
$ sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
$ sudo sh -c "echo 'nat on {en0} from 2001:230:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
$ sudo sh -c "echo 'nat on {en0} from 2001:db8:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
$ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
```

View File

@@ -35,7 +35,7 @@ You are now ready to set the IP address on TUN device.
```bash
$ sudo ip addr add 10.45.0.1/16 dev ogstun
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
```
Make sure it is set up properly.

View File

@@ -484,7 +484,7 @@ $ diff -u /etc/systemd/network/99-open5gs.network /etc/systemd/network/99-open5g
[Network]
-Address=10.45.0.1/16
+Address=10.46.0.1/16
Address=2001:230:cafe::1/48
Address=2001:db8:cafe::1/48
```
Restart systemd-networkd
@@ -509,7 +509,7 @@ $ diff -u smf.yaml smf.yaml.new
subnet:
- - addr: 10.45.0.1/16
+ - addr: 10.46.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
```
@@ -524,7 +524,7 @@ $ diff -u upf.yaml upf.yaml.new
subnet:
- - addr: 10.45.0.1/16
+ - addr: 10.46.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
#
```
@@ -796,7 +796,7 @@ $ sudo iptables-restore < newtables
Docker doesn't have IPv6 NAT rules. In this case, you just add the NAT rule as below.
```
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
```
The above operation is the same as described in the following manuals.
@@ -832,7 +832,7 @@ $ sudo sysctl -w net.ipv6.conf.all.forwarding=1
### Add NAT Rule
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
```
#### How to use a different DNN/APN for each SMF
@@ -897,26 +897,26 @@ The IP address of the UE can also use a different UE pool depending on the DNN/A
#
# o IPv4/IPv6 Pool
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
#
# subnet:
# - addr: 10.45.0.1/16
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
#
#
# o Specific DNN/APN(e.g 'volte') uses 10.46.0.1/16, 2001:230:babe::1/48
# All other DNNs/APNs use 10.45.0.1/16, 2001:230:cafe::1/48
# o Specific DNN/APN(e.g 'volte') uses 10.46.0.1/16, 2001:db8:babe::1/48
# All other DNNs/APNs use 10.45.0.1/16, 2001:db8:cafe::1/48
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add 10.46.0.1/16 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun
#
# subnet:
# - addr: 10.45.0.1/16
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
# - addr: 10.46.0.1/16
# dnn: volte
# - addr: 2001:230:babe::1/48
# - addr: 2001:db8:babe::1/48
# dnn: volte
#
# o Pool Range Sample
@@ -941,10 +941,10 @@ The IP address of the UE can also use a different UE pool depending on the DNN/A
# range:
# - 10.45.0.100-10.45.0.200
# - 10.45.1.100-10.45.1.200
# - addr: 2001:230:cafe::1/48
# - addr: 2001:db8:cafe::1/48
# range:
# - 2001:230:cafe:a0::0-2001:230:cafe:b0::0
# - 2001:230:cafe:c0::0-2001:230:cafe:d0::0
# - 2001:db8:cafe:a0::0-2001:db8:cafe:b0::0
# - 2001:db8:cafe:c0::0-2001:db8:cafe:d0::0
#
```
@@ -1125,7 +1125,7 @@ Currently, the number of UE is limited to `128*128`.
```
* IPv4 : 10.45.0.1/16
* IPv6 : 2001:230:cafe::1/48
* IPv6 : 2001:db8:cafe::1/48
```
- DNS

View File

@@ -144,9 +144,9 @@ Download and build srsLTE:
```bash
$ git clone https://github.com/srsRAN/srsRAN.git
$ cd srsRAN
$ git checkout release_21_04
$ git checkout release_21_10
$ git rev-parse HEAD
1c6dd8c4adc8419d4a431f382283539f1719582a
5275f33360f1b3f1ee8d1c4d9ae951ac7c4ecd4e
$ mkdir build
$ cd build
$ cmake ../
@@ -228,12 +228,12 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml.old 2020-08-22 12:07:32.755250028 -0400
+++ mme.yaml 2020-08-22 12:08:17.309320211 -0400
@@ -204,20 +204,20 @@
@@ -208,20 +208,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
s1ap:
- addr: 127.0.0.2
+ addr: 127.0.1.100
+ addr: 127.0.1.2
gtpc:
addr: 127.0.0.2
gummei:
@@ -251,7 +251,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
- tac: 1
+ mcc: 310
+ mnc: 789
+ tac: 7
+ tac: 2
security:
integrity_order : [ EIA1, EIA2, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
@@ -262,7 +262,7 @@ Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_usernam
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
+++ sgwu.yaml 2020-08-22 12:06:49.809299514 -0400
@@ -51,7 +51,7 @@
@@ -82,7 +82,7 @@
#
sgwu:
gtpu:
@@ -314,7 +314,7 @@ $ sudo sysctl -w net.ipv6.conf.all.forwarding=1
### Add NAT Rule
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
```
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
@@ -335,22 +335,22 @@ You should check your phone frequency. If your phone does not support Band-3, yo
```diff
$ diff -u enb.conf.example enb.conf
--- enb.conf.example 2021-08-23 12:00:03.975297244 +0900
+++ enb.conf 2021-08-23 14:34:01.794290668 +0900
@@ -19,8 +19,10 @@
-- enb.conf.example 2022-01-19 20:30:13.612993155 +0900
+++ enb.conf 2022-01-19 21:04:15.674419300 +0900
@@ -20,9 +20,9 @@
#####################################################################
[enb]
enb_id = 0x19B
-mcc = 001
-mnc = 01
+#mcc = 001
+#mnc = 01
+mcc = 901
+mnc = 70
mme_addr = 127.0.1.100
-mme_addr = 127.0.1.100
+mcc = 310
+mnc = 789
+mme_addr = 127.0.1.2
gtp_bind_addr = 127.0.1.1
s1c_bind_addr = 127.0.1.1
@@ -65,7 +67,7 @@
s1c_bind_port = 0
@@ -67,7 +67,7 @@
tx_gain = 80
rx_gain = 40
@@ -359,43 +359,61 @@ $ diff -u enb.conf.example enb.conf
# For best performance in 2x2 MIMO and >= 15 MHz use the following device_args settings:
# USRP B210: num_recv_frames=64,num_send_frames=64
@@ -80,6 +82,7 @@
@@ -81,7 +81,7 @@
# Example for ZMQ-based operation with TCP transport for I/Q samples
#device_name = zmq
#device_args = fail_on_disconnect=true,tx_port=tcp://*:2000,rx_port=tcp://localhost:2001,id=enb,base_srate=23.04e6
-#device_args = fail_on_disconnect=true,tx_port=tcp://*:2000,rx_port=tcp://localhost:2001,id=enb,base_srate=23.04e6
+device_args = clock=external
#####################################################################
# Packet capture configuration
```
```diff
$ diff -u rr.conf.example rr.conf
diff rr.conf.example rr.conf
61c61,62
< dl_earfcn = 3350;
---
> // dl_earfcn = 3350;
> dl_earfcn = 1600;
-- rr.conf.example 2022-01-19 20:30:13.620992794 +0900
+++ rr.conf 2022-01-19 21:05:21.959044145 +0900
@@ -55,10 +55,10 @@
{
// rf_port = 0;
cell_id = 0x01;
- tac = 0x0007;
+ tac = 0x0002;
pci = 1;
// root_seq_idx = 204;
- dl_earfcn = 3350;
+ dl_earfcn = 1600;
//ul_earfcn = 21400;
ho_active = false;
//meas_gap_period = 0; // 0 (inactive), 40 or 80
@@ -114,4 +114,4 @@
nr_cell_list =
(
// no NR cells
```
PLMN ID, DL EARFCN, and Device Argument are updated as belows.
MME Address, TAC, PLMN ID, DL EARFCN, and Device Argument are updated as belows.
```
MME Address : 127.0.1.2
TAC : 2
PLMN ID : MNC(310), MCC(789) programmed USIM with a card reader
DL EARFCN : Band-3 - from your Phone
Device Argument : Clock source from external GPS-DO
```
If you do not use the GPS-DO, you should use:
If you are not using GPS-DO, you can just comment out `device_args` as shown below.
```diff
$ diff -u enb.conf.example enb.conf
--- enb.conf.example 2021-08-23 14:32:35.585438813 +0900
+++ enb.conf 2021-08-23 14:32:08.350450409 +0900
@@ -82,7 +82,6 @@
$ diff -u enb.conf enb.conf.no_gps_do
--- enb.conf 2022-01-19 21:08:32.941527373 +0900
+++ enb.conf.no_gps_do 2022-01-19 21:10:18.612581261 +0900
@@ -81,7 +81,7 @@
# Example for ZMQ-based operation with TCP transport for I/Q samples
#device_name = zmq
#device_args = fail_on_disconnect=true,tx_port=tcp://*:2000,rx_port=tcp://localhost:2001,id=enb,base_srate=23.04e6
-device_args = clock=external
+#device_args = fail_on_disconnect=true,tx_port=tcp://*:2000,rx_port=tcp://localhost:2001,id=enb,base_srate=23.04e6
#####################################################################
# Packet capture configuration
@@ -405,17 +423,23 @@ Now, run the srsRAN as follows:
```bash
$ cd srsenb/
$ sudo ../build/srsenb/src/srsenb ./enb.conf
Built in Release mode using commit d045213fb on branch HEAD.
$ sudo UHD_IMAGES_DIR=/usr/share/uhd/images ../build/srsenb/src/srsenb ./enb.conf
--- Software Radio Systems LTE eNodeB ---
Reading configuration file ./enb.conf...
Opening 1 RF devices with 1 RF channels...
[INFO] [UHD] linux; GNU C++ version 7.4.0; Boost_106501; UHD_3.14.1.1-release
WARNING: cpu0 scaling governor is not set to performance mode. Realtime processing could be compromised. Consider setting it to performance mode before running the application.
Built in Release mode using commit 5275f3336 on branch HEAD.
connect(): Connection refused
Failed to initiate S1 connection. Attempting reconnection in 10 seconds
Opening 1 channels in RF device=default with args=default
Available RF device list: UHD
Trying to open RF device 'UHD'
[INFO] [UHD] linux; GNU C++ version 9.3.0; Boost_107100; UHD_4.1.0.4-release
[INFO] [LOGGING] Fastpath logging disabled at runtime.
Opening USRP with args: type=b200,master_clock_rate=23.04e6
Opening USRP channels=1, args: type=b200,master_clock_rate=23.04e6
[INFO] [UHD RF] RF UHD Generic instance constructed
[INFO] [B200] Detected Device: B200
[INFO] [B200] Operating over USB 3.
[INFO] [B200] Initialize CODEC control...
@@ -424,8 +448,7 @@ Opening USRP with args: type=b200,master_clock_rate=23.04e6
[INFO] [B200] Register loopback test passed
[INFO] [B200] Asking for clock rate 23.040000 MHz...
[INFO] [B200] Actually got clock rate 23.040000 MHz.
Setting frequency: DL=1845.0 Mhz, UL=1750.0 MHz
Setting Sampling frequency 11.52 MHz
RF device 'UHD' successfully opened
==== eNodeB started ===
Type <t> to view trace

View File

@@ -0,0 +1,134 @@
---
title: Metrics with Prometheus
---
#### 0. Introduction
This tutorial explains how to export open5gs metrics to Prometheus, which can in
turn be used to visualize or export them to other systems such as Grafana or
StatsD.
When this method is used, any open5gs program exporting metrics becomes a
Prometheus server, which is basically an HTTP server serving Prometheus data to
the Prometheus scrapper.
Note: Only open5gs-smfd supports exporting metrics so far, though other may
hopefully follow soon.
#### 1. Enable Prometheus support during build
Open5GS programs use a generic internal API available in libogsmetrics. This
library implements the API based on configuration passed during open5gs build
time. By default, the library will be built using the `void` implementation,
which is basically a NO-OP implementation.
In order to use the Prometheus, the `prometheus` metrics implementation needs to
be selected at build time:
```
meson configure -Dmetrics_impl=prometheus build
```
This will enable building the implementation under lib/metrics/prometheus/,
which uses:
* prometheus-client-c project (libprom): To generate the Prometheus expected
output format of the metrics
* libmicrohttpd: To server the content generated by libprom as an HTTP server
The `prometheus-client-c` project is not currently well maintained, and uses a
weird mixture of build systems, which makes it difficult to make it available in
most Linux distributions. As a result, a fork of the project is available under
Open5GS GitHub namespace, with an extra patch applied making it possible to
include it as a subproject, which will be fetched and built automatically when
building the prometheus libmetrics implementation.
#### 2. Configuring for runtime
By default the created Prometheus HTTP server will be listening on `0.0.0.0`
port `9090`.
This can be configured under the following config file options:
```
#
# metrics:
#
# <Metrics Server>
#
# o Metrics Server(http://<any address>:9090)
# metrics:
# addr: 0.0.0.0
# port: 9090
#
metrics:
addr: 0.0.0.0
port: 9090
```
Note: You may want to change the default IP address or port if you are running
the Prometheus scrapper in the same host, since it will also spawn its own
Prometheus server also in port 9090, which will collide.
#### 3. Manual visualization
Simply open the web browser at the following URL (changing IP address and port
as configured in previous section):
```
http://127.0.0.1:9090/metrics
```
Note: URL `metrics/` (with a slash at the end) will not work.
You should see some output similar to this one below:
```
# HELP ues_active Active User Equipments
# TYPE ues_active gauge
ues_active 2
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1024
# HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.
# TYPE process_virtual_memory_max_bytes gauge
process_virtual_memory_max_bytes -1
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total gauge
process_cpu_seconds_total 0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 3156643840
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 402433
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 23
```
#### 3. Integration with Prometheus scrapper
Sample Prometheus scrapper configuration (`~/prometheus.yml`):
```
global:
scrape_interval: 10s
scrape_configs:
- job_name: open5gs-smfd
static_configs:
- targets: ["192.168.1.140:9091"]
```
Where `192.168.1.140:9091` is the IP address and port where `open5gs-smfd` is
serving its metrics, as configured in above sections.
The Prometheus scrapper can be easily started from a docker container:
```
docker run -p 9090:9090 -v /prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
```
Then open your browser to be able to visualize the data: `http://localhost:9090/graph`

View File

@@ -13,6 +13,7 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- [Your First LTE](tutorial/01-your-first-lte)
- [VoLTE Setup with Kamailio IMS and Open5GS](tutorial/02-VoLTE-setup)
- [Dockerized VoLTE Setup](tutorial/03-VoLTE-dockerized)
- [Metrics with Prometheus](tutorial/04-metrics-prometheus)
- Troubleshooting
- [Simple Issues](troubleshoot/01-simple-issues)
@@ -26,10 +27,10 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- [MacOSX(Intel)](platform/06-macosx-intel)
- [FreeBSD](platform/07-freebsd)
- [Alpine](platform/08-alpine)
- Hardware Specific Notes
- [eNodeBs/gNodeBs tested on Open5GS](hardware/01-genodebs)
- @infinitydon
- [Open5GS on Amazon Elastic Kubernetes Service](https://aws.amazon.com/blogs/opensource/open-source-mobile-core-network-implementation-on-amazon-elastic-kubernetes-service/)
- [Kubernetes Open5GS Deployment](https://dev.to/infinitydon/virtual-4g-simulation-using-kubernetes-and-gns3-3b7k?fbclid=IwAR1p99h13a-mCfejanbBQe0H0-jp5grXkn5mWf1WrTHf47UtegB2-UHGGZQ)
@@ -46,3 +47,4 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- [Open5GS EPC & OpenAirInterface UE/RAN Sample configuration](https://github.com/s5uishida/open5gs_epc_oai_sample_config)
- [Open5GS 5GC & UERANSIM UE/RAN Sample Configuration](https://github.com/s5uishida/open5gs_5gc_ueransim_sample_config)
- [Open5GS & UERANSIM - Select nearby UPF according to the connected gNodeB](https://github.com/s5uishida/open5gs_5gc_ueransim_nearby_upf_sample_config)
- [VoLTE and SMS Configuration for docker_open5gs](https://github.com/s5uishida/docker_open5gs_volte_sms_config)

View File

@@ -79,7 +79,7 @@ pgw:
- addr: ::1
ue_pool:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
- addr: 2001:db8:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4

View File

@@ -0,0 +1,25 @@
---
title: "v2.4.1 - Use talloc & S1AP/NGAP r16.7.0"
date: 2022-01-04 17:38:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### Modification
- [ALL] Use talloc memory pool ([#1263](https://github.com/open5gs/open5gs/issues/1263)) -- [kbarlee](https://github.com/kbarlee)
- [MME/AMF] Upgrade S1AP/NGAP r16.7.0 ([#1263](https://github.com/open5gs/open5gs/issues/1263)) -- [kbarlee](https://github.com/kbarlee)
- [SMF/UPF] Added Usage Report in PFCP protocol ([#1289](https://github.com/open5gs/open5gs/pull/1289)) -- [mhkndgn](https://github.com/mhkndgn)
#### Bug Fixes
- [SGW-U/UPF] Fix the crash from a crafted packet from UE ([a0f2535](https://github.com/open5gs/open5gs/commit/a0f2535cb5a29bba6dbbccdb90c74ccd770cc700) -- [CVE-2021-45462](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45462)
- [MME] Updated E-RABSetupResponse to support optional parameter ([#1295](https://github.com/open5gs/open5gs/issues/1295)) -- [EugeneBogush](https://github.com/EugeneBogush)
- [MME] Fix the crash with Unknown S-NSSAI in DB ([#1287](https://github.com/open5gs/open5gs/issues/1287),[#1294](https://github.com/open5gs/open5gs/pull/1294)) -- [nelsondohua](https://github.com/nelsondohua)
- [SMF/UPF] Fix Link-Local Address in Router Advertisement as per RFC4861 ([#1291](https://github.com/open5gs/open5gs/pull/1291),[#1294](https://github.com/open5gs/open5gs/pull/1294)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [HSS] Fix the Cx interface crash ([#1264](https://github.com/open5gs/open5gs/issues/1264)) -- [EugeneBogush](https://github.com/EugeneBogush)
Download -- [v2.4.1.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.1.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,26 @@
---
title: "v2.4.3 - Bug Fixes (mostly talloc related)"
date: 2022-01-20 19:14:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### Modification
- [HSS] Changed network_access_mode default to 0 ([#1323](https://github.com/open5gs/open5gs/issues/1323)) -- [kbarlee](https://github.com/kbarlee)
- [SMF/UPF] Changed IPv6 prefix to documentation prefix 2001:db8::/32 ([#1320](https://github.com/open5gs/open5gs/issues/1320),[#1321](https://github.com/open5gs/open5gs/pull/1321)) -- [JM-Lemmi](https://github.com/JM-Lemmi)
- [ALL] Increased gNB/NF memory pool from 32 to 64 ([ea667587](https://github.com/open5gs/open5gs/commit/ea6675879c52f8c758ca215f70734a9acf54e064))
#### Bug Fixes
- [SBI] FQDN bug from talloc ([#1328](https://github.com/open5gs/open5gs/issues/1328)) -- [UmakantKulkarni](https://github.com/UmakantKulkarni)
- [SBI] Fix potential null pointer dereference ([#1324](https://github.com/open5gs/open5gs/pull/1324)) -- [pespin](https://github.com/pespin)
- [HSS] Changed PUR-Flags to Optional ([#1298](https://github.com/open5gs/open5gs/issues/1298)) -- [fedkis](https://github.com/fedkis)
- [PFCP/DIAMETER] Fixed the crash by flow->description ([#1313](https://github.com/open5gs/open5gs/issues/1313)) -- [WingPig99](https://github.com/WingPig99), [s5uishida](https://github.com/s5uishida)
- [ALL] Fixed the crash by epoll ([#1131](https://github.com/open5gs/open5gs/issues/1131)) -- [VLiu7](https://github.com/VLiu7)
- [AMF] Should cipher the NAS message container IE ([715e4c0](https://github.com/open5gs/open5gs/commit/715e4c0b506357ee57df3a827ae2cbf0cadf6209))
Download -- [v2.4.3.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.3.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,19 @@
---
title: "v2.4.4 - Memory leak fixed"
date: 2022-02-01 15:09:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### Bug Fixes
- [NRF] Fixed the crash if reqNFInstanceId does not exist in Subscription ([#1347](https://github.com/open5gs/open5gs/issues/1347)) -- [ajimenezsa](https://github.com/ajimenezsa)
- [ALL] Memory leak fixed ([#1282](https://github.com/open5gs/open5gs/issues/1282)) -- [bluehat-f](https://github.com/bluehat-f), [micjerry](https://github.com/micjerry)
- [SMF] Fixed SMF crash if TransportLayerAddress in GTPTunnel does not exist ([#1341](https://github.com/open5gs/open5gs/issues/1341)) -- [modyngs](https://github.com/modyngs)
- [SBI] Remove one octet length in FQDN ([#1333](https://github.com/open5gs/open5gs/issues/1333)) -- [ajimenezsa](https://github.com/ajimenezsa)
Download -- [v2.4.4.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.4.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,42 @@
---
title: "v2.4.5 - GTP-1C(GGSN) provided by sysmocom"
date: 2022-03-27 19:32:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### New Features
- [SMF] Introduced Gn interface(GTPv1C) Support to SMF provided [sysmocom](https://sysmocom.de) -- [pespin](https://github.com/pespin)
#### Enhancements
- [SMF] Remove T_RELEASE_HOLDING timer -- [72ecd1c](https://github.com/open5gs/open5gs/commit/72ecd1c0052a55d8aefb645eb2c3e7c64057caae)
- [MME] Refactor to check a piggybacked ESM -- [bf77318](https://github.com/open5gs/open5gs/commit/bf773186026c9847a2aff0035d91949a1b098d14)
- [CORE] Added APIs to manage NTP 32-bit timestamps ([#1439](https://github.com/open5gs/open5gs/pull/1439)) -- [pespin](https://github.com/pespin)
- [GTP] Supprt binding socket to device/Improve socket configuration ([#1404](https://github.com/open5gs/open5gs/pull/1404)) -- [pespin](https://github.com/pespin)
- [ASN] Applied the NGAP modification of both [mouse07410/asn1c#89](https://github.com/mouse07410/asn1c/pull/89) and [mouse07410/asn1c#90](https://github.com/mouse07410/asn1c/pull/90) -- [nkout](https://github.com/nkout)
- [SMF] Support PCO protocol ID PAP(0xc023) ([#1357](https://github.com/open5gs/open5gs/issues/1357)) -- [pespin](https://github.com/pespin)
- [ALL] Refined systemd sequencing ([#1366](https://github.com/open5gs/open5gs/pull/1366), [#1368](https://github.com/open5gs/open5gs/pull/1368)) -- [matt9j](https://github.com/matt9j)
#### Security Updates
- [UPF] Check if Source IP address is spoofing ([#1354](https://github.com/open5gs/open5gs/issues/1354), [#1355](https://github.com/open5gs/open5gs/issues/1355)) -- [pespin](https://github.com/pespin)
#### Bug Fixes
- [AMF] Fixed the Slice/DNN selection method ([#1438](https://github.com/open5gs/open5gs/issues/1438), [#1440](https://github.com/open5gs/open5gs/issues/1440)) -- [dcandal-gti](https://github.com/dcandal-gti)
- [ALL] Use talloc memory pool in PKBUF ([#1353](https://github.com/open5gs/open5gs/issues/1353), [#1431](https://github.com/open5gs/open5gs/issues/1431)) -- [raphaelsander](https://github.com/raphaelsander)
- [SMF] Exception handling for APN duplicate check ([#1431](https://github.com/open5gs/open5gs/issues/1431)) -- [raphaelsander](https://github.com/raphaelsander)
- [SBI] Need to increase NF reference count -- [ed34444e](https://github.com/open5gs/open5gs/commit/ed3444eef5e9e57705645b500dbd6c5af453703f)
- [CORE] Initialize struct epoll_event ([#1399](https://github.com/open5gs/open5gs/issues/1399)) -- [pespin](https://github.com/pespin)
- [SMF/PCRF] Fixed prefix length in Gx CCR Framed-IPv6-Prefix AVP ([#1396](https://github.com/open5gs/open5gs/pull/1396), [#1398](https://github.com/open5gs/open5gs/pull/1398)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [SMF/PCRF] Fixed packet fileter for pre rel11 LTE devices ([#1393](https://github.com/open5gs/open5gs/pull/1393)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [SMF] Fixed an incorrect GTP cause with a changed APN type(IPv4v6->IPv4/IPv6) ([#1360](https://github.com/open5gs/open5gs/issues/1360)) -- [pespin](https://github.com/pespin)
- [ALL] Fixed the timezone string converter ([#1376](https://github.com/open5gs/open5gs/issues/1376)) -- [modyngs](https://github.com/modyngs)
- [SMF] Added DNS servers to PCO IPCP only if UE requested ([#1358](https://github.com/open5gs/open5gs/issues/1358)) -- [pespin](https://github.com/pespin)
- [SBI] Remove Accept-Encoding(gzip) in HTTP2-Client -- [ffcd92c](https://github.com/open5gs/open5gs/commit/ffcd92c2f3b6547ae8d159b195ffc0592ad0f3e9)
- [SBI] Fixed NFs crash if no mandotory item such like a version in NFService ([#1350](https://github.com/open5gs/open5gs/issues/1350)) -- [ajimenezsa](https://github.com/ajimenezsa)
Download -- [v2.4.5.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.5.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,45 @@
---
title: "v2.4.7 - Gy interface provided by sysmocom"
date: 2022-05-21 19:42:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### New Features
- [SMF] Introduced Gy interface Support provided by [sysmocom](https://sysmocom.de) -- [pespin](https://github.com/pespin)
- [GTP] X2 Handover with SGW relocation ([#1367](https://github.com/open5gs/open5gs/issues/1367), [#1459](https://github.com/open5gs/open5gs/issues/1459)) -- [pespin](https://github.com/pespin), [cbrasho](https://github.com/cbrasho)
#### Enhancements
- [GY] Clarify use of Reporting-Request and set it to FINAL in TERMINATION_REQ ([#1552](https://github.com/open5gs/open5gs/pull/1552)) -- [pespin](https://github.com/pespin)
- [SBI] Change handling of SessionManagementSubscriptionData as an array ([#1551](https://github.com/open5gs/open5gs/pull/1551)) -- [bmeglicit](https://github.com/bmeglicit)
- [PFCP] Support Multi-CP with One-UP ([c6c8dc1](https://github.com/open5gs/open5gs/commit/c6c8dc1256c304aea1fc44cd70fbaeb290f31ad3))
- [SMF] Use Only One PFCP Session Modification Message in the ViNR([e0a487f](https://github.com/open5gs/open5gs/commit/e0a487f479b7d916044d6595228de6211d548656))
- [SMF] Parallelize Gx+Gy CCR Initial ([#1491](https://github.com/open5gs/open5gs/pull/1491)) -- [pespin](https://github.com/pespin)
- [SMF] Integrate Session Setup Cycle into GSM State Machine ([#1489](https://github.com/open5gs/open5gs/pull/1489)) -- [pespin](https://github.com/pespin)
- [CX] Functionality for send SMS with using IMS service ([#1477](https://github.com/open5gs/open5gs/pull/1477)) -- [EugeneBogush](https://github.com/EugeneBogush)
- [MEM] Improve data-path performance using talloc_pool() -- ([e213f65](https://github.com/open5gs/open5gs/commit/e213f654060b7b9f2bae11420c5175e876cf006e))
- [TEST] Automatic CI for github PRs ([#1454](https://github.com/open5gs/open5gs/issues/1454)) -- [pespin](https://github.com/pespin)
- [DB] Add/update current IMEISV of UE in subscriber profile ([#1464](https://github.com/open5gs/open5gs/pull/1464)) -- [EugeneBogush](https://github.com/EugeneBogush)
#### Bug Fixes
- [CORE] Fixed the linked-list BUG ([#1187](https://github.com/open5gs/open5gs/issues/1187)) -- [Vomvas](https://github.com/Vomvas)
- [SMF] Prevent concurrent access to ogs_pool allocating smf_event ([#1546](https://github.com/open5gs/open5gs/issues/1546)) -- [pespin](https://github.com/pespin)
- [DIAMETER] Fix AN-Trusted AVP sent in CCR ([#1542](https://github.com/open5gs/open5gs/pull/1542)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [PFCP] Fixed incorrect memcpy usage ([#1531](https://github.com/open5gs/open5gs/issues/1531)) -- [pespin](https://github.com/pespin)
- [AMF] Fixed the bug Not Sending NG RESET Acknowledge ([#1525](https://github.com/open5gs/open5gs/issues/1525)) -- [mcatalancid](https://github.com/mcatalancid)
- [IPv6] IPv6 RS/RA with QFI Extended Header ([#1506](https://github.com/open5gs/open5gs/issues/1506)) -- [irazairspan](https://github.com/irazairspan)
- [SBI] cJSON v1.7.7 to v1.7.15 to solve HTTP2 request with incorrect payload ([#1503](https://github.com/open5gs/open5gs/issues/1503)) -- [bmeglicit](https://github.com/bmeglicit)
- [GTP] Handling multiple bearer message ([#1498](https://github.com/open5gs/open5gs/issues/1498)) -- [cbrasho](https://github.com/cbrasho)
- [MME] SCTP Crash when eNB, SGW-U and UPF are going down ([#1497](https://github.com/open5gs/open5gs/pull/1497)) -- [spencersevilla](https://github.com/spencersevilla)
- [SBI] fixed HTTP2 header values is 0 ([#1488](https://github.com/open5gs/open5gs/issues/1488)) -- [bmeglicit](https://github.com/bmeglicit)
- [MME] Send EMM Cause when Attach Request type is not same as HSS Network-Access-Mode ([#1484](https://github.com/open5gs/open5gs/pull/1484)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [GX] Prevent sending Gx messages to non-PCRF Diameter peers ([#1468](https://github.com/open5gs/open5gs/pull/1468)) -- [pespin](https://github.com/pespin)
- [AMF] AMF crashes when requesting a PDU session for a S-NSSAI with an SST when the network is configured with multiple S-NSSAIs with the same SST ([#1440](https://github.com/open5gs/open5gs/issues/1440)) -- [dcandal-gti](https://github.com/dcandal-gti)
Download -- [v2.4.7.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.7.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,31 @@
---
title: "v2.4.8 - Upgrade PFCP to v16.9.1"
date: 2022-06-12 16:35:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### New Features
- [Metrics] Initial metrics support based on Prometheus ([#1571](https://github.com/open5gs/open5gs/pull/1571)) -- [pespin](https://github.com/pespin)
#### Enhancements
- [PFCP] Upgrade PFCP to v16.9.1 [1235317](https://github.com/open5gs/open5gs/commit/12353178fb7c15a5c78035e19501412af9c76ad0)
- [AMF] Added support for SUCI prtection schemes A and B( ([#1589](https://github.com/open5gs/open5gs/pull/1589)) -- [bmeglicit](https://github.com/bmeglicit)
- [NRF] Don't abort if there are too many registered NF instances ([#1579](https://github.com/open5gs/open5gs/pull/1579)) -- [mitmitmitm](https://github.com/mitmitmitm)
- [SGW-C] Consider if SMF/PGW GTPv2-C address changed ([#1560](https://github.com/open5gs/open5gs/issues/1560)) -- [pespin](https://github.com/pespin)
- [CLI] Added four addtional commands in dbctl ([#1562](https://github.com/open5gs/open5gs/pull/1562)) -- [mcatalancid](https://github.com/mcatalancid)
- [GY] Gy+PFCP improvements ([#1555](https://github.com/open5gs/open5gs/pull/1555)) -- [pespin](https://github.com/pespin)
#### Bug Fixes
- [AMF] Added to handle an invalid RI(Routing Indicator) ([#1570](https://github.com/open5gs/open5gs/issues/1570)) -- [ray28850101](https://github.com/ray28850101)
- [SBI] Re-enabling HTTP/1.1 ([#1254](https://github.com/open5gs/open5gs/issues/1254)) -- [hidingturtle](https://github.com/hidingturtle), [22username2022](https://github.com/22username2022)
- [GTP] GTP-U address does not change when gNB with IPv6-only changes
([#1515](https://github.com/open5gs/open5gs/issues/1515), [#1586](https://github.com/open5gs/open5gs/issues/1586)) -- [irazairspan](https://github.com/irazairspan), [dmartyushev](https://github.com/dmartyushev)
Download -- [v2.4.8.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.8.tar.gz)
{: .notice--info}

View File

@@ -10,7 +10,7 @@
#
PACKAGE="open5gs"
VERSION="2.2.8"
VERSION="2.4.7"
print_status() {
echo

View File

@@ -20,10 +20,12 @@ libapp_sources = files('''
ogs-yaml.h
ogs-context.h
ogs-config.h
ogs-init.h
ogs-yaml.c
ogs-context.c
ogs-config.c
ogs-init.c
'''.split())

View File

@@ -28,6 +28,7 @@ extern int __ogs_app_domain;
#include "app/ogs-yaml.h"
#include "app/ogs-context.h"
#include "app/ogs-config.h"
#include "app/ogs-init.h"
#undef OGS_APP_INSIDE

110
lib/app/ogs-config.c Normal file
View File

@@ -0,0 +1,110 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-app.h"
int ogs_app_config_parse_sockopt(
ogs_yaml_iter_t *parent, ogs_sockopt_t *option)
{
ogs_yaml_iter_t sockopt_iter;
ogs_assert(parent);
ogs_assert(option);
ogs_sockopt_init(option);
ogs_yaml_iter_recurse(parent, &sockopt_iter);
while (ogs_yaml_iter_next(&sockopt_iter)) {
const char *sockopt_key = ogs_yaml_iter_key(&sockopt_iter);
ogs_assert(sockopt_key);
if (!strcmp(sockopt_key, "sctp")) {
ogs_yaml_iter_t sctp_iter;
ogs_yaml_iter_recurse(&sockopt_iter, &sctp_iter);
while (ogs_yaml_iter_next(&sctp_iter)) {
const char *sctp_key = ogs_yaml_iter_key(&sctp_iter);
ogs_assert(sctp_key);
if (!strcmp(sctp_key, "spp_hbinterval")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.spp_hbinterval = atoi(v);
} else if (!strcmp(sctp_key, "spp_sackdelay")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.spp_sackdelay = atoi(v);
} else if (!strcmp(sctp_key, "srto_initial")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.srto_initial = atoi(v);
} else if (!strcmp(sctp_key, "srto_min")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.srto_min = atoi(v);
} else if (!strcmp(sctp_key, "srto_max")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.srto_max = atoi(v);
} else if (!strcmp(sctp_key, "sinit_num_ostreams")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.sinit_num_ostreams = atoi(v);
} else if (!strcmp(sctp_key, "sinit_max_instreams")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.sinit_max_instreams = atoi(v);
} else if (!strcmp(sctp_key, "sinit_max_attempts")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.sinit_max_attempts = atoi(v);
} else if (!strcmp(sctp_key, "sinit_max_init_timeo")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) option->sctp.sinit_max_init_timeo = atoi(v);
} else {
ogs_error("unknown key `%s`", sctp_key);
return OGS_ERROR;
}
}
} else if (!strcmp(sockopt_key, "sctp_nodelay")) {
option->sctp_nodelay = ogs_yaml_iter_bool(&sockopt_iter);
} else if (!strcmp(sockopt_key, "tcp_nodelay")) {
option->tcp_nodelay = ogs_yaml_iter_bool(&sockopt_iter);
} else if (!strcmp(sockopt_key, "so_linger")) {
ogs_yaml_iter_t so_linger_iter;
ogs_yaml_iter_recurse(&sockopt_iter, &so_linger_iter);
while (ogs_yaml_iter_next(&so_linger_iter)) {
const char *so_linger_key = ogs_yaml_iter_key(&so_linger_iter);
ogs_assert(so_linger_key);
if (!strcmp(so_linger_key, "l_onoff")) {
option->so_linger.l_onoff =
ogs_yaml_iter_bool(&so_linger_iter);
} else if (!strcmp(so_linger_key, "l_linger")) {
const char *v = ogs_yaml_iter_value(&so_linger_iter);
if (v) option->so_linger.l_linger = atoi(v);
} else {
ogs_error("unknown key `%s`", so_linger_key);
return OGS_ERROR;
}
}
} else if (!strcmp(sockopt_key, "so_bindtodevice")) {
option->so_bindtodevice = ogs_yaml_iter_value(&sockopt_iter);
} else {
ogs_error("unknown key `%s`", sockopt_key);
return OGS_ERROR;
}
}
return OGS_OK;
}

38
lib/app/ogs-config.h Normal file
View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(OGS_APP_INSIDE) && !defined(OGS_APP_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_APP_CONFIG_H
#define OGS_APP_CONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
int ogs_app_config_parse_sockopt(
ogs_yaml_iter_t *parent, ogs_sockopt_t *sockopt);
#ifdef __cplusplus
}
#endif
#endif /* OGS_APP_CONFIG_H */

View File

@@ -189,7 +189,7 @@ static void app_context_prepare(void)
self.sockopt.no_delay = true;
#define MAX_NUM_OF_UE 1024 /* Num of UE per AMF/MME */
#define MAX_NUM_OF_GNB 32 /* Num of gNB per AMF/MME */
#define MAX_NUM_OF_GNB 64 /* Num of gNB per AMF/MME */
self.max.gnb = MAX_NUM_OF_GNB;
self.max.ue = MAX_NUM_OF_UE;
@@ -226,9 +226,12 @@ static void app_context_prepare(void)
*/
self.time.handover.duration = ogs_time_from_msec(300);
/* Size of internal metrics pool (amount of ogs_metrics_spec_t) */
self.metrics.max_specs = 512;
regenerate_all_timer_duration();
}
static int app_context_validation(void)
{
if (self.parameter.no_ipv4 == 1 &&

View File

@@ -24,8 +24,6 @@
#ifndef OGS_APP_CONTEXT_H
#define OGS_APP_CONTEXT_H
#include "ogs-app.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -177,6 +175,10 @@ typedef struct ogs_app_context_s {
} handover;
} time;
struct metrics {
uint64_t max_specs;
} metrics;
} ogs_app_context_t;
int ogs_app_context_init(void);

View File

@@ -32,9 +32,6 @@ int ogs_app_initialize(
char *log_file;
char *log_level;
char *domain_mask;
bool enable_debug;
bool enable_trace;
} optarg;
ogs_core_initialize();

View File

@@ -17,7 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-yaml.h"
#include "ogs-app.h"
void ogs_yaml_iter_init(ogs_yaml_iter_t *iter, yaml_document_t *document)
{

View File

@@ -26,8 +26,6 @@
#include <yaml.h>
#include "ogs-app.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -89,7 +89,7 @@ NativeEnumerated_encode_aper(const asn_TYPE_descriptor_t *td,
asn_enc_rval_t er = {0,0,0};
long native, value;
const asn_per_constraint_t *ct;
int inext = 0;
int inext = 0, range_bits = 1;
asn_INTEGER_enum_map_t key;
asn_INTEGER_enum_map_t *kf;
@@ -126,12 +126,12 @@ NativeEnumerated_encode_aper(const asn_TYPE_descriptor_t *td,
if(ct->flags & APC_EXTENSIBLE) {
if(per_put_few_bits(po, inext, 1))
ASN__ENCODE_FAILED;
if(inext) ct = 0;
if(inext) range_bits = 0;
} else if(inext) {
ASN__ENCODE_FAILED;
}
if(ct && ct->range_bits >= 0) {
if(range_bits && ct && ct->range_bits >= 0) {
if(per_put_few_bits(po, value, ct->range_bits))
ASN__ENCODE_FAILED;
ASN__ENCODED_OK(er);

View File

@@ -94,6 +94,14 @@ asn_enc_rval_t OPEN_TYPE_encode_aper(
const asn_TYPE_descriptor_t *type_descriptor,
const asn_per_constraints_t *constraints, const void *struct_ptr,
asn_per_outp_t *per_output);
int OPEN_TYPE_aper_is_unknown_type(
const asn_TYPE_descriptor_t *td,
void *sptr,
const asn_TYPE_member_t *elm);
asn_dec_rval_t OPEN_TYPE_aper_unknown_type_discard_bytes(
asn_per_data_t *pd);
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
extern asn_TYPE_operation_t asn_OP_OPEN_TYPE;

View File

@@ -117,3 +117,58 @@ OPEN_TYPE_encode_aper(const asn_TYPE_descriptor_t *td,
er.encoded = 0;
ASN__ENCODED_OK(er);
}
int OPEN_TYPE_aper_is_unknown_type(const asn_TYPE_descriptor_t *td, void *sptr, const asn_TYPE_member_t *elm) {
asn_type_selector_result_t selected;
if(!elm->type_selector) {
return 1;
}
else {
selected = elm->type_selector(td, sptr);
if(!selected.presence_index) {
return 1;
}
}
return 0;
}
asn_dec_rval_t
OPEN_TYPE_aper_unknown_type_discard_bytes (asn_per_data_t *pd) {
#define ASN_DUMMY_BYTES 256
unsigned char dummy[ASN_DUMMY_BYTES], *dummy_ptr = NULL;
ssize_t bytes;
int repeat;
asn_dec_rval_t rv;
rv.consumed = 0;
rv.code = RC_FAIL;
do {
bytes = aper_get_length(pd, -1, -1, &repeat);
if (bytes > 10 * ASN_DUMMY_BYTES)
{
return rv;
}
else if (bytes > ASN_DUMMY_BYTES)
{
dummy_ptr = CALLOC(1, bytes);
if (!dummy_ptr)
return rv;
}
per_get_many_bits(pd, (dummy_ptr ? dummy_ptr : dummy), 0, bytes << 3);
if (dummy_ptr)
{
FREEMEM(dummy_ptr);
dummy_ptr = NULL;
}
} while (repeat);
rv.code = RC_OK;
return rv;
#undef ASN_DUMMY_BYTES
}

View File

@@ -151,10 +151,10 @@ UTF8String_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
static ssize_t
UTF8String__process(const UTF8String_t *st, uint32_t *dst, size_t dstlen) {
size_t length;
uint8_t *buf = st->buf;
uint8_t *end = buf + st->size;
uint32_t *dstend = dst + dstlen;
size_t length = 0;
uint8_t *buf = (st == NULL)? NULL : st->buf;
uint8_t *end = (buf == NULL)? NULL : buf + st->size;
uint32_t *dstend = (dst == NULL)? NULL : dst + dstlen;
for(length = 0; buf < end; length++) {
int ch = *buf;

View File

@@ -130,6 +130,11 @@ SEQUENCE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name);
if(elm->flags & ATF_OPEN_TYPE) {
if (OPEN_TYPE_aper_is_unknown_type(td, st, elm)) {
rv = OPEN_TYPE_aper_unknown_type_discard_bytes(pd);
FREEMEM(opres);
return rv;
}
rv = OPEN_TYPE_aper_get(opt_codec_ctx, td, st, elm, pd);
} else {
rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,

View File

@@ -49420,7 +49420,7 @@ static asn_TYPE_member_t asn_MBR_NGAP_extensionValue_648[] = {
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
#if 0
#if 0 /* modified by acetcom */
&asn_PER_memb_NGAP_OCTET_STRING_CONTAINING_PDUSessionResourceReleaseResponseTransfer__constr_47,
#else
0,

View File

@@ -1,15 +1,17 @@
Use mounse07410(vlm_master) git's fork for asn1c
commit dcf963c0e43196057a97feac16421fe79dc7d943 (HEAD -> vlm_master, origin/vlm_master, origin/HEAD)
Merge: b33a84f9 c35ebd33
Author: Mouse <mouse008@gmail.com>
Date: Sun Nov 1 08:58:12 2020 -0500
commit c098de2086633d2027f1d117092541d8482c1c96 (HEAD -> vlm_master, origin/vlm_master, origin/HEAD)
Author: Nikolaos Koutsianas <nkoutsianas@gmail.com>
Date: Fri Feb 25 13:18:01 2022 +0200
aper decoder can ignore unknown open types in a sequence and continue with next ones
===========================================
user@host ~/Documents/git/my$ \
git clone https://github.com/mouse07410/asn1c.git
user@host ~/Documents/git/my$ \
git checkout 8282f80bc89cc773f9432cde56398a36f2683511
git checkout git checkout c098de2086633d2027f1d117092541d8482c1c96
OR
@@ -175,24 +177,59 @@ Check common file
user@host ~/Documents/git/open5gs/lib/asn1c/common$ \
git diff asn_internal.h
diff --git a/lib/asn1c/common/asn_internal.h b/lib/asn1c/common/asn_internal.h
index 71397a62..0b673a46 100644
--- a/lib/asn1c/common/asn_internal.h
+++ b/lib/asn1c/common/asn_internal.h
@@ -34,18 +34,11 @@ extern "C" {
#define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */
int get_asn1c_environment_version(void); /* Run-time version */
diff -u asn_internal.h ~/asn_internal.h
--- asn_internal.h 2022-02-26 15:48:33.431509100 +0900
+++ /home/acetcom/asn_internal.h 2022-02-26 15:43:00.890972555 +0900
@@ -34,10 +34,53 @@
#define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */
int get_asn1c_environment_version(void); /* Run-time version */
+#if 0 /* modified by acetcom */
+#define CALLOC(nmemb, size) calloc(nmemb, size)
+#define MALLOC(size) malloc(size)
+#define REALLOC(oldptr, size) realloc(oldptr, size)
+#define FREEMEM(ptr) free(ptr)
#define CALLOC(nmemb, size) calloc(nmemb, size)
#define MALLOC(size) malloc(size)
#define REALLOC(oldptr, size) realloc(oldptr, size)
#define FREEMEM(ptr) free(ptr)
+#else
#include "ogs-core.h"
#define CALLOC(nmemb, size) ogs_calloc(nmemb, size)
#define MALLOC(size) ogs_malloc(size)
#define REALLOC(oldptr, size) ogs_realloc(oldptr, size)
#define FREEMEM(ptr) ogs_free(ptr)
+#include "ogs-core.h"
+
+static ogs_inline void *ogs_asn_malloc(size_t size, const char *file_line)
+{
+ void *ptr = ogs_malloc(size);
+ if (!ptr) {
+ ogs_fatal("asn_malloc() failed in `%s`", file_line);
+ ogs_assert_if_reached();
+ }
+
+ return ptr;
+}
+static ogs_inline void *ogs_asn_calloc(
+ size_t nmemb, size_t size, const char *file_line)
+{
+ void *ptr = ogs_calloc(nmemb, size);
+ if (!ptr) {
+ ogs_fatal("asn_calloc() failed in `%s`", file_line);
+ ogs_assert_if_reached();
+ }
+
+ return ptr;
+}
+static ogs_inline void *ogs_asn_realloc(
+ void *oldptr, size_t size, const char *file_line)
+{
+ void *ptr = ogs_realloc(oldptr, size);
+ if (!ptr) {
+ ogs_fatal("asn_realloc() failed in `%s`", file_line);
+ ogs_assert_if_reached();
+ }
+
+ return ptr;
+}
+
+#define CALLOC(nmemb, size) ogs_asn_calloc(nmemb, size, OGS_FILE_LINE)
+#define MALLOC(size) ogs_asn_malloc(size, OGS_FILE_LINE)
+#define REALLOC(oldptr, size) ogs_asn_realloc(oldptr, size, OGS_FILE_LINE)
+#define FREEMEM(ptr) ogs_free(ptr)
+
+#endif
#define asn_debug_indent 0

View File

@@ -171,8 +171,10 @@ int ogs_asn_BIT_STRING_to_ip(BIT_STRING_t *bit_string, ogs_ip_t *ip)
ip->ipv6 = 1;
memcpy(&ip->addr6, bit_string->buf, OGS_IPV6_LEN);
ogs_debug(" IPv6[%s]", OGS_INET_NTOP(&ip->addr6, buf));
} else
ogs_assert_if_reached();
} else {
ogs_error("ogs_asn_BIT_STRING_to_ip(size=%d) failed", bit_string->size);
return OGS_ERROR;
}
ip->len = bit_string->size;

View File

@@ -241,6 +241,7 @@ libcore_sources = files('''
ogs-process.h
ogs-sockaddr.h
ogs-socket.h
ogs-sockopt.h
ogs-sockpair.h
ogs-socknode.h
ogs-udp.h
@@ -275,6 +276,7 @@ libcore_sources = files('''
ogs-process.c
ogs-sockaddr.c
ogs-socket.c
ogs-sockopt.c
ogs-sockpair.c
ogs-socknode.c
ogs-udp.c

View File

@@ -198,7 +198,6 @@ char *ogs_supi_from_suci(char *suci)
{
#define MAX_SUCI_TOKEN 16
char *array[MAX_SUCI_TOKEN];
char *saveptr = NULL;
char *p, *tmp;
int i;
char *supi = NULL;
@@ -207,12 +206,10 @@ char *ogs_supi_from_suci(char *suci)
tmp = ogs_strdup(suci);
ogs_expect_or_return_val(tmp, NULL);
p = strtok_r(tmp, "-", &saveptr);
memset(array, 0, sizeof(array));
for (i = 0; i < MAX_SUCI_TOKEN && p; i++) {
array[i] = p;
p = strtok_r(NULL, "-", &saveptr);
p = tmp;
i = 0;
while((array[i++] = strsep(&p, "-"))) {
/* Empty Body */
}
SWITCH(array[0])
@@ -240,17 +237,17 @@ char *ogs_supi_from_suci(char *suci)
char *ogs_id_get_type(char *str)
{
char *saveptr = NULL;
char *p, *tmp;
char *token, *p, *tmp;
char *type = NULL;
ogs_assert(str);
tmp = ogs_strdup(str);
ogs_expect_or_return_val(tmp, NULL);
p = strtok_r(tmp, "-", &saveptr);
ogs_assert(p);
type = ogs_strdup(p);
p = tmp;
token = strsep(&p, "-");
ogs_assert(token);
type = ogs_strdup(token);
ogs_expect_or_return_val(type, NULL);
ogs_free(tmp);
@@ -259,19 +256,19 @@ char *ogs_id_get_type(char *str)
char *ogs_id_get_value(char *str)
{
char *saveptr = NULL;
char *p, *tmp;
char *token, *p, *tmp;
char *ueid = NULL;
ogs_assert(str);
tmp = ogs_strdup(str);
ogs_expect_or_return_val(tmp, NULL);
p = strtok_r(tmp, "-", &saveptr);
ogs_assert(p);
p = strtok_r(NULL, "-", &saveptr);
ogs_assert(p);
ueid = ogs_strdup(p);
p = tmp;
token = strsep(&p, "-");
ogs_assert(token);
token = strsep(&p, "-");
ogs_assert(token);
ueid = ogs_strdup(token);
ogs_expect_or_return_val(ueid, NULL);
ogs_free(tmp);
@@ -324,11 +321,12 @@ int ogs_fqdn_parse(char *dst, char *src, int length)
int i = 0, j = 0;
uint8_t len = 0;
while (i < length) {
while (i+1 < length) {
len = src[i++];
if ((j + len + 1) > length) {
ogs_error("Invalid APN encoding[len:%d] + 1 > length[%d]",
ogs_error("Invalid FQDN encoding[len:%d] + 1 > length[%d]",
len, length);
ogs_log_hexdump(OGS_LOG_ERROR, (unsigned char *)src, length);
return 0;
}
memcpy(&dst[j], &src[i], len);
@@ -336,7 +334,7 @@ int ogs_fqdn_parse(char *dst, char *src, int length)
i += len;
j += len;
if (i < length)
if (i+1 < length)
dst[j++] = '.';
else
dst[j] = 0;
@@ -464,11 +462,11 @@ int ogs_ip_to_sockaddr(ogs_ip_t *ip, uint16_t port, ogs_sockaddr_t **list)
return OGS_OK;
}
void ogs_sockaddr_to_ip(
int ogs_sockaddr_to_ip(
ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6, ogs_ip_t *ip)
{
ogs_assert(ip);
ogs_assert(addr || addr6);
ogs_expect_or_return_val(ip, OGS_ERROR);
ogs_expect_or_return_val(addr || addr6, OGS_ERROR);
memset(ip, 0, sizeof(ogs_ip_t));
@@ -488,6 +486,8 @@ void ogs_sockaddr_to_ip(
memcpy(ip->addr6, addr6->sin6.sin6_addr.s6_addr, OGS_IPV6_LEN);
} else
ogs_assert_if_reached();
return OGS_OK;
}
char *ogs_ipv4_to_string(uint32_t addr)
@@ -748,7 +748,7 @@ static int flow_rx_to_gx(ogs_flow_t *rx_flow, ogs_flow_t *gx_flow)
/* 'permit in' should be changed
* 'permit out' in Gx Diameter */
len = strlen(rx_flow->description)+2;
gx_flow->description = ogs_malloc(len);
gx_flow->description = ogs_calloc(1, len);
ogs_assert(gx_flow->description);
strcpy(gx_flow->description, "permit out");
from_str = strstr(&rx_flow->description[strlen("permit in")], "from");

View File

@@ -30,6 +30,7 @@ extern "C" {
#define OGS_MAX_NUM_OF_SESS 4 /* Num of APN(Session) per UE */
#define OGS_MAX_NUM_OF_BEARER 4 /* Num of Bearer per Session */
#define OGS_BEARER_PER_UE 8 /* Num of Bearer per UE */
#define OGS_MAX_NUM_OF_PACKET_BUFFER 64 /* Num of PacketBuffer per UE */
/*
@@ -121,7 +122,7 @@ uint16_t ogs_plmn_id_mcc(ogs_plmn_id_t *plmn_id);
uint16_t ogs_plmn_id_mnc(ogs_plmn_id_t *plmn_id);
uint16_t ogs_plmn_id_mnc_len(ogs_plmn_id_t *plmn_id);
void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id,
void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id,
uint16_t mcc, uint16_t mnc, uint16_t mnc_len);
char *ogs_serving_network_name_from_plmn_id(ogs_plmn_id_t *plmn_id);
@@ -238,7 +239,7 @@ ED3(uint8_t ipv4:1;,
} ogs_ip_t;
int ogs_ip_to_sockaddr(ogs_ip_t *ip, uint16_t port, ogs_sockaddr_t **list);
void ogs_sockaddr_to_ip(
int ogs_sockaddr_to_ip(
ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6, ogs_ip_t *ip);
char *ogs_ipv4_to_string(uint32_t addr);
@@ -250,7 +251,34 @@ int ogs_ipv6prefix_from_string(
uint8_t *addr6, uint8_t *prefixlen, char *string);
/**************************************************
* 8.14 PDN Address Allocation (PAA) */
* GTPv1-C: TS 29.060 7.7.27 End User Address (EUA) */
#define OGS_PDP_EUA_ORG_ETSI 0
#define OGS_PDP_EUA_ORG_IETF 1
#define OGS_PDP_EUA_ETSI_PPP 1
#define OGS_PDP_EUA_IETF_IPV4 0x21
#define OGS_PDP_EUA_IETF_IPV6 0x57
#define OGS_PDP_EUA_IETF_IPV4V6 0x8D
typedef struct ogs_eua_s {
ED2(uint8_t spare:4;,
uint8_t organization:4;)
uint8_t type;
union {
/* PDU_SESSION_TYPE_IPV4 */
uint32_t addr;
/* PDU_SESSION_TYPE_IPV6 */
uint8_t addr6[OGS_IPV6_LEN];
/* PDU_SESSION_TYPE_IPV4V6 */
struct {
uint32_t addr;
uint8_t addr6[OGS_IPV6_LEN];
} __attribute__ ((packed)) both;
};
} __attribute__ ((packed)) ogs_eua_t;
/**************************************************
* GTPv2-C: TS 29.274 8.14 PDN Address Allocation (PAA) */
#define OGS_PAA_IPV4_LEN 5
#define OGS_PAA_IPV6_LEN 18
#define OGS_PAA_IPV4V6_LEN 22
@@ -265,7 +293,7 @@ ED2(uint8_t spare:5;,
uint8_t session_type:3;)
union {
/* PDU_SESSION_TYPE_IPV4 */
uint32_t addr;
uint32_t addr;
/* PDU_SESSION_TYPE_IPV6 */
struct {
@@ -283,7 +311,7 @@ ED2(uint8_t spare:5;,
/* IPv6 Prefix and Interface Identifier */
uint8_t addr6[OGS_IPV6_LEN];
};
uint32_t addr;
uint32_t addr;
} __attribute__ ((packed)) both;
};
} __attribute__ ((packed)) ogs_paa_t;
@@ -305,8 +333,8 @@ typedef struct ogs_qos_s {
struct {
/* Values 1 to 8 should only be assigned for services that are
* authorized to receive prioritized treatment within an operator domain.
* Values 9 to 15 may be assigned to resources that are authorized
* authorized to receive prioritized treatment within an operator domain.
* Values 9 to 15 may be assigned to resources that are authorized
* by the home network and thus applicable when a UE is roaming. */
uint8_t priority_level;
/*
@@ -370,7 +398,7 @@ typedef struct ogs_pcc_rule_s {
int flow_status;
uint32_t precedence;
ogs_qos_t qos;
} ogs_pcc_rule_t;
@@ -453,13 +481,14 @@ int ogs_fqdn_parse(char *dst, char *src, int len);
/**************************************************
* Protocol Configuration Options Structure
* 8.13 Protocol Configuration Options (PCO)
* 10.5.6.3 Protocol configuration options in 3GPP TS 24.008
* 8.13 Protocol Configuration Options (PCO)
* 10.5.6.3 Protocol configuration options in 3GPP TS 24.008
* RFC 3232 [103]
* RFC 1661 [102] */
#define OGS_PCO_PPP_FOR_USE_WITH_IP_PDP_TYPE_OR_IP_PDN_TYPE 0
#define OGS_PCO_ID_INTERNET_PROTOCOL_CONTROL_PROTOCOL 0x8021
#define OGS_PCO_ID_PASSWORD_AUTHENTICATION_PROTOCOL 0xc023
#define OGS_PCO_ID_CHALLENGE_HANDSHAKE_AUTHENTICATION_PROTOCOL 0xc223
#define OGS_PCO_ID_P_CSCF_IPV6_ADDRESS_REQUEST 0x0001
#define OGS_PCO_ID_DNS_SERVER_IPV6_ADDRESS_REQUEST 0x0003
@@ -470,20 +499,41 @@ int ogs_fqdn_parse(char *dst, char *src, int len);
#define OGS_PCO_ID_IPV4_LINK_MTU_REQUEST 0x0010
#define OGS_PCO_ID_MS_SUPPORT_LOCAL_ADDR_TFT_INDICATOR 0x0011
#define OGS_PCO_ID_P_CSCF_RE_SELECTION_SUPPORT 0x0012
enum ogs_pco_ipcp_options {
OGS_IPCP_OPT_IPADDR = 3,
OGS_IPCP_OPT_PRIMARY_DNS = 129,
OGS_IPCP_OPT_SECONDARY_DNS = 131,
};
typedef struct ogs_pco_ipcp_options_s {
uint8_t type;
uint8_t len;
uint32_t addr;
} __attribute__ ((packed)) ogs_pco_ipcp_options_t;
#define OGS_PCO_MAX_NUM_OF_IPCO_OPTIONS 4
#define OGS_PCO_MAX_NUM_OF_IPCP_OPTIONS 4
typedef struct ogs_pco_ipcp_s {
uint8_t code;
uint8_t identifier;
uint16_t len;
ogs_pco_ipcp_options_t options[OGS_PCO_MAX_NUM_OF_IPCO_OPTIONS];
ogs_pco_ipcp_options_t options[OGS_PCO_MAX_NUM_OF_IPCP_OPTIONS];
} __attribute__ ((packed)) ogs_pco_ipcp_t;
typedef struct ogs_pco_pap_s {
uint8_t code;
uint8_t identifier;
uint16_t len;
uint8_t welcome_len;
char welcome[255];
} __attribute__ ((packed)) ogs_pco_pap_t;
typedef struct ogs_pco_chap_s {
uint8_t code;
uint8_t identifier;
uint16_t len;
} __attribute__ ((packed)) ogs_pco_chap_t;
typedef struct ogs_pco_id_s {
uint16_t id;
uint8_t len;

View File

@@ -47,6 +47,7 @@
#include "core/ogs-signal.h"
#include "core/ogs-sockaddr.h"
#include "core/ogs-socket.h"
#include "core/ogs-sockopt.h"
#include "core/ogs-sockpair.h"
#include "core/ogs-socknode.h"
#include "core/ogs-udp.h"

View File

@@ -125,6 +125,8 @@ static int epoll_add(ogs_poll_t *poll)
if (poll->when & OGS_POLLOUT)
map->write = poll;
memset(&ee, 0, sizeof ee);
ee.events = 0;
if (map->read)
ee.events |= (EPOLLIN|EPOLLRDHUP);
@@ -164,6 +166,8 @@ static int epoll_remove(ogs_poll_t *poll)
if (poll->when & OGS_POLLOUT)
map->write = NULL;
memset(&ee, 0, sizeof ee);
ee.events = 0;
if (map->read)
ee.events |= (EPOLLIN|EPOLLRDHUP);
@@ -240,8 +244,9 @@ static int epoll_process(ogs_pollset_t *pollset, ogs_time_t timeout)
fd = context->event_list[i].data.fd;
ogs_assert(fd != INVALID_SOCKET);
map = ogs_hash_get(context->map_hash, &fd, sizeof(fd));
ogs_assert(map);
if (!map) continue;
if (map->read && map->write && map->read == map->write) {
map->read->handler(when, map->read->fd, map->read->data);
@@ -254,10 +259,10 @@ static int epoll_process(ogs_pollset_t *pollset, ogs_time_t timeout)
* So, we need to check map instance
*/
map = ogs_hash_get(context->map_hash, &fd, sizeof(fd));
if (map) {
if ((when & OGS_POLLOUT) && map->write)
map->write->handler(when, map->write->fd, map->write->data);
}
if (!map) continue;
if ((when & OGS_POLLOUT) && map->write)
map->write->handler(when, map->write->fd, map->write->data);
}
}

View File

@@ -32,6 +32,7 @@ extern "C" {
typedef DWORD ogs_err_t;
#define OGS_EPERM ERROR_ACCESS_DENIED
#define OGS_ENOMEM ERROR_NOT_ENOUGH_MEMORY
#define OGS_EACCES ERROR_ACCESS_DENIED
#define OGS_EEXIST ERROR_ALREADY_EXISTS
@@ -51,6 +52,7 @@ typedef DWORD ogs_err_t;
typedef int ogs_err_t;
#define OGS_EPERM EPERM
#define OGS_ENOMEM ENOMEM
#define OGS_EACCES EACCES
#define OGS_EEXIST EEXIST

View File

@@ -32,7 +32,7 @@ struct ogs_list_s {
struct ogs_list_s *prev, *next;
};
typedef struct ogs_list_s ogs_list_t;
typedef struct ogs_list_s ogs_lnode_t;;
typedef struct ogs_list_s ogs_lnode_t;
#define OGS_LIST(name) \
ogs_list_t name = { NULL, NULL }
@@ -42,6 +42,11 @@ typedef struct ogs_list_s ogs_lnode_t;;
(list)->next = (NULL); \
} while (0)
#define ogs_list_copy(dst, src) do { \
(dst)->prev = (src)->prev; \
(dst)->next = (src)->next; \
} while (0)
static ogs_inline void *ogs_list_first(const ogs_list_t *list)
{
return list->next;
@@ -64,15 +69,20 @@ static ogs_inline void *ogs_list_prev(void *lnode)
return node->prev;
}
#define ogs_list_entry(ptr, type, member) ogs_container_of(ptr, type, member)
#define ogs_list_entry(ptr, type, member) \
ptr ? ogs_container_of(ptr, type, member) : NULL
#define ogs_list_for_each(list, node) \
for (node = ogs_list_first(list); (node); \
node = ogs_list_next(node))
#define ogs_list_reverse_for_each(list, node) \
for (node = ogs_list_last(list); (node); \
node = ogs_list_prev(node))
#define ogs_list_for_each_entry(list, node, member) \
for (node = ogs_list_entry(ogs_list_first(list), typeof(*node), member); \
(&node->member); \
(node) && (&node->member); \
node = ogs_list_entry( \
ogs_list_next(&node->member), typeof(*node), member))
@@ -83,7 +93,7 @@ static ogs_inline void *ogs_list_prev(void *lnode)
#define ogs_list_for_each_entry_safe(list, n, node, member) \
for (node = ogs_list_entry(ogs_list_first(list), typeof(*node), member); \
(&node->member) && \
(node) && (&node->member) && \
(n = ogs_list_entry( \
ogs_list_next(&node->member), typeof(*node), member), 1); \
node = n)
@@ -118,7 +128,7 @@ static ogs_inline void ogs_list_remove(ogs_list_t *list, void *lnode)
{
ogs_list_t *node = lnode;
ogs_list_t *prev = node->prev;
ogs_list_t *next = node->next;;
ogs_list_t *next = node->next;
if (prev)
prev->next = next;

View File

@@ -22,6 +22,7 @@
#undef OGS_LOG_DOMAIN
#define OGS_LOG_DOMAIN __ogs_mem_domain
#if OGS_USE_TALLOC == 0
#define OGS_CLUSTER_128_SIZE 128
#define OGS_CLUSTER_256_SIZE 256
#define OGS_CLUSTER_512_SIZE 512
@@ -67,6 +68,7 @@ static ogs_pkbuf_pool_t *default_pool = NULL;
static ogs_cluster_t *cluster_alloc(
ogs_pkbuf_pool_t *pool, unsigned int size);
static void cluster_free(ogs_pkbuf_pool_t *pool, ogs_cluster_t *cluster);
#endif
void *ogs_pkbuf_put_data(
ogs_pkbuf_t *pkbuf, const void *data, unsigned int len)
@@ -79,16 +81,21 @@ void *ogs_pkbuf_put_data(
void ogs_pkbuf_init(void)
{
#if OGS_USE_TALLOC == 0
ogs_pool_init(&pkbuf_pool, ogs_core()->pkbuf.pool);
#endif
}
void ogs_pkbuf_final(void)
{
#if OGS_USE_TALLOC == 0
ogs_pool_final(&pkbuf_pool);
#endif
}
void ogs_pkbuf_default_init(ogs_pkbuf_config_t *config)
{
#if OGS_USE_TALLOC == 0
ogs_assert(config);
memset(config, 0, sizeof *config);
@@ -99,21 +106,27 @@ void ogs_pkbuf_default_init(ogs_pkbuf_config_t *config)
config->cluster_2048_pool = 1024;
config->cluster_8192_pool = 512;
config->cluster_big_pool = 8;
#endif
}
void ogs_pkbuf_default_create(ogs_pkbuf_config_t *config)
{
#if OGS_USE_TALLOC == 0
default_pool = ogs_pkbuf_pool_create(config);
#endif
}
void ogs_pkbuf_default_destroy(void)
{
#if OGS_USE_TALLOC == 0
ogs_pkbuf_pool_destroy(default_pool);
#endif
}
ogs_pkbuf_pool_t *ogs_pkbuf_pool_create(ogs_pkbuf_config_t *config)
{
ogs_pkbuf_pool_t *pool = NULL;
#if OGS_USE_TALLOC == 0
int tmp = 0;
ogs_assert(config);
@@ -139,6 +152,7 @@ ogs_pkbuf_pool_t *ogs_pkbuf_pool_create(ogs_pkbuf_config_t *config)
ogs_pool_init(&pool->cluster_2048, config->cluster_2048_pool);
ogs_pool_init(&pool->cluster_8192, config->cluster_8192_pool);
ogs_pool_init(&pool->cluster_big, config->cluster_big_pool);
#endif
return pool;
}
@@ -163,6 +177,7 @@ ogs_pkbuf_pool_t *ogs_pkbuf_pool_create(ogs_pkbuf_config_t *config)
void ogs_pkbuf_pool_destroy(ogs_pkbuf_pool_t *pool)
{
#if OGS_USE_TALLOC == 0
ogs_assert(pool);
ogs_pkbuf_pool_final(&pool->pkbuf);
@@ -179,11 +194,33 @@ void ogs_pkbuf_pool_destroy(ogs_pkbuf_pool_t *pool)
ogs_thread_mutex_destroy(&pool->mutex);
ogs_pool_free(&pkbuf_pool, pool);
#endif
}
ogs_pkbuf_t *ogs_pkbuf_alloc_debug(
ogs_pkbuf_pool_t *pool, unsigned int size, const char *file_line)
{
#if OGS_USE_TALLOC
ogs_pkbuf_t *pkbuf = NULL;
pkbuf = ogs_talloc_zero_size(pool, sizeof(*pkbuf) + size, file_line);
if (!pkbuf) {
ogs_error("ogs_pkbuf_alloc() failed [size=%d]", size);
return NULL;
}
pkbuf->head = pkbuf->_data;
pkbuf->end = pkbuf->_data + size;
pkbuf->len = 0;
pkbuf->data = pkbuf->_data;
pkbuf->tail = pkbuf->_data;
pkbuf->file_line = file_line; /* For debug */
return pkbuf;
#else
ogs_pkbuf_t *pkbuf = NULL;
ogs_cluster_t *cluster = NULL;
@@ -210,8 +247,6 @@ ogs_pkbuf_t *ogs_pkbuf_alloc_debug(
cluster->ref++;
ogs_thread_mutex_unlock(&pool->mutex);
pkbuf->cluster = cluster;
pkbuf->len = 0;
@@ -225,11 +260,17 @@ ogs_pkbuf_t *ogs_pkbuf_alloc_debug(
pkbuf->pool = pool;
ogs_thread_mutex_unlock(&pool->mutex);
return pkbuf;
#endif
}
void ogs_pkbuf_free(ogs_pkbuf_t *pkbuf)
{
#if OGS_USE_TALLOC
ogs_talloc_free(pkbuf, OGS_FILE_LINE);
#else
ogs_pkbuf_pool_t *pool = NULL;
ogs_cluster_t *cluster = NULL;
ogs_assert(pkbuf);
@@ -237,11 +278,11 @@ void ogs_pkbuf_free(ogs_pkbuf_t *pkbuf)
pool = pkbuf->pool;
ogs_assert(pool);
ogs_thread_mutex_lock(&pool->mutex);
cluster = pkbuf->cluster;
ogs_assert(cluster);
ogs_thread_mutex_lock(&pool->mutex);
cluster->ref--;
if (cluster->ref == 0)
cluster_free(pool, pkbuf->cluster);
@@ -249,10 +290,33 @@ void ogs_pkbuf_free(ogs_pkbuf_t *pkbuf)
ogs_pool_free(&pool->pkbuf, pkbuf);
ogs_thread_mutex_unlock(&pool->mutex);
#endif
}
ogs_pkbuf_t *ogs_pkbuf_copy_debug(ogs_pkbuf_t *pkbuf, const char *file_line)
{
#if OGS_USE_TALLOC
ogs_pkbuf_t *newbuf;
int size = pkbuf->end - pkbuf->head;
ogs_assert(size > 0);
newbuf = ogs_pkbuf_alloc_debug(NULL, size, file_line);
if (!pkbuf) {
ogs_error("ogs_pkbuf_alloc() failed [size=%d]", size);
return NULL;
}
/* copy data */
memcpy(newbuf->_data, pkbuf->_data, size);
/* copy header */
newbuf->len = pkbuf->len;
newbuf->tail += pkbuf->tail - pkbuf->_data;
newbuf->data += pkbuf->data - pkbuf->_data;
return newbuf;
#else
ogs_pkbuf_pool_t *pool = NULL;
ogs_pkbuf_t *newbuf = NULL;
@@ -274,10 +338,12 @@ ogs_pkbuf_t *ogs_pkbuf_copy_debug(ogs_pkbuf_t *pkbuf, const char *file_line)
newbuf->cluster->ref++;
ogs_thread_mutex_unlock(&pool->mutex);
#endif
return newbuf;
}
#if OGS_USE_TALLOC == 0
static ogs_cluster_t *cluster_alloc(
ogs_pkbuf_pool_t *pool, unsigned int size)
{
@@ -363,3 +429,4 @@ static void cluster_free(ogs_pkbuf_pool_t *pool, ogs_cluster_t *cluster)
ogs_pool_free(&pool->cluster, cluster);
}
#endif

View File

@@ -35,7 +35,11 @@ typedef struct ogs_cluster_s {
unsigned int ref;
} ogs_cluster_t;
#if OGS_USE_TALLOC
typedef void ogs_pkbuf_pool_t;
#else
typedef struct ogs_pkbuf_pool_s ogs_pkbuf_pool_t;
#endif
typedef struct ogs_pkbuf_s {
ogs_lnode_t lnode;
@@ -54,6 +58,8 @@ typedef struct ogs_pkbuf_s {
const char *file_line;
ogs_pkbuf_pool_t *pool;
unsigned char _data[0]; /*!< optional immediate data array */
} ogs_pkbuf_t;
typedef struct ogs_pkbuf_config_s {
@@ -108,12 +114,12 @@ static ogs_inline void *ogs_pkbuf_put(ogs_pkbuf_t *pkbuf, unsigned int len)
{
void *tmp = pkbuf->tail;
if (ogs_unlikely(ogs_pkbuf_tailroom(pkbuf) < (int)len))
ogs_assert_if_reached();
pkbuf->tail += len;
pkbuf->len += len;
if (ogs_unlikely(pkbuf->tail > pkbuf->end))
ogs_assert_if_reached();
return tmp;
}
@@ -138,12 +144,12 @@ static ogs_inline void ogs_pkbuf_put_u32(ogs_pkbuf_t *pkbuf, uint32_t val)
static ogs_inline void *ogs_pkbuf_push(ogs_pkbuf_t *pkbuf, unsigned int len)
{
if (ogs_unlikely(ogs_pkbuf_headroom(pkbuf) < (int)len))
ogs_assert_if_reached();
pkbuf->data -= len;
pkbuf->len += len;
if (ogs_unlikely(pkbuf->data < pkbuf->head))
ogs_assert_if_reached();
return pkbuf->data;
}
@@ -160,12 +166,19 @@ static ogs_inline void *ogs_pkbuf_pull(ogs_pkbuf_t *pkbuf, unsigned int len)
NULL : ogs_pkbuf_pull_inline(pkbuf, len);
}
static ogs_inline void ogs_pkbuf_trim(ogs_pkbuf_t *pkbuf, unsigned int len)
static ogs_inline int ogs_pkbuf_trim(ogs_pkbuf_t *pkbuf, int len)
{
if (pkbuf->len > len) {
pkbuf->tail = pkbuf->data + len;
pkbuf->len = len;
if (ogs_unlikely(len < 0))
ogs_assert_if_reached();
if (ogs_unlikely(len > pkbuf->len)) {
ogs_error("len(%d) > pkbuf->len(%d)", len, pkbuf->len);
return OGS_ERROR;
}
pkbuf->tail = pkbuf->data + len;
pkbuf->len = len;
return OGS_OK;
}
#ifdef __cplusplus

View File

@@ -70,7 +70,7 @@ int ogs_getnameinfo(
}
#endif
int ogs_getaddrinfo(ogs_sockaddr_t **sa_list,
int ogs_getaddrinfo(ogs_sockaddr_t **sa_list,
int family, const char *hostname, uint16_t port, int flags)
{
*sa_list = NULL;
@@ -93,7 +93,7 @@ int ogs_freeaddrinfo(ogs_sockaddr_t *sa_list)
return OGS_OK;
}
int ogs_addaddrinfo(ogs_sockaddr_t **sa_list,
int ogs_addaddrinfo(ogs_sockaddr_t **sa_list,
int family, const char *hostname, uint16_t port, int flags)
{
int rc;
@@ -246,7 +246,7 @@ int ogs_sortaddrinfo(ogs_sockaddr_t **sa_list, int family)
new->next = addr;
}
}
*sa_list = head;
return OGS_OK;
@@ -312,11 +312,11 @@ ogs_sockaddr_t *ogs_link_local_addr_by_sa(const ogs_sockaddr_t *sa)
return ogs_link_local_addr(NULL, sa);
}
int ogs_filter_ip_version(ogs_sockaddr_t **addr,
int ogs_filter_ip_version(ogs_sockaddr_t **addr,
int no_ipv4, int no_ipv6, int prefer_ipv4)
{
int rv;
if (no_ipv4 == 1) {
rv = ogs_filteraddrinfo(addr, AF_INET6);
ogs_assert(rv == OGS_OK);
@@ -491,7 +491,7 @@ static int parse_ip(
/* supported flavors of IP:
*
* . IPv6 numeric address string (e.g., "fe80::1")
*
*
* IMPORTANT: Don't store IPv4-mapped IPv6 address as an IPv6 address.
*
* . IPv4 numeric address string (e.g., "127.0.0.1")
@@ -506,7 +506,7 @@ static int parse_ip(
if (rc == 1) {
if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ipsub->sub)) {
/* ipsubnet_test() assumes that we don't create IPv4-mapped IPv6
* addresses; this of course forces the user to specify
* addresses; this of course forces the user to specify
* IPv4 addresses in a.b.c.d style instead of ::ffff:a.b.c.d style.
*/
ogs_error("Cannot support IPv4-mapped IPv6: "
@@ -535,7 +535,7 @@ static int looks_like_ip(const char *ipstr)
{
if (strlen(ipstr) == 0)
return 0;
if (strchr(ipstr, ':')) {
/* definitely not a hostname;
* assume it is intended to be an IPv6 address */
@@ -572,13 +572,13 @@ int ogs_ipsubnet(ogs_ipsubnet_t *ipsub,
ogs_assert(ipstr);
/* filter out stuff which doesn't look remotely like an IP address;
* this helps callers like mod_access which have a syntax allowing
* this helps callers like mod_access which have a syntax allowing
* hostname or IP address;
* CORE_EINVAL tells the caller that it was probably not intended
* CORE_EINVAL tells the caller that it was probably not intended
* to be an IP address
*/
if (!looks_like_ip(ipstr)) {
ogs_error("looks_like_ip() is failed");
ogs_error("looks_like_ip(%s, %s) failed", ipstr, mask_or_numbits);
return OGS_ERROR;
}
@@ -587,7 +587,7 @@ int ogs_ipsubnet(ogs_ipsubnet_t *ipsub,
rv = parse_ip(ipsub, ipstr, mask_or_numbits == NULL);
if (rv != OGS_OK) {
ogs_error("parse_ip() is failed");
ogs_error("parse_ip(%s, %s) failed", ipstr, mask_or_numbits);
return rv;
}
@@ -619,7 +619,7 @@ int ogs_ipsubnet(ogs_ipsubnet_t *ipsub,
ipsub->family == AF_INET) {
/* valid IPv4 netmask */
} else {
ogs_error("Bad netmask");
ogs_error("Bad netmask %s", mask_or_numbits);
return OGS_ERROR;
}
}

View File

@@ -53,12 +53,12 @@ void ogs_socket_final(void)
ogs_sock_t *ogs_sock_create(void)
{
ogs_sock_t *sock = NULL;
sock = ogs_calloc(1, sizeof(*sock));
ogs_expect_or_return_val(sock, NULL);
sock->fd = INVALID_SOCKET;
return sock;
}
@@ -131,7 +131,7 @@ int ogs_sock_connect(ogs_sock_t *sock, ogs_sockaddr_t *addr)
ogs_assert(addrlen);
if (connect(sock->fd, &addr->sa, addrlen) != 0) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"socket connect[%s]:%d failed",
OGS_ADDR(addr, buf), OGS_PORT(addr));
return OGS_ERROR;
@@ -255,79 +255,3 @@ int ogs_closesocket(ogs_socket_t fd)
return OGS_OK;
}
int ogs_nonblocking(ogs_socket_t fd)
{
#ifdef _WIN32
int rc;
ogs_assert(fd != INVALID_SOCKET);
u_long io_mode = 1;
rc = ioctlsocket(fd, FIONBIO, &io_mode);
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "ioctlsocket failed");
return OGS_ERROR;
}
#else
int rc;
int flags;
ogs_assert(fd != INVALID_SOCKET);
flags = fcntl(fd, F_GETFL, NULL);
if (flags < 0) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_GETFL failed");
return OGS_ERROR;
}
if (!(flags & O_NONBLOCK)) {
rc = fcntl(fd, F_SETFL, (flags | O_NONBLOCK));
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_SETFL failed");
return OGS_ERROR;
}
}
#endif
return OGS_OK;
}
int ogs_closeonexec(ogs_socket_t fd)
{
#ifndef _WIN32
int rc;
int flags;
ogs_assert(fd != INVALID_SOCKET);
flags = fcntl(fd, F_GETFD, NULL);
if (flags < 0) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_GETFD failed");
return OGS_ERROR;
}
if (!(flags & FD_CLOEXEC)) {
rc = fcntl(fd, F_SETFD, (flags | FD_CLOEXEC));
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_SETFD failed");
return OGS_ERROR;
}
}
#endif
return OGS_OK;
}
int ogs_listen_reusable(ogs_socket_t fd)
{
#if defined(SO_REUSEADDR) && !defined(_WIN32)
int rc;
int on = 1;
ogs_assert(fd != INVALID_SOCKET);
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(int));
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"setsockopt(SOL_SOCKET, SO_REUSEADDR) failed");
return OGS_ERROR;
}
#endif
return OGS_OK;
}

View File

@@ -71,10 +71,6 @@ ssize_t ogs_recvfrom(ogs_socket_t fd,
int ogs_closesocket(ogs_socket_t fd);
int ogs_nonblocking(ogs_socket_t fd);
int ogs_closeonexec(ogs_socket_t fd);
int ogs_listen_reusable(ogs_socket_t fd);
#ifdef __cplusplus
}
#endif

View File

@@ -51,6 +51,8 @@ void ogs_socknode_free(ogs_socknode_t *node)
ogs_assert(node);
ogs_freeaddrinfo(node->addr);
if (node->dev)
ogs_free(node->dev);
if (node->poll)
ogs_pollset_remove(node->poll);
if (node->sock) {
@@ -59,11 +61,13 @@ void ogs_socknode_free(ogs_socknode_t *node)
else
ogs_sock_destroy(node->sock);
}
if (node->option)
ogs_free(node->option);
ogs_free(node);
}
ogs_socknode_t *ogs_socknode_add(
ogs_list_t *list, int family, ogs_sockaddr_t *addr)
ogs_socknode_t *ogs_socknode_add(ogs_list_t *list,
int family, ogs_sockaddr_t *addr, ogs_sockopt_t *option)
{
ogs_socknode_t *node = NULL;
ogs_sockaddr_t *dup = NULL;
@@ -79,6 +83,9 @@ ogs_socknode_t *ogs_socknode_add(
node = ogs_socknode_new(dup);
ogs_assert(node);
ogs_list_add(list, node);
if (option)
node->option = ogs_memdup(option, sizeof *option);
}
return node;
@@ -100,8 +107,8 @@ void ogs_socknode_remove_all(ogs_list_t *list)
ogs_socknode_remove(list, node);
}
int ogs_socknode_probe(
ogs_list_t *list, ogs_list_t *list6, const char *dev, uint16_t port)
int ogs_socknode_probe(ogs_list_t *list, ogs_list_t *list6,
const char *dev, uint16_t port, ogs_sockopt_t *option)
{
#if defined(HAVE_GETIFADDRS)
ogs_socknode_t *node = NULL;
@@ -164,6 +171,8 @@ int ogs_socknode_probe(
node = ogs_calloc(1, sizeof(ogs_socknode_t));
node->addr = addr;
if (dev)
node->dev = ogs_strdup(dev);
if (addr->ogs_sa_family == AF_INET) {
ogs_assert(list);
@@ -173,6 +182,9 @@ int ogs_socknode_probe(
ogs_list_add(list6, node);
} else
ogs_assert_if_reached();
if (option)
node->option = ogs_memdup(option, sizeof *option);
}
freeifaddrs(iflist);
@@ -186,6 +198,7 @@ int ogs_socknode_probe(
}
#if 0 /* deprecated */
int ogs_socknode_fill_scope_id_in_local(ogs_sockaddr_t *sa_list)
{
#if defined(HAVE_GETIFADDRS)
@@ -243,6 +256,7 @@ int ogs_socknode_fill_scope_id_in_local(ogs_sockaddr_t *sa_list)
return OGS_ERROR;
#endif
}
#endif
void ogs_socknode_set_cleanup(
ogs_socknode_t *node, void (*cleanup)(ogs_sock_t *))

View File

@@ -35,23 +35,28 @@ typedef struct ogs_socknode_s {
ogs_lnode_t node;
ogs_sockaddr_t *addr;
char *dev;
ogs_sock_t *sock;
void (*cleanup)(ogs_sock_t *sock);
ogs_poll_t *poll;
ogs_sockopt_t *option;
} ogs_socknode_t;
ogs_socknode_t *ogs_socknode_new(ogs_sockaddr_t *addr);
void ogs_socknode_free(ogs_socknode_t *node);
ogs_socknode_t *ogs_socknode_add(
ogs_list_t *list, int family, ogs_sockaddr_t *sa_list);
ogs_socknode_t *ogs_socknode_add(ogs_list_t *list,
int family, ogs_sockaddr_t *addr, ogs_sockopt_t *option);
void ogs_socknode_remove(ogs_list_t *list, ogs_socknode_t *node);
void ogs_socknode_remove_all(ogs_list_t *list);
int ogs_socknode_probe(
ogs_list_t *list, ogs_list_t *list6, const char *dev, uint16_t port);
int ogs_socknode_probe(ogs_list_t *list, ogs_list_t *list6,
const char *dev, uint16_t port, ogs_sockopt_t *option);
#if 0 /* deprecated */
int ogs_socknode_fill_scope_id_in_local(ogs_sockaddr_t *sa_list);
#endif
void ogs_socknode_set_cleanup(
ogs_socknode_t *node, void (*cleanup)(ogs_sock_t *));

197
lib/core/ogs-sockopt.c Normal file
View File

@@ -0,0 +1,197 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "core-config-private.h"
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#if HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
#include "ogs-core.h"
#undef OGS_LOG_DOMAIN
#define OGS_LOG_DOMAIN __ogs_sock_domain
void ogs_sockopt_init(ogs_sockopt_t *option)
{
ogs_assert(option);
memset(option, 0, sizeof *option);
option->sctp.spp_hbinterval = 5000; /* 5 seconds */
option->sctp.spp_sackdelay = 200; /* 200 ms */
option->sctp.srto_initial = 3000; /* 3 seconds */
option->sctp.srto_min = 1000; /* 1 seconds */
option->sctp.srto_max = 5000; /* 5 seconds */
option->sctp.sinit_num_ostreams = OGS_DEFAULT_SCTP_MAX_NUM_OF_OSTREAMS;
option->sctp.sinit_max_instreams = 65535;
option->sctp.sinit_max_attempts = 4;
option->sctp.sinit_max_init_timeo = 8000; /* 8 seconds */
option->sctp_nodelay = true;
option->tcp_nodelay = true;
}
int ogs_nonblocking(ogs_socket_t fd)
{
#ifdef _WIN32
int rc;
ogs_assert(fd != INVALID_SOCKET);
u_long io_mode = 1;
rc = ioctlsocket(fd, FIONBIO, &io_mode);
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "ioctlsocket failed");
return OGS_ERROR;
}
#else
int rc;
int flags;
ogs_assert(fd != INVALID_SOCKET);
flags = fcntl(fd, F_GETFL, NULL);
if (flags < 0) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_GETFL failed");
return OGS_ERROR;
}
if (!(flags & O_NONBLOCK)) {
rc = fcntl(fd, F_SETFL, (flags | O_NONBLOCK));
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_SETFL failed");
return OGS_ERROR;
}
}
#endif
return OGS_OK;
}
int ogs_closeonexec(ogs_socket_t fd)
{
#ifndef _WIN32
int rc;
int flags;
ogs_assert(fd != INVALID_SOCKET);
flags = fcntl(fd, F_GETFD, NULL);
if (flags < 0) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_GETFD failed");
return OGS_ERROR;
}
if (!(flags & FD_CLOEXEC)) {
rc = fcntl(fd, F_SETFD, (flags | FD_CLOEXEC));
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_SETFD failed");
return OGS_ERROR;
}
}
#endif
return OGS_OK;
}
int ogs_listen_reusable(ogs_socket_t fd, int on)
{
#if defined(SO_REUSEADDR) && !defined(_WIN32)
int rc;
ogs_assert(fd != INVALID_SOCKET);
ogs_debug("Turn on SO_REUSEADDR");
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(int));
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"setsockopt(SOL_SOCKET, SO_REUSEADDR) failed");
return OGS_ERROR;
}
#endif
return OGS_OK;
}
int ogs_tcp_nodelay(ogs_socket_t fd, int on)
{
#if defined(TCP_NODELAY) && !defined(_WIN32)
int rc;
ogs_assert(fd != INVALID_SOCKET);
ogs_debug("Turn on TCP_NODELAY");
rc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int));
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"setsockopt(IPPROTO_TCP, TCP_NODELAY) failed");
return OGS_ERROR;
}
#endif
return OGS_OK;
}
int ogs_so_linger(ogs_socket_t fd, int l_linger)
{
#if defined(SO_LINGER) && !defined(_WIN32)
struct linger l;
int rc;
ogs_assert(fd != INVALID_SOCKET);
memset(&l, 0, sizeof(l));
l.l_onoff = 1;
l.l_linger = l_linger;
ogs_debug("SO_LINGER:[%d]", l_linger);
rc = setsockopt(fd, SOL_SOCKET, SO_LINGER,
(void *)&l, sizeof(struct linger));
if (rc != OGS_OK) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"setsockopt(SOL_SOCKET, SO_LINGER) failed");
return OGS_ERROR;
}
#endif
return OGS_OK;
}
int ogs_bind_to_device(ogs_socket_t fd, const char *device)
{
#if defined(SO_BINDTODEVICE) && !defined(_WIN32)
int rc;
ogs_assert(fd != INVALID_SOCKET);
ogs_assert(device);
ogs_debug("SO_BINDTODEVICE:[%s]", device);
rc = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1);
if (rc != OGS_OK) {
int err = ogs_errno;
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"setsockopt(SOL_SOCKET, SO_BINDTODEVICE, %s) failed", device);
if (err == OGS_EPERM)
ogs_error("You need to grant CAP_NET_RAW privileges to use SO_BINDTODEVICE.");
return OGS_ERROR;
}
#endif
return OGS_OK;
}

68
lib/core/ogs-sockopt.h Normal file
View File

@@ -0,0 +1,68 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_SOCKOPT_H
#define OGS_SOCKOPT_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ogs_sockopt_s {
struct {
uint32_t spp_hbinterval;
uint32_t spp_sackdelay;
uint32_t srto_initial;
uint32_t srto_min;
uint32_t srto_max;
uint16_t sinit_num_ostreams;
uint16_t sinit_max_instreams;
uint16_t sinit_max_attempts;
uint16_t sinit_max_init_timeo;
} sctp;
bool sctp_nodelay;
bool tcp_nodelay;
struct {
bool l_onoff;
int l_linger;
} so_linger;
const char *so_bindtodevice;
} ogs_sockopt_t;
void ogs_sockopt_init(ogs_sockopt_t *option);
int ogs_nonblocking(ogs_socket_t fd);
int ogs_closeonexec(ogs_socket_t fd);
int ogs_listen_reusable(ogs_socket_t fd, int on);
int ogs_tcp_nodelay(ogs_socket_t fd, int on);
int ogs_so_linger(ogs_socket_t fd, int l_linger);
int ogs_bind_to_device(ogs_socket_t fd, const char *device);
#ifdef __cplusplus
}
#endif
#endif /* OGS_SOCKOPT_H */

View File

@@ -22,21 +22,38 @@
#undef OGS_LOG_DOMAIN
#define OGS_LOG_DOMAIN __ogs_sock_domain
ogs_sock_t *ogs_tcp_server(ogs_socknode_t *node)
ogs_sock_t *ogs_tcp_server(
ogs_sockaddr_t *sa_list, ogs_sockopt_t *socket_option)
{
int rv;
ogs_sock_t *new = NULL;
ogs_sockaddr_t *addr;
char buf[OGS_ADDRSTRLEN];
ogs_assert(node);
ogs_assert(node->addr);
ogs_sock_t *new = NULL;
ogs_sockaddr_t *addr;
ogs_sockopt_t option;
addr = node->addr;
ogs_assert(sa_list);
ogs_sockopt_init(&option);
if (socket_option)
memcpy(&option, socket_option, sizeof option);
addr = sa_list;
while(addr) {
new = ogs_sock_socket(addr->ogs_sa_family, SOCK_STREAM, IPPROTO_TCP);
if (new) {
rv = ogs_listen_reusable(new->fd);
if (option.tcp_nodelay == true) {
rv = ogs_tcp_nodelay(new->fd, true);
ogs_assert(rv == OGS_OK);
} else
ogs_warn("TCP NO_DELAY Disabled");
if (option.so_linger.l_onoff == true) {
rv = ogs_so_linger(new->fd, option.so_linger.l_linger);
ogs_assert(rv == OGS_OK);
}
rv = ogs_listen_reusable(new->fd, true);
ogs_assert(rv == OGS_OK);
if (ogs_sock_bind(new, addr) == OGS_OK) {
@@ -54,31 +71,47 @@ ogs_sock_t *ogs_tcp_server(ogs_socknode_t *node)
if (addr == NULL) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"tcp_server() [%s]:%d failed",
OGS_ADDR(node->addr, buf), OGS_PORT(node->addr));
OGS_ADDR(sa_list, buf), OGS_PORT(sa_list));
return NULL;
}
rv = ogs_sock_listen(new);
ogs_assert(rv == OGS_OK);
node->sock = new;
return new;
}
ogs_sock_t *ogs_tcp_client(ogs_socknode_t *node)
ogs_sock_t *ogs_tcp_client(
ogs_sockaddr_t *sa_list, ogs_sockopt_t *socket_option)
{
ogs_sock_t *new = NULL;
ogs_sockaddr_t *addr;
int rv;
char buf[OGS_ADDRSTRLEN];
ogs_assert(node);
ogs_assert(node->addr);
ogs_sock_t *new = NULL;
ogs_sockaddr_t *addr;
ogs_sockopt_t option;
addr = node->addr;
ogs_assert(sa_list);
ogs_sockopt_init(&option);
if (socket_option)
memcpy(&option, socket_option, sizeof option);
addr = sa_list;
while (addr) {
new = ogs_sock_socket(addr->ogs_sa_family, SOCK_STREAM, IPPROTO_TCP);
if (new) {
if (option.sctp_nodelay == true) {
rv = ogs_tcp_nodelay(new->fd, true);
ogs_assert(rv == OGS_OK);
} else
ogs_warn("TCP NO_DELAY Disabled");
if (option.so_linger.l_onoff == true) {
rv = ogs_so_linger(new->fd, option.so_linger.l_linger);
ogs_assert(rv == OGS_OK);
}
if (ogs_sock_connect(new, addr) == OGS_OK) {
ogs_debug("tcp_client() [%s]:%d",
OGS_ADDR(addr, buf), OGS_PORT(addr));
@@ -94,11 +127,9 @@ ogs_sock_t *ogs_tcp_client(ogs_socknode_t *node)
if (addr == NULL) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"tcp_client() [%s]:%d failed",
OGS_ADDR(node->addr, buf), OGS_PORT(node->addr));
OGS_ADDR(sa_list, buf), OGS_PORT(sa_list));
return NULL;
}
node->sock = new;
return new;
}

View File

@@ -28,8 +28,10 @@
extern "C" {
#endif
ogs_sock_t *ogs_tcp_server(ogs_socknode_t *node);
ogs_sock_t *ogs_tcp_client(ogs_socknode_t *node);
ogs_sock_t *ogs_tcp_server(
ogs_sockaddr_t *sa_list, ogs_sockopt_t *socket_option);
ogs_sock_t *ogs_tcp_client(
ogs_sockaddr_t *sa_list, ogs_sockopt_t *socket_option);
#ifdef __cplusplus
}

Some files were not shown because too many files have changed in this diff Show More