Compare commits

...

172 Commits

Author SHA1 Message Date
Sukchan Lee
7ba77e6cc1 Release v2.2.1 2021-03-15 10:09:45 +09:00
Sukchan Lee
37e0a714f9 Fixes UE IPv6 BUG (#808) 2021-03-15 10:01:55 +09:00
Sukchan Lee
0270c0e340 ASN.1 encoding failure if no Request-NSSAI #844 2021-03-12 23:25:58 +09:00
Sukchan Lee
a6e42a4932 fix: No S-NSSAI error during NAS signalling #845 2021-03-12 22:45:21 +09:00
Sukchan Lee
0a94e1ece4 Update WebUI version to v2.2.1 (#838)
Security patch is applied. If you want to use this version, you need to
log out and log back in.

See Pull Request #838 for more detailed information.
2021-03-12 09:32:11 +09:00
Sukchan Lee
569f98f92c webui: Follow-up on Pull Request #838
- Update document
- Fix the install script
- Remove last commit to maintain login session
2021-03-12 09:20:58 +09:00
Ryan
7848b6c966 Add API tokens (#838)
* protects db endpoints with auth data, but will require ui updates to function properly

* adds an Authorization header with bearer token to all api/db/* request endpoints

* force login if token doesn't exist

* remove debug code
2021-03-12 09:13:38 +09:00
Sukchan Lee
60b75b5f5e rearrange sponsors image 2021-03-11 16:52:58 +09:00
Sukchan Lee
82261bc8e4 Arrange the sponsor images 2021-03-11 16:42:13 +09:00
Sukchan Lee
9e8700f1a2 Add new sponsors (Skylark Wireless) 2021-03-11 16:37:18 +09:00
Sukchan Lee
fc5c9b2af0 Try to fix the UE infinite attach (#568)
If both Delete-Session-Request/Response and
UEContextReleaseCommand/UEContextReleaseComplete are failed at the same time,
UE cannot attach to the EPC infinitely.

So, I've add the protection code
if timer expires when MME does not receive Delete-Session-Response.
2021-03-09 14:28:07 +09:00
Sukchan Lee
56c0987ad2 doc: update document for changes configuration
o `plmn` -> `plmn_support` in AMF configuration
2021-03-08 22:30:06 +09:00
Sukchan Lee
08751e1b4a doc: update document for changing configuration
o 'pdn' -> 'subnet' in all conf files
2021-03-08 22:27:29 +09:00
Sukchan Lee
de72ccaf91 Release v2.2.0 2021-03-08 21:55:43 +09:00
Sukchan Lee
9af4268bab arch: DB schema Changes (#796)
- New function : NSSF
- New feature : SMF selection
2021-03-08 21:25:09 +09:00
Sukchan Lee
c6bfbed922 Modify not to limit the length of DB URI (#827) 2021-03-03 23:13:20 +09:00
Charlie Lewis
0790674c14 mask mongo credentials when logging (#827) 2021-03-03 23:06:31 +09:00
Sukchan Lee
2f2178595d doc: update troubleshooting (#818) 2021-02-25 23:01:48 -05:00
Paweł
515b5d2b17 Changed the branch name (#811) 2021-02-22 10:24:18 -05:00
Sukchan Lee
31977bf30a SMF: fix the bug for DataForwardingNotPossible
DataForwardingNotPossible should only be included
if Data Path is not available during N2-Handover.

However, there is a bug that always includes
DataFowardingNotPossible regardless of Handover.

So, I've fixed it!
2021-02-18 23:15:36 -05:00
Sukchan Lee
d1400897e0 update: Cause of UEContextReleaseCommand (#789)
When AMF receives UEContextReleaseRequest,
AMF sends UEContextReleaseCommand with Cause received from gNB.
2021-02-17 12:19:20 -05:00
Sukchan Lee
b6bcbac3e3 fix: Add the exception handling (#804)
When UE/gNB repeatedly sends NGAP message repeatedly, AMF crashed.
Exception routines have been added to resolve this issue.
2021-02-15 12:17:33 -05:00
Sukchan Lee
9b5cc4a568 Release v2.1.7 2021-02-08 22:37:01 -05:00
Sukchan Lee
094d40b073 fix: 256 pool num increased to 16,384 (#753) 2021-02-08 14:32:04 -05:00
Sukchan Lee
852756f902 test: Porting FreeBSD 2021-02-08 14:25:40 -05:00
Miguel
fea48f5a44 Update list of eNB/gNB - Added Accelleran's SC (#800) 2021-02-08 07:24:59 -05:00
Sukchan Lee
b19b3e9dd1 Add missing files 2021-02-06 00:15:25 -05:00
Sukchan Lee
7901a1164f mac: Support Apple M1 chips
See https://open5gs.org/open5gs/docs/platform/05-macosx-apple-silicon/
2021-02-06 00:13:48 -05:00
Sukchan Lee
950c4c0a12 Release v2.1.6 2021-02-04 09:27:58 -05:00
Sukchan Lee
5e839e25fe fix: amf crash bug (#793) 2021-02-03 23:49:16 -05:00
Sukchan Lee
d3fa7619bf update document v2.1.5 2021-02-02 15:29:24 -05:00
Sukchan Lee
6cd755ac97 doc: Update document v2.1.5 2021-02-02 15:22:50 -05:00
Sukchan Lee
f597c9e899 doc: update document for v2.1.5 2021-02-02 15:18:01 -05:00
Sukchan Lee
9e8303762c Update document for v2.1.5 2021-02-02 15:07:18 -05:00
Sukchan Lee
e7c261d0d3 Release v2.1.5 2021-02-02 14:50:15 -05:00
Sukchan Lee
e7cb25ac9b asn1c: MME crash is resolved (#783) 2021-02-02 14:27:03 -05:00
Sukchan Lee
f47f65a51c fix: asn1c decode problem for NGReset (#773) 2021-02-02 13:33:09 -05:00
Sukchan Lee
0311d2255c Oops! remove debug info 2021-02-01 10:17:49 -05:00
Sukchan Lee
d9417be9a6 feat: Handling Duplicated PDU Session ID
TS29.502 5.2.2.3.11 AMF requested PDU Session Release due to duplciated
PDU Session Id
2021-02-01 10:14:27 -05:00
Sukchan Lee
373ba1452f log: update debug info for S1AP/NGAP (#785) 2021-02-01 08:52:22 -05:00
smartVan
848b7ffc29 modify handover request and uplink ran status transfer debug info (#785) 2021-02-01 00:50:22 -05:00
Sukchan Lee
ff5236f3e0 feat: Indirect Data Forwarding in N2-Handover 2021-01-31 23:01:15 -05:00
Sukchan Lee
388e64213f etc: miscellaneous work (#779)
o Check IMEISV length == 16 digits
o Add Relative Capabity comment in the configuration file
2021-01-29 00:10:17 -05:00
Sukchan Lee
49a9e58efe feat: Add N2-Handover 2021-01-28 14:23:54 -05:00
Sukchan Lee
0fc5190a09 etc: coding convection (#778) 2021-01-28 14:23:22 -05:00
smartVan
19014a3a25 modify udr smf selection subscription data (#778) 2021-01-28 14:18:02 -05:00
Sukchan Lee
ada01fca8f spec: S1AP/NGAP update to v16.4.0(2021-01-04) 2021-01-24 23:43:42 -05:00
Sukchan Lee
61778f9142 fix: UE Context Request IE handling (#771) 2021-01-23 13:42:59 -05:00
Sukchan Lee
776d323a16 fix: Change UE Context Request IE handling (#771)
Previously, AMF would sends PDUSessionResourceSetupRequest
when the following conditions were met:
- gNB didn't send UE Context Request IE of InitialUEMessage
- AMF should send SMF generated TRANSFER message(PDU_RES_SETUP_REQ)
to the gNB

However, in issues #771, the gNB did not accept
PDUSessionResourceSetupRequest. Perhaps the gNB engineer thought
that if gNB needs to send data traffic to the UE, AMF should send
an InitialContextSetupRequest regardless of UE Context Request IE.
This is because gNB requires the kgNB security context
for data connection.

So, in this case, Open5GS-AMF decided to send
an InitialContexSetupRequest regardless of
whether it received UE Context Request IE of InitialUEMessage.
2021-01-23 11:56:04 -05:00
Sukchan Lee
9eac90252e fix: AMF/SMF/UDM crash issues resolved (#770/#771) 2021-01-22 22:17:01 -05:00
Sukchan Lee
708784e222 fix: User Location in UplinkNASTrasnport (#772)
- Based on pull request #772
- Add 4G EPC User Location Information handling
- Copy ran_ue/enb_ue context to amf_ue/mme_ue context
2021-01-20 10:03:32 -05:00
smartVan
50db1aaeb1 handle user location in ngap uplink nas transport (#772) 2021-01-20 09:27:57 -05:00
Sukchan Lee
8e29eb2417 Update document for v2.1.4 2021-01-18 21:35:08 -05:00
Sukchan Lee
0552bc49c9 Release v2.1.4 2021-01-18 19:16:24 -05:00
Sukchan Lee
c9363b1320 5gc: Paging was added 2021-01-18 11:48:35 -05:00
Sukchan Lee
408c378b94 doc: update sponsor link 2021-01-13 08:38:24 -05:00
Sukchan Lee
bfa6eae71c Oops! remove style tag 2021-01-11 23:53:40 -05:00
Sukchan Lee
55e9f08430 Add special sponsors 2021-01-11 11:10:17 -05:00
Supreeth Herle
1c13d7f5ec Legacy support for pre-release LTE 11 devices while performing VoLTE call (#757)
* AAR Media-Sub-Component modification for more UEs support

* Introduce parameter for legacy support for pre-release LTE 11 devices to do calling

IE (IPV4-local-addr field ) is not supported on
the LTE pre release-11 UEs. In order for the call
to work the local address in packet filter must
be replaced by any.

Parameter: no_ipv4v6_local_addr_in_packet_filter
2021-01-11 08:03:52 -05:00
Sukchan Lee
8d0ce5b03c Oops! Remove bearer after sending reject (#755) 2021-01-11 00:01:28 -05:00
Sukchan Lee
5fb0611cb2 fix: Derive ESM cause from GTP-Cause (#755) 2021-01-10 23:36:12 -05:00
Sukchan Lee
d6ed13968d Release v2.1.3 2021-01-08 23:22:22 -05:00
Sukchan Lee
f15d2c96fe remove math library for time string conversion 2021-01-08 23:16:54 -05:00
Sukchan Lee
508a78d43b Update document for v2.1.3 2021-01-08 22:58:23 -05:00
Sukchan Lee
f250b6e411 Release v2.1.3 2021-01-08 22:48:43 -05:00
Sukchan Lee
d17ea0f135 fix: update test code 2021-01-08 22:30:31 -05:00
Sukchan Lee
b4358fe703 fix: Add dedicated bearer activation reject (#755) 2021-01-08 15:09:02 -05:00
Sukchan Lee
e531ccab5a fix: The SBI time string converting error in 32bit 2021-01-08 10:42:51 -05:00
Sukchan Lee
a0ebf20c88 Release v2.1.2 2021-01-08 00:30:45 -05:00
Sukchan Lee
31cc259ee4 fix: release error 2021-01-08 00:24:00 -05:00
Sukchan Lee
e803b01d9c Update document for v2.1.2 2021-01-07 23:39:17 -05:00
Sukchan Lee
0c61e7b70b Release v2.1.2 2021-01-07 23:07:09 -05:00
Sukchan Lee
80e337b465 fix: update to avoid MME crash (#721) 2021-01-07 23:01:02 -05:00
Sukchan Lee
6946dc4998 fix: update to avoid MME crash (#708) 2021-01-07 22:41:13 -05:00
Sukchan Lee
7b29cdf898 Handling UEContextRequest of InitialUEMessage 2021-01-07 22:26:06 -05:00
Sukchan Lee
7dd4609c0f fix: increase mempool to support 1024UEs (#753) 2021-01-07 13:18:45 -05:00
smartVan
060d2a08f5 remove repeated qer in handling create pdr (#749) 2021-01-06 23:32:12 -05:00
Sukchan Lee
c9cfc4cf6e etc: update debug message 2021-01-04 23:24:22 -05:00
Sukchan Lee
a96d3ca0fa feat: Add multiple session 2021-01-03 23:29:01 -05:00
Sukchan Lee
1238b30526 Oops! remove test code 2021-01-03 01:07:09 -05:00
Sukchan Lee
70a7bac6b2 feat: Add 5G Core Xn Handover (#726) 2021-01-03 00:50:59 -05:00
Sukchan Lee
b329b09573 fix: add SCTP ppid and stream_no (#743) 2021-01-02 10:03:35 -05:00
Sukchan Lee
88346c0141 fix: SBI heartbeat timer usage changed (#741) 2021-01-01 15:56:46 -05:00
Sukchan Lee
b35eb9fcf4 fix: Receive HTTP2 message up to 8192bytes (#738) 2020-12-31 22:36:33 -05:00
Sukchan Lee
79b0552bb0 test: for checking issues #736 2020-12-31 21:55:11 -05:00
Sukchan Lee
235a041b8d feat: Add dedicated QoS flow 2020-12-31 21:07:08 -05:00
Sukchan Lee
65aea5ebf2 test: Use milliseconds in RFC3339 (#727) 2020-12-29 13:26:36 -05:00
Sukchan Lee
4115799c2a fix: NRF notification send all information (#737) 2020-12-28 23:36:02 -05:00
Sukchan Lee
efd1780745 fix: update NRF issues (#727,#728,#729,#730) 2020-12-24 15:41:31 -05:00
Kenny Barlee
dcec18a3d8 Doc update - 01 Quickstart (#731)
* text update 01-quickstart

* text update, diagrams 01-quickstart
2020-12-23 16:25:26 -05:00
Sukchan Lee
371e22c96b fix: AMF sets default DNN if UE does not send it. 2020-12-21 14:49:05 -05:00
Tim Gates
171f15f684 docs: fix simple typo, speciic -> specific (#724)
There is a small typo in lib/asn1c/common/constr_TYPE.h.

Should read `specific` rather than `speciic`.
2020-12-19 16:10:00 -05:00
Sukchan Lee
ef3e7b2528 docs: update release notes for v2.1.1 2020-12-16 23:11:19 -05:00
Sukchan Lee
7002c1e4b5 Release v2.1.1 2020-12-16 23:06:27 -05:00
Sukchan Lee
2392f23d7f fix: the unexpected PDN type error (#721) 2020-12-16 22:44:32 -05:00
Sukchan Lee
2bf8d6c3c7 Update document for v2.1.0 2020-12-11 14:37:17 -05:00
Sukchan Lee
191f109f7f Release v2.1.0 2020-12-11 14:16:45 -05:00
Sukchan Lee
198abc6e8b Add PCF(Policy Control Function) 2020-12-11 14:03:20 -05:00
Jose Carlos
fb95725ca4 Update 01-genodebs.md (#710) 2020-12-08 15:15:35 -05:00
Sukchan Lee
41fd851b7f fix: SCTP workaround for PEER_ADDR_PARAMS (#707) 2020-12-06 17:34:22 -05:00
Sukchan Lee
d16d295708 docs: update quickstart for nightly builds #685 2020-12-03 22:44:40 -05:00
Sukchan Lee
5999bd22f9 Update document for adding tutorial #702 2020-12-03 10:05:25 -05:00
Sukchan Lee
33edd12335 fix: UPF is not working with Landslide (#685)
* Flow-Description use 'to assigned' in Gx Interface
* Support SDF Filter ID
* Support F-TEID's Choose
* BAR(Buffering) is added in PFCP session
* Default Apply Action uses NOCP|BUFF
2020-12-03 01:16:57 -05:00
Shigeru Ishida
b2d012c253 update Misc Radio Hardware (#700) 2020-12-02 20:30:36 -05:00
Kenny Barlee
e5a9156444 update 4G 5G software stack + SDR list (#699) 2020-12-02 17:22:05 -05:00
Sheng Zheng
90123efae3 Add Gemtek 4G small cell to eNodeB support list (#698)
Signed-off-by: ZhengSheng <j13tw@yahoo.com.tw>
2020-12-02 09:53:45 -05:00
Nick
c424796955 Doc Update - Added list of eNodeBs / gNodeBs confirmed to work by community, links to CSFB & SMS Docs (#694)
* Update docs.md

Added link to Hardware Specific notes

* Added link to posts on SMS over NAS and CSFB Setup

* Formatting on eNB list

* Added UERANSIM
2020-12-01 07:02:55 -05:00
Sukchan Lee
1c997c4069 Update docuemt for MacOSX 2020-11-28 22:38:46 -05:00
Sukchan Lee
3be76db08a Update document 2020-11-26 21:52:54 -05:00
Sukchan Lee
0742c6208c Add missing work after supporting HTTP/2 2020-11-26 21:47:53 -05:00
Sukchan Lee
2c2b6dfcaf Use HTTP/2 instead of HTTP/1.1 in 5G Core SBI 2020-11-26 21:44:37 -05:00
Sukchan Lee
0c47098c4a About parameter "use_openair" #688 2020-11-26 00:03:13 -05:00
Sukchan Lee
1a7b4de7c6 Fix the error message in UPF #685 2020-11-24 00:50:56 -05:00
Sukchan Lee
19a3680c60 change the directory location for vagrant #684 2020-11-24 00:28:42 -05:00
Dan Gora
520d9cd2c3 Centos devel (#684)
* Remove invalid link in debian docker file.

Remove self-referential link from debian docker setup.

Fixes bug introduced in commit 8c4a50785

* Add Vagrantfile to create CentOS 8 system for deploying open5GS.

This Vagrantfile is identical to the base CentOS 8 box from Vagrant
Cloud, but was modified to increase the amount of virtual memory to
1GB from 512MB.

* Update installation instructions for CentOS 8.

Update the installation instructions for CentOS 8 to describe
step-by-step the commands necessary to install the necessary
prerequesites for building and running Open5GS, installing and building
the source code, and running the base tests to confirm that Open5GS
was built correctly.
2020-11-24 00:23:56 -05:00
R. Medeiros
3c99af7736 Update to generate SMF Log for Session Removed. (#677)
Create info log to show when the user disconnect the APN, with IMSI, APN and IPv4/IPv6.
2020-11-19 16:11:28 -05:00
Sukchan Lee
dcf0a714aa Update document for v2.0.22 2020-11-19 09:44:28 -05:00
Sukchan Lee
e1a2e3803f Release v2.0.22 2020-11-19 07:57:35 -05:00
Sukchan Lee
f0b9a35962 [#672] Fix DL data is not working in 5G Core 2020-11-19 07:47:26 -05:00
R. Medeiros
70f7e2d5d4 Update s5c-handler.c (#674)
Add information of the used APN in the smf log file
2020-11-18 16:33:02 -05:00
Sukchan Lee
f4c6791227 Sponsor update 2020-11-16 10:02:27 -05:00
Nick
ee964d825c Update docs.md (#668)
Added links to some recent posts I did on Static IPs and using UERANSIM
2020-11-16 07:18:26 -05:00
Sukchan Lee
b9fdc0ab44 Update 80 column and Apply MME (#659) 2020-11-14 10:13:29 -05:00
list1982
0b2ba07f97 Update ngap-sm.c (#659)
AMF should not process any NGAP message before it finish the NGSetup procedure in 3GPP 38413.
2020-11-14 10:09:57 -05:00
Sukchan Lee
fe7525a784 Support Openair UE (#651)
In mme.yaml
parameter:
   use_openair: true
2020-11-13 09:02:42 -05:00
Sukchan Lee
d7c188dc00 License update 2020-11-12 20:58:08 -05:00
Sukchan Lee
961db54c2f add missing files for Ubuntu groovy 2020-11-12 14:35:58 -05:00
Sukchan Lee
1f1a741e53 FreeBSD is no longer supported. 2020-11-12 14:35:05 -05:00
Sukchan Lee
e6e825c6a3 update docuemtn for v2.0.21 2020-11-11 14:40:24 -05:00
Sukchan Lee
cbb3758c9c Release v2.0.21 2020-11-11 14:13:48 -05:00
Sukchan Lee
6f11a78079 If SCTP use SOCK_STREAM, Use BUFFERING method.
Most of the time, an application wants to perform some amount of data buffering
in addition to just responding to events. When we want to write data,
for example, the usual pattern runs something like:

1. Decide that we want to write some data to a connection;
   put that data in a buffer.
2. Wait for the connection to become writable
3. Write as much of the data as we can
4. Remember how much we wrote, and if we still have more data to write,
   wait for the connection to become writable again.

Now, Open5GS implements the above method by default when transmitting data
in a stream type socket.
2020-11-11 13:21:32 -05:00
Sukchan Lee
9a1824f6aa Openair UE workaround for HashMME #651, #584 2020-11-10 10:04:09 -05:00
Sukchan Lee
23e8e6577c Update ogs_pollset library
- Fix the ogs_pollset_remove() bug in select(WIN32), kqueue(MacOSX)
- Modify to enable ogs_pollset_remove() in pollset callback handler
2020-11-09 22:57:14 -05:00
Sukchan Lee
830587a250 Fix the possible vulnerabilities 2020-11-07 21:25:53 -05:00
Sukchan Lee
f1a207fd9b Support VoLTE service in ECM-IDLE 2020-11-07 17:27:12 -05:00
Sukchan Lee
2d3b8eed81 Fix MME crash if SGs interface is down #448, #628 2020-11-04 15:58:16 -05:00
Sukchan Lee
18c3a4d5d9 Update financial sponsors 2020-11-04 13:32:39 -05:00
Sukchan Lee
8975613ae9 Update document for previous commit #535, #595 2020-11-03 20:24:06 -05:00
Sukchan Lee
621145d8b0 Add rpath to required shared library #535, #595 2020-11-03 20:11:30 -05:00
Sukchan Lee
5af01d1a71 Add the exception for no 2G/3G environment #627 2020-11-03 05:54:12 -05:00
Sukchan Lee
ad85c12513 checking for APN/DNN in case insensitive #617 2020-11-02 11:45:14 -05:00
Sukchan Lee
b80554e955 Document update for v2.0.20 2020-11-01 23:13:10 -05:00
Sukchan Lee
13c7f30e39 Release v2.0.20 2020-11-01 23:07:08 -05:00
Sukchan Lee
21595426b2 Fix the bug of the TAU update result value #568 2020-11-01 22:50:41 -05:00
Sukchan Lee
d1e643ed6c Re-release v2.0.19 2020-11-01 01:51:00 -04:00
Sukchan Lee
22e98d612a fix the compile error 2020-11-01 01:44:59 -04:00
Sukchan Lee
48bf4a763a Re-release v2.0.19 2020-11-01 01:01:41 -04:00
Sukchan Lee
3fef5848b8 Oops! Fix the PDN connectivity reject handler #568 2020-11-01 00:54:32 -04:00
Sukchan Lee
a679ea56a8 Document update for v2.0.19 2020-10-31 23:18:50 -04:00
Sukchan Lee
080c6a9002 Release v2.0.19 2020-10-31 22:54:45 -04:00
Sukchan Lee
5fd6dac961 Change handling the PDU connectivity reject #568
If MME received the PDU connectivity reject, MME will not release UE
context to accept further service request
2020-10-31 22:42:49 -04:00
Sukchan Lee
f137d1947f Last Modification for releasing v2.0.19
1. SCTP event size workaround - stolen code from libosmo-netif
2. Remove PFCP User Plane IP resource information
3. Fix the bug when building Initial Context Setup Request with EMM NAS message.
2020-10-31 00:30:42 -04:00
Sukchan Lee
0ec0b2dc69 Fix the crash for NAS message missing #619 2020-10-29 00:18:11 -04:00
Sukchan Lee
93312e8f3d Fix the bug for S1-reset or eNB-restart(#627) 2020-10-28 22:59:27 -04:00
Sukchan Lee
3cbec5f2e6 License update 2020-10-26 22:43:47 -04:00
Sukchan Lee
4f2803c058 Re-add feature custom GTP-U address #367
Provide custom SGW-U GTP-U address to be advertised inside S1AP messages.
And also, custom UPF GTP-U address to be advertised inside NGAP messages.
2020-10-26 21:44:50 -04:00
Sukchan Lee
a470131489 Now, F-TEID is allocated in the UP function. 2020-10-25 22:43:53 -04:00
Sukchan Lee
aa81bb2c89 Fix the bug #619
When missing Activate default EPS bearer context accept
between UE and eNB, MME's exception handler has a bug.

So I've fixed it!
2020-10-23 13:48:39 -04:00
Sukchan Lee
15e42bc4a9 Fix MME crash when VoLTE is enabled [#619] 2020-10-22 17:53:13 -04:00
Sukchan Lee
bdeea7ce8b Add troubleshoot for #621 2020-10-21 22:54:40 -04:00
Sukchan Lee
39aa726543 Remove the redundant assertion (#619) 2020-10-20 22:50:44 -04:00
Sukchan Lee
1bed0d5872 [#568] Add GTP-U Error Indication Handling
So far, no operation was performed when Error Indication was received
from eNodeB. For that reason, I solved #568 issues by controlling
the MME to prevent this from happening.

Now, when GTP-U Error Indication is received, MME and SGW are implemented
to do what they have to do. I hope that the network can be restored
by responding appropriately even if Error Indication occurs.
2020-10-20 20:00:02 -04:00
Sukchan Lee
c244dcc5e9 Fix the DIAMETER_MISSING_AVP on Rx #610 2020-10-16 14:05:49 -04:00
Sukchan Lee
c052193a37 update it 2020-10-16 13:12:43 -04:00
Sukchan Lee
50149dd1a7 update it 2020-10-16 12:45:23 -04:00
Sukchan Lee
5bfaac17e0 Fix typo in document (#613) 2020-10-15 11:25:51 -04:00
Sukchan Lee
c424099200 Need to test later! 2020-10-14 23:02:18 -04:00
list1982
06ec924466 Update ngap-build.c (#607)
add path switch request ack
2020-10-14 22:56:29 -04:00
list1982
6ff129e9da Update ngap-handler.c (#606)
add path switch request handler
2020-10-14 22:56:18 -04:00
Sukchan Lee
fae76f9e9d Update document for #587 2020-10-13 12:55:31 -04:00
Sukchan Lee
f294a5f55c Add Environment Variable for WebUI [#587]
e.g)
$ HOSTNAME=localhost npm run dev
$ PORT=4000 npm run dev
2020-10-13 12:39:45 -04:00
Sukchan Lee
5c9b3d09d8 Update document for v2.0.18 2020-10-09 07:54:08 -04:00
4344 changed files with 400160 additions and 119871 deletions

2
.gitignore vendored
View File

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

View File

@@ -2,14 +2,24 @@
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">Special Sponsors</h3>
<!--special start-->
<p align="center">
<h3 align="center">Special Sponsor</h3>
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://nextepc.com/" target="_blank">
<img width="260px" src="https://open5gs.org/assets/img/nextepc_logo.jpg">
</a>
</p>
</td>
<td width="20px"></td>
<td align="center" valign="middle">
<a href="https://sdr.eee.strath.ac.uk/" target="_blank">
<img width="260px" src="https://open5gs.org/assets/img/strath.png">
</a>
</td>
</tr>
</tbody>
</table>
<h3 align="center">Sponsors</h3>
<table>
@@ -20,12 +30,24 @@ If you find Open5GS useful for work, please consider supporting this Open Source
<img width="222px" src="https://open5gs.org/assets/img/asLogonew.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.wearetriple.com/" target="_blank">
<img width="222px" src="https://open5gs.org/assets/img/triple_logo.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.accessparks.com/" target="_blank">
<img width="222px" src="https://open5gs.org/assets/img/AccessParks.png">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://skylarkwireless.com/" target="_blank">
<img width="222px" src="https://open5gs.org/assets/img/SkylarkWireless-420x78-Web2-R.png">
</a>
</td>
</tr>
</tbody>
</table>
@@ -33,9 +55,11 @@ If you find Open5GS useful for work, please consider supporting this Open Source
If you don't understand something about Open5GS, the [https://open5gs.org/open5gs/docs/](https://open5gs.org/open5gs/docs/) is a great place to look for answers.
## Technical Discussion
## Community
Problem with Open5GS can be filed as [issues](https://github.com/open5gs/open5gs/issues) in this repository. Voice and text chat available in Open5GS's [Discord](https://discordapp.com/) workspace. Use [this link](https://discord.gg/GreNkuc) to get started.
- Problem with Open5GS can be filed as [issues](https://github.com/open5gs/open5gs/issues) in this repository.
- Other topics related to this project are happening on the [discussions](https://github.com/open5gs/open5gs/discussions).
- Voice and text chat are available in Open5GS's [Discord](https://discordapp.com/) workspace. Use [this link](https://discord.gg/GreNkuc) to get started.
## Contributing

View File

@@ -9,6 +9,8 @@ parameter:
# no_upf: true
# no_ausf: true
# no_udm: true
# no_pcf: true
# no_nssf: true
# no_udr: true
# no_mme: true
# no_sgwc: true
@@ -66,14 +68,17 @@ smf:
sbi:
- addr: 127.0.0.4
port: 7777
pfcp:
- addr: 127.0.0.4
gtpc:
- addr: 127.0.0.4
- addr: ::1
pfcp:
gtpu:
- addr: 127.0.0.4
pdn:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -128,19 +133,19 @@ amf:
amf_name: open5gs-amf0
sgwu:
gtpu:
- addr: 127.0.0.6
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
hss:
freeDiameter:
@@ -194,7 +199,32 @@ udm:
- addr: 127.0.0.12
port: 7777
udr:
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: ::1
port: 7777
s_nssai:
sst: 1
- addr: 127.0.0.19
port: 7777
s_nssai:
sst: 1
sd: 000080
- addr: 127.0.0.10
port: 7777
s_nssai:
sst: 1
sd: 009000
udr:
sbi:
- addr: 127.0.0.20
port: 7777

View File

@@ -9,6 +9,8 @@ parameter:
# no_upf: true
# no_ausf: true
# no_udm: true
# no_pcf: true
# no_nssf: true
# no_udr: true
# no_mme: true
# no_sgwc: true
@@ -97,17 +99,20 @@ sgwc:
- addr: 127.0.0.3
smf:
sbi:
# sbi:
# - addr: 127.0.0.4
# port: 7777
pfcp:
- addr: 127.0.0.4
port: 7777
gtpc:
- addr: 127.0.0.4
- addr: ::1
pfcp:
gtpu:
- addr: 127.0.0.4
pdn:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -162,19 +167,19 @@ amf:
amf_name: open5gs-amf0
sgwu:
gtpu:
- addr: 127.0.0.6
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
hss:
freeDiameter:
@@ -211,12 +216,12 @@ pcrf:
- identity: smf.localdomain
addr: 127.0.0.4
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
ausf:
sbi:
@@ -228,7 +233,32 @@ udm:
- addr: 127.0.0.12
port: 7777
udr:
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: ::1
port: 7777
s_nssai:
sst: 1
- addr: 127.0.0.19
port: 7777
s_nssai:
sst: 1
sd: 000080
- addr: 127.0.0.10
port: 7777
s_nssai:
sst: 1
sd: 009000
udr:
sbi:
- addr: 127.0.0.20
port: 7777

View File

@@ -38,7 +38,8 @@ example_conf = '''
310014.yaml
csfb.yaml
volte.yaml
minimal.yaml
vonr.yaml
slice.yaml
srslte.yaml
sample.yaml
'''.split()

View File

@@ -143,7 +143,7 @@ logger:
# mnc: 70
# s_nssai:
# - sst: 1
# - sd: 010000
# sd: 010000
# - plmn_id:
# mcc: 901
# mnc: 70
@@ -160,6 +160,10 @@ logger:
#
# amf_name: amf1.open5gs.amf.5gc.mnc70.mcc901.3gppnetwork.org
#
# <Relative Capacity> - Default(255)
#
# relative_capacity: 100
#
amf:
sbi:
- addr: 127.0.0.5
@@ -260,19 +264,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
@@ -283,19 +288,28 @@ pool:
#
# time:
#
# o NF Instance Heartbeat (Default : 10 seconds)
# o NF Instance Heartbeat (Default : 0)
# NFs will not send heart-beat timer in NFProfile
# NRF will send heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (20 seconds)
# NFs will send heart-beat timer (20 seconds) in NFProfile
# NRF can change heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (Disabled)
# nf_instance:
# heartbeat: 0
# heartbeat: 20
#
# o NF Instance Heartbeat (10 seconds)
# nf_instance:
# heartbeat: 10
#
# o Message Wait Duration (Default : 2000ms = 2 seconds)
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
#
# o Handover Wait Duration (Default : 300 ms)
# Time to wait for AMF to send UEContextReleaseCommand
# to the source gNB after receiving HandoverNotify
#
# o Handover Wait Duration (500ms)
# handover:
# duration: 500
time:

View File

@@ -136,19 +136,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
@@ -159,17 +160,18 @@ pool:
#
# time:
#
# o NF Instance Heartbeat (Default : 10 seconds)
# o NF Instance Heartbeat (Default : 0)
# NFs will not send heart-beat timer in NFProfile
# NRF will send heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (20 seconds)
# NFs will send heart-beat timer (20 seconds) in NFProfile
# NRF can change heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (Disabled)
# nf_instance:
# heartbeat: 0
# heartbeat: 20
#
# o NF Instance Heartbeat (10 seconds)
# nf_instance:
# heartbeat: 10
#
# o Message Wait Duration (Default : 2000ms = 2 seconds)
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:

View File

@@ -62,19 +62,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128

View File

@@ -32,6 +32,8 @@ open5gs_conf = '''
ausf.yaml
udm.yaml
udr.yaml
pcf.yaml
nssf.yaml
'''.split()
foreach file : open5gs_conf

View File

@@ -201,6 +201,10 @@ logger:
#
# mme_name: open5gs-mme0
#
# <Relative Capacity> - Default(255)
#
# relative_capacity: 100
#
mme:
freeDiameter: @sysconfdir@/freeDiameter/mme.conf
s1ap:
@@ -349,6 +353,11 @@ smf:
# o Disable Stateless Address Autoconfiguration for IPv6
# no_slaac: true
#
# o Use OAI UE
# - Remove HashMME in Security-mode command message
# - Use the length 1 of EPS network feature support in Attach accept message
# use_openair: true
#
parameter:
#
@@ -364,19 +373,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
@@ -398,3 +408,21 @@ pool:
# o usrsctp_udp_port : 9899
#
sctp:
#
# time:
#
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
#
# o Handover Wait Duration (Default : 300 ms)
# Time to wait for MME to send UEContextReleaseCommand
# to the source eNB after receiving HandoverNotify
#
# o Handover Wait Duration (500ms)
# handover:
# duration: 500
time:

View File

@@ -1,3 +1,5 @@
db_uri: mongodb://localhost/open5gs
#
# logger:
#
@@ -106,19 +108,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
@@ -129,6 +132,16 @@ pool:
#
# time:
#
# o NF Instance Heartbeat (Default : 10 seconds)
#
# o NF Instance Heartbeat (Disabled)
# nf_instance:
# heartbeat: 0
#
# o NF Instance Heartbeat (5 seconds)
# nf_instance:
# heartbeat: 5
#
# o NF Instance Validity (Default : 3600 seconds = 1 hour)
#
# o NF Instance Validity (10 seconds)
@@ -145,7 +158,7 @@ pool:
# subscription:
# validity: 3600
#
# o Message Wait Duration (Default : 2000ms = 2 seconds)
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:

View File

@@ -0,0 +1,187 @@
#
# logger:
#
# o Set OGS_LOG_INFO to all domain level
# - If `level` is omitted, the default level is OGS_LOG_INFO)
# - If `domain` is omitted, the all domain level is set from 'level'
# (Nothing is needed)
#
# o Set OGS_LOG_ERROR to all domain level
# - `level` can be set with none, fatal, error, warn, info, debug, trace
# level: error
#
# o Set OGS_LOG_DEBUG to mme/emm domain level
# level: debug
# domain: mme,emm
#
# o Set OGS_LOG_TRACE to all domain level
# level: trace
# domain: core,sbi,nssf,event,tlv,mem,sock
#
logger:
file: @localstatedir@/log/open5gs/nssf.log
#
# nssf:
#
# <SBI Server>
#
# o SBI Server(http://<all address available>:80)
# sbi:
#
# o SBI Server(http://<any address>:80)
# sbi:
# - addr:
# - 0.0.0.0
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# sbi:
# tls:
# key: nssf.key
# pem: nssf.pem
#
# o SBI Server(https://127.0.0.14:443, http://[::1]:80)
# sbi:
# - addr: 127.0.0.14
# tls:
# key: nssf.key
# pem: nssf.pem
# - addr: ::1
#
# o SBI Server(http://nssf.open5gs.org:80)
# sbi:
# name: nssf.open5gs.org
#
# o SBI Server(http://127.0.0.14:7777)
# sbi:
# - addr: 127.0.0.14
# port: 7777
#
# o SBI Server(http://<eth0 IP address>:80)
# sbi:
# dev: eth0
#
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
#
# nrf:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.0.10:7777)
# sbi:
# addr: 127.0.0.10
# port: 7777
#
# o SBI Client(https://127.0.0.10:443, http://nrf.open5gs.org:80)
# sbi:
# - addr: 127.0.0.10
# tls:
# key: nrf.key
# pem: nrf.pem
# - name: nrf.open5gs.org
#
# o SBI Client(http://[fe80::1%@loopback_devname@]:80)
# If prefer_ipv4 is true, http://127.0.0.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.0.10
# - fe80::1%@loopback_devname@
#
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
# o Disable use of IPv6 addresses (only IPv4)
# no_ipv6: true
#
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
# prefer_ipv4: true
#
# o Enable Multicast traffic to the UE
# multicast: true
#
# o Disable Stateless Address Autoconfiguration for IPv6
# no_slaac: true
#
parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
#
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:
#
# o NF Instance Heartbeat (Default : 0)
# NFs will not send heart-beat timer in NFProfile
# NRF will send heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (20 seconds)
# NFs will send heart-beat timer (20 seconds) in NFProfile
# NRF can change heart-beat timer in NFProfile
#
# nf_instance:
# heartbeat: 20
#
# o NF Instance Heartbeat (Disabled)
# nf_instance:
# heartbeat: 0
#
# o NF Instance Heartbeat (10 seconds)
# nf_instance:
# heartbeat: 10
#
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
time:

181
configs/open5gs/pcf.yaml.in Normal file
View File

@@ -0,0 +1,181 @@
db_uri: mongodb://localhost/open5gs
#
# logger:
#
# o Set OGS_LOG_INFO to all domain level
# - If `level` is omitted, the default level is OGS_LOG_INFO)
# - If `domain` is omitted, the all domain level is set from 'level'
# (Nothing is needed)
#
# o Set OGS_LOG_ERROR to all domain level
# - `level` can be set with none, fatal, error, warn, info, debug, trace
# level: error
#
# o Set OGS_LOG_DEBUG to mme/emm domain level
# level: debug
# domain: mme,emm
#
# o Set OGS_LOG_TRACE to all domain level
# level: trace
# domain: core,sbi,pcf,event,tlv,mem,sock
#
logger:
file: @localstatedir@/log/open5gs/pcf.log
#
# pcf:
#
# <SBI Server>
#
# o SBI Server(http://<all address available>:80)
# sbi:
#
# o SBI Server(http://<any address>:80)
# sbi:
# - addr:
# - 0.0.0.0
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# sbi:
# tls:
# key: pcf.key
# pem: pcf.pem
#
# o SBI Server(https://127.0.0.13:443, http://[::1]:80)
# sbi:
# - addr: 127.0.0.13
# tls:
# key: pcf.key
# pem: pcf.pem
# - addr: ::1
#
# o SBI Server(http://pcf.open5gs.org:80)
# sbi:
# name: pcf.open5gs.org
#
# o SBI Server(http://127.0.0.13:7777)
# sbi:
# - addr: 127.0.0.13
# port: 7777
#
# o SBI Server(http://<eth0 IP address>:80)
# sbi:
# dev: eth0
#
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
#
# nrf:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.0.10:7777)
# sbi:
# addr: 127.0.0.10
# port: 7777
#
# o SBI Client(https://127.0.0.10:443, http://nrf.open5gs.org:80)
# sbi:
# - addr: 127.0.0.10
# tls:
# key: nrf.key
# pem: nrf.pem
# - name: nrf.open5gs.org
#
# o SBI Client(http://[fe80::1%@loopback_devname@]:80)
# If prefer_ipv4 is true, http://127.0.0.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.0.10
# - fe80::1%@loopback_devname@
#
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:
#
# o Number of output streams per SCTP associations.
# sctp_streams: 30
#
# o Disable use of IPv4 addresses (only IPv6)
# no_ipv4: true
#
# o Disable use of IPv6 addresses (only IPv4)
# no_ipv6: true
#
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
# prefer_ipv4: true
#
# o Enable Multicast traffic to the UE
# multicast: true
#
# o Disable Stateless Address Autoconfiguration for IPv6
# no_slaac: true
#
parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 32
#
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:
#
# o NF Instance Heartbeat (Default : 0)
# NFs will not send heart-beat timer in NFProfile
# NRF will send heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (20 seconds)
# NFs will send heart-beat timer (20 seconds) in NFProfile
# NRF can change heart-beat timer in NFProfile
#
# nf_instance:
# heartbeat: 20
#
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
time:

View File

@@ -46,6 +46,10 @@ pcrf:
# o Disable Stateless Address Autoconfiguration for IPv6
# no_slaac: 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
# no_ipv4v6_local_addr_in_packet_filter: true
#
parameter:
#
@@ -61,19 +65,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128

View File

@@ -45,6 +45,10 @@ logger:
# - addr: 127.0.0.3
# - addr: ::1
#
# o PFCP-U Server(127.0.0.1:2152, [::1]:2152)
# pfcp:
# name: localhost
#
sgwc:
gtpc:
- addr: 127.0.0.3
@@ -143,22 +147,33 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
time:

View File

@@ -24,24 +24,6 @@ logger:
#
# sgwu:
#
# <GTP-U Server>
#
# o GTP-U Server(all address available)
# gtpu:
#
# o Provide custom SGW GTP-U address to be advertised inside S1AP messages
# gtpu:
# addr: 10.4.128.21
# advertise_addr: 172.24.15.30
#
# gtpu:
# addr: 10.4.128.21
# advertise_name: sgw1.epc.mnc001.mcc001.3gppnetwork.org
#
# gtpu:
# dev: ens3
# advertise_name: sgw1.epc.mnc001.mcc001.3gppnetwork.org
#
# <PFCP Server>
#
# o PFCP Server(127.0.0.6:8805, ::1:8805)
@@ -49,11 +31,26 @@ logger:
# - addr: 127.0.0.6
# - addr: ::1
#
# o PFCP-U Server(127.0.0.1:2152, [::1]:2152)
# pfcp:
# - name: localhost
#
# <GTP-U Server>
#
# o GTP-U Server(127.0.0.6:2152, [::1]:2152)
# gtpu:
# - addr: 127.0.0.6
# - addr: ::1
#
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
# gtpu:
# - name: localhost
#
sgwu:
gtpu:
- addr: 127.0.0.6
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
#
# sgwc:
@@ -103,22 +100,33 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
time:

View File

@@ -69,6 +69,10 @@ logger:
# - addr: 127.0.0.4
# - addr: ::1
#
# o PFCP-U Server(127.0.0.1:2152, [::1]:2152)
# pfcp:
# name: localhost
#
# <GTP-C Server>
#
# o GTP-C Server(127.0.0.4:2123, [fe80::3%@loopback_devname@]:2123)
@@ -83,74 +87,78 @@ logger:
# - addr: 127.0.0.4
# - addr: fe80::3%@loopback_devname@
#
# <PDN Configuration with UE Pool>
# <GTP-U Server>>
#
# o GTP-U Server(127.0.0.4:2152, [::1]:2152)
# gtpu:
# - addr: 127.0.0.4
# - addr: ::1
#
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
# gtpu:
# name: localhost
#
# <Subnet for UE Pool>
#
# o IPv4 Pool
# pdn:
# subnet:
# addr: 10.45.0.1/16
#
# o IPv4/IPv6 Pool
# pdn:
# subnet:
# - addr: 10.45.0.1/16
# - addr: cafe:1::1/64
# - addr: 2001:230:cafe::1/48
#
#
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, cafe:2::1/64
# pdn:
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:230:babe::1/48
#
# subnet:
# - addr: 10.45.0.1/16
# apn: internet
# - addr: cafe:1::1/64
# apn: internet
# dnn: internet
# - addr: 2001:230:cafe::1/48
# dnn: internet
# - addr: 10.46.0.1/16
# apn: ims
# - addr: cafe:2::1/64
# apn: ims
#
# o Multiple Devices (default: ogstun)
# pdn:
# - addr: 10.45.0.1/16
# apn: internet
# - addr: cafe:1::1/64
# apn: internet
# dev: ogstun2
# - addr: 10.46.0.1/16
# apn: ims
# dev: ogstun3
# - addr: cafe:2::1/64
# apn: ims
# dev: ogstun3
# dnn: ims
# - addr: 2001:230:babe::1/48
# dnn: ims
#
# o Pool Range Sample
# pdn:
# subnet:
# - addr: 10.45.0.1/24
# range: 10.45.0.100-10.45.0.200
#
# pdn:
# subnet:
# - addr: 10.45.0.1/24
# range:
# - 10.45.0.5-10.45.0.50
# - 10.45.0.100-
#
# pdn:
# subnet:
# - addr: 10.45.0.1/24
# range:
# - -10.45.0.200
# - 10.45.0.210-10.45.0.220
#
# pdn:
# subnet:
# - addr: 10.45.0.1/16
# range:
# - 10.45.0.100-10.45.0.200
# - 10.45.1.100-10.45.1.200
# - addr: cafe::1/64
# - addr: 2001:230:cafe::1/48
# range:
# - cafe::a0-cafe:b0
# - cafe::c0-cafe:d0
# - 2001:230:cafe:a0::0-2001:230:cafe:b0::0
# - 2001:230:cafe:c0::0-2001:230:cafe:d0::0
#
# <Domain Name Server>
#
# o Primary/Secondary can be configured. Others are ignored.
#
# dns:
# - 8.8.8.8
# - 8.8.4.4
# - 2001:4860:4860::8888
# - 2001:4860:4860::8844
#
# <MTU Size>
#
# o Provisioning a limit on the size of the packets sent by the MS
@@ -167,19 +175,152 @@ logger:
# - 127.0.0.1
# - ::1
#
# <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.
# 3. AMF selects SMF based on S-NSSAI, DNN and TAI in SmfInfo.
#
# Note that if there is no SmfInfo, any AMF can select this SMF.
#
# o S-NSSAI[SST:1] and DNN[internet] - At least 1 DNN is required in S-NSSAI
# info:
# - s_nssai:
# - sst: 1
# dnn:
# - internet
#
# o S-NSSAI[SST:1 SD:009000] and DNN[internet or ims]
# info:
# - s_nssai:
# - sst: 1
# sd: 009000
# dnn:
# - internet
# - ims
#
# o S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:90170 TAC:1]
# info:
# - s_nssai:
# - sst: 1
# dnn:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mnc: 70
# tac: 1
#
# o If any of conditions below are met:
# - S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:90170 TAC:1-9]
# - S-NSSAI[SST:2 SD:000080] and DNN[internet or ims]
# - S-NSSAI[SST:4] and DNN[internet] and TAI[PLMN-ID:90170 TAC:10-20,30-40]
#
# info:
# - s_nssai:
# - sst: 1
# dnn:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mnc: 70
# range:
# - 1-9
# - s_nssai:
# - sst: 2
# sd: 000080
# dnn:
# - internet
# - ims
# - s_nssai:
# - sst: 4
# dnn:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mnc: 70
# range:
# - 10-20
# - 30-40
#
# o Complex Example
# info:
# - s_nssai:
# - sst: 1
# dnn:
# - internet
# - sst: 1
# sd: 000080
# dnn:
# - internet
# - ims
# - sst: 1
# sd: 009000
# dnn:
# [internet, ims]
# - sst: 2
# dnn:
# - internet
# - sst: 3
# sd: 123456
# dnn:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mnc: 70
# tac: [1, 2, 3]
# - plmn_id:
# mcc: 901
# mnc: 70
# tac: 4
# - plmn_id:
# mcc: 901
# mnc: 70
# tac:
# - 5
# - 6
# - plmn_id:
# mcc: 901
# mnc: 70
# range:
# - 100-200
# - 300-400
# - plmn_id:
# mcc: 901
# mnc: 70
# range:
# - 500-600
# - 700-800
# - 900-1000
# - s_nssai:
# - sst: 4
# dnn:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mnc: 70
# tac: 99
#
smf:
sbi:
- addr: 127.0.0.4
port: 7777
gtpc:
- addr: 127.0.0.4
- addr: ::1
pfcp:
- addr: 127.0.0.4
- addr: ::1
pdn:
gtpc:
- addr: 127.0.0.4
- addr: ::1
gtpu:
- addr: 127.0.0.4
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -231,10 +372,10 @@ nrf:
# pfcp:
# addr: 127.0.0.7
#
# <UPF_SELECTION_MODE - EPC only>
# <UPF Selection>
#
# o Round-Robin
# (note that round robin can be disabled for a particular node
# o Round-Robin
# (note that round robin can be disabled for a particular node
# by setting flag 'rr' to 0)
#
# upf:
@@ -244,8 +385,8 @@ nrf:
# rr: 0
# - addr: 127.0.0.19
#
# o UPF selection by eNodeB TAC
# (either single TAC or multiple TACs, DECIMAL representation)
# o UPF selection by eNodeB TAC
# (either single TAC or multiple TACs, DECIMAL representation)
#
# upf:
# pfcp:
@@ -254,17 +395,17 @@ nrf:
# - addr: 127.0.0.12
# tac: [3,5,8]
#
# o UPF selection by UE's DNN/APN (either single DNN/APN or multiple DNNs/APNs)
# o UPF selection by UE's DNN/APN (either single DNN/APN or multiple DNNs/APNs)
#
# upf:
# pfcp:
# - addr: 127.0.0.7
# dnn: ims
# - addr: 127.0.0.12
# apn: [internet, web]
# dnn: [internet, web]
#
# o UPF selection by CellID(e_cell_id: 28bit, nr_cell_id: 36bit)
# (either single enb_id or multiple enb_ids, HEX representation)
# o UPF selection by CellID(e_cell_id: 28bit, nr_cell_id: 36bit)
# (either single enb_id or multiple enb_ids, HEX representation)
#
# upf:
# pfcp:
@@ -313,19 +454,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
@@ -336,19 +478,29 @@ pool:
#
# time:
#
# o NF Instance Heartbeat (Default : 10 seconds)
# o NF Instance Heartbeat (Default : 0)
# NFs will not send heart-beat timer in NFProfile
# NRF will send heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (20 seconds)
# NFs will send heart-beat timer (20 seconds) in NFProfile
# NRF can change heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (Disabled)
# nf_instance:
# heartbeat: 0
# heartbeat: 20
#
# o NF Instance Heartbeat (10 seconds)
# nf_instance:
# heartbeat: 10
#
# o Message Wait Duration (Default : 2000ms = 2 seconds)
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
#
# o Handover Wait Duration (Default : 300 ms)
# Time to wait for SMF to send
# PFCP Session Modification Request(Remove Indirect Tunnel) to the UPF
# after sending Nsmf_PDUSession_UpdateSMContext Response(hoState:COMPLETED)
#
# o Handover Wait Duration (500ms)
# handover:
# duration: 500
time:

View File

@@ -136,19 +136,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
@@ -159,17 +160,18 @@ pool:
#
# time:
#
# o NF Instance Heartbeat (Default : 10 seconds)
# o NF Instance Heartbeat (Default : 0)
# NFs will not send heart-beat timer in NFProfile
# NRF will send heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (20 seconds)
# NFs will send heart-beat timer (20 seconds) in NFProfile
# NRF can change heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (Disabled)
# nf_instance:
# heartbeat: 0
# heartbeat: 20
#
# o NF Instance Heartbeat (10 seconds)
# nf_instance:
# heartbeat: 10
#
# o Message Wait Duration (Default : 2000ms = 2 seconds)
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:

View File

@@ -43,9 +43,9 @@ logger:
# key: udr.key
# pem: udr.pem
#
# o SBI Server(https://127.0.0.13:443, http://[::1]:80)
# o SBI Server(https://127.0.0.20:443, http://[::1]:80)
# sbi:
# - addr: 127.0.0.13
# - addr: 127.0.0.20
# tls:
# key: udr.key
# pem: udr.pem
@@ -55,9 +55,9 @@ logger:
# sbi:
# name: udr.open5gs.org
#
# o SBI Server(http://127.0.0.13:7777)
# o SBI Server(http://127.0.0.20:7777)
# sbi:
# - addr: 127.0.0.13
# - addr: 127.0.0.20
# port: 7777
#
# o SBI Server(http://<eth0 IP address>:80)
@@ -66,7 +66,7 @@ logger:
#
udr:
sbi:
- addr: 127.0.0.13
- addr: 127.0.0.20
port: 7777
#
@@ -138,19 +138,20 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
@@ -161,7 +162,16 @@ pool:
#
# time:
#
# o NF Instance Heartbeat (Default : 10 seconds)
# o NF Instance Heartbeat (Default : 0)
# NFs will not send heart-beat timer in NFProfile
# NRF will send heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (20 seconds)
# NFs will send heart-beat timer (20 seconds) in NFProfile
# NRF can change heart-beat timer in NFProfile
#
# nf_instance:
# heartbeat: 20
#
# o NF Instance Heartbeat (Disabled)
# nf_instance:
@@ -171,7 +181,7 @@ pool:
# nf_instance:
# heartbeat: 10
#
# o Message Wait Duration (Default : 2000ms = 2 seconds)
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:

View File

@@ -26,125 +26,90 @@ logger:
#
# <PFCP Server>
#
# o PFCP Server(127.0.0.7:8805)
# o PFCP Server(127.0.0.7:8805, ::1:8805)
# pfcp:
# addr: 127.0.0.7
# - addr: 127.0.0.7
# - addr: ::1
#
# o PFCP-U Server(127.0.0.1:2152, [::1]:2152)
# pfcp:
# name: localhost
#
# <GTP-U Server>>
#
# o GTP-U Server(127.0.0.7:2152, [::1]:2152)
# gtpu:
# - addr:
# - 127.0.0.7
# - ::1
# - addr: 127.0.0.7
# - addr: ::1
#
# o Same configuration(127.0.0.7:2152, [::1]:2152) as below.
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
# gtpu:
# name: localhost
#
# o User Plane IP Resource information
# gtpu:
# - addr:
# - 127.0.0.7
# - ::1
# teid_range_indication: 4
# teid_range: 10
# network_instance: internet
# source_interface: 0
# - addr: 127.0.10.4
# teid_range_indication: 4
# teid_range: 5
# network_instance: ims
# source_interface: 1
# <Subnet for UE network>
#
# <PDN Configuration with UE Pool>
# Note that you need to setup your UE network using TUN device.
# (ogstun, ogstun2, ogstunX, ..)
#
# o IPv4 Pool
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
#
# pdn:
# subnet:
# addr: 10.45.0.1/16
#
# o IPv4/IPv6 Pool
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add cafe:1::1/64 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
#
# pdn:
# subnet:
# - addr: 10.45.0.1/16
# - addr: cafe:1::1/64
# - addr: 2001:230:cafe::1/48
#
#
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, cafe:2::1/64
# All other APNs use 10.45.0.1/16, cafe:1::1/64
# 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
# $ 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 cafe:1::1/64 dev ogstun
# $ sudo ip addr add cafe:2::1/64 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
#
# pdn:
# subnet:
# - addr: 10.45.0.1/16
# apn: internet
# - addr: cafe:1::1/64
# apn: internet
# dnn: internet
# - addr: 2001:230:cafe::1/48
# dnn: internet
# - addr: 10.46.0.1/16
# apn: ims
# - addr: cafe:2::1/64
# apn: ims
# dnn: ims
# - addr: 2001:230:babe::1/48
# dnn: ims
#
# o Multiple Devices (default: ogstun)
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add cafe:1::1/64 dev ogstun2
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun2
# $ sudo ip addr add 10.46.0.1/16 dev ogstun3
# $ sudo ip addr add cafe:2::1/64 dev ogstun3
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun3
#
# pdn:
# subnet:
# - addr: 10.45.0.1/16
# apn: internet
# - addr: cafe:1::1/64
# apn: internet
# dnn: internet
# - addr: 2001:230:cafe::1/48
# dnn: internet
# dev: ogstun2
# - addr: 10.46.0.1/16
# apn: ims
# dnn: ims
# dev: ogstun3
# - addr: cafe:2::1/64
# apn: ims
# - addr: 2001:230:babe::1/48
# dnn: ims
# dev: ogstun3
#
# o Pool Range Sample
# pdn:
# - addr: 10.45.0.1/24
# range: 10.45.0.100-10.45.0.200
#
# pdn:
# - addr: 10.45.0.1/24
# range:
# - 10.45.0.5-10.45.0.50
# - 10.45.0.100-
#
# pdn:
# - addr: 10.45.0.1/24
# range:
# - -10.45.0.200
# - 10.45.0.210-10.45.0.220
#
# pdn:
# - addr: 10.45.0.1/16
# range:
# - 10.45.0.100-10.45.0.200
# - 10.45.1.100-10.45.1.200
# - addr: cafe::1/64
# range:
# - cafe::a0-cafe:b0
# - cafe::c0-cafe:d0
#
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
#
# smf:
@@ -195,22 +160,33 @@ max:
#
# pool:
#
# o The Number of Default Memory Pool Size
# 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 => 32768 Number
# - Pool-size 256 => 4096 Number
# - Pool-size 512 => 2048 Number
# - 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: 32768
# 256: 4096
# 512: 2048
# 128: 65536
# 256: 16384
# 512: 4096
# 1024: 1024
# 2048: 512
# 8192: 128
# big: 8
#
pool:
#
# time:
#
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
time:

View File

@@ -9,6 +9,8 @@ parameter:
# no_upf: true
# no_ausf: true
# no_udm: true
# no_pcf: true
# no_nssf: true
# no_udr: true
# no_mme: true
# no_sgwc: true
@@ -66,14 +68,17 @@ smf:
sbi:
- addr: 127.0.0.4
port: 7777
pfcp:
- addr: 127.0.0.4
gtpc:
- addr: 127.0.0.4
- addr: ::1
pfcp:
gtpu:
- addr: 127.0.0.4
pdn:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -128,19 +133,19 @@ amf:
amf_name: open5gs-amf0
sgwu:
gtpu:
- addr: 127.0.0.6
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
hss:
freeDiameter:
@@ -194,7 +199,32 @@ udm:
- addr: 127.0.0.12
port: 7777
udr:
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: ::1
port: 7777
s_nssai:
sst: 1
- addr: 127.0.0.19
port: 7777
s_nssai:
sst: 1
sd: 000080
- addr: 127.0.0.10
port: 7777
s_nssai:
sst: 1
sd: 009000
udr:
sbi:
- addr: 127.0.0.20
port: 7777

View File

@@ -9,6 +9,8 @@ parameter:
# no_upf: true
# no_ausf: true
# no_udm: true
# no_pcf: true
# no_nssf: true
# no_udr: true
# no_mme: true
# no_sgwc: true
@@ -66,14 +68,17 @@ smf:
sbi:
- addr: 127.0.0.4
port: 7777
pfcp:
- addr: 127.0.0.4
gtpc:
- addr: 127.0.0.4
- addr: ::1
pfcp:
gtpu:
- addr: 127.0.0.4
pdn:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -104,25 +109,26 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 208
mnc: 93
mcc: 901
mnc: 70
amf_id:
region: 202
set: 1016
tai:
- plmn_id:
mcc: 208
mnc: 93
mcc: 901
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 208
mnc: 93
mcc: 901
mnc: 70
s_nssai:
- sst: 1
sd: 010203
- sst: 1
sd: 112233
sd: 000080
- sst: 1
sd: 009000
security:
integrity_order : [ NIA2, NIA1 ]
ciphering_order : [ NEA0, NEA1, NEA2 ]
@@ -131,19 +137,19 @@ amf:
amf_name: open5gs-amf0
sgwu:
gtpu:
- addr: 127.0.0.6
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
hss:
freeDiameter:
@@ -197,7 +203,32 @@ udm:
- addr: 127.0.0.12
port: 7777
udr:
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: ::1
port: 7777
s_nssai:
sst: 1
- addr: 127.0.0.19
port: 7777
s_nssai:
sst: 1
sd: 000080
- addr: 127.0.0.10
port: 7777
s_nssai:
sst: 1
sd: 009000
udr:
sbi:
- addr: 127.0.0.20
port: 7777

View File

@@ -9,6 +9,8 @@ parameter:
# no_upf: true
# no_ausf: true
# no_udm: true
# no_pcf: true
# no_nssf: true
# no_udr: true
# no_mme: true
# no_sgwc: true
@@ -63,17 +65,20 @@ sgwc:
- addr: 127.0.0.3
smf:
sbi:
# sbi:
# - addr: 127.0.0.4
# port: 7777
pfcp:
- addr: 127.0.0.4
port: 7777
gtpc:
- addr: 127.0.0.4
- addr: ::1
pfcp:
gtpu:
- addr: 127.0.0.4
pdn:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -128,19 +133,19 @@ amf:
amf_name: open5gs-amf0
sgwu:
gtpu:
- addr: 127.0.0.6
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
hss:
freeDiameter:
@@ -177,12 +182,12 @@ pcrf:
- identity: smf.localdomain
addr: 127.0.0.4
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
ausf:
sbi:
@@ -194,7 +199,32 @@ udm:
- addr: 127.0.0.12
port: 7777
udr:
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: ::1
port: 7777
s_nssai:
sst: 1
- addr: 127.0.0.19
port: 7777
s_nssai:
sst: 1
sd: 000080
- addr: 127.0.0.10
port: 7777
s_nssai:
sst: 1
sd: 009000
udr:
sbi:
- addr: 127.0.0.20
port: 7777

View File

@@ -3,4 +3,4 @@ Name=ogstun
[Network]
Address=10.45.0.1/16
Address=cafe::1/64
Address=2001:230:cafe::1/48

View File

@@ -27,6 +27,8 @@ systemd_conf_in = '''
open5gs-nrfd.service
open5gs-ausfd.service
open5gs-udmd.service
open5gs-pcfd.service
open5gs-nssfd.service
open5gs-udrd.service
'''.split()

View File

@@ -0,0 +1,18 @@
[Unit]
Description=Open5GS NSSF Daemon
After=networking.service
[Service]
Type=simple
User=open5gs
Group=open5gs
Restart=always
ExecStart=@bindir@/open5gs-nssfd -c @sysconfdir@/open5gs/nssf.yaml
RestartSec=2
RestartPreventExitStatus=1
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,18 @@
[Unit]
Description=Open5GS PCF Daemon
After=networking.service
[Service]
Type=simple
User=open5gs
Group=open5gs
Restart=always
ExecStart=@bindir@/open5gs-pcfd -c @sysconfdir@/open5gs/pcf.yaml
RestartSec=2
RestartPreventExitStatus=1
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@@ -9,6 +9,8 @@ parameter:
# no_upf: true
# no_ausf: true
# no_udm: true
# no_pcf: true
# no_nssf: true
# no_udr: true
# no_mme: true
# no_sgwc: true
@@ -63,17 +65,20 @@ sgwc:
- addr: 127.0.0.3
smf:
sbi:
# sbi:
# - addr: 127.0.0.4
# port: 7777
pfcp:
- addr: 127.0.0.4
port: 7777
gtpc:
- addr: 127.0.0.4
- addr: ::1
pfcp:
gtpu:
- addr: 127.0.0.4
pdn:
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
@@ -131,19 +136,19 @@ amf:
amf_name: open5gs-amf0
sgwu:
gtpu:
- addr: 127.0.0.6
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
hss:
freeDiameter:
@@ -182,12 +187,12 @@ pcrf:
- identity: pcscf.localdomain
addr: 127.0.0.1
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
ausf:
sbi:
@@ -199,7 +204,32 @@ udm:
- addr: 127.0.0.12
port: 7777
udr:
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: ::1
port: 7777
s_nssai:
sst: 1
- addr: 127.0.0.19
port: 7777
s_nssai:
sst: 1
sd: 000080
- addr: 127.0.0.10
port: 7777
s_nssai:
sst: 1
sd: 009000
udr:
sbi:
- addr: 127.0.0.20
port: 7777

235
configs/vonr.yaml.in Normal file
View File

@@ -0,0 +1,235 @@
db_uri: mongodb://localhost/open5gs
logger:
parameter:
# no_nrf: true
# no_amf: true
# no_smf: true
# no_upf: true
# no_ausf: true
# no_udm: true
# no_pcf: true
# no_nssf: true
# no_udr: true
# no_mme: true
# no_sgwc: true
# no_sgwu: true
# no_pcrf: true
# no_hss: true
mme:
freeDiameter:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: hss.localdomain
addr: 127.0.0.8
s1ap:
- addr: 127.0.0.2
gtpc:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 901
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mnc: 70
tac: 1
security:
integrity_order : [ EIA2, EIA1, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
network_name:
full: Open5GS
sgwc:
gtpc:
- addr: 127.0.0.3
pfcp:
- addr: 127.0.0.3
smf:
sbi:
- addr: 127.0.0.4
port: 7777
pfcp:
- addr: 127.0.0.4
gtpc:
- addr: 127.0.0.4
- addr: ::1
gtpu:
- addr: 127.0.0.4
- addr: ::1
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
- 8.8.4.4
- 2001:4860:4860::8888
- 2001:4860:4860::8844
p-cscf:
- 127.0.0.1
- ::1
mtu: 1400
freeDiameter:
identity: smf.localdomain
realm: localdomain
listen_on: 127.0.0.4
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: pcrf.localdomain
addr: 127.0.0.9
amf:
sbi:
- addr: 127.0.0.5
port: 7777
ngap:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mnc: 70
s_nssai:
- sst: 1
security:
integrity_order : [ NIA2, NIA1, NIA0 ]
ciphering_order : [ NEA0, NEA1, NEA2 ]
network_name:
full: Open5GS
amf_name: open5gs-amf0
sgwu:
pfcp:
- addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- addr: 127.0.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:230:cafe::1/48
hss:
freeDiameter:
identity: hss.localdomain
realm: localdomain
listen_on: 127.0.0.8
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: mme.localdomain
addr: 127.0.0.2
pcrf:
freeDiameter:
identity: pcrf.localdomain
realm: localdomain
listen_on: 127.0.0.9
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: smf.localdomain
addr: 127.0.0.4
- identity: pcscf.localdomain
addr: 127.0.0.1
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
ausf:
sbi:
- addr: 127.0.0.11
port: 7777
udm:
sbi:
- addr: 127.0.0.12
port: 7777
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: ::1
port: 7777
s_nssai:
sst: 1
- addr: 127.0.0.19
port: 7777
s_nssai:
sst: 1
sd: 000080
- addr: 127.0.0.10
port: 7777
s_nssai:
sst: 1
sd: 009000
udr:
sbi:
- addr: 127.0.0.20
port: 7777

252
debian/changelog vendored
View File

@@ -1,3 +1,255 @@
open5gs (2.2.1) unstable; urgency=medium
* UE IPv6 Support
-- Sukchan Lee <acetcom@gmail.com> Mon, 15 Mar 2021 10:06:16 +0900
open5gs (2.2.1~bionic) bionic; urgency=medium
* UE IPv6 Support
-- Sukchan Lee <acetcom@gmail.com> Mon, 15 Mar 2021 10:05:00 +0900
open5gs (2.2.1~focal) focal; urgency=medium
* UE IPv6 Support
-- Sukchan Lee <acetcom@gmail.com> Mon, 15 Mar 2021 10:03:39 +0900
open5gs (2.2.0) unstable; urgency=medium
* DB Schame Changes
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Mar 2021 21:31:35 +0900
open5gs (2.2.0~bionic) bionic; urgency=medium
* DB Schame Changes
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Mar 2021 21:30:31 +0900
open5gs (2.2.0~focal) focal; urgency=medium
* DB Schame Changes
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Mar 2021 21:29:03 +0900
open5gs (2.1.7) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Feb 2021 22:27:23 -0500
open5gs (2.1.7~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Feb 2021 22:26:08 -0500
open5gs (2.1.7~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Feb 2021 22:23:55 -0500
open5gs (2.1.6) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 04 Feb 2021 09:18:13 -0500
open5gs (2.1.6~bionic1) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 04 Feb 2021 09:17:04 -0500
open5gs (2.1.6~focal1) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 04 Feb 2021 09:14:17 -0500
open5gs (2.1.5) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 02 Feb 2021 14:47:59 -0500
open5gs (2.1.5~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 02 Feb 2021 14:46:57 -0500
open5gs (2.1.5~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 02 Feb 2021 14:45:48 -0500
open5gs (2.1.4) unstable; urgency=medium
* Paging was added
-- Sukchan Lee <acetcom@gmail.com> Mon, 18 Jan 2021 19:14:26 -0500
open5gs (2.1.4~bionic) bionic; urgency=medium
* Paging was added
-- Sukchan Lee <acetcom@gmail.com> Mon, 18 Jan 2021 19:13:26 -0500
open5gs (2.1.4~focal) focal; urgency=medium
* Paging was added
-- Sukchan Lee <acetcom@gmail.com> Mon, 18 Jan 2021 19:12:06 -0500
open5gs (2.1.3) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 08 Jan 2021 23:20:33 -0500
open5gs (2.1.3~bionic1) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 08 Jan 2021 23:19:22 -0500
open5gs (2.1.3~focal1) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 08 Jan 2021 23:17:48 -0500
open5gs (2.1.2) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 08 Jan 2021 00:28:16 -0500
open5gs (2.1.2~bionic1) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 08 Jan 2021 00:27:09 -0500
open5gs (2.1.2~focal1) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 08 Jan 2021 00:25:31 -0500
open5gs (2.1.1) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 16 Dec 2020 23:04:41 -0500
open5gs (2.1.1~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 16 Dec 2020 23:03:25 -0500
open5gs (2.1.1~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 16 Dec 2020 23:02:04 -0500
open5gs (2.1.0) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 11 Dec 2020 14:16:21 -0500
open5gs (2.1.0~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 11 Dec 2020 14:15:00 -0500
open5gs (2.1.0~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 11 Dec 2020 14:13:40 -0500
open5gs (2.0.22) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 19 Nov 2020 07:55:27 -0500
open5gs (2.0.22~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 19 Nov 2020 07:54:23 -0500
open5gs (2.0.22~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Thu, 19 Nov 2020 07:53:15 -0500
open5gs (2.0.21) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 11 Nov 2020 14:16:54 -0500
open5gs (2.0.21~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 11 Nov 2020 14:12:36 -0500
open5gs (2.0.21~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 11 Nov 2020 14:11:17 -0500
open5gs (2.0.20) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 23:05:14 -0500
open5gs (2.0.20~bionic3) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 23:04:15 -0500
open5gs (2.0.20~focal3) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 23:03:11 -0500
open5gs (2.0.19) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 01:49:04 -0400
open5gs (2.0.19~bionic3) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 01:47:12 -0400
open5gs (2.0.19~focal3) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 01:46:05 -0400
open5gs (2.0.18) unstable; urgency=medium
* Bug Fixed

27
debian/control vendored
View File

@@ -19,6 +19,7 @@ Build-Depends: debhelper (>= 11),
libyaml-dev,
libmicrohttpd-dev,
libcurl4-gnutls-dev,
libnghttp2-dev,
Standards-Version: 4.3.0
Rules-Requires-Root: no
Homepage: https://open5gs.org
@@ -186,6 +187,30 @@ Description: UDM (Unified Data Management)
.
This package provides the UDM (Unified Data Managemement)
Package: open5gs-pcf
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends},
open5gs-common (= ${binary:Version})
Description: PCF (Policy Control Function)
Open5GS is a C-language implementation of 5G Core and EPC
Packet Core, i.e. the core network of an NR/LTE network (Release-16)
.
This package provides the PCF (Policy Control Function)
Package: open5gs-nssf
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends},
open5gs-common (= ${binary:Version})
Description: NSSF (Network Slice Selection Function)
Open5GS is a C-language implementation of 5G Core and EPC
Packet Core, i.e. the core network of an NR/LTE network (Release-16)
.
This package provides the NSSF (Network Slice Selection Function)
Package: open5gs-udr
Architecture: any
Multi-Arch: same
@@ -214,6 +239,8 @@ Depends: ${misc:Depends},
open5gs-nrf (= ${binary:Version}),
open5gs-ausf (= ${binary:Version}),
open5gs-udm (= ${binary:Version}),
open5gs-pcf (= ${binary:Version}),
open5gs-nssf (= ${binary:Version}),
open5gs-udr (= ${binary:Version})
Description: 5G Core and EPC (metapackage)
Open5GS is a C-language implementation of 5G Core and EPC

View File

@@ -3,4 +3,4 @@ usr/lib/*/libfd*.so*
usr/lib/*/freeDiameter/*.fdx
configs/freeDiameter/cacert.pem /etc/freeDiameter
configs/logrotate/open5gs /etc/logrotate.d
misc/db/open5gs-dbctl /usr/bin
#misc/db/open5gs-dbctl /usr/bin

3
debian/open5gs-nssf.install vendored Normal file
View File

@@ -0,0 +1,3 @@
usr/bin/open5gs-nssfd
configs/open5gs/nssf.yaml etc/open5gs
configs/systemd/open5gs-nssfd.service lib/systemd/system

3
debian/open5gs-pcf.install vendored Normal file
View File

@@ -0,0 +1,3 @@
usr/bin/open5gs-pcfd
configs/open5gs/pcf.yaml etc/open5gs
configs/systemd/open5gs-pcfd.service lib/systemd/system

2
debian/rules vendored
View File

@@ -14,4 +14,4 @@ override_dh_install:
dh_install --sourcedir=obj-$(DEB_HOST_GNU_TYPE)
override_dh_auto_test:
cd obj-$(DEB_HOST_GNU_TYPE) && meson test --suite unit
cd obj-$(DEB_HOST_GNU_TYPE) && meson test -v --suite unit

View File

@@ -10,7 +10,7 @@ COPY setup.sh /root
ARG USER=open5gs
ARG REPO=open5gs
ARG BRANCH=master
ARG BRANCH=main
RUN git clone https://github.com/$USER/$REPO
ADD https://api.github.com/repos/$USER/$REPO/git/refs/heads/$BRANCH /root/open5gs-ver.json

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 cafe::1/64 dev ogstun 2> /dev/null
ip addr add cafe::1/64 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 link set ogstun up

View File

@@ -26,4 +26,5 @@ RUN yum -y install \
mongo-c-driver-devel \
libmicrohttpd-devel \
libcurl-devel \
libnghttp2-devel \
iproute

View File

@@ -31,6 +31,7 @@ RUN dnf -y install \
mongo-c-driver-devel \
libmicrohttpd-devel \
libcurl-devel \
libnghttp2-devel \
iproute
RUN dnf -y install meson

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 cafe::1/64 dev ogstun 2> /dev/null
ip addr add cafe::1/64 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 link set ogstun up

View File

@@ -3,25 +3,16 @@
docker-compose build
docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
TAG=eoan docker-compose build
TAG=eoan docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
TAG=bionic docker-compose build
TAG=bionic docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=fedora docker-compose build
DIST=fedora docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=fedora TAG=29 docker-compose build
DIST=fedora TAG=29 docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=fedora TAG=32 docker-compose build
DIST=fedora TAG=32 docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=centos docker-compose build
DIST=centos docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=centos TAG=7 docker-compose build
DIST=centos TAG=7 docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=debian docker-compose build
DIST=debian docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=debian TAG=stretch docker-compose build
DIST=debian TAG=stretch docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
docker rm $(docker ps -qa --no-trunc --filter "status=exited")

View File

@@ -27,6 +27,7 @@ RUN apt-get update && \
libyaml-dev \
libmicrohttpd-dev \
libcurl4-gnutls-dev \
libnghttp2-dev \
iproute2 \
ca-certificates \
netbase \

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 cafe::1/64 dev ogstun 2> /dev/null
ip addr add cafe::1/64 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 link set ogstun up

View File

@@ -1 +0,0 @@
stretch

View File

@@ -21,6 +21,7 @@ RUN dnf -y install \
mongo-c-driver-devel \
libmicrohttpd-devel \
libcurl-devel \
libnghttp2-devel \
iproute
RUN dnf -y install meson

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 cafe::1/64 dev ogstun 2> /dev/null
ip addr add cafe::1/64 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 link set ogstun up

1
docker/ubuntu/groovy Symbolic link
View File

@@ -0,0 +1 @@
../debian/latest

View File

@@ -27,6 +27,7 @@ RUN apt-get update && \
libyaml-dev \
libmicrohttpd-dev \
libcurl4-gnutls-dev \
libnghttp2-dev \
iproute2 \
ca-certificates \
netbase \

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 cafe::1/64 dev ogstun 2> /dev/null
ip addr add cafe::1/64 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 link set ogstun up

View File

@@ -2,11 +2,73 @@
title: Quickstart
---
**Note:** Open5GS supports installation of packages in *Debian/Ubuntu and openSUSE* environments. *CentOS, Fedora, FreeBSD, and Mac OSX* require you to [build with source code]({{ site.url }}{{ site.baseurl }}/docs/guide/02-building-open5gs-from-sources)
## 1. Introduction to Open5GS
---
Welcome! If you want to set up your first Open5GS core you have come to the right place. Before we get started, we'll spend a moment to understand the basic architecture of the software.
**TL;DR:** Open5GS contains a series of software components and network functions that implement the 4G/ 5G NSA and 5G SA core functions. If you know what each of these do already and how they interface with each other, skip to section 2.
{: .notice--info}
<style>
img {
max-width: 100%;
height: auto;
}
</style>
![Open5GS Diagram]({{ site.url }}{{ site.baseurl }}/assets/images/Open5GS_CUPS-01.jpg)
[[Higher quality PDF diagram available HERE]]({{ site.url }}{{ site.baseurl }}/assets/images/Open5GS_CUPS-01.pdf)
#### 4G/ 5G NSA Core
The Open5GS 4G/ 5G NSA Core contains the following components:
* MME - Mobility Management Entity
* HSS - Home Subscriber Server
* PCRF - Policy and Charging Rules Function
* SGWC - Serving Gateway Control Plane
* SGWU - Serving Gateway User Plane
* PGWC/SMF - Packet Gateway Control Plane / (component contained in Open5GS SMF)
* PGWU/UPF - Packet Gateway User Plane / (component contained in Open5GS UPF)
The core has two main planes: the control plane and the user plane. These are physically separated in Open5GS as CUPS (control/ user plane separation) is implemented.
The MME is the main **control plane** hub of the core. It primarily manages sessions, mobilty, paging and bearers. It links to the HSS, which generates SIM authentication vectors and holds the subscriber profile; and also to the SGWC and PGWC/SMF, which are the control planes of the gateway servers. All the eNBs in the mobile network (4G basestations) connect to the MME. The final element of the control plane is the PCRF, which sits in-between the PGWC/SMF and the HSS, and handles charging and enforces subscriber policies.
The **user plane** carries user data packets between the eNB/ NSA gNB (5G NSA basestations) and the external WAN. The two user plane core components are the SGWU and PGWU/UPF. Each of these connect back to their control plane counterparts. eNBs/ NSA gNBs connect to the SGWU, which connects to the PGWU/UPF, and on to the WAN. *By having the control and user planes physically separated like this, it means you can deploy multiple user plane servers in the field (eg somewhere with a high speed Internet connection), whilst keeping control functionality centralised. This enables support of MEC use cases, for example.*
All of these Open5GS components have config files. Each config file contains the component's IP bind addresses/ local Interface names **and** the IP addresses/ DNS names of the other components it needs to connect to. We'll come back to this in Section 3.
#### 5G SA Core
The Open5GS 5G SA Core contains the following functions:
* AMF - Access and Mobility Management Function
* SMF - Session Management Function
* UPF - User Plane Function
* AUSF - Authentication Server Function
* NRF - NF Repository Function
* UDM - Unified Data Management
* UDR - Unified Data Repository
* PCF - Policy and Charging Function
* NSSF - Network Slice Selection Function
The 5G SA core works in a different way to the 4G core - it uses a **Service Based Architecture** (SBI). **Control plane** functions are configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations) connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/ PGWC). The NSSF provides a way to select the network slice. Finally there is the PCF, used for charging and enforcing subscriber policies.
The 5G SA core **user plane** is much simpler, as it only contains a single function. The UPF carries user data packets between the gNB and the external WAN. It connects back to the SMF too.
With the exception of the SMF and UPF, all config files for the 5G SA core functions only contain the function's IP bind addresses/ local Interface names and the IP address/ DNS name of the NRF.
## 2. Install Open5GS with a Package Manager
---
**Note:** Package managers can be used to install Open5GS in *Debian/Ubuntu and openSUSE* environments (for major and minor builds). *CentOS, Fedora, and Mac OSX* require you to [build with source code]({{ site.url }}{{ site.baseurl }}/docs/guide/02-building-open5gs-from-sources).
{: .notice--warning}
**Note:** Nighly builds are offered by [Osmocom](https://osmocom.org) on [OBS](https://build.opensuse.org/package/show/network:osmocom:nightly/open5gs). Scroll down to use a nightly build package.
{: .notice--warning}
### Install Open5GS with a Package Manager
---
#### Ubuntu
@@ -48,19 +110,7 @@ https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbunt
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_19.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_19.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/
```
Nightly package build are provided by [Osmocom](https://osmocom.org) on [OBS](https://build.opensuse.org/package/show/network:osmocom:nightly/open5gs).
```
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_Testing/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_Unstable/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Raspbian_10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_18.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_18.10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_19.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_19.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.10/
```
#### openSUSE
@@ -73,134 +123,41 @@ $ sudo zypper install mongodb-server mongodb-shell
$ sudo zypper install open5gs
```
### Configure Open5GS
---
#### Nightly Builds
##### 5G Core
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
```diff
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400
@@ -165,23 +165,23 @@
- addr: 127.0.0.5
port: 7777
ngap:
- - addr: 127.0.0.5
+ - addr: 10.10.0.5
guami:
- plmn_id:
- mcc: 901
- mnc: 70
+ mcc: 001
+ mnc: 01
amf_id:
region: 2
set: 1
tai:
- plmn_id:
- mcc: 901
- mnc: 70
- tac: 1
+ mcc: 001
+ mnc: 01
+ tac: 2
plmn:
- plmn_id:
- mcc: 901
- mnc: 70
+ mcc: 001
+ mnc: 01
s_nssai:
- sst: 1
security:
```
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400
@@ -137,9 +137,7 @@
pfcp:
- addr: 127.0.0.7
gtpu:
- - addr:
- - 127.0.0.7
- - ::1
+ - addr: 10.11.0.7
pdn:
- addr: 10.45.0.1/16
- addr: cafe::1/64
```
##### 4G EPC
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
@@ -204,20 +204,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
s1ap:
- addr: 127.0.0.2
+ addr: 10.10.0.2
gtpc:
addr: 127.0.0.2
gummei:
plmn_id:
- mcc: 901
- mnc: 70
+ mcc: 001
+ mnc: 01
mme_gid: 2
mme_code: 1
tai:
plmn_id:
- mcc: 901
- mnc: 70
- tac: 1
+ mcc: 001
+ mnc: 01
+ tac: 2
security:
integrity_order : [ EIA1, EIA2, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
```
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
@@ -51,7 +51,7 @@
#
sgwu:
gtpu:
- addr: 127.0.0.6
+ addr: 10.11.0.6
pfcp:
addr: 127.0.0.6
```
After changing conf files, please restart Open5GS daemons.
Nightly bulit package are provided by [Osmocom](https://osmocom.org) on [OBS](https://build.opensuse.org/package/show/network:osmocom:nightly/open5gs). On *Ubuntu 20.04* you can install it like this:
```bash
$ sudo systemctl restart open5gs-amfd.service
$ sudo systemctl restart open5gs-upfd.service
$ sudo systemctl restart open5gs-mmed.service
$ sudo systemctl restart open5gs-sgwud.service
$ sudo apt update
$ sudo apt install wget gnupg
$ wget -qO - https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.04/Release.key | sudo apt-key add -
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.04/ ./' > /etc/apt/sources.list.d/open5gs.list"
$ sudo apt update
$ sudo apt install open5gs
```
### Install WebUI of Open5GS
Other distributions can be installed by changing the path.
```
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_Testing/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_Unstable/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Raspbian_10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_18.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_19.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_19.10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.10/
```
## 3. Install the WebUI of Open5GS
---
[Node.js](https://nodejs.org/) is required to install WebUI of Open5GS
The WebUI allows you to interactively edit subscriber data. While it is not essential to use this, it makes things easier when you are just starting out on your Open5GS adventure. (A [command line tool](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/db/open5gs-dbctl) is available for advanced users).
[Node.js](https://nodejs.org/) is required to install the WebUI of Open5GS
1. *Debian and Ubuntu* based Linux distributions can install [Node.js](https://nodejs.org/) as follows:
@@ -223,7 +180,181 @@ You can now install WebUI of Open5GS.
$ curl -sL {{ site.url }}{{ site.baseurl }}/assets/webui/install | sudo -E bash -
```
### Register Subscriber Information
## 4. Configure Open5GS
---
Okay - you have installed the software, now what to do with it? Well, there are some tweaks you will need to make to the config files, and you will need to enter subscriber data into your HSS/ UDR. You will also need to set some IP Table rules to bridge the PGWU/UPF to the WAN.
Out of the box, the default configurations see all of the Open5GS components fully configured for use on a single computer. They are set to communicate with each other using the local loopback address space (`127.0.0.X`). The default addresses for each of the bind interfaces for these components and functions are as follows:
```
MongoDB = 127.0.0.1 (subscriber data) - http://localhost:3000
MME-s1ap = 127.0.0.2 :36412 for S1-MME
MME-gtpc = 127.0.0.2 :2123 for S11
MME-frDi = 127.0.0.2 :3868 for S6a auth
SGWC-gtpc = 127.0.0.3 :2123 for S11
SGWC-pfcp = 127.0.0.3 :8805 for Sxa
SMF-gtpc = 127.0.0.4 :2123 for S5/8c, N11
SMF-pfcp = 127.0.0.4 :8805 for N4
SMF-frDi = 127.0.0.4 :3868 for Gx auth
SMF-sbi = 127.0.0.4 :7777 for 5G SBI (N7,N10,N11)
AMF-ngap = 127.0.0.5 :38412 for N2
AMF-sbi = 127.0.0.5 :7777 for 5G SBI (N8,N12,N11)
SGWU-pfcp = 127.0.0.6 :8805 for Sxa
SGWU-gtpu = 127.0.0.6 :2152 for S1-U, S5/8u
UPF-pfcp = 127.0.0.7 :8805 for N4
UPF-gtpu = 127.0.0.7 :2152 for S5/8u, N3
HSS-frDi = 127.0.0.8 :3868 for S6a auth
PCRF-frDi = 127.0.0.9 :3868 for Gx auth
NRF-sbi = 127.0.0.10:7777 for 5G SBI
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
UDM-sbi = 127.0.0.12:7777 for 5G SBI
PCF-sbi = 127.0.0.13:7777 for 5G SBI
NSSF-sbi = 127.0.0.14:7777 for 5G SBI
UDR-sbi = 127.0.0.20:7777 for 5G SBI
```
#### Setup a 4G/ 5G NSA Core
You will need to modify your 4G MME config to support your PLMN and TAC. The international test PLMN is 001/01, and the international private network PLMN is 999/99. You should stick to using either of these PLMNs unless you have been issued a PLMN by your national regulator. (This PLMN will need to be configured in your eNB).
If you are aiming to connect an external eNB to your core, you will also need to change the S1AP bind address of the MME **and** the GTP-U bind address of the SGWU. If you are running an eNB stack locally, you will not need to make these changes.
Modify [/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
mme:
freeDiameter: /etc/freeDiameter/mme.conf
s1ap:
- addr: 127.0.0.2
+ addr: 10.10.0.2 # for external eNB - a local address that can be reached by the eNB
gtpc:
addr: 127.0.0.2
gummei:
plmn_id:
- mcc: 901
- mnc: 70
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
mme_gid: 2
mme_code: 1
tai:
plmn_id:
- mcc: 901
- mnc: 70
- tac: 1
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
+ tac: 2 # should match the TAC used by your eNB
security:
```
Modify [/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
sgwu:
gtpu:
- addr: 127.0.0.6
+ addr: 10.11.0.6 # for external eNB - a local address that can be reached by the eNB
pfcp:
addr: 127.0.0.6
```
After changing config files, please restart Open5GS daemons.
```bash
$ sudo systemctl restart open5gs-mmed
$ sudo systemctl restart open5gs-sgwud
```
#### Setup a 5G Core
You will need to modify your 5G AMF config to support your PLMN and TAC. The international test PLMN is 001/01, and the international private network PLMN is 999/99. You should stick to using either of these PLMNs unless you have been issued a PLMN by your national regulator. (This PLMN will need to be configured in your gNB).
If you are aiming to connect an external gNB to your core, you will also need to change the NGAP bind address of the AMF **and** the GTPU bind address of the UPF. If you are running an gNB stack locally, you will not need to make these changes.
Modify [/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
```diff
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
amf:
sbi:
- addr: 127.0.0.5
port: 7777
ngap:
- - addr: 127.0.0.5
+ - addr: 10.10.0.5 # for external gNB - a local address that can be reached by the gNB
guami:
- plmn_id:
- mcc: 901
- mnc: 70
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
amf_id:
region: 2
set: 1
tai:
- plmn_id:
- mcc: 901
- mnc: 70
- tac: 1
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
+ tac: 2 # should match the TAC used by your gNB
plmn_support:
- plmn_id:
- mcc: 901
- mnc: 70
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
s_nssai:
- sst: 1
security:
```
Modify [/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U address.
```diff
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- - addr: 127.0.0.7
+ - 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
```
After changing config files, please restart Open5GS daemons.
```bash
$ sudo systemctl restart open5gs-amfd
$ sudo systemctl restart open5gs-upfd
```
#### Register Subscriber Information
---
Connect to `http://localhost:3000` and login with **admin** account.
@@ -241,15 +372,21 @@ To add subscriber information, you can do WebUI operations in the following orde
3. Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
4. Click `SAVE` Button
**Tip:** This addition immediately affects Open5GS without restaring any daemon.
Enter the subscriber details of your SIM cards using this tool, to save the subscriber profile in the HSS and UDR MongoDB database backend. If you are using test SIMs, the details are normally printed on the card.
**Tip:** Subscribers added with this tool immediately register in the Open5GS HSS/ UDR without the need to restart any daemon.
{: .notice--info}
### Adding a route for UE to have Internet connectivity {#UEInternet}
#### Adding a route for the UE to have WAN connectivity {#UEInternet}
---
If your phone can connect to internet, you must run the following command in Open5GS-PGW installed host.
In order to bridge between the PGWU/UPF and WAN (Internet), you must enable IP forwarding and add a NAT rule to your IP Tables.
**Note:** For the first run, it makes things simpler 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 rules differently.
{: .notice--danger}
You can check your current IP Table rules with the following commands (these tables are empty):
```bash
### Check IP Tables
$ sudo iptables -L
@@ -275,27 +412,86 @@ target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
```
### Enable IPv4 Forwarding
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
To enable forwarding and add the NAT rule, enter
```bash
### Enable IPv4/IPv6 Forwarding
$ sudo sysctl -w net.ipv4.ip_forward=1
$ 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
```
**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.
{: .notice--danger}
### Turn on your gNB/eNB and Phone
## 5. Turn on your eNB/gNB and UE
---
- Connect your gNB/eNB to the IP of your server via the standard NGAP/S1AP port of SCTP 38412/36412 (for AMF/MME)
- You can see actual traffic through wireshark -- [[srsenb.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/srsenb.pcapng).
- You can view the log at `/var/log/open5gs/*.log`.
First, connect your eNB/gNB to the Open5GS core:
* Make sure the PLMN and TAC of the eNB/gNB matches the settings in your MME/AMF
* Connect your eNB/gNB to the IP of your server via the standard S1AP/NGAP SCTP port 36412/38412 (for MME/AMF)
* Your eNB/gNB should report a successful S1/NG connection - congrats, your core is fully working!
* You can see actual traffic through wireshark -- [[srsenb.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/srsenb.pcapng).
* You can view the log at `/var/log/open5gs/*.log`, eg:
```bash
### Watch the live MME log
tail -f /var/log/open5gs/mme.log
```
Next, try to attach a UE to the basestation:
* Insert your SIM card to the UE
* Set the UE's APN to match the APN you configured in the Open5GS WebUI
* Toggle the UE in and out of flight mode
* If it doesn't automatically connect, try manually searching for a network
* If the PLMN set on the SIM card does not match the PLMN being used by the radio, you will need to ensure 'data roaming' on the UE is switched on
## 6. Starting and Stopping Open5GS
---
When you install the software using the package manager, it is setup to run as a systemd service. You can stop and restart the components and network functions as follows:
```bash
$ sudo systemctl stop open5gs-mmed
$ sudo systemctl stop open5gs-sgwcd
$ sudo systemctl stop open5gs-smfd
$ sudo systemctl stop open5gs-amfd
$ sudo systemctl stop open5gs-sgwud
$ sudo systemctl stop open5gs-upfd
$ sudo systemctl stop open5gs-hssd
$ sudo systemctl stop open5gs-pcrfd
$ sudo systemctl stop open5gs-nrfd
$ sudo systemctl stop open5gs-ausfd
$ sudo systemctl stop open5gs-udmd
$ sudo systemctl stop open5gs-pcfd
$ sudo systemctl stop open5gs-nssfd
$ sudo systemctl stop open5gs-udrd
$ sudo systemctl stop open5gs-webui
```
```bash
$ sudo systemctl restart open5gs-mmed
$ sudo systemctl restart open5gs-sgwcd
$ sudo systemctl restart open5gs-smfd
$ sudo systemctl restart open5gs-amfd
$ sudo systemctl restart open5gs-sgwud
$ sudo systemctl restart open5gs-upfd
$ sudo systemctl restart open5gs-hssd
$ sudo systemctl restart open5gs-pcrfd
$ sudo systemctl restart open5gs-nrfd
$ sudo systemctl restart open5gs-ausfd
$ sudo systemctl restart open5gs-udmd
$ sudo systemctl restart open5gs-pcfd
$ sudo systemctl restart open5gs-nssfd
$ sudo systemctl restart open5gs-udrd
$ sudo systemctl restart open5gs-webui
```
### Uninstall Open5GS and WebUI
## 7. Uninstall Open5GS and WebUI
How to remove Open5GS package:
To remove the Open5GS packages:
1. On *Ubuntu/Debian*:

View File

@@ -6,10 +6,14 @@ head_inline: "<style> .blue { color: blue; } </style>"
This post explains how to compile and install the source code on **Debian/Ubuntu** based Linux Distribution.
{: .blue}
**Note:** Ubuntu 16.04(xenial) and earlier versions, and Debian 9(stretch) and earlier versions are not supported.
{: .notice--danger}
### Getting MongoDB
---
Install MongoDB with package manager. It is used as database for the HSS and PCRF.
Install MongoDB with package manager. It is used as database for NRF/PCF/UDR and PCRF/HSS.
```bash
$ sudo apt update
@@ -26,11 +30,11 @@ 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 cafe::1/64 dev ogstun
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
$ sudo ip link set ogstun up
```
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/master/misc/netconf.sh) makes it easy to configure the TUN device as follows:
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
`$ sudo ./misc/netconf.sh`
{: .notice--info}
@@ -40,7 +44,7 @@ $ sudo ip link set ogstun up
Install the dependencies for building the source code.
```bash
$ 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 libmicrohttpd-dev libcurl4-gnutls-dev meson
$ 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 meson
```
Git clone.
@@ -74,7 +78,7 @@ $ cd build
$ meson test -v
```
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
{: .notice--info}
You need to perform the **installation process**.
@@ -89,7 +93,7 @@ $ cd ../
##### 5G Core
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
```diff
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
@@ -118,7 +122,7 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
+ mcc: 001
+ mnc: 01
+ tac: 2
plmn:
plmn_support:
- plmn_id:
- mcc: 901
- mnc: 70
@@ -129,7 +133,7 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
security:
```
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
@@ -142,13 +146,13 @@ $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
- - 127.0.0.7
- - ::1
+ - addr: 10.11.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
```
##### 4G EPC
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
@@ -183,7 +187,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
ciphering_order : [ EEA0, EEA1, EEA2 ]
```
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
@@ -205,33 +209,10 @@ If you modify the config files while Open5GS daemons are running, please restart
### Running Open5GS
---
Specify the absolute path to the shared library as follows.
```bash
$ echo $(cd $(dirname ./install/lib/x86_64-linux-gnu/) && pwd -P)/$(basename ./install/lib/x86_64-linux-gnu/)
/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
$ export LD_LIBRARY_PATH=/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
$ ldd ./install/bin/open5gs-amfd
...
libogsapp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsapp.so.1 (0x00007f161ab51000)
libogscore.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.1 (0x00007f161a922000)
libogssctp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogssctp.so.1 (0x00007f161a71d000)
libogss1ap.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogss1ap.so.1 (0x00007f161a519000)
...
```
If you want to set the shared library path permanently, you can use ldconfig.
```bash
$ sudo sh -c "echo /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu > /etc/ld.so.conf.d/open5gs.conf"
$ sudo ldconfig
```
Now let's get started.
```bash
$ cd install/bin/
$ ./install/bin/open5gs-mmed
Open5GS daemon v1.3.0-213-gd190548+
$ ./install/bin/open5gs-mmed
Open5GS daemon v2.1.0
08/21 22:53:47.328: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../src/main.c:54)
08/21 22:53:47.328: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/mme.log' (../src/main.c:57)
@@ -240,8 +221,8 @@ Open5GS daemon v1.3.0-213-gd190548+
08/21 22:53:47.365: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:59)
08/21 22:53:47.366: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:57)
$ ./install/bin/open5gs-sgwcd
Open5GS daemon v1.3.0-213-gd190548+
$ ./install/bin/open5gs-sgwcd
Open5GS daemon v2.1.0
08/21 22:54:43.059: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../src/main.c:54)
08/21 22:54:43.059: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwc.log' (../src/main.c:57)
@@ -251,7 +232,7 @@ Open5GS daemon v1.3.0-213-gd190548+
08/21 22:54:43.066: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.6]:8805 (../lib/pfcp/path.c:60)
$ ./install/bin/open5gs-smfd
Open5GS daemon v1.3.0-213-gd190548+
Open5GS daemon v2.1.0
08/21 22:54:56.000: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../src/main.c:54)
08/21 22:54:56.000: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/smf.log' (../src/main.c:57)
@@ -264,7 +245,7 @@ Open5GS daemon v1.3.0-213-gd190548+
08/21 22:54:56.051: [sbi] INFO: sbi_server() [127.0.0.4]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-amfd
Open5GS daemon v1.3.0-213-gd190548+
Open5GS daemon v2.1.0
08/21 22:55:14.015: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/amf.yaml' (../src/main.c:54)
08/21 22:55:14.015: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log' (../src/main.c:57)
@@ -272,8 +253,8 @@ Open5GS daemon v1.3.0-213-gd190548+
08/21 22:55:14.040: [sbi] INFO: sbi_server() [127.0.0.5]:7777 (../lib/sbi/server.c:298)
08/21 22:55:14.040: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:56)
$ ./install/bin/open5gs-sgwud
Open5GS daemon v1.3.0-213-gd190548+
$ ./install/bin/open5gs-sgwud
Open5GS daemon v2.1.0
08/21 22:54:10.357: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../src/main.c:54)
08/21 22:54:10.357: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwu.log' (../src/main.c:57)
@@ -281,8 +262,8 @@ Open5GS daemon v1.3.0-213-gd190548+
08/21 22:54:10.360: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31)
08/21 22:54:10.361: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:32)
$ ./install/bin/open5gs-upfd
Open5GS daemon v1.3.0-213-gd190548+
$ ./install/bin/open5gs-upfd
Open5GS daemon v2.1.0
08/21 22:54:21.596: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../src/main.c:54)
08/21 22:54:21.596: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/upf.log' (../src/main.c:57)
@@ -292,15 +273,15 @@ Open5GS daemon v1.3.0-213-gd190548+
08/21 22:54:21.601: [gtp] INFO: gtp_server() [::1]:2152 (../lib/gtp/path.c:32)
$ ./install/bin/open5gs-hssd
Open5GS daemon v1.3.0-213-gd190548+
Open5GS daemon v2.1.0
08/21 22:57:17.450: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/hss.yaml' (../src/main.c:54)
08/21 22:57:17.450: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/hss.log' (../src/main.c:57)
08/21 22:57:17.451: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99)
08/21 22:57:17.519: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
$ ./install/bin/open5gs-pcrfd
Open5GS daemon v1.3.0-213-gd190548+
$ ./install/bin/open5gs-pcrfd
Open5GS daemon v2.1.0
08/21 22:57:45.894: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../src/main.c:54)
08/21 22:57:45.894: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcrf.log' (../src/main.c:57)
@@ -308,7 +289,7 @@ Open5GS daemon v1.3.0-213-gd190548+
08/21 22:57:45.997: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31)
$ ./install/bin/open5gs-nrfd
Open5GS daemon v1.3.0-213-gd190548+
Open5GS daemon v2.1.0
08/21 22:56:35.472: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nrf.yaml' (../src/main.c:54)
08/21 22:56:35.472: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nrf.log' (../src/main.c:57)
@@ -317,23 +298,39 @@ Open5GS daemon v1.3.0-213-gd190548+
08/21 22:56:35.473: [sbi] INFO: sbi_server() [::1]:7777 (../lib/sbi/server.c:298
$ ./install/bin/open5gs-ausfd
Open5GS daemon v1.3.0-213-gd190548+
Open5GS daemon v2.1.0
08/21 22:55:41.899: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/ausf.yaml' (../src/main.c:54)
08/21 22:55:41.899: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/ausf.log' (../src/main.c:57)
08/21 22:55:41.900: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31)
08/21 22:55:41.900: [sbi] INFO: sbi_server() [127.0.0.11]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-udmd
Open5GS daemon v1.3.0-213-gd190548+
$ ./install/bin/open5gs-udmd
Open5GS daemon v2.1.0
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../src/main.c:54)
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udm.log' (../src/main.c:57)
08/21 22:56:02.155: [app] INFO: UDM initialize...done (../src/udm/app.c:31)
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-udrd
Open5GS daemon v1.3.0-213-gd190548+
$ ./install/bin/open5gs-pcfd
Open5GS daemon v2.1.0
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcf.yaml' (../src/main.c:54)
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log' (../src/main.c:57)
08/21 22:56:02.155: [app] INFO: PCF initialize...done (../src/pcf/app.c:31)
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-nssfd
Open5GS daemon v2.1.0
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nssfd.yaml' (../src/main.c:54)
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nssfd.log' (../src/main.c:57)
08/21 22:56:02.155: [app] INFO: NSSF initialize...done (../src/nssfd/app.c:31)
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-udrd
Open5GS daemon v2.1.0
08/21 22:56:15.810: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../src/main.c:54)
08/21 22:56:15.810: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udr.log' (../src/main.c:57)
@@ -366,9 +363,9 @@ $ cp open5gs* /usr/bin/
For convenience, you can execute all NFs at once by using the following command.
```bash
$ ./build/tests/app/5gc ## 5G Core Only with ./build/config/sample.yaml
$ ./build/tests/app/epc -c ./build/config/srslte.yaml ## EPC Only with ./build/config/srslte.yaml
$ ./build/tests/app/app ## Both 5G Core and EPC with ./build/config/sample.yaml
$ ./build/tests/app/5gc ## 5G Core Only with ./build/configs/sample.yaml
$ ./build/tests/app/epc -c ./build/configs/srslte.yaml ## EPC Only with ./build/configs/srslte.yaml
$ ./build/tests/app/app ## Both 5G Core and EPC with ./build/configs/sample.yaml
```
### Building the WebUI of Open5GS
@@ -386,7 +383,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm install
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.
@@ -395,10 +392,17 @@ The WebUI runs as an [npm](https://www.npmjs.com/) script.
$ npm run dev
```
Server listening can be changed by setting the environment variable HOSTNAME or PORT as below.
```bash
$ HOSTNAME=192.168.0.11 npm run dev
$ PORT=7777 npm run dev
```
### Register Subscriber Information
---
Connect to `http://localhost:3000` and login with **admin** account.
Connect to `http://127.0.0.1:3000` and login with **admin** account.
> Username : admin
> Password : 1423
@@ -448,11 +452,13 @@ target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
### Enable IPv4 Forwarding
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
### Enable IPv4/IPv6 Forwarding
$ sudo sysctl -w net.ipv4.ip_forward=1
$ 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
```
**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

@@ -33,7 +33,9 @@ PCRF-frDi = 127.0.0.9 :3868 for Gx auth
NRF-sbi = 127.0.0.10:7777 for 5G SBI
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
UDM-sbi = 127.0.0.12:7777 for 5G SBI
UDR-sbi = 127.0.0.13:7777 for 5G SBI
PCF-sbi = 127.0.0.13:7777 for 5G SBI
NSSF-sbi = 127.0.0.14:7777 for 5G SBI
UDR-sbi = 127.0.0.20:7777 for 5G SBI
```
_Cloud Userplane Server (to host IMS etc)_
@@ -49,7 +51,7 @@ You can refer to the network settings at
[{{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf]({{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf) provided by [@kbarlee](https://github.com/kbarlee) in issue [#528](https://github.com/{{ site.github_username }}/open5gs/issues/528)
{: .notice--danger}
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
@@ -84,7 +86,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
ciphering_order : [ EEA0, EEA1, EEA2 ]
```
Modify [install/etc/open5gs/sgwc.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwc.yaml.in) to set the PFCP IP address.
Modify [install/etc/open5gs/sgwc.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwc.yaml.in) to set the PFCP IP address.
```diff
$ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
@@ -49,7 +49,7 @@
@@ -107,7 +109,7 @@ $ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
# parameter:
```
Modify [install/etc/open5gs/smf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/smf.yaml.in) to set the PFCP IP address.
Modify [install/etc/open5gs/smf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/smf.yaml.in) to set the PFCP IP address.
```diff
$ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
--- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
@@ -119,9 +121,9 @@ $ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
- - addr: 127.0.0.4
- - addr: ::1
+ - addr: 10.10.0.4
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
@@ -282,7 +281,7 @@
#
upf:
@@ -134,7 +136,7 @@ $ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
```
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
```diff
diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
@@ -163,7 +165,7 @@ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
+ mcc: 901
+ mnc: 70
+ tac: 1
plmn:
plmn_support:
- plmn_id:
- mcc: 001
- mnc: 01
@@ -177,7 +179,7 @@ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
ciphering_order : [ NEA0, NEA1, NEA2 ]
```
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U and PFCP IP address.
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
@@ -196,7 +198,7 @@ $ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
# sgwc:
```
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400
@@ -212,9 +214,9 @@ $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
- - 127.0.0.7
- - ::1
+ - addr: 10.11.0.7
pdn:
subnet:
- addr: 10.45.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
```
After changing conf files, please restart Open5GS daemons.

View File

@@ -0,0 +1,51 @@
---
title: eNodeBs / gNodeBs tested on Open5GS
head_inline: "<style> .blue { color: blue; } .bold { font-weight: bold; } </style>"
---
This page lists Radio hardware that has been tested by members of the Open5GS community,
Listed eNodeBs have at a minimum connected to Open5GS. This does not mean all functionality (dedicated bearers, GBRs, etc) has been tested.
If you have tested radio hardware from a vendor not listed with Open5GS, please add it to this page [by creating a PR on GitHub.](https://github.com/open5gs/open5gs)
### Commercial Macro BTS
---
* Huawei BTS 3900 (S/W version V100R011C10SPC230)
### Small Cells
---
* Baicells Neutrino
* Baicells Nova 243
* Baicells Nova 246
* Baicells Nova 436Q
* Baicells Nova 227 (EBS & CBRS)
* Baicells Nova 233
* Airspan AirSpeed 1030
* Airspan AirHarmony 1000
* AirHarmony 4000
* AirHarmony 4200
* AirHarmony 4400
* Gemtek WLTGFC-101 (S/W version 2.1.1746.1116)
* 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
* Accelleran E1010 (LTE TDD B42)
### OpenRAN Hardware
---
### 4G/5G Software Stacks + SDRs
---
* [srsLTE / srsENB](https://github.com/srsLTE/srsLTE) + LimeSDR, USRP, BladeRF x40 (BladeRF Not stable)
* [Amarisoft](https://www.amarisoft.com/) + LimeSDR, USRP, Amarisoft PCI Express Card
### Misc Radio Hardware
---
* [OsmoBTS](https://osmocom.org/projects/osmobts/wiki) controlled ip.access NanoBTS (Used for CSFB with Osmocom)
* [UERANSIM](https://github.com/aligungr/UERANSIM) 5G RAN Simulator
* [OpenAirInterface v1.0.3](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/v1.0.3) 4G RAN Simulator

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=cafe::1/64
Address=2001:230: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 cafe::1 prefixlen 64 scopeid 0x0<global>
inet6 2001:230: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

@@ -6,10 +6,85 @@ head_inline: "<style> .blue { color: blue; } </style>"
This guide is based on **CentOS 8** Distribution.
{: .blue}
### Getting MongoDB
## Install **CentOS 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.
This allows the user to quickly create a virtual machine without the hassle
of installing the operating system by hand.
### Install Vagrant
---
Create the MongoDB repository file.
The instructions to install Vagrant are provided at
[vagrantup.com](https://www.vagrantup.com/).
### Create a CentOS 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
the exception that the amount of virtual memory has been increased to 1GB:
```bash
cd vagrant/centos
vagrant up --provider virtualbox
```
### Log into the newly created CentOS VM
---
Use SSH to log into the CentOS 8 VM:
```bash
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.
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.
## Install prerequisite packages to build and run Open5GS
---
### Enable CentOS 8 PowerTools repository
---
```bash
$ sudo dnf install 'dnf-command(config-manager)'
$ sudo dnf config-manager --set-enabled PowerTools
```
### Enable the Extra Packages for Enterprise Linux
---
Enable the Extra Packages for Enterprise Linux repo by installing the
``epel-release`` package:
```bash
$ sudo dnf install epel-release
```
### Enable [ELRepo](https://elrepo.org)
---
Enable the ELRepo repo (with testing enabled):
```bash
$ sudo dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
$ sudo dnf config-manager --set-enabled elrepo-testing
```
### Install MongoDB using the package manager:
---
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]
@@ -21,28 +96,128 @@ gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
EOF'
```
Install MongoDB with Package Manager.
Install MongoDB using the package manager:
```bash
sudo dnf -y install mongodb-org
$ sudo dnf -y install mongodb-org
```
Run MongoDB server.
### Install the dependencies for building the source code.
---
Open5GS requires several packages which are not installed by default in
a base CentOS 8 installation.
```bash
$ mkdir -p ./data/db
$ mongod --dbpath ./data/db
$ sudo dnf install python3 meson ninja-build gcc 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
```
### Setting up TUN device (No persistent after rebooting)
### Install the SCTP kernel module in kernel-modules-extra.
---
Create the TUN device. Interface name will be `ogstun`.
```bash
$ sudo yum -y install iproute
$ sudo dnf install kernel-modules-extra
```
### Install iproute IP interface tools.
---
```bash
$ sudo dnf install iproute
```
### Update all installed packages to the latest versions.
---
This will update all of the installed packages to the latest versions from
all of the repos that we enabled above.
```bash
$ sudo dnf update
```
Note that this may update the kernel version so you may need to reboot
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] $ # ssh back into the VM after it reboots...
[host] $ vagrant ssh
```
## Build Open5GS from Source
---
### Git clone the Open5GS source code.
---
Clone a copy of the open5GS source code from github:
```bash
$ cd ~
$ git clone https://github.com/{{ site.github_username }}/open5gs
```
### Compile the Open5GS source.
---
Compile the source using `meson`. Note that this sets the installation prefix
to `~/open5gs/install`:
```bash
$ cd ~/open5gs
$ meson build --prefix=`pwd`/install
$ ninja -C build
```
## Run and Test Open5GS
---
### Start MongoDB
---
After installing the MongoDB server, it will be started automatically
when the machine is rebooted. You can check the status using `systemctl`:
```bash
$ sudo systemctl status mongod.service
● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2020-11-20 09:46:40 UTC; 10h ago
Docs: https://docs.mongodb.org/manual
Process: 779 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
Process: 775 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 770 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 732 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
Main PID: 781 (mongod)
Memory: 99.7M
CGroup: /system.slice/mongod.service
└─781 /usr/bin/mongod -f /etc/mongod.conf
```
If it has not started, then it can be started using `systemctl`:
```bash
$ sudo systemctl enable mongod.service
$ sudo systemctl start mongod.service
```
The default database location is `/var/log/mongodb/mongod.log`. This can
be adjusted in `/etc/mongod.conf`.
### Set up a TUN interface
---
Create a TUN/TAP interface. The interface name will be `ogstun`.
```bash
$ sudo ip tuntap add name ogstun mode tun
$ ip link show
```
Then, to support IPv6-enabled UEs, you must configure your TUN device to support IPv6.
To support IPv6-enabled UEs, you must configure the `ogstun` interface
to support IPv6. This is done by setting the `diable_ipv6` option for
`ogstun` to 0 (false):
```bash
$ sysctl -n net.ipv6.conf.ogstun.disable_ipv6
@@ -54,14 +229,14 @@ $ sysctl -n net.ipv6.conf.ogstun.disable_ipv6
0
```
**Note:** If your TUN device already supports IPv6, you can skip this steps above.
{: .notice--warning}
**Note:** If your TUN interface already supports IPv6, you can skip this steps above.
{: .notice--info}
You are now ready to set the IP address on TUN device.
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 cafe::1/64 dev ogstun
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
```
Make sure it is set up properly.
@@ -70,94 +245,104 @@ $ sudo ip link set ogstun up
$ ip link show
```
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/master/misc/netconf.sh) makes it easy to configure the TUN device as follows:
**Notice:** This configuration is not persistent after rebooting. The
script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{
site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy
to configure the TUN device as follows:
`$ sudo ./misc/netconf.sh`
{: .notice--info}
### Building Open5GS
### 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
---
Configure EPEL package.
### Run Individual Open5GS tests.
----
Open5GS test applications are created in the `~/open5gs/build/tests` directory.
```bash
$ sudo dnf install epel-release
```
$ cd ~/open5gs
Enable PowerTools.
```bash
$ sudo dnf install 'dnf-command(config-manager)'
$ sudo dnf config-manager --set-enabled PowerTools
$ sudo update
```
Configure ELRepo(with testing) package.
```bash
$ sudo dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
$ sudo dnf config-manager --set-enabled elrepo-testing
$ sudo dnf update
```
Install the depedencies for building the source code.
```bash
$ sudo dnf install python3 ninja-build gcc 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 iproute
```
Install Meson
```bash
$ sudo dnf install meson
```
Git clone.
```bash
$ git clone https://github.com/{{ site.github_username }}/open5gs
```
To compile with meson:
```bash
$ cd open5gs
$ meson build --prefix=`pwd`/install
$ ninja -C build
```
Check whether the compilation is correct.
```bash
$ ./build/tests/attach/attach ## EPC Only
s1setup-test : SUCCESS
guti-test : SUCCESS
auth-test : SUCCESS
idle-test : SUCCESS
emm-status-test : SUCCESS
ue-context-test : SUCCESS
reset-test : SUCCESS
All tests passed.
$ ./build/tests/registration/registration ## 5G Core Only
guti-test : SUCCESS
auth-test : SUCCESS
idle-test : SUCCESS
dereg-test : SUCCESS
identity-test : SUCCESS
gmm-status-test : SUCCESS
ue-context-test : SUCCESS
All tests passed.
```
Run all test programs as below.
### Run all Open5GS tests.
----
Run all Open5GS test programs:
```bash
$ cd ~/open5gs
$ cd build
$ meson test -v
```
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
**Tip:** You can also check the result of `meson test -v` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
{: .notice--info}
You need to perform the **installation process**.
### Installing Open5GS.
----
Open5GS can be installed using meson as well. This will install the
product to `$(HOME)/open5gs/install` if the `prefix` was set as shown above.
```bash
$ cd ~/open5gs
$ cd build
$ ninja install
$ cd ../
$ ls install/bin
open5gs-amfd open5gs-hssd open5gs-nrfd open5gs-sgwcd open5gs-smfd open5gs-udrd
open5gs-ausfd open5gs-mmed open5gs-pcrfd open5gs-sgwud open5gs-udmd open5gs-pcfd
open5gs-upfd open5gs-nssfd
```
### Building WebUI of Open5GS
## Building WebUI of Open5GS
---
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
Install Node.js:
```bash
$ curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
$ sudo yum -y install nodejs
$ sudo dnf install nodejs
```
Install the dependencies to run WebUI
```bash
$ cd ~/open5gs
$ cd webui
$ npm install
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.

View File

@@ -3,9 +3,12 @@ title: Fedora
head_inline: "<style> .blue { color: blue; } </style>"
---
This guide is based on **Fedora 31** Distribution.
This guide is based on **Fedora 33** Distribution.
{: .blue}
**Note:** Fedora 33 is not working
{: .notice--danger}
### Getting MongoDB
---
@@ -49,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 cafe::1/64 dev ogstun
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
```
Make sure it is set up properly.
@@ -58,7 +61,7 @@ $ sudo ip link set ogstun up
$ ip link show
```
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/master/misc/netconf.sh) makes it easy to configure the TUN device as follows:
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
`$ sudo ./misc/netconf.sh`
{: .notice--info}
@@ -67,7 +70,7 @@ $ ip link show
Install the depedencies for building the source code.
```bash
$ sudo dnf install python3 ninja-build gcc 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 iproute
$ sudo dnf install python3 ninja-build gcc 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 iproute
```
Install Meson
@@ -101,7 +104,7 @@ $ cd build
$ meson test -v
```
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
{: .notice--info}
You need to perform the **installation process**.
@@ -124,7 +127,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm install
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.

View File

@@ -1,131 +0,0 @@
---
title: FreeBSD
head_inline: "<style> .blue { color: blue; } </style>"
---
This guide is based on **FreeBSD Relase 11.1**.
{: .blue}
### Getting MongoDB
---
Install MongoDB with package manager.
```bash
$ sudo pkg install mongodb
```
Run MongoDB server.
```bash
$ mkdir -p ./data/db
$ mongod --dbpath ./data/db
```
### Setting up TUN device (No persistent after rebooting)
---
Configure the TUN device.
```bash
$ 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
```
Enable IP forwarding
```bash
$ sudo sysctl -w net.inet.ip.forwarding=1
```
**Tip:** The script provided in [$GIT_REPO/support/network/restart.sh](https://github.com/{{ site.github_username }}/open5gs/blob/master/support/network/restart.sh) makes it easy to configure the TUN device as follows:
`$ sudo ./support/network/restart.sh`
{: .notice--info}
### Building Open5GS
---
Install the depedencies for building the source code.
```bash
$ sudo pkg install py36-pip ninja gcc bison gsed pkgconf git mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd curl
```
Install Meson using Python.
```bash
$ sudo pip install --upgrade pip
$ sudo pip install meson
```
Git clone.
```bash
$ git clone https://github.com/{{ site.github_username }}/open5gs
```
To compile with meson:
```bash
$ cd open5gs
$ meson build --prefix=`pwd`/install
$ ninja -C build
```
Check whether the compilation is correct.
**Note:** This should require *sudo* due to access `/dev/tun0`.
{: .notice--danger}
```bash
$ sudo ./build/tests/attach/attach ## EPC Only
$ sudo ./build/tests/registration/registration ## 5G Core Only
```
Run all test programs as below.
**Note:** This should require *sudo* due to access `/dev/tun0`.
{: .notice--danger}
```bash
$ cd build
$ sudo meson test -v
```
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
{: .notice--info}
You need to perform the **installation process**.
```bash
$ cd build
$ ninja install
$ cd ../
```
### Building WebUI of Open5GS
---
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
```bash
$ sudo pkg install node
```
Install the dependencies to run WebUI
```bash
$ cd webui
$ npm install
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.
```bash
$ npm run dev
```

View File

@@ -0,0 +1,172 @@
---
title: Mac OS X
head_inline: "<style> .blue { color: blue; } </style>"
---
This guide is based on macOS Big Sur 11.2 on a Macbook Air(Apple M1 Chips) computer.
{: .blue}
### Install Xcode Command-Line Tools
---
Homebrew requires the Xcode command-line tools from Apple's Xcode.
```bash
$ xcode-select --install
```
### Installing Homebrew
---
Install brew using the official Homebrew installation instructions.
```bash
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
### Getting MongoDB
---
Install MongoDB with Package Manager.
```bash
$ brew tap mongodb/brew
$ brew install mongodb-community
```
Run MongoDB server.
```bash
$ mongod --config /usr/local/etc/mongod.conf
```
**Tip:** MongoDB is persistent after rebooting with the following commands:
`$ brew services start mongodb-community`
{: .notice--info}
### Setting up network (No persistent after rebooting)
---
Note that Open5GS uses built-in "utun" device driver. So, You don't have to install external TUN/TAP driver.
{: .blue}
Configure the loopback interface.
```bash
$ 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
```
Enable IP forwarding & Masquerading
```bash
$ 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 pfctl -e -f /etc/pf.anchors/org.open5gs
```
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
`$ sudo ./misc/netconf.sh`
{: .notice--info}
### Building Open5GS
---
Install the depedencies for building the source code.
```bash
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config bison
```
Configure Homebrew PATH
```bash
$ export PATH="/opt/homebrew/opt/bison/bin:/opt/homebrew/bin:$PATH"
$ export LIBRARY_PATH=/opt/homebrew/lib
$ export C_INCLUDE_PATH=/opt/homebrew/include
```
Install Meson using Homebrew.
```bash
$ brew install meson
```
Git clone.
```bash
$ git clone https://github.com/{{ site.github_username }}/open5gs
```
To compile with meson:
```bash
$ cd open5gs
$ meson build --prefix=`pwd`/install -D c_std=c99
$ ninja -C build
```
Check whether the compilation is correct.
**Note:** This should require *sudo* due to access `/dev/tun0`.
{: .notice--danger}
```bash
$ sudo ./build/tests/attach/attach ## EPC Only
$ sudo ./build/tests/registration/registration ## 5G Core Only
```
Run all test programs as below.
**Note:** This should require *sudo* due to access `/dev/tun0`.
{: .notice--danger}
```bash
$ cd build
$ sudo meson test -v
```
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
{: .notice--info}
You need to perform the **installation process**.
```bash
$ cd build
$ ninja install
$ cd ../
```
### Building WebUI of Open5GS
---
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
```bash
$ brew install node
```
Install the dependencies to run WebUI
```bash
$ cd webui
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.
```bash
$ npm run dev
```

View File

@@ -3,14 +3,23 @@ title: Mac OS X
head_inline: "<style> .blue { color: blue; } </style>"
---
This guide is based on **macOS Catalina 10.15**.
This guide is based on macOS Big Sur 11.2 on a Macbook Pro(Intel Chips) computer.
{: .blue}
### Install Xcode Command-Line Tools
---
Homebrew requires the Xcode command-line tools from Apple's Xcode.
```bash
$ xcode-select --install
```
### Installing Homebrew
---
Install brew using the official Homebrew installation instructions.
```bash
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
### Getting MongoDB
@@ -32,14 +41,13 @@ $ mongod --config /usr/local/etc/mongod.conf
{: .notice--info}
### Setting up TUN device (No persistent after rebooting)
### Setting up network (No persistent after rebooting)
---
Install TUN/TAP driver
- You can download it from [http://tuntaposx.sourceforge.net/](http://tuntaposx.sourceforge.net/)
- And then, run tuntap_20150118.pkg to install TUN/TAP driver.
Note that Open5GS uses built-in "utun" device driver. So, You don't have to install external TUN/TAP driver.
{: .blue}
Configure the TUN device.
Configure the loopback interface.
```bash
$ 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
@@ -54,16 +62,25 @@ $ 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
```
Enable IP forwarding & Masquerading
```bash
$ 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 pfctl -e -f /etc/pf.anchors/org.open5gs
```
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/master/misc/netconf.sh) makes it easy to configure the TUN device as follows:
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
`$ sudo ./misc/netconf.sh`
{: .notice--info}
@@ -72,7 +89,13 @@ $ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
Install the depedencies for building the source code.
```bash
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd curl pkg-config
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config
```
Install Bison and Create soft link.
```bash
$ brew install bison
$ export PATH="/usr/local/opt/bison/bin:$PATH"
```
Install Meson using Homebrew.
@@ -114,7 +137,7 @@ $ cd build
$ sudo meson test -v
```
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
{: .notice--info}
You need to perform the **installation process**.
@@ -138,7 +161,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm install
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.
@@ -146,4 +169,3 @@ The WebUI runs as an [npm](https://www.npmjs.com/) script.
```bash
$ npm run dev
```

View File

@@ -0,0 +1,216 @@
---
title: FreeBSD
head_inline: "<style> .blue { color: blue; } </style>"
---
This guide is based on **FreeBSD-11.4-STABLE**.
{: .blue}
## Install **FreeBSD-11.4-STABLE** 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.
This allows the user to quickly create a virtual machine without the hassle
of installing the operating system by hand.
### Install Vagrant
---
The instructions to install Vagrant are provided at
[vagrantup.com](https://www.vagrantup.com/).
### Create a FreeBSD-11.4-STABLE 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 FreeBSD 11 box, with
the exception that the amount of virtual memory has been increased to 1GB:
```bash
cd vagrant/freebsd
vagrant up --provider virtualbox
```
### Log into the newly created FreeBSD VM
---
Use SSH to log into the FreeBSD 11 VM:
```bash
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 FreeBSD 11 system.
The rest of the commands below are performed inside the FreeBSD VM as the
user 'vagrant', or on your bare metal FreeBSD 11 system as any normal user.
### Getting MongoDB
---
Install MongoDB with package manager.
```bash
$ sudo pkg install mongodb44
```
Run MongoDB server.
```bash
$ mkdir -p ./data/db
$ mongod --dbpath ./data/db
```
### Setting up network (No persistent after rebooting)
---
Configure the loopback interface.
```bash
$ 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
```
Enable IP forwarding
```bash
$ sudo sysctl -w net.inet.ip.forwarding=1
$ sudo sysctl -w net.inet6.ip6.forwarding=1
```
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
`$ sudo ./misc/netconf.sh`
{: .notice--info}
### Building Open5GS
---
Install the depedencies for building the source code.
```bash
$ sudo pkg install meson ninja gcc bison gsed pkgconf git mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2
```
Configure gcc PATH
```bash
$ setenv LIBRARY_PATH /usr/local/lib
$ setenv C_INCLUDE_PATH /usr/local/include
```
If you are using BASH instead of default CSH,
```bash
$ export LIBRARY_PATH=/usr/local/lib
$ export C_INCLUDE_PATH=/usr/local/include
```
Git clone.
```bash
$ git clone https://github.com/{{ site.github_username }}/open5gs
```
To compile with meson:
```bash
$ cd open5gs
$ meson build --prefix=`pwd`/install
$ ninja -C build
```
**Note:** No source code changes are required for FreeBSD 11.x version. However, in FreeBSD 12.x version, we'll getting a crash with segmentation fault when calling basename(3). To avoid this, you need to change the freeDiameter source code as below.
{: .blue}
```diff
$ cd open5gs/subprojects/freeDiameter
$ diff --git a/include/freeDiameter/libfdproto.h b/include/freeDiameter/libfdproto.h
index 52c11ef..cd7f383 100644
--- a/include/freeDiameter/libfdproto.h
+++ b/include/freeDiameter/libfdproto.h
@@ -293,7 +293,7 @@ extern int fd_g_debug_lvl;
/* A version of __FILE__ without the full path. This is specific to each C file being compiled */
static char * file_bname = NULL;
-static char * file_bname_init(char * full) { file_bname = basename(full); return file_bname; }
+static char * file_bname_init(char * full) { file_bname = __old_basename(full); return file_bname; }
#define __STRIPPED_FILE__ (file_bname ?: file_bname_init((char *)__FILE__))
```
Now, compile again:
{: .blue}
```bash
$ cd open5gs
$ ninja -C build
```
Check whether the compilation is correct.
**Note:** This should require *sudo* due to access `/dev/tun0`.
{: .notice--danger}
```bash
$ sudo ./build/tests/attach/attach ## EPC Only
$ sudo ./build/tests/registration/registration ## 5G Core Only
```
Run all test programs as below.
**Note:** This should require *sudo* due to access `/dev/tun0`.
{: .notice--danger}
```bash
$ cd build
$ sudo meson test -v
```
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
{: .notice--info}
You need to perform the **installation process**.
```bash
$ cd build
$ ninja install
$ cd ../
```
### Building WebUI of Open5GS
---
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
```bash
$ sudo pkg install node
```
Install the dependencies to run WebUI
```bash
$ cd webui
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.
```bash
$ npm run dev
```

View File

@@ -23,10 +23,12 @@ open5gs 27366 0.0 0.0 2890772 14380 ? Ssl 12:13 0:00 /usr/bin/open5g
open5gs 27485 0.0 0.0 243816 15064 ? Ssl 12:13 0:00 /usr/bin/open5gs-nrfd -c /etc/open5gs/nrf.yaml
open5gs 27543 0.0 0.0 222416 9672 ? Ssl 12:13 0:00 /usr/bin/open5gs-ausfd -c /etc/open5gs/ausf.yaml
open5gs 27600 0.0 0.0 222328 9668 ? Ssl 12:13 0:00 /usr/bin/open5gs-udmd -c /etc/open5gs/udm.yaml
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-pcfd -c /etc/open5gs/pcf.yaml
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-nssfd -c /etc/open5gs/nssf.yaml
open5gs 27697 0.0 0.0 243976 13716 ? Ssl 12:13 0:00 /usr/bin/open5gs-udrd -c /etc/open5gs/udr.yaml
```
You should see each of the above services, MME, SGW-C, SMF, AMF, SGW-U, UPF, HSS, PCRF, NRF, AUSF, UDM & UDR are all running.
You should see each of the above services, MME, SGW-C, SMF, AMF, SGW-U, UPF, HSS, PCRF, NRF, AUSF, UDM, PCF, NSSF & UDR are all running.
If your instance doesn't show this make sure you're started each service:
```bash
@@ -41,6 +43,8 @@ $ systemctl start open5gs-pcrfd.service
$ systemctl start open5gs-nrfd.service
$ systemctl start open5gs-ausfd.service
$ systemctl start open5gs-udmd.service
$ systemctl start open5gs-pcfd.service
$ systemctl start open5gs-nssfd.service
$ systemctl start open5gs-udrd.service
```

View File

@@ -3,6 +3,123 @@ title: Now in the Github Issue
head_inline: "<style> .blue { color: blue; } </style>"
---
<style>
img {
max-width: 100%;
height: auto;
}
</style>
#### Cannot open shared object file when running daemon
An error occurred when running as follows.
```
$ ./install/bin/open5gs-nrfd
./install/bin/open5gs-nrfd: error while loading shared libraries: libogscrypt.so.2: cannot open shared object file: No such file or directory
```
You need to specify the absolute path to the shared library as follows.
```bash
$ echo $(cd $(dirname ./install/lib/x86_64-linux-gnu/) && pwd -P)/$(basename ./install/lib/x86_64-linux-gnu/)
/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
$ export LD_LIBRARY_PATH=/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
$ ldd ./install/bin/open5gs-amfd
...
libogsapp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsapp.so.1 (0x00007f161ab51000)
libogscore.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.1 (0x00007f161a922000)
libogssctp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogssctp.so.1 (0x00007f161a71d000)
libogss1ap.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogss1ap.so.1 (0x00007f161a519000)
...
```
If you want to set the shared library path permanently, you can use ldconfig.
```bash
$ sudo sh -c "echo /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu > /etc/ld.so.conf.d/open5gs.conf"
$ sudo ldconfig
```
#### Can I disable specific services if 5G functionally is not needed?
From v2.0.x, SGW was divided into SGW-C and SGW-U, and PGW function was seperated into SMF and UPF.
In order to use 4G only, you need to run the process below.
```bash
$ open5gs-mmed
$ open5gs-sgwcd
$ open5gs-smfd
$ open5gs-sgwud
$ open5gs-upfd
$ open5gs-hssd
$ open5gs-pcrfd
```
And the process below is only used in 5G, so there is no need to run it.
```bash
$ open5gs-nrfd
$ open5gs-amfd
$ open5gs-ausfd
$ open5gs-udmd
$ open5gs-pcfd
$ open5gs-nssfd
$ open5gs-udrd
```
However, among these, SMF and UPF are used by both 4G EPC and 5G Core. And SMF has a protocol stack to interact with 5G NRF. Therefore, if you run SMF without running 5G NRF, the following WARNING occurs in SMF.
```
10/08 14:44:03.045: [sbi] WARNING: [7] Failed to connect to ::1 port 7777: Connection refused (../lib/sbi/client.c:450)
10/08 14:44:03.045: [smf] INFO: PFCP associated (../src/smf/pfcp-sm.c:174)
10/08 14:44:03.046: [diam] INFO: CONNECTED TO 'pcrf.localdomain' (SCTP,soc#16): (../lib/diameter/common/logger.c:108)
10/08 14:44:06.046: [smf] WARNING: [3c85dd06-0996-41eb-a985-476fa905aefc] Retry to registration with NRF (../src/smf/nf-sm.c:161)
10/08 14:44:06.047: [sbi] WARNING: [7] Failed to connect to ::1 port 7777: Connection refused (../lib/sbi/client.c:450)
```
To prevent SMF from attempting to access the 5G NRF, you need to modify the SMF configuration file as below.
```diff
$ diff -u ./install/etc/open5gs/smf.yaml.old ./install/etc/open5gs/smf.yaml
--- ./install/etc/open5gs/smf.yaml.old 2020-10-08 14:43:20.599734045 -0400
+++ ./install/etc/open5gs/smf.yaml 2020-10-08 14:44:21.864952687 -0400
@@ -168,9 +168,9 @@
# - ::1
#
smf:
- sbi:
- - addr: 127.0.0.4
- port: 7777
+# sbi:
+# - addr: 127.0.0.4
+# port: 7777
gtpc:
- addr: 127.0.0.4
- addr: ::1
@@ -214,12 +214,12 @@
# - 127.0.0.10
# - fe80::1%lo
#
-nrf:
- sbi:
- - addr:
- - 127.0.0.10
- - ::1
- port: 7777
+#nrf:
+# sbi:
+# - addr:
+# - 127.0.0.10
+# - ::1
+# port: 7777
#
# upf:
```
If you set as above and run SMF, you do not need to run NRF. Seven daemons operate in 4G only state.
#### How to change UE IP Pool
The Open5GS package contains a systemd-networkd configuration file for `ogstun`. Therefore, you must first modify the configuration file as follows.
@@ -17,7 +134,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=cafe::1/64
Address=2001:230:cafe::1/48
```
Restart systemd-networkd
@@ -25,6 +142,11 @@ Restart systemd-networkd
$ sudo systemctl restart systemd-networkd
```
And then, you need to chanage NAT table as below.
```
$ sudo iptables -t nat -A POSTROUTING -s 10.46.0.0/16 ! -o ogstun -j MASQUERADE
```
Now, you need to modify the configuration file of Open5GS to adjust the UE IP Pool. UE IP Pool can be allocated by SMF or UPF, but in this tutorial, we will modify both configuration files.
```diff
@@ -34,10 +156,10 @@ $ diff -u smf.yaml smf.yaml.new
@@ -190,7 +190,7 @@
- addr: 127.0.0.4
- addr: ::1
pdn:
subnet:
- - addr: 10.45.0.1/16
+ - addr: 10.46.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
dns:
- 8.8.8.8
```
@@ -49,10 +171,10 @@ $ diff -u upf.yaml upf.yaml.new
@@ -139,7 +139,7 @@
gtpu:
- addr: 127.0.0.7
pdn:
subnet:
- - addr: 10.45.0.1/16
+ - addr: 10.46.0.1/16
- addr: cafe::1/64
- addr: 2001:230:cafe::1/48
#
```
@@ -67,15 +189,15 @@ $ sudo systemctl restart open5gs-upfd.service
By default, wireshark cannot decode NAS-5GS message when the security header type is "Integrity protected and ciphered".
![Wireshark cannot decode]({{ site.url }}{{ site.baseurl }}/assets/images/wireshark_cannot_decode_nas_5gs.png){: height="100%" width="100%"}
![Wireshark cannot decode]({{ site.url }}{{ site.baseurl }}/assets/images/wireshark_cannot_decode_nas_5gs.png)
You need to turn on "Try to detect and decode 5G-EA0 ciphered messages" in the wireshark perference menu.
![Wireshark perference]({{ site.url }}{{ site.baseurl }}/assets/images/wireshark_preference.png){: height="100%" width="100%"}
![Wireshark perference]({{ site.url }}{{ site.baseurl }}/assets/images/wireshark_preference.png)
Now, you can see the NAS-5GS message in the wireshark.
![Wireshark can decode]({{ site.url }}{{ site.baseurl }}/assets/images/wireshark_can_decode_nas_5gs.png){: height="100%" width="100%"}
![Wireshark can decode]({{ site.url }}{{ site.baseurl }}/assets/images/wireshark_can_decode_nas_5gs.png)
#### Test failed (e.g. `meson test -v`)
@@ -146,6 +268,8 @@ $ sudo pkill -9 open5gs-pcrfd
$ sudo pkill -9 open5gs-nrfd
$ sudo pkill -9 open5gs-ausfd
$ sudo pkill -9 open5gs-udmd
$ sudo pkill -9 open5gs-pcfd
$ sudo pkill -9 open5gs-nssfd
$ sudo pkill -9 open5gs-udrd
```
@@ -240,9 +364,10 @@ Timeout: 0
#### Is it possible to setup IP/NAT table along with Docker?
Enable IP Forward.
Enable IPv4/IPv6 Forward.
```
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
$ sudo sysctl -w net.ipv4.ip_forward=1
$ sudo sysctl -w net.ipv6.conf.all.forwarding=1
```
The following is the default docker IP/NAT table.
@@ -318,6 +443,11 @@ And then, apply **newtables** as below.
$ 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
```
The above operation is the same as described in the following manuals.
```
### Check IP Tables
@@ -345,16 +475,18 @@ target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
### Enable IPv4 Forwarding
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
### Enable IPv4/IPv6 Forwarding
$ sudo sysctl -w net.ipv4.ip_forward=1
$ 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
```
#### How to use a different APN for each SMF
#### How to use a different DNN/APN for each SMF
By default, MME selects the SMF as the first SMF node. To use a different APN for each SMF, specify gtpc.apn as the APN name. If the HSS uses WebUI to set the SMF IP for each UE, you can use a specific SMF node for each UE.
By default, MME selects the SMF as the first SMF node. To use a different DNN/APN for each SMF, specify gtpc.dnn as the DNN/APN name. If the HSS uses WebUI to set the SMF IP for each UE, you can use a specific SMF node for each UE.
See the following example.
@@ -366,118 +498,102 @@ See the following example.
# <GTP-C Client>
#
# o By default, the SMF uses the first SMF node.
# - To use a different APN for each SMF, specify gtpc.apn as the APN name.
# - To use a different DNN/APN for each SMF, specify gtpc.dnn
# as the DNN/APN name.
# - If the HSS uses WebUI to set the SMF IP for each UE,
# you can use a specific SMF node for each UE.
#
# o Two SMF are defined. 127.0.0.4:2123 is used.
# [fe80::3%@loopback_devname@]:2123 is ignored.
# [fe80::3%lo]:2123 is ignored.
# gtpc:
# - addr: 127.0.0.4
# - addr: fe80::3%@loopback_devname@
# - addr: fe80::3%lo
#
# o One SMF is defined. if prefer_ipv4 is not true,
# [fe80::3%@loopback_devname@] is selected.
# [fe80::3%lo] is selected.
# gtpc:
# - addr:
# - 127.0.0.4
# - fe80::3%@loopback_devname@
# - fe80::3%lo
#
# o Two SMF are defined with a different APN.
# o Two SMF are defined with a different DNN/APN.
# - Note that if SMF IP for UE is configured in HSS,
# the following configurion for this UE is ignored.
# gtpc:
# - addr: 127.0.0.4
# apn: internet
# dnn: internet
# - addr: 127.0.0.5
# apn: volte
# dnn: volte
#
# o If APN is omitted, the default APN uses the first SMF node.
# o If DNN/APN is omitted, the default DNN/APN uses the first SMF node.
# gtpc:
# - addr: 127.0.0.4
# - addr: 127.0.0.5
# apn: volte
# dnn: volte
```
The IP address of the UE can also use a different UE pool depending on the APN.
The IP address of the UE can also use a different UE pool depending on the DNN/APN.
```
### For reference, see `smf.yaml`
# <PDN Configuration with UE Pool>
# <Subnet for UE Pool>
#
# o IPv4 Pool
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
#
# pdn:
# subnet:
# addr: 10.45.0.1/16
#
# o IPv4/IPv6 Pool
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add cafe:1::1/64 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
#
# pdn:
# subnet:
# - addr: 10.45.0.1/16
# - addr: cafe:1::1/64
# - addr: 2001:230:cafe::1/48
#
#
# o Specific APN(e.g 'volte') uses 10.46.0.1/16, cafe:2::1/64
# All other APNs use 10.45.0.1/16, cafe:1::1/64
# 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
# $ 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 cafe:1::1/64 dev ogstun
# $ sudo ip addr add cafe:2::1/64 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
#
# pdn:
# subnet:
# - addr: 10.45.0.1/16
# - addr: cafe:1::1/64
# - addr: 2001:230:cafe::1/48
# - addr: 10.46.0.1/16
# apn: volte
# - addr: cafe:2::1/64
# apn: volte
#
# o Multiple Devices (default: ogstun)
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add cafe:1::1/64 dev ogstun2
# $ sudo ip addr add 10.46.0.1/16 dev ogstun3
# $ sudo ip addr add cafe:2::1/64 dev ogstun3
#
# pdn:
# - addr: 10.45.0.1/16
# - addr: cafe:1::1/64
# dev: ogstun2
# - addr: 10.46.0.1/16
# apn: volte
# dev: ogstun3
# - addr: cafe:2::1/64
# apn: volte
# dev: ogstun3
# dnn: volte
# - addr: 2001:230:babe::1/48
# dnn: volte
#
# o Pool Range Sample
# pdn:
# subnet:
# - addr: 10.45.0.1/24
# range: 10.45.0.100-10.45.0.200
#
# pdn:
# subnet:
# - addr: 10.45.0.1/24
# range:
# - 10.45.0.5-10.45.0.50
# - 10.45.0.100-
#
# pdn:
# subnet:
# - addr: 10.45.0.1/24
# range:
# - -10.45.0.200
# - 10.45.0.210-10.45.0.220
#
# pdn:
# subnet:
# - addr: 10.45.0.1/16
# range:
# - 10.45.0.100-10.45.0.200
# - 10.45.1.100-10.45.1.200
# - addr: cafe::1/64
# - addr: 2001:230:cafe::1/48
# range:
# - cafe::a0-cafe:b0
# - cafe::c0-cafe:d0
# - 2001:230:cafe:a0::0-2001:230:cafe:b0::0
# - 2001:230:cafe:c0::0-2001:230:cafe:d0::0
#
```
@@ -575,7 +691,7 @@ You should configure the domain name on your computer. Otherwise, freeDiameter r
#### How many of UEs can Open5GS support?
See the [lib/core/ogs-3gpp-types.h](https://github.com/{{ site.github_username }}/open5gs/blob/master/lib/core/ogs-3gpp-types.h).
See the [lib/core/ogs-3gpp-types.h](https://github.com/{{ site.github_username }}/open5gs/blob/main/lib/core/ogs-3gpp-types.h).
```
#define MAX_NUM_OF_ENB 128
@@ -612,7 +728,9 @@ Currently, the number of UE is limited to `128*128`.
* NRF : 127.0.0.10
* AUSF : 127.0.0.11
* UDM : 127.0.0.12
* UDR : 127.0.0.13
* PCF : 127.0.0.13
* NSSF : 127.0.0.14
* UDR : 127.0.0.20
```
- AMF_ID, TAC and S_NSSAI
@@ -655,7 +773,7 @@ Currently, the number of UE is limited to `128*128`.
```
* IPv4 : 10.45.0.1/16
* IPv6 : cafe::1/64
* IPv6 : 2001:230:cafe::1/48
```
- DNS

View File

@@ -222,7 +222,7 @@ Then proceed as follows:
3. Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
4. Click `SAVE` Button
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
@@ -257,7 +257,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
ciphering_order : [ EEA0, EEA1, EEA2 ]
```
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
@@ -308,11 +308,13 @@ target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
### Enable IPv4 Forwarding
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
### Enable IPv4/IPv6 Forwarding
$ sudo sysctl -w net.ipv4.ip_forward=1
$ 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
```
**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.

View File

@@ -754,22 +754,22 @@ Below startup script can be used for setting up interfaces:
```
#!/bin/bash
sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sh -c "echo 1 > /proc/sys/net/ipv6/ip_forward"
sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl -w net.ipv6.conf.all.forwarding=1
ip tuntap add name ogstun mode tun
ip addr add 192.168.100.1/24 dev ogstun
ip addr add fd84:6aea:c36e:2b69::/64 dev ogstun
ip addr add fd84:6aea:c36e:2b69::/48 dev ogstun
ip link set ogstun mtu 1400
ip link set ogstun up
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 ! -o ogstun -j MASQUERADE
ip6tables -t nat -A POSTROUTING -s fd84:6aea:c36e:2b69::/64 ! -o ogstun -j MASQUERADE
ip6tables -t nat -A POSTROUTING -s fd84:6aea:c36e:2b69::/48 ! -o ogstun -j MASQUERADE
iptables -I INPUT -i ogstun -j ACCEPT
ip6tables -I INPUT -i ogstun -j ACCEPT
ip tuntap add name ogstun2 mode tun
ip addr add 192.168.101.1/24 dev ogstun2
ip addr add fd1f:76f3:da9b:0101::/64 dev ogstun2
ip addr add fd1f:76f3:da9b:0101::/48 dev ogstun2
ip link set ogstun2 mtu 1400
ip link set ogstun2 up
iptables -I INPUT -i ogstun2 -j ACCEPT

View File

@@ -13,16 +13,18 @@ Open5GS is a C-language Open Source implementation of 5GC and EPC, i.e. the core
- AES, Snow3G, ZUC algorithms for encryption
- Support of USIM cards using Milenage
- IPv6 support
- Multiple PDU session resource(EPC only)
- S1/X2 Handover(EPC only)
- Multiple PDU session
- Handover(5GC Xn/N2 and EPC S1/X2)
- CSFB(Circuit Switched Fall Back) and SMSoS(SMS Over SGs)
- VoLTE(Voice over LTE)
#### Known Limitations
---
- No OCS/OFCS
- No VoNR(Voice over NR)
- No Interworking with EPC
- No NB-IoT
- No OCS/OFCS
- No eMBMS
- No SRVCC
- No Roaming

View File

@@ -12,8 +12,14 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- Tutorials
- [Your First LTE](tutorial/01-your-first-lte)
- [EPC Advanced Example with OpenAirInterface UE/RAN](https://github.com/s5uishida/open5gs_epc_oai_sample_config)
- [VoLTE Setup with Kamailio IMS and Open5GS](tutorial/02-VoLTE-setup)
- [Dockerized VoLTE Setup](tutorial/03-VoLTE-dockerized)
- [My first 5G Core : Open5GS and UERANSIM](http://nickvsnetworking.com/my-first-5g-core-open5gs-and-ueransim/)
- [5GC Advanced Example with UERANSIM](https://github.com/s5uishida/open5gs_5gc_ueransim_sample_config)
- [Sending SMS in Open5GS LTE Networks using the SGs Interface and OsmoMSC](https://nickvsnetworking.com/sending-sms-in-open5gs-lte-networks-using-the-sgs-interface-and-osmomsc-with-smsos/)
- [OsmoMSC and Open5GS MME SGs Interface for CSCF / InterRAT Handover](https://nickvsnetworking.com/osmomsc-and-open5gs-mme-sgs-interface-for-cscf-interran-handover/)
- [Static IPs for UEs](http://nickvsnetworking.com/open5gs-epc-static-ip-addresses-for-ues-apns-subscribers/)
- [Kubernetes Open5GS Deployment](https://dev.to/infinitydon/virtual-4g-simulation-using-kubernetes-and-gns3-3b7k?fbclid=IwAR1p99h13a-mCfejanbBQe0H0-jp5grXkn5mWf1WrTHf47UtegB2-UHGGZQ)
- Troubleshooting
@@ -24,5 +30,10 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- [Debian/Ubuntu](platform/01-debian-ubuntu)
- [CentOS](platform/02-centos)
- [Fedora](platform/03-fedora)
- [FreeBSD](platform/04-freebsd)
- [MacOSX](platform/05-macosx)
- [MacOSX(Apple Silicon)](platform/05-macosx-apple-silicon)
- [MacOSX(Intel)](platform/06-macosx-intel)
- [FreeBSD](platform/07-freebsd)
- Hardware Specific Notes
- [Tested e/gNodeBs](hardware/01-genodebs)

View File

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

View File

@@ -1,6 +1,6 @@
---
title: "v2.0.17 - 100+ UEs tested"
date: 2020-10-08 23:12:00 -0400
title: "v2.0.18 - 250+ UEs tested"
date: 2020-10-09 07:53:00 -0400
categories:
- Release
tags:
@@ -28,5 +28,5 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- Fix PDN connectivity request in PDN DISCONNECT ESM-state([#486](https://github.com/open5gs/open5gs/issues/486)) -- [yc541](https://github.com/yc541)
- Fix SEMANTIC ERROR in PACKET FILTER ([#338](https://github.com/open5gs/open5gs/issues/338)) -- [herlesupreeth](https://github.com/herlesupreeth)
Download -- [v2.0.17.tar.gz](https://github.com/open5gs/open5gs/archive/v2.0.17.tar.gz)
Download -- [v2.0.18.tar.gz](https://github.com/open5gs/open5gs/archive/v2.0.18.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,40 @@
---
title: "v2.0.22 - Running for 1 Month"
date: 2020-11-19 09:35:00 -0500
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### Enhancement
- Add information of the used APN in the SMF log file ([#674](https://github.com/open5gs/open5gs/pull/674)) -- [medeiros405](https://github.com/medeiros405)
- Use buffering method when sending packet through stream socket ([6f11a780](https://github.com/open5gs/open5gs/commit/6f11a780792ff0d695d9f735c84e5bff3ee1804b))
- Support VoLTE service in IDLE state ([#627](https://github.com/open5gs/open5gs/issues/627)) -- [kuanghanqian](https://github.com/kuanghanqian)
- F-TEID Allocation and Release by the UP function ([a470131](https://github.com/open5gs/open5gs/commit/a470131489231bff384d54561f66b937328d2e2d))
- Network Restorations from GTP-U Error Indication ([1bed0d5](https://github.com/open5gs/open5gs/commit/1bed0d587275ad105c5fe6f0d9ca4ef1508a74e0))
- Work around SCTP_EVENTS broken - copy blindly from Osmocom's libosmo-netif ([f137d194](https://github.com/open5gs/open5gs/commit/f137d1947f0afaaf0a3ec37b35ff1ce99c757ded))
#### Re-adding features
- Support OAI UE/RAN ([#651](https://github.com/open5gs/open5gs/issues/651), [#584](https://github.com/open5gs/open5gs/issues/584)) -- [asoltanian1979](https://github.com/asoltanian1979), [s5uishida](https://github.com/s5uishida)
- Provide SGW GTP(S1) address to be advertised inside S1AP messages ([#367](https://github.com/open5gs/open5gs/pull/367)) -- [herlesupreeth](https://github.com/herlesupreeth)
#### Bug Fixes
- Resolves an issues with DL data traffic not working in v2.0.20 and v2.0.21 ([#672](https://github.com/open5gs/open5gs/issues/672)) -- [CarlosYLee](https://github.com/CarlosYLee)
- Fix the select/kqueue bug in Win32/MacOSX [23e8e657](https://github.com/open5gs/open5gs/commit/23e8e6577c3bc4f785e797084b66fef707bfa450)
- Fix the possible vulnerabilities [830587a2](https://github.com/open5gs/open5gs/commit/830587a250fb22f01327a14812d778d2a51bc5b9)
- Fix MME crash if SGs interface is DOWN ([#448](https://github.com/open5gs/open5gs/issues/448), [#628](https://github.com/open5gs/open5gs/issues/628)) -- [nickvsnetworking](https://github.com/nickvsnetworking), [kbarlee](https://github.com/kbarlee)
- Add `rpath` to required shared library ([#535](https://github.com/open5gs/open5gs/issues/535), [#595](https://github.com/open5gs/open5gs/issues/595)) -- [kuanghanqian](https://github.com/kuanghanqian), [RafalArciszewski](https://github.com/RafalArciszewski)
- Change not to remove UE context when receiving Extended Service Request without MSC/VLC ([#627](https://github.com/open5gs/open5gs/issues/627)) -- [kuanghanqian](https://github.com/kuanghanqian)
- Case-insensitive APN/DNN check ([#617](https://github.com/open5gs/open5gs/issues/617)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
- Fix the bug for Update-Type in Tracking area update accept ([#568](https://github.com/open5gs/open5gs/issues/568)) -- [cecrevier](https://github.com/cecrevier)
- Only Send PDN connectivity reject if APN is mismatch ([#568](https://github.com/open5gs/open5gs/issues/568)) -- [cecrevier](https://github.com/cecrevier)
- Fix the bug for S1-reset or eNB restart ([#627](https://github.com/open5gs/open5gs/issues/627)) -- [kuanghanqian](https://github.com/kuanghanqian)
- Fix MME crash when VoLTE is enabled ([#619](https://github.com/open5gs/open5gs/issues/619)) -- [kuanghanqian](https://github.com/kuanghanqian)
- Fix the DIAMETER_MISSING_AVP on Rx ([#610](https://github.com/open5gs/open5gs/issues/610)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
- Make WebUI listen on 0.0.0.0:3000 ([#587](https://github.com/open5gs/open5gs/pull/587)) -- [bjoern-r](https://github.com/bjoern-r)
Download -- [v2.0.22.tar.gz](https://github.com/open5gs/open5gs/archive/v2.0.22.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,32 @@
---
title: "v2.1.0 - More Feature in 5G Core"
date: 2020-12-11 14:20:00 -0500
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### Add PCF(Policy Control Function)
#### Use HTTP/2 instead of HTTP/1.1 in 5G Core SBI
#### PFCP Update
- Flow-Description use 'to assigned' in Gx Interface
- Support SDF Filter ID
- Support F-TEID's Choose
- BAR(Buffering) is added in PFCP session
- Default Apply Action uses NOCP+BUFF
#### Enhancement
- Add parameter 'use_openair' for legacy UE ([#688](https://github.com/open5gs/open5gs/issues/688)) -- [s5uishida](https://github.com/s5uishida)
- Add CentOS vagrant ([#684](https://github.com/open5gs/open5gs/pull/684)) -- [danielgora](https://github.com/danielgora)
#### Bug Fixes
- SCTP workaround for PEER_ADDR_PARAMS ([#707](https://github.com/open5gs/open5gs/issues/707)) -- [infinitydon](https://github.com/infinitydon)
- Fix UPF for Landslide ([#685](https://github.com/open5gs/open5gs/issues/685)) -- [valenciakarlos](https://github.com/valenciakarlos)
Download -- [v2.1.0.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.0.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,16 @@
---
title: "v2.1.1 - 4G EPC Hotfix"
date: 2020-12-16 11:08:00 -0500
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### Bug Fixes
- Fix the assertion BUG with Unexpected PDN Type ([#721](https://github.com/open5gs/open5gs/issues/721)) -- [cecrevier](https://github.com/cecrevier)
Download -- [v2.1.1.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.1.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,35 @@
---
title: "v2.1.3 - 5GC improvements"
date: 2021-01-08 22:50:00 -0500
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### New features
- [5GC] Dedicated QoS flow & Multiple PDU session ([235a041](https://github.com/open5gs/open5gs/commit/235a041b8d7638db931114ace49e4f771508830f), [a96d3ca](https://github.com/open5gs/open5gs/commit/a96d3ca0fa88828f4efb1135ebcb8a88d8bdc66c))
- [5GC] Xn Handover ([#726](https://github.com/open5gs/open5gs/pull/726)) -- [lester-001](https://github.com/lester-001)
#### Test
- [5GC] 1024 UEs Registration ([#753](https://github.com/open5gs/open5gs/issues/753)) -- [mmailand](https://github.com/mmailand)
#### Enhancement
- [AMF] Handling UEContextRequest of InitialUEMessage ([7b29cdf](https://github.com/open5gs/open5gs/commit/7b29cdf89871be0a00c0dd907ae5da7bcf88e305))
#### Bug Fixes
- [SBI] Time string conversion error on 32bit machine ([a0ebf20](https://github.com/open5gs/open5gs/commit/e531ccab5a82698dad46d5d9d41a0e0c496b5ed6))
- [MME] Add handler for NAS EPS activate_dedicated EPS bearer context reject ([#755](https://github.com/open5gs/open5gs/pull/755)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [PFCP] Remvoe repeated QER in handling Create-PDR ([#749](https://github.com/open5gs/open5gs/pull/749)) -- [zhonglin6666](https://github.com/zhonglin6666)
- [AMF] Re-add SCTP ppid and stream-no ([#743](https://github.com/open5gs/open5gs/issues/743)) -- [aligungr](https://github.com/aligungr)
- [5GC] Fix wrong usage of SBI heartbeat timer ([#741](https://github.com/open5gs/open5gs/issues/741)) -- [fatihozer90](https://github.com/fatihozer90)
- [5GC] Fix the problem of receiving large HTTP2 message(Max: 8,192 bytes) ([#738](https://github.com/open5gs/open5gs/issues/738)) -- [fatihozer90](https://github.com/fatihozer90)
- [NRF] Support subscrCond ([#730](https://github.com/open5gs/open5gs/issues/730)) -- [fatihozer90](https://github.com/fatihozer90)
- [NRF] Many BUG fixes ([#727](https://github.com/open5gs/open5gs/issues/727), [#728](https://github.com/open5gs/open5gs/issues/728), [#729](https://github.com/open5gs/open5gs/issues/729), [#737](https://github.com/open5gs/open5gs/issues/737)) -- [fatihozer90](https://github.com/fatihozer90)
- [AMF] AMF sets default DNN if UE does not sent it
- [MME] Fix the MME crash ([#708](https://github.com/open5gs/open5gs/issues/708), [#721](https://github.com/open5gs/open5gs/issues/721)) -- [cecrevier](https://github.com/cecrevier)
Download -- [v2.1.3.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.3.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,23 @@
---
title: "v2.1.4 - Paging was added"
date: 2021-01-18 21:23:00 -0500
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### New feature
- [5GC] Paging ([c9363b1](https://github.com/open5gs/open5gs/commit/c9363b132093581b6fd2ce794aa63cd597bf83a6))
#### Enhancement
- [PFCP] Legacy support for pre-release LTE11 devices while performing VoLTE call([#757](https://github.com/open5gs/open5gs/pull/757)) -- [herlesupreeth](https://github.com/herlesupreeth)
#### Bug Fixes
- [EPC] Use ESM cause(43:Invalid EPS bearer identity) if SGW-C sends GTP cause(Context Not Found) ([#755](https://github.com/open5gs/open5gs/issues/755)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [MME] fix a bug where SCTP stream number was not set while sending S1-Paging message. ([c9363b1](https://github.com/open5gs/open5gs/commit/c9363b132093581b6fd2ce794aa63cd597bf83a6))
Download -- [v2.1.4.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.4.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,29 @@
---
title: "v2.1.5 - 5G Core N2 based handover"
date: 2021-02-02 14:52:00 -0500
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### New feature
- [5GC] N2 Handver ([49a9e58](https://github.com/open5gs/open5gs/commit/49a9e58efe3f6ecd482c3b77b98cd0841688b647), [ff5236f](https://github.com/open5gs/open5gs/commit/ff5236f3e01ee6984bc78eaacc7d84e08c321266))
#### Enhancement
- [AMF/MME] Check IMEISV length == 16 digits ([388e642](https://github.com/open5gs/open5gs/commit/388e64213fcebc257eb7bd0223105c3055c56252))
- [AMF] Add Handling Duplicated PDU Session ID ([d9417be](https://github.com/open5gs/open5gs/commit/d9417be9a62255efa91a11ee2c424ec1e739b919))
- [ASN] S1AP/NGAP update to v16.4.0(2021-01-04) ([ada01fc](https://github.com/open5gs/open5gs/commit/ada01fca8ffaea029d2ae04e6bc1bb499ab37894))
- [AMF/MME] Add UserLocation Handling in UplinkNASTransport ([#772](https://github.com/open5gs/open5gs/pull/772)) -- [zhonglin6666](https://github.com/zhonglin6666)
#### Bug Fixes
- [UDR] Modify SmfSelectionSubscriptionData ([#785](https://github.com/open5gs/open5gs/pull/785)) -- [zhonglin6666](https://github.com/zhonglin6666)
- [MME] ENBDirectInformationTransfer decoding problem ([#783](https://github.com/open5gs/open5gs/issues/783)) -- [kuanghanqian](https://github.com/kuanghanqian)
- [AMF] PartOfNG-Interface in NGReset decoding problem ([#773](https://github.com/open5gs/open5gs/issues/773)) -- [acetcom](https://github.com/acetcom)
- [AMF] Fix UE Context Request IE Handling ([#771](https://github.com/open5gs/open5gs/issues/771)) -- [kuanghanqian](https://github.com/kuanghanqian)
- [5GC] Fix the AMF/SMF/UDM crash issues ([#770](https://github.com/open5gs/open5gs/issues/770), [#771](https://github.com/open5gs/open5gs/issues/771)) -- [kuanghanqian](https://github.com/kuanghanqian)
Download -- [v2.1.5.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.5.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,22 @@
---
title: "v2.1.7 - 5G Core Hotfix"
date: 2021-02-07 22:31:00 -0500
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### Bug Fixes
- [5GC/EPC] Pool size adjusted to support 1,024 UEs ([#753](https://github.com/open5gs/open5gs/issues/753)) -- [zhouxiang93123](https://github.com/zhouxiang93123)
- [AMF] Crash during handling Duplicated PDU Session ID ([#793](https://github.com/open5gs/open5gs/issues/783)) -- [kuanghanqian](https://github.com/kuanghanqian)
#### New Platform
- MacOSX with Apple M1 Silicon ([7901a1](https://github.com/open5gs/open5gs/commit/7901a1164fdaa04cf72a5a944f50474d569f619d))
- FreeBSD ([852756](https://github.com/open5gs/open5gs/commit/852756f90222a8e0821f6e1994baa32eafbdc47c))
Download -- [v2.1.7.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.7.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,30 @@
---
title: "v2.2.0 - DB Schema Changes"
date: 2021-03-08 21:35:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### DB Schema Changes
- No backward compatibility. If you are using an old subscription DB, you should change to the new DB schema.
#### New features
- NSSF(Network Slice Selection Function) is added.
- SMF selection is added.
#### Enhancement
- [DB] Masking MongoDB credentials when logging ([#827](https://github.com/open5gs/open5gs/pull/827)) -- [cglewis](https://github.com/cglewis)
- [EPC/5GC] Branch name changes from master to main ([#811](https://github.com/open5gs/open5gs/pull/811)) -- [PawelMack](https://github.com/PawelMack)
- [AMF] Cause of UEContextRelaseCommand uses Cause of UEContextReleaseRequest ([#789](https://github.com/open5gs/open5gs/issues/789)) -- [PawelMack](https://github.com/PawelMack)
#### Bug Fixes
- [SMF] Fix the bug for DataForwardingNotPossible ([31977bf](https://github.com/open5gs/open5gs/commit/31977bf30a396389557c8be0f82cfdfb8152d580))
- [AMF] Fix the exception handling routine when UE/gNB repeatedly sends NGAP messages ([#804](https://github.com/open5gs/open5gs/issues/804)) -- [strongcourage](https://github.com/strongcourage)
Download -- [v2.2.0.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.0.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,31 @@
---
title: "v2.2.1 - UE IPv6 Support"
date: 2021-03-15 09:38:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### IMPORTANT
To use the new WebUI v2.2.1, you have to log out and log back in to reset your browser token information.
{: .blue}
#### UE IPv6 Support
- If the SMF receives Router Solicitation Message through UPF, it sends Router Advertisement Message to the UE through UPF.
- If the UPF matches the IPv6 Prefix instead of Full IPv6 address, it forwards the packet to the UE. ([#808](https://github.com/open5gs/open5gs/issues/808)) -- [kbarlee](https://github.com/kbarlee), [byteburner](https://github.com/byteburner)
#### Enhancement
- Adding API tokens to WebUI to improve security vulnerabilities ([#838](https://github.com/open5gs/open5gs/pull/838)) -- [rashley-iqt](https://github.com/rashley-iqt)
#### Bug Fixes
- [AMF] Fixed a problem that occurs when the UE does not send S-NSSAI in UL NAS Transport message ([#845](https://github.com/open5gs/open5gs/issues/845)) -- [mcatalancid](https://github.com/mcatalancid)
- [AMF] Fixed a problem that occurs when the UE does not send Request-NSSAI in Registration request([#844](https://github.com/open5gs/open5gs/issues/844)) -- [ggardikis](https://github.com/ggardikis)
- [MME] Fixed the infinit loop related to Delete-Session-Request ([#568](https://github.com/open5gs/open5gs/issues/568)) -- [domgth](https://github.com/domgth)
Download -- [v2.2.1.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.1.tar.gz)
{: .notice--info}

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

File diff suppressed because one or more lines are too long

View File

@@ -10,7 +10,7 @@
#
PACKAGE="open5gs"
VERSION="2.0.0"
VERSION="2.2.1"
print_status() {
echo
@@ -228,7 +228,7 @@ if [[ $RC != 0 ]]; then
fi
print_status "Build the Open5GS WebUI..."
exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm install && npm run build"
exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm ci --no-optional && npm run build"
print_status "Install the Open5GS WebUI..."
exec_cmd "mv ./${PACKAGE}-${VERSION}/webui /usr/lib/node_modules/${PACKAGE}"

View File

@@ -75,6 +75,12 @@ void udm_terminate(void);
int ausf_initialize(void);
void ausf_terminate(void);
int pcf_initialize(void);
void pcf_terminate(void);
int nssf_initialize(void);
void nssf_terminate(void);
int upf_initialize(void);
void upf_terminate(void);

View File

@@ -86,7 +86,7 @@ static void recalculate_pool_size(void)
self.pool.pfcp_node = self.pool.nf;
#define MAX_NUM_OF_NF_SERVICE 16 /* Num of NF Service per NF Instance */
#define MAX_NUM_OF_SBI_MESSAGE 8 /* Num of HTTP(s) Request/Response per NF */
#define MAX_NUM_OF_SBI_MESSAGE 4 /* Num of HTTP(s) Request/Response per NF */
#define MAX_NUM_OF_NF_SUBSCRIPTION 4 /* Num of Subscription per NF */
self.pool.nf_service = self.pool.nf * MAX_NUM_OF_NF_SERVICE;
self.pool.sbi_message = self.pool.nf * MAX_NUM_OF_SBI_MESSAGE;
@@ -183,8 +183,8 @@ static void app_context_prepare(void)
recalculate_pool_size();
/* 10 second */
self.time.nf_instance.heartbeat_interval = 10;
/* <Heartbeat Checking Interval>
* Heartbeat Interval(e.g: 10 seconds) + No Heartbeat Margin(1 second) */
self.time.nf_instance.no_heartbeat_margin = 1;
/* 3600 seconds = 1 hour */
@@ -193,8 +193,23 @@ static void app_context_prepare(void)
/* 86400 seconds = 1 day */
self.time.subscription.validity_duration = 86400;
/* Message Wait Duration : 2 seconds */
self.time.message.duration = ogs_time_from_sec(2);
/*
* Message Wait Duration : 10 seconds (Default)
*
* The paging retry timer is 2 seconds and the retry count is 3.
*
* It is recomended to set at least 9 seconds to reflect
* the paging failure result to GTPv2-C or HTTP2(SBI).
*/
self.time.message.duration = ogs_time_from_sec(10);
/*
* Handover Wait Duration : 300 ms (Default)
*
* Time to wait for AMF/MME to send UEContextReleaseCommand
* to the source gNB/eNB after receiving HandoverNotify
*/
self.time.handover.duration = ogs_time_from_msec(300);
regenerate_all_timer_duration();
}
@@ -296,6 +311,12 @@ int ogs_app_context_parse_config(void)
} else if (!strcmp(parameter_key, "no_udm")) {
self.parameter.no_udm =
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key, "no_pcf")) {
self.parameter.no_pcf =
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key, "no_nssf")) {
self.parameter.no_nssf =
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key, "no_udr")) {
self.parameter.no_udr =
ogs_yaml_iter_bool(&parameter_iter);
@@ -311,8 +332,12 @@ int ogs_app_context_parse_config(void)
} else if (!strcmp(parameter_key, "multicast")) {
self.parameter.multicast =
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key, "no_slaac")) {
self.parameter.no_slaac =
} else if (!strcmp(parameter_key, "use_openair")) {
self.parameter.use_openair =
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(
parameter_key, "no_ipv4v6_local_addr_in_packet_filter")) {
self.parameter.no_ipv4v6_local_addr_in_packet_filter =
ogs_yaml_iter_bool(&parameter_iter);
} else
ogs_warn("unknown key `%s`", parameter_key);
@@ -465,13 +490,31 @@ int ogs_app_context_parse_config(void)
if (!strcmp(msg_key, "duration")) {
const char *v = ogs_yaml_iter_value(&msg_iter);
if (v) {
self.time.message.duration =
self.time.message.duration =
ogs_time_from_msec(atoll(v));
regenerate_all_timer_duration();
}
} else
ogs_warn("unknown key `%s`", msg_key);
}
} else if (!strcmp(time_key, "handover")) {
ogs_yaml_iter_t msg_iter;
ogs_yaml_iter_recurse(&time_iter, &msg_iter);
while (ogs_yaml_iter_next(&msg_iter)) {
const char *msg_key =
ogs_yaml_iter_key(&msg_iter);
ogs_assert(msg_key);
if (!strcmp(msg_key, "duration")) {
const char *v = ogs_yaml_iter_value(&msg_iter);
if (v) {
self.time.handover.duration =
ogs_time_from_msec(atoll(v));
}
} else
ogs_warn("unknown key `%s`", msg_key);
}
} else
ogs_warn("unknown key `%s`", time_key);
}

View File

@@ -31,6 +31,8 @@ extern "C" {
#endif
typedef struct ogs_app_context_s {
const char *version;
const char *file;
void *document;
@@ -60,6 +62,8 @@ typedef struct ogs_app_context_s {
int no_upf;
int no_ausf;
int no_udm;
int no_pcf;
int no_nssf;
int no_udr;
int no_nrf;
@@ -68,7 +72,9 @@ typedef struct ogs_app_context_s {
int no_ipv6;
int prefer_ipv4;
int multicast;
int no_slaac;
int use_openair;
int no_ipv4v6_local_addr_in_packet_filter;
} parameter;
ogs_sockopt_t sockopt;
@@ -140,6 +146,12 @@ typedef struct ogs_app_context_s {
ogs_time_t no_heartbeat_duration;
} pfcp;
} message;
struct {
ogs_time_t duration;
ogs_time_t complete_delay;
} handover;
} time;
} ogs_app_context_t;

View File

@@ -21,7 +21,9 @@
int __ogs_app_domain;
int ogs_app_initialize(const char *default_config, const char *const argv[])
int ogs_app_initialize(
const char *version, const char *default_config,
const char *const argv[])
{
int rv, opt;
ogs_getopt_t options;
@@ -39,6 +41,7 @@ int ogs_app_initialize(const char *default_config, const char *const argv[])
ogs_app_setup_log();
ogs_app_context_init();
ogs_app()->version = version;
/**************************************************************************
* Stage 1 : Command Line Options
@@ -117,7 +120,27 @@ int ogs_app_initialize(const char *default_config, const char *const argv[])
ogs_app()->db_uri = ogs_env_get("DB_URI");
/**************************************************************************
* Stage 6 : Queue, Timer and Poll
* Stage 6 : Print Banner
*/
if (ogs_app()->version) {
ogs_log_print(OGS_LOG_INFO,
"Open5GS daemon %s\n\n", ogs_app()->version);
ogs_info("Configuration: '%s'", ogs_app()->file);
if (ogs_app()->logger.file) {
ogs_info("File Logging: '%s'", ogs_app()->logger.file);
if (ogs_app()->logger.level)
ogs_info("LOG-LEVEL: '%s'", ogs_app()->logger.level);
if (ogs_app()->logger.domain)
ogs_info("LOG-DOMAIN: '%s'", ogs_app()->logger.domain);
}
}
/**************************************************************************
* Stage 7 : Queue, Timer and Poll
*/
ogs_app()->queue = ogs_queue_create(ogs_app()->pool.event);
ogs_assert(ogs_app()->queue);

View File

@@ -28,7 +28,9 @@
extern "C" {
#endif /* __cplusplus */
int ogs_app_initialize(const char *default_config, const char *const argv[]);
int ogs_app_initialize(
const char *version, const char *default_config,
const char *const argv[]);
void ogs_app_terminate(void);
int ogs_app_config_read(void);

View File

@@ -4,447 +4,72 @@
*/
#include <asn_internal.h>
#include <ANY.h>
#include <errno.h>
asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = {
sizeof(ANY_t),
offsetof(ANY_t, _asn_ctx),
ASN_OSUBV_ANY
sizeof(ANY_t),
offsetof(ANY_t, _asn_ctx),
ASN_OSUBV_ANY
};
asn_TYPE_operation_t asn_OP_ANY = {
OCTET_STRING_free,
OCTET_STRING_print,
OCTET_STRING_compare,
OCTET_STRING_decode_ber,
OCTET_STRING_encode_der,
OCTET_STRING_decode_xer_hex,
ANY_encode_xer,
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
OCTET_STRING_free,
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
OCTET_STRING_print,
#else
0,
0,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0, 0, 0, 0,
0,
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
OCTET_STRING_compare,
#if !defined(ASN_DISABLE_BER_SUPPORT)
OCTET_STRING_decode_ber,
OCTET_STRING_encode_der,
#else
ANY_decode_uper,
ANY_encode_uper,
ANY_decode_aper,
ANY_encode_aper,
#endif /* ASN_DISABLE_PER_SUPPORT */
0, /* Random fill is not defined for ANY type */
0 /* Use generic outmost tag fetcher */
0,
0,
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
#if !defined(ASN_DISABLE_XER_SUPPORT)
OCTET_STRING_decode_xer_hex,
ANY_encode_xer,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
0,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
ANY_decode_uper,
ANY_encode_uper,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
ANY_decode_aper,
ANY_encode_aper,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
0, /* Random fill is not defined for ANY type */
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_ANY = {
"ANY",
"ANY",
&asn_OP_ANY,
0, 0, 0, 0,
{ 0, 0, asn_generic_no_constraint }, /* No constraints */
0, 0, /* No members */
&asn_SPC_ANY_specs,
"ANY",
"ANY",
&asn_OP_ANY,
0, 0, 0, 0,
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
asn_generic_no_constraint
}, /* No constraints */
0, 0, /* No members */
&asn_SPC_ANY_specs,
};
#undef RETURN
#define RETURN(_code) \
do { \
asn_dec_rval_t tmprval; \
tmprval.code = _code; \
tmprval.consumed = consumed_myself; \
return tmprval; \
} while(0)
asn_enc_rval_t
ANY_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
void *app_key) {
if(flags & XER_F_CANONICAL) {
/*
* Canonical XER-encoding of ANY type is not supported.
*/
ASN__ENCODE_FAILED;
}
/* Dump as binary */
return OCTET_STRING_encode_xer(td, sptr, ilevel, flags, cb, app_key);
}
struct _callback_arg {
uint8_t *buffer;
size_t offset;
size_t size;
};
static int ANY__consume_bytes(const void *buffer, size_t size, void *key);
int
ANY_fromType(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
struct _callback_arg arg;
asn_enc_rval_t erval = {0,0,0};
if(!st || !td) {
errno = EINVAL;
return -1;
}
if(!sptr) {
if(st->buf) FREEMEM(st->buf);
st->size = 0;
return 0;
}
arg.offset = arg.size = 0;
arg.buffer = 0;
erval = der_encode(td, sptr, ANY__consume_bytes, &arg);
if(erval.encoded == -1) {
if(arg.buffer) FREEMEM(arg.buffer);
return -1;
}
assert((size_t)erval.encoded == arg.offset);
if(st->buf) FREEMEM(st->buf);
st->buf = arg.buffer;
st->size = arg.offset;
return 0;
}
int
ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
uint8_t *buffer = NULL;
ssize_t erval;
if(!st || !td) {
errno = EINVAL;
return -1;
}
if(!sptr) {
if(st->buf) FREEMEM(st->buf);
st->size = 0;
return 0;
}
erval = aper_encode_to_new_buffer(td, td->encoding_constraints.per_constraints, sptr, (void**)&buffer);
if(erval == -1) {
if(buffer) FREEMEM(buffer);
return -1;
}
assert((size_t)erval > 0);
if(st->buf) FREEMEM(st->buf);
st->buf = buffer;
st->size = erval;
return 0;
}
ANY_t *
ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
ANY_t tmp;
ANY_t *st;
if(!td || !sptr) {
errno = EINVAL;
return 0;
}
memset(&tmp, 0, sizeof(tmp));
if(ANY_fromType(&tmp, td, sptr)) return 0;
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
if(st) {
*st = tmp;
return st;
} else {
FREEMEM(tmp.buf);
return 0;
}
}
ANY_t *
ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
ANY_t tmp;
ANY_t *st;
if(!td || !sptr) {
errno = EINVAL;
return 0;
}
memset(&tmp, 0, sizeof(tmp));
if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
if(st) {
*st = tmp;
return st;
} else {
FREEMEM(tmp.buf);
return 0;
}
}
int
ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
asn_dec_rval_t rval;
void *newst = 0;
if(!st || !td || !struct_ptr) {
errno = EINVAL;
return -1;
}
if(st->buf == 0) {
/* Nothing to convert, make it empty. */
*struct_ptr = (void *)0;
return 0;
}
rval = ber_decode(0, td, (void **)&newst, st->buf, st->size);
if(rval.code == RC_OK) {
*struct_ptr = newst;
return 0;
} else {
/* Remove possibly partially decoded data. */
ASN_STRUCT_FREE(*td, newst);
return -1;
}
}
int
ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
asn_dec_rval_t rval;
void *newst = 0;
if(!st || !td || !struct_ptr) {
errno = EINVAL;
return -1;
}
if(st->buf == 0) {
/* Nothing to convert, make it empty. */
*struct_ptr = (void *)0;
return 0;
}
rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
if(rval.code == RC_OK) {
*struct_ptr = newst;
return 0;
} else {
/* Remove possibly partially decoded data. */
ASN_STRUCT_FREE(*td, newst);
return -1;
}
}
static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
struct _callback_arg *arg = (struct _callback_arg *)key;
if((arg->offset + size) >= arg->size) {
size_t nsize = (arg->size ? arg->size << 2 : 16) + size;
void *p = REALLOC(arg->buffer, nsize);
if(!p) return -1;
arg->buffer = (uint8_t *)p;
arg->size = nsize;
}
memcpy(arg->buffer + arg->offset, buffer, size);
arg->offset += size;
assert(arg->offset < arg->size);
return 0;
}
#ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t
ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_ANY_specs;
size_t consumed_myself = 0;
int repeat;
ANY_t *st = (ANY_t *)*sptr;
(void)opt_codec_ctx;
(void)constraints;
/*
* Allocate the structure.
*/
if(!st) {
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("UPER Decoding ANY type");
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = uper_get_length(pd, -1, 0, &repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
repeat ? "repeat" : "once", td->name);
len_bytes = raw_len;
len_bits = len_bytes * 8;
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += len_bits;
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
RETURN(RC_OK);
}
asn_enc_rval_t
ANY_encode_uper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const void *sptr,
asn_per_outp_t *po) {
const ANY_t *st = (const ANY_t *)sptr;
asn_enc_rval_t er = {0, 0, 0};
const uint8_t *buf;
size_t size;
int ret;
(void)constraints;
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
buf = st->buf;
size = st->size;
do {
int need_eom = 0;
ssize_t may_save = uper_put_length(po, size, &need_eom);
if(may_save < 0) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, buf, may_save * 8);
if(ret) ASN__ENCODE_FAILED;
buf += may_save;
size -= may_save;
assert(!(may_save & 0x07) || !size);
if(need_eom && uper_put_length(po, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size);
ASN__ENCODED_OK(er);
}
asn_dec_rval_t
ANY_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_ANY_specs;
size_t consumed_myself = 0;
int repeat;
ANY_t *st = (ANY_t *)*sptr;
(void)opt_codec_ctx;
(void)constraints;
/*
* Allocate the structure.
*/
if(!st) {
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("APER Decoding ANY type");
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = aper_get_length(pd, -1, 0, &repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
repeat ? "repeat" : "once", td->name);
len_bytes = raw_len;
len_bits = len_bytes * 8;
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += len_bits;
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
RETURN(RC_OK);
}
asn_enc_rval_t
ANY_encode_aper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const void *sptr,
asn_per_outp_t *po) {
const ANY_t *st = (const ANY_t *)sptr;
asn_enc_rval_t er = {0, 0, 0};
const uint8_t *buf;
size_t size;
int ret;
(void)constraints;
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
buf = st->buf;
size = st->size;
do {
int need_eom = 0;
ssize_t may_save = uper_put_length(po, size, &need_eom);
if(may_save < 0) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, buf, may_save * 8);
if(ret) ASN__ENCODE_FAILED;
buf += may_save;
size -= may_save;
assert(!(may_save & 0x07) || !size);
if(need_eom && uper_put_length(po, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size);
ASN__ENCODED_OK(er);
}
#endif /* ASN_DISABLE_PER_SUPPORT */

View File

@@ -22,23 +22,34 @@ extern asn_TYPE_descriptor_t asn_DEF_ANY;
extern asn_TYPE_operation_t asn_OP_ANY;
extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;
asn_struct_free_f ANY_free;
asn_struct_print_f ANY_print;
ber_type_decoder_f ANY_decode_ber;
der_type_encoder_f ANY_encode_der;
#define ANY_free OCTET_STRING_free
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
#define ANY_print OCTET_STRING_print
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
#define ANY_compare OCTET_STRING_compare
#define ANY_constraint asn_generic_no_constraint
#if !defined(ASN_DISABLE_BER_SUPPORT)
#define ANY_decode_ber OCTET_STRING_decode_ber
#define ANY_encode_der OCTET_STRING_encode_der
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
#if !defined(ASN_DISABLE_XER_SUPPORT)
#define ANY_decode_xer OCTET_STRING_decode_xer_hex
xer_type_encoder_f ANY_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
per_type_decoder_f ANY_decode_uper;
per_type_encoder_f ANY_encode_uper;
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
per_type_decoder_f ANY_decode_aper;
per_type_encoder_f ANY_encode_aper;
#define ANY_free OCTET_STRING_free
#define ANY_print OCTET_STRING_print
#define ANY_compare OCTET_STRING_compare
#define ANY_constraint asn_generic_no_constraint
#define ANY_decode_ber OCTET_STRING_decode_ber
#define ANY_encode_der OCTET_STRING_encode_der
#define ANY_decode_xer OCTET_STRING_decode_xer_hex
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
/******************************
* Handy conversion routines. *
@@ -46,13 +57,17 @@ per_type_encoder_f ANY_encode_aper;
/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
#if !defined(ASN_DISABLE_APER_SUPPORT)
int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
/* Convert the contents of the ANY type into the specified type. */
int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
#if !defined(ASN_DISABLE_APER_SUPPORT)
int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \

190
lib/asn1c/common/ANY_aper.c Normal file
View File

@@ -0,0 +1,190 @@
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <ANY.h>
#include <errno.h>
#undef RETURN
#define RETURN(_code) \
do { \
asn_dec_rval_t tmprval; \
tmprval.code = _code; \
tmprval.consumed = consumed_myself; \
return tmprval; \
} while(0)
int
ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
uint8_t *buffer = NULL;
ssize_t erval;
if(!st || !td) {
errno = EINVAL;
return -1;
}
if(!sptr) {
if(st->buf) FREEMEM(st->buf);
st->size = 0;
return 0;
}
erval = aper_encode_to_new_buffer(td, td->encoding_constraints.per_constraints, sptr, (void**)&buffer);
if(erval == -1) {
if(buffer) FREEMEM(buffer);
return -1;
}
assert((size_t)erval > 0);
if(st->buf) FREEMEM(st->buf);
st->buf = buffer;
st->size = erval;
return 0;
}
ANY_t *
ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
ANY_t tmp;
ANY_t *st;
if(!td || !sptr) {
errno = EINVAL;
return 0;
}
memset(&tmp, 0, sizeof(tmp));
if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
if(st) {
*st = tmp;
return st;
} else {
FREEMEM(tmp.buf);
return 0;
}
}
int
ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
asn_dec_rval_t rval;
void *newst = 0;
if(!st || !td || !struct_ptr) {
errno = EINVAL;
return -1;
}
if(st->buf == 0) {
/* Nothing to convert, make it empty. */
*struct_ptr = (void *)0;
return 0;
}
rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
if(rval.code == RC_OK) {
*struct_ptr = newst;
return 0;
} else {
/* Remove possibly partially decoded data. */
ASN_STRUCT_FREE(*td, newst);
return -1;
}
}
asn_dec_rval_t
ANY_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_ANY_specs;
size_t consumed_myself = 0;
int repeat;
ANY_t *st = (ANY_t *)*sptr;
(void)opt_codec_ctx;
(void)constraints;
/*
* Allocate the structure.
*/
if(!st) {
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("APER Decoding ANY type");
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = aper_get_length(pd, -1, 0, &repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
repeat ? "repeat" : "once", td->name);
len_bytes = raw_len;
len_bits = len_bytes * 8;
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += len_bits;
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
RETURN(RC_OK);
}
asn_enc_rval_t
ANY_encode_aper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const void *sptr,
asn_per_outp_t *po) {
const ANY_t *st = (const ANY_t *)sptr;
asn_enc_rval_t er = {0, 0, 0};
const uint8_t *buf;
size_t size;
int ret;
(void)constraints;
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
buf = st->buf;
size = st->size;
do {
int need_eom = 0;
ssize_t may_save = aper_put_length(po, -1, size, &need_eom);
if(may_save < 0) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, buf, may_save * 8);
if(ret) ASN__ENCODE_FAILED;
buf += may_save;
size -= may_save;
assert(!(may_save & 0x07) || !size);
if(need_eom && aper_put_length(po, -1, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size);
ASN__ENCODED_OK(er);
}

View File

@@ -4,61 +4,89 @@
*/
#include <asn_internal.h>
#include <BIT_STRING.h>
#include <asn_internal.h>
/*
* BIT STRING basic type description.
*/
static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
};
asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
sizeof(BIT_STRING_t),
offsetof(BIT_STRING_t, _asn_ctx),
ASN_OSUBV_BIT
sizeof(BIT_STRING_t),
offsetof(BIT_STRING_t, _asn_ctx),
ASN_OSUBV_BIT
};
asn_TYPE_operation_t asn_OP_BIT_STRING = {
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
BIT_STRING_print,
BIT_STRING_compare,
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */
OCTET_STRING_decode_xer_binary,
BIT_STRING_encode_xer,
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
BIT_STRING_print,
#else
BIT_STRING_decode_oer,
BIT_STRING_encode_oer,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0,
0,
0,
0,
0,
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
BIT_STRING_compare,
#if !defined(ASN_DISABLE_BER_SUPPORT)
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */
#else
BIT_STRING_decode_uper, /* Unaligned PER decoder */
BIT_STRING_encode_uper, /* Unaligned PER encoder */
OCTET_STRING_decode_aper, /* Aligned PER decoder */
OCTET_STRING_encode_aper, /* Aligned PER encoder */
#endif /* ASN_DISABLE_PER_SUPPORT */
BIT_STRING_random_fill,
0 /* Use generic outmost tag fetcher */
0,
0,
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
#if !defined(ASN_DISABLE_XER_SUPPORT)
OCTET_STRING_decode_xer_binary,
BIT_STRING_encode_xer,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
BIT_STRING_decode_oer,
BIT_STRING_encode_oer,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
BIT_STRING_decode_uper, /* Unaligned PER decoder */
BIT_STRING_encode_uper, /* Unaligned PER encoder */
#else
0,
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
OCTET_STRING_decode_aper, /* Aligned PER decoder */
OCTET_STRING_encode_aper, /* Aligned PER encoder */
#else
0,
0,
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
BIT_STRING_random_fill,
#else
0,
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
"BIT STRING",
"BIT_STRING",
&asn_OP_BIT_STRING,
asn_DEF_BIT_STRING_tags,
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
asn_DEF_BIT_STRING_tags, /* Same as above */
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
{ 0, 0, BIT_STRING_constraint },
0, 0, /* No members */
&asn_SPC_BIT_STRING_specs
"BIT STRING",
"BIT_STRING",
&asn_OP_BIT_STRING,
asn_DEF_BIT_STRING_tags,
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
asn_DEF_BIT_STRING_tags, /* Same as above */
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
BIT_STRING_constraint
},
0, 0, /* No members */
&asn_SPC_BIT_STRING_specs
};
/*
@@ -87,136 +115,10 @@ BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
return 0;
}
static const char *_bit_pattern[16] = {
"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"
};
asn_enc_rval_t
BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er = {0, 0, 0};
char scratch[128];
char *p = scratch;
char *scend = scratch + (sizeof(scratch) - 10);
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
int xcan = (flags & XER_F_CANONICAL);
uint8_t *buf;
uint8_t *end;
if(!st || !st->buf)
ASN__ENCODE_FAILED;
er.encoded = 0;
buf = st->buf;
end = buf + st->size - 1; /* Last byte is special */
/*
* Binary dump
*/
for(; buf < end; buf++) {
int v = *buf;
int nline = xcan?0:(((buf - st->buf) % 8) == 0);
if(p >= scend || nline) {
ASN__CALLBACK(scratch, p - scratch);
p = scratch;
if(nline) ASN__TEXT_INDENT(1, ilevel);
}
memcpy(p + 0, _bit_pattern[v >> 4], 4);
memcpy(p + 4, _bit_pattern[v & 0x0f], 4);
p += 8;
}
if(!xcan && ((buf - st->buf) % 8) == 0)
ASN__TEXT_INDENT(1, ilevel);
ASN__CALLBACK(scratch, p - scratch);
p = scratch;
if(buf == end) {
int v = *buf;
int ubits = st->bits_unused;
int i;
for(i = 7; i >= ubits; i--)
*p++ = (v & (1 << i)) ? 0x31 : 0x30;
ASN__CALLBACK(scratch, p - scratch);
}
if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
ASN__ENCODED_OK(er);
cb_failed:
ASN__ENCODE_FAILED;
}
/*
* BIT STRING specific contents printer.
*/
int
BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {
const char * const h2c = "0123456789ABCDEF";
char scratch[64];
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
uint8_t *buf;
uint8_t *end;
char *p = scratch;
(void)td; /* Unused argument */
if(!st || !st->buf)
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
ilevel++;
buf = st->buf;
end = buf + st->size;
/*
* Hexadecimal dump.
*/
for(; buf < end; buf++) {
if((buf - st->buf) % 16 == 0 && (st->size > 16)
&& buf != st->buf) {
_i_INDENT(1);
/* Dump the string */
if(cb(scratch, p - scratch, app_key) < 0) return -1;
p = scratch;
}
*p++ = h2c[*buf >> 4];
*p++ = h2c[*buf & 0x0F];
*p++ = 0x20;
}
if(p > scratch) {
p--; /* Eat the tailing space */
if((st->size > 16)) {
_i_INDENT(1);
}
/* Dump the incomplete 16-bytes row */
if(cb(scratch, p - scratch, app_key) < 0)
return -1;
}
if(st->bits_unused) {
int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
st->bits_unused, st->bits_unused == 1 ? "" : "s");
assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
if(ret > 0 && ret < (ssize_t)sizeof(scratch)
&& cb(scratch, ret, app_key) < 0)
return -1;
}
return 0;
}
/*
* Non-destructively remove the trailing 0-bits from the given bit string.
*/
static const BIT_STRING_t *
const BIT_STRING_t *
BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) {
const uint8_t *b;
union {
@@ -271,6 +173,7 @@ BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b);
const asn_OCTET_STRING_specifics_t *specs = td->specifics;
(void)specs;
assert(specs && specs->subvariant == ASN_OSUBV_BIT);
if(a && b) {
@@ -303,354 +206,3 @@ BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
return 1;
}
}
#ifndef ASN_DISABLE_PER_SUPPORT
#undef RETURN
#define RETURN(_code) \
do { \
asn_dec_rval_t tmprval; \
tmprval.code = _code; \
tmprval.consumed = consumed_myself; \
return tmprval; \
} while(0)
static asn_per_constraint_t asn_DEF_BIT_STRING_constraint_size = {
APC_SEMI_CONSTRAINED, -1, -1, 0, 0};
asn_dec_rval_t
BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
const asn_per_constraint_t *csiz;
asn_dec_rval_t rval = { RC_OK, 0 };
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
ssize_t consumed_myself = 0;
int repeat;
(void)opt_codec_ctx;
if(pc) {
csiz = &pc->size;
} else {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
if(specs->subvariant != ASN_OSUBV_BIT) {
ASN_DEBUG("Subvariant %d is not BIT OSUBV_BIT", specs->subvariant);
RETURN(RC_FAIL);
}
/*
* Allocate the string.
*/
if(!st) {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
if(csiz->flags & APC_EXTENSIBLE) {
int inext = per_get_few_bits(pd, 1);
if(inext < 0) RETURN(RC_WMORE);
if(inext) {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
}
if(csiz->effective_bits >= 0) {
FREEMEM(st->buf);
st->size = (csiz->upper_bound + 7) >> 3;
st->buf = (uint8_t *)MALLOC(st->size + 1);
if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
}
/* X.691, #16.5: zero-length encoding */
/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
if(csiz->effective_bits == 0) {
int ret;
ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound);
ret = per_get_many_bits(pd, st->buf, 0, csiz->upper_bound);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += csiz->upper_bound;
st->buf[st->size] = 0;
st->bits_unused = (8 - (csiz->upper_bound & 0x7)) & 0x7;
RETURN(RC_OK);
}
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
&repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
(long)csiz->effective_bits, (long)raw_len,
repeat ? "repeat" : "once", td->name);
len_bits = raw_len;
len_bytes = (len_bits + 7) >> 3;
if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7);
/* len_bits be multiple of 16K if repeat is set */
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
return rval;
}
asn_enc_rval_t
BIT_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints,
const void *sptr, asn_per_outp_t *po) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
const asn_per_constraint_t *csiz;
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
BIT_STRING_t compact_bstr; /* Do not modify this directly! */
asn_enc_rval_t er = { 0, 0, 0 };
int inext = 0; /* Lies not within extension root */
size_t size_in_bits;
const uint8_t *buf;
int ret;
int ct_extensible;
if(!st || (!st->buf && st->size))
ASN__ENCODE_FAILED;
if(specs->subvariant == ASN_OSUBV_BIT) {
if((st->size == 0 && st->bits_unused) || (st->bits_unused & ~7))
ASN__ENCODE_FAILED;
} else {
ASN__ENCODE_FAILED;
}
if(pc) {
csiz = &pc->size;
} else {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
ct_extensible = csiz->flags & APC_EXTENSIBLE;
/* Figure out the size without the trailing bits */
st = BIT_STRING__compactify(st, &compact_bstr);
size_in_bits = 8 * st->size - st->bits_unused;
ASN_DEBUG(
"Encoding %s into %" ASN_PRI_SIZE " bits"
" (%ld..%ld, effective %d)%s",
td->name, size_in_bits, csiz->lower_bound, csiz->upper_bound,
csiz->effective_bits, ct_extensible ? " EXT" : "");
/* Figure out whether size lies within PER visible constraint */
if(csiz->effective_bits >= 0) {
if((ssize_t)size_in_bits > csiz->upper_bound) {
if(ct_extensible) {
csiz = &asn_DEF_BIT_STRING_constraint_size;
inext = 1;
} else {
ASN__ENCODE_FAILED;
}
}
} else {
inext = 0;
}
if(ct_extensible) {
/* Declare whether length is [not] within extension root */
if(per_put_few_bits(po, inext, 1))
ASN__ENCODE_FAILED;
}
if(csiz->effective_bits >= 0 && !inext) {
int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
ASN_DEBUG(
"Encoding %" ASN_PRI_SIZE " bytes (%ld), length (in %d bits) trailer %d; actual "
"value %" ASN_PRI_SSIZE "",
st->size, size_in_bits - csiz->lower_bound, csiz->effective_bits,
add_trailer,
add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound);
ret = per_put_few_bits(
po, add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound,
csiz->effective_bits);
if(ret) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, st->buf, size_in_bits);
if(ret) ASN__ENCODE_FAILED;
if(add_trailer) {
static const uint8_t zeros[16];
size_t trailing_zero_bits = csiz->lower_bound - size_in_bits;
while(trailing_zero_bits > 0) {
if(trailing_zero_bits > 8 * sizeof(zeros)) {
ret = per_put_many_bits(po, zeros, 8 * sizeof(zeros));
trailing_zero_bits -= 8 * sizeof(zeros);
} else {
ret = per_put_many_bits(po, zeros, trailing_zero_bits);
trailing_zero_bits = 0;
}
if(ret) ASN__ENCODE_FAILED;
}
}
ASN__ENCODED_OK(er);
}
ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
buf = st->buf;
do {
int need_eom = 0;
ssize_t maySave = uper_put_length(po, size_in_bits, &need_eom);
if(maySave < 0) ASN__ENCODE_FAILED;
ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "", maySave, size_in_bits);
ret = per_put_many_bits(po, buf, maySave);
if(ret) ASN__ENCODE_FAILED;
buf += maySave >> 3;
size_in_bits -= maySave;
assert(!(maySave & 0x07) || !size_in_bits);
if(need_eom && uper_put_length(po, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size_in_bits);
ASN__ENCODED_OK(er);
}
#endif /* ASN_DISABLE_PER_SUPPORT */
asn_random_fill_result_t
BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints,
size_t max_length) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
static unsigned lengths[] = {0, 1, 2, 3, 4, 8,
126, 127, 128, 16383, 16384, 16385,
65534, 65535, 65536, 65537};
uint8_t *buf;
uint8_t *bend;
uint8_t *b;
size_t rnd_bits, rnd_len;
BIT_STRING_t *st;
if(max_length == 0) return result_skipped;
switch(specs->subvariant) {
case ASN_OSUBV_ANY:
return result_failed;
case ASN_OSUBV_BIT:
break;
default:
break;
}
/* Figure out how far we should go */
rnd_bits = lengths[asn_random_between(
0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
if(!constraints || !constraints->per_constraints)
constraints = &td->encoding_constraints;
if(constraints->per_constraints) {
const asn_per_constraint_t *pc = &constraints->per_constraints->size;
if(pc->flags & APC_CONSTRAINED) {
long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
? pc->upper_bound
: (ssize_t)max_length;
if(max_length < (size_t)pc->lower_bound) {
return result_skipped;
}
if(pc->flags & APC_EXTENSIBLE) {
switch(asn_random_between(0, 5)) {
case 0:
if(pc->lower_bound > 0) {
rnd_bits = pc->lower_bound - 1;
break;
}
/* Fall through */
case 1:
rnd_bits = pc->upper_bound + 1;
break;
case 2:
/* Keep rnd_bits from the table */
if(rnd_bits < max_length) {
break;
}
/* Fall through */
default:
rnd_bits = asn_random_between(pc->lower_bound,
suggested_upper_bound);
}
} else {
rnd_bits =
asn_random_between(pc->lower_bound, suggested_upper_bound);
}
} else {
rnd_bits = asn_random_between(0, max_length - 1);
}
} else if(rnd_bits >= max_length) {
rnd_bits = asn_random_between(0, max_length - 1);
}
rnd_len = (rnd_bits + 7) / 8;
buf = CALLOC(1, rnd_len + 1);
if(!buf) return result_failed;
bend = &buf[rnd_len];
for(b = buf; b < bend; b++) {
*(uint8_t *)b = asn_random_between(0, 255);
}
*b = 0; /* Zero-terminate just in case. */
if(*sptr) {
st = *sptr;
FREEMEM(st->buf);
} else {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) {
FREEMEM(buf);
return result_failed;
}
}
st->buf = buf;
st->size = rnd_len;
st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
if(st->bits_unused) {
assert(st->size > 0);
st->buf[st->size-1] &= 0xff << st->bits_unused;
}
result_ok.length = st->size;
return result_ok;
}

View File

@@ -24,22 +24,45 @@ extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
extern asn_TYPE_operation_t asn_OP_BIT_STRING;
extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
asn_struct_print_f BIT_STRING_print; /* Human-readable output */
#define BIT_STRING_free OCTET_STRING_free
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
asn_struct_print_f BIT_STRING_print; /* Human-readable output */
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
asn_struct_compare_f BIT_STRING_compare;
asn_constr_check_f BIT_STRING_constraint;
#if !defined(ASN_DISABLE_BER_SUPPORT)
#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
#define BIT_STRING_encode_der OCTET_STRING_encode_der
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
#if !defined(ASN_DISABLE_XER_SUPPORT)
#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
xer_type_encoder_f BIT_STRING_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f BIT_STRING_decode_oer;
oer_type_encoder_f BIT_STRING_encode_oer;
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
per_type_decoder_f BIT_STRING_decode_uper;
per_type_encoder_f BIT_STRING_encode_uper;
asn_random_fill_f BIT_STRING_random_fill;
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
#define BIT_STRING_decode_aper OCTET_STRING_decode_aper
#define BIT_STRING_encode_aper OCTET_STRING_encode_aper
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
#define BIT_STRING_free OCTET_STRING_free
#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
#define BIT_STRING_encode_der OCTET_STRING_encode_der
#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
#define BIT_STRING_decode_aper OCTET_STRING_decode_aper
#define BIT_STRING_encode_aper OCTET_STRING_encode_aper
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
asn_random_fill_f BIT_STRING_random_fill;
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
const BIT_STRING_t *BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp);
#ifdef __cplusplus
}

View File

@@ -0,0 +1,69 @@
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <BIT_STRING.h>
/*
* BIT STRING specific contents printer.
*/
int
BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {
const char * const h2c = "0123456789ABCDEF";
char scratch[64];
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
uint8_t *buf;
uint8_t *end;
char *p = scratch;
(void)td; /* Unused argument */
if(!st || !st->buf)
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
ilevel++;
buf = st->buf;
end = buf + st->size;
/*
* Hexadecimal dump.
*/
for(; buf < end; buf++) {
if((buf - st->buf) % 16 == 0 && (st->size > 16)
&& buf != st->buf) {
_i_INDENT(1);
/* Dump the string */
if(cb(scratch, p - scratch, app_key) < 0) return -1;
p = scratch;
}
*p++ = h2c[*buf >> 4];
*p++ = h2c[*buf & 0x0F];
*p++ = 0x20;
}
if(p > scratch) {
p--; /* Eat the tailing space */
if((st->size > 16)) {
_i_INDENT(1);
}
/* Dump the incomplete 16-bytes row */
if(cb(scratch, p - scratch, app_key) < 0)
return -1;
}
if(st->bits_unused) {
int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
st->bits_unused, st->bits_unused == 1 ? "" : "s");
assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
if(ret > 0 && ret < (ssize_t)sizeof(scratch)
&& cb(scratch, ret, app_key) < 0)
return -1;
}
return 0;
}

View File

@@ -0,0 +1,124 @@
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <BIT_STRING.h>
asn_random_fill_result_t
BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints,
size_t max_length) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
static unsigned lengths[] = {0, 1, 2, 3, 4, 8,
126, 127, 128, 16383, 16384, 16385,
65534, 65535, 65536, 65537};
uint8_t *buf;
uint8_t *bend;
uint8_t *b;
size_t rnd_bits, rnd_len;
BIT_STRING_t *st;
if(max_length == 0) return result_skipped;
switch(specs->subvariant) {
case ASN_OSUBV_ANY:
return result_failed;
case ASN_OSUBV_BIT:
break;
default:
break;
}
/* Figure out how far we should go */
rnd_bits = lengths[asn_random_between(
0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
if(!constraints || !constraints->per_constraints)
constraints = &td->encoding_constraints;
if(constraints->per_constraints) {
const asn_per_constraint_t *pc = &constraints->per_constraints->size;
if(pc->flags & APC_CONSTRAINED) {
long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
? pc->upper_bound
: (ssize_t)max_length;
if(max_length < (size_t)pc->lower_bound) {
return result_skipped;
}
if(pc->flags & APC_EXTENSIBLE) {
switch(asn_random_between(0, 5)) {
case 0:
if(pc->lower_bound > 0) {
rnd_bits = pc->lower_bound - 1;
break;
}
/* Fall through */
case 1:
rnd_bits = pc->upper_bound + 1;
break;
case 2:
/* Keep rnd_bits from the table */
if(rnd_bits < max_length) {
break;
}
/* Fall through */
default:
rnd_bits = asn_random_between(pc->lower_bound,
suggested_upper_bound);
}
} else {
rnd_bits =
asn_random_between(pc->lower_bound, suggested_upper_bound);
}
} else {
rnd_bits = asn_random_between(0, max_length - 1);
}
} else {
#else
if(!constraints) constraints = &td->encoding_constraints;
{
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
if(rnd_bits >= max_length) {
rnd_bits = asn_random_between(0, max_length - 1);
}
}
rnd_len = (rnd_bits + 7) / 8;
buf = CALLOC(1, rnd_len + 1);
if(!buf) return result_failed;
bend = &buf[rnd_len];
for(b = buf; b < bend; b++) {
*(uint8_t *)b = asn_random_between(0, 255);
}
*b = 0; /* Zero-terminate just in case. */
if(*sptr) {
st = *sptr;
FREEMEM(st->buf);
} else {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) {
FREEMEM(buf);
return result_failed;
}
}
st->buf = buf;
st->size = rnd_len;
st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
if(st->bits_unused) {
assert(st->size > 0);
st->buf[st->size-1] &= 0xff << st->bits_unused;
}
result_ok.length = st->size;
return result_ok;
}

View File

@@ -9,50 +9,78 @@
* GraphicString basic type description.
*/
static const ber_tlv_tag_t asn_DEF_GraphicString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (25 << 2)), /* [UNIVERSAL 25] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
(ASN_TAG_CLASS_UNIVERSAL | (25 << 2)), /* [UNIVERSAL 25] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn_TYPE_operation_t asn_OP_GraphicString = {
OCTET_STRING_free,
OCTET_STRING_print, /* non-ascii string */
OCTET_STRING_compare,
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_der,
OCTET_STRING_decode_xer_hex,
OCTET_STRING_encode_xer, /* Can't expect it to be ASCII/UTF8 */
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
OCTET_STRING_free,
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
OCTET_STRING_print, /* non-ascii string */
#else
OCTET_STRING_decode_oer,
OCTET_STRING_encode_oer,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0,
0,
0,
0,
0,
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
OCTET_STRING_compare,
#if !defined(ASN_DISABLE_BER_SUPPORT)
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_der,
#else
OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_uper,
OCTET_STRING_decode_aper, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_aper,
#endif /* ASN_DISABLE_PER_SUPPORT */
OCTET_STRING_random_fill,
0 /* Use generic outmost tag fetcher */
0,
0,
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
#if !defined(ASN_DISABLE_XER_SUPPORT)
OCTET_STRING_decode_xer_hex,
OCTET_STRING_encode_xer, /* Can't expect it to be ASCII/UTF8 */
#else
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
OCTET_STRING_decode_oer,
OCTET_STRING_encode_oer,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_uper,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
OCTET_STRING_decode_aper, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_aper,
#else
0,
0,
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
OCTET_STRING_random_fill,
#else
0,
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_GraphicString = {
"GraphicString",
"GraphicString",
&asn_OP_GraphicString,
asn_DEF_GraphicString_tags,
sizeof(asn_DEF_GraphicString_tags)
/ sizeof(asn_DEF_GraphicString_tags[0]) - 1,
asn_DEF_GraphicString_tags,
sizeof(asn_DEF_GraphicString_tags)
/ sizeof(asn_DEF_GraphicString_tags[0]),
{ 0, 0, asn_generic_unknown_constraint },
0, 0, /* No members */
0 /* No specifics */
"GraphicString",
"GraphicString",
&asn_OP_GraphicString,
asn_DEF_GraphicString_tags,
sizeof(asn_DEF_GraphicString_tags)
/ sizeof(asn_DEF_GraphicString_tags[0]) - 1,
asn_DEF_GraphicString_tags,
sizeof(asn_DEF_GraphicString_tags)
/ sizeof(asn_DEF_GraphicString_tags[0]),
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
asn_generic_unknown_constraint
},
0, 0, /* No members */
0 /* No specifics */
};

View File

@@ -16,18 +16,34 @@ typedef OCTET_STRING_t GraphicString_t; /* Implemented via OCTET STRING */
extern asn_TYPE_descriptor_t asn_DEF_GraphicString;
extern asn_TYPE_operation_t asn_OP_GraphicString;
#define GraphicString_free OCTET_STRING_free
#define GraphicString_print OCTET_STRING_print
#define GraphicString_compare OCTET_STRING_compare
#define GraphicString_constraint asn_generic_unknown_constraint
#define GraphicString_decode_ber OCTET_STRING_decode_ber
#define GraphicString_encode_der OCTET_STRING_encode_der
#define GraphicString_decode_xer OCTET_STRING_decode_xer_hex
#define GraphicString_encode_xer OCTET_STRING_encode_xer
#define GraphicString_decode_uper OCTET_STRING_decode_uper
#define GraphicString_encode_uper OCTET_STRING_encode_uper
#define GraphicString_decode_aper OCTET_STRING_decode_aper
#define GraphicString_encode_aper OCTET_STRING_encode_aper
#define GraphicString_free OCTET_STRING_free
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
#define GraphicString_print OCTET_STRING_print
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
#define GraphicString_compare OCTET_STRING_compare
#define GraphicString_constraint asn_generic_unknown_constraint
#if !defined(ASN_DISABLE_BER_SUPPORT)
#define GraphicString_decode_ber OCTET_STRING_decode_ber
#define GraphicString_encode_der OCTET_STRING_encode_der
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
#if !defined(ASN_DISABLE_XER_SUPPORT)
#define GraphicString_decode_xer OCTET_STRING_decode_xer_hex
#define GraphicString_encode_xer OCTET_STRING_encode_xer
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
#define GraphicString_decode_uper OCTET_STRING_decode_uper
#define GraphicString_encode_uper OCTET_STRING_encode_uper
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
#define GraphicString_decode_aper OCTET_STRING_decode_aper
#define GraphicString_encode_aper OCTET_STRING_encode_aper
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
#ifdef __cplusplus
}

File diff suppressed because it is too large Load Diff

View File

@@ -35,21 +35,48 @@ typedef struct asn_INTEGER_specifics_s {
int field_unsigned; /* Signed=0, unsigned=1 */
} asn_INTEGER_specifics_t;
#define INTEGER_free ASN__PRIMITIVE_TYPE_free
#define INTEGER_decode_ber ber_decode_primitive
#define INTEGER_constraint asn_generic_no_constraint
ssize_t INTEGER__dump(const asn_TYPE_descriptor_t *td,
const INTEGER_t *st,
asn_app_consume_bytes_f *cb,
void *app_key, int plainOrXER);
#define INTEGER_free ASN__PRIMITIVE_TYPE_free
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
asn_struct_print_f INTEGER_print;
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
asn_struct_compare_f INTEGER_compare;
#define INTEGER_constraint asn_generic_no_constraint
#if !defined(ASN_DISABLE_BER_SUPPORT)
#define INTEGER_decode_ber ber_decode_primitive
der_type_encoder_f INTEGER_encode_der;
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
#if !defined(ASN_DISABLE_XER_SUPPORT)
xer_type_decoder_f INTEGER_decode_xer;
xer_type_encoder_f INTEGER_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f INTEGER_decode_oer;
oer_type_encoder_f INTEGER_encode_oer;
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
per_type_decoder_f INTEGER_decode_uper;
per_type_encoder_f INTEGER_encode_uper;
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
per_type_decoder_f INTEGER_decode_aper;
per_type_encoder_f INTEGER_encode_aper;
asn_random_fill_f INTEGER_random_fill;
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
asn_random_fill_f INTEGER_random_fill;
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
/***********************************
* Some handy conversion routines. *

View File

@@ -0,0 +1,304 @@
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <INTEGER.h>
asn_dec_rval_t
INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
asn_dec_rval_t rval = { RC_OK, 0 };
INTEGER_t *st = (INTEGER_t *)*sptr;
const asn_per_constraint_t *ct;
int repeat;
(void)opt_codec_ctx;
if(!st) {
st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
if(!st) ASN__DECODE_FAILED;
}
if(!constraints) constraints = td->encoding_constraints.per_constraints;
ct = constraints ? &constraints->value : 0;
if(ct && ct->flags & APC_EXTENSIBLE) {
int inext = per_get_few_bits(pd, 1);
if(inext < 0) ASN__DECODE_STARVED;
if(inext) ct = 0;
}
FREEMEM(st->buf);
st->buf = 0;
st->size = 0;
if(ct) {
if(ct->flags & APC_SEMI_CONSTRAINED) {
st->buf = (uint8_t *)CALLOC(1, 2);
if(!st->buf) ASN__DECODE_FAILED;
st->size = 1;
} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
size_t size = (ct->range_bits + 7) >> 3;
st->buf = (uint8_t *)MALLOC(1 + size + 1);
if(!st->buf) ASN__DECODE_FAILED;
st->size = size;
}
}
/* X.691, #12.2.2 */
if(ct && ct->flags != APC_UNCONSTRAINED) {
/* #10.5.6 */
ASN_DEBUG("Integer with range %d bits", ct->range_bits);
if(ct->range_bits >= 0) {
if (ct->range_bits > 16) {
int max_range_bytes = (ct->range_bits >> 3) +
(((ct->range_bits % 8) > 0) ? 1 : 0);
int length = 0, i;
long value = 0;
for (i = 1; ; i++) {
int upper = 1 << i;
if (upper >= max_range_bytes)
break;
}
ASN_DEBUG("Can encode %d (%d bytes) in %d bits", ct->range_bits,
max_range_bytes, i);
if ((length = per_get_few_bits(pd, i)) < 0)
ASN__DECODE_FAILED;
/* X.691 #12.2.6 length determinant + lb (1) */
length += 1;
ASN_DEBUG("Got length %d", length);
if (aper_get_align(pd) != 0)
ASN__DECODE_FAILED;
while (length--) {
int buf = per_get_few_bits(pd, 8);
if (buf < 0)
ASN__DECODE_FAILED;
value += (((long)buf) << (8 * length));
}
value += ct->lower_bound;
if((specs && specs->field_unsigned)
? asn_uint642INTEGER(st, (unsigned long)value)
: asn_int642INTEGER(st, value))
ASN__DECODE_FAILED;
ASN_DEBUG("Got value %ld + low %ld",
value, ct->lower_bound);
} else {
long value = 0;
if (ct->range_bits < 8) {
value = per_get_few_bits(pd, ct->range_bits);
if(value < 0) ASN__DECODE_STARVED;
} else if (ct->range_bits == 8) {
if (aper_get_align(pd) < 0)
ASN__DECODE_FAILED;
value = per_get_few_bits(pd, ct->range_bits);
if(value < 0) ASN__DECODE_STARVED;
} else {
/* Align */
if (aper_get_align(pd) < 0)
ASN__DECODE_FAILED;
value = per_get_few_bits(pd, 16);
if(value < 0) ASN__DECODE_STARVED;
}
value += ct->lower_bound;
if((specs && specs->field_unsigned)
? asn_ulong2INTEGER(st, value)
: asn_long2INTEGER(st, value))
ASN__DECODE_FAILED;
ASN_DEBUG("Got value %ld + low %ld",
value, ct->lower_bound);
}
return rval;
} else {
ASN__DECODE_FAILED;
}
} else {
ASN_DEBUG("Decoding unconstrained integer %s", td->name);
}
/* X.691, #12.2.3, #12.2.4 */
do {
ssize_t len;
void *p;
int ret;
/* Get the PER length */
len = aper_get_length(pd, -1, -1, &repeat);
if(len < 0) ASN__DECODE_STARVED;
p = REALLOC(st->buf, st->size + len + 1);
if(!p) ASN__DECODE_FAILED;
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
if(ret < 0) ASN__DECODE_STARVED;
st->size += len;
} while(repeat);
st->buf[st->size] = 0; /* JIC */
/* #12.2.3 */
if(ct && ct->lower_bound) {
/*
* TODO: replace by in-place arithmetics.
*/
long value;
if(asn_INTEGER2long(st, &value))
ASN__DECODE_FAILED;
if(asn_long2INTEGER(st, value + ct->lower_bound))
ASN__DECODE_FAILED;
}
return rval;
}
asn_enc_rval_t
INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints,
const void *sptr, asn_per_outp_t *po) {
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
asn_enc_rval_t er = {0,0,0};
const INTEGER_t *st = (const INTEGER_t *)sptr;
const uint8_t *buf;
const uint8_t *end;
const asn_per_constraint_t *ct;
long value = 0;
if(!st || st->size == 0) ASN__ENCODE_FAILED;
if(!constraints) constraints = td->encoding_constraints.per_constraints;
ct = constraints ? &constraints->value : 0;
er.encoded = 0;
if(ct) {
int inext = 0;
if(specs && specs->field_unsigned) {
unsigned long uval;
if(asn_INTEGER2ulong(st, &uval))
ASN__ENCODE_FAILED;
/* Check proper range */
if(ct->flags & APC_SEMI_CONSTRAINED) {
if(uval < (unsigned long)ct->lower_bound)
inext = 1;
} else if(ct->range_bits >= 0) {
if(uval < (unsigned long)ct->lower_bound
|| uval > (unsigned long)ct->upper_bound)
inext = 1;
}
ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
uval, st->buf[0], st->size,
ct->lower_bound, ct->upper_bound,
inext ? "ext" : "fix");
value = uval;
} else {
if(asn_INTEGER2long(st, &value)) ASN__ENCODE_FAILED;
/* Check proper range */
if(ct->flags & APC_SEMI_CONSTRAINED) {
if(value < ct->lower_bound)
inext = 1;
} else if(ct->range_bits >= 0) {
if(value < ct->lower_bound
|| value > ct->upper_bound)
inext = 1;
}
ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
value, st->buf[0], st->size,
ct->lower_bound, ct->upper_bound,
inext ? "ext" : "fix");
}
if(ct->flags & APC_EXTENSIBLE) {
if(per_put_few_bits(po, inext, 1))
ASN__ENCODE_FAILED;
if(inext) ct = 0;
} else if(inext) {
ASN__ENCODE_FAILED;
}
}
/* X.691, #12.2.2 */
if(ct && ct->range_bits >= 0) {
unsigned long v;
/* #10.5.6 */
ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
value, value - ct->lower_bound, ct->range_bits);
v = value - ct->lower_bound;
/* #12 <= 8 -> alignment ? */
int range = ct->upper_bound - ct->lower_bound + 1;
if (ct->range_bits < 8 || (ct->range_bits == 8 && range < 256)) {
if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
ASN__ENCODE_FAILED;
} else if (ct->range_bits == 8) {
if(aper_put_align(po) < 0)
ASN__ENCODE_FAILED;
if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
ASN__ENCODE_FAILED;
} else if (ct->range_bits <= 16) {
/* Consume the bytes to align on octet */
if(aper_put_align(po) < 0)
ASN__ENCODE_FAILED;
if(per_put_few_bits(po, 0x0000 | v, 16))
ASN__ENCODE_FAILED;
} else {
/* TODO: extend to >64 bits */
int64_t v64 = v;
int i, j;
int max_range_bytes = (ct->range_bits >> 3) +
(((ct->range_bits % 8) > 0) ? 1 : 0);
for (i = 1; ; i++) {
int upper = 1 << i;
if (upper >= max_range_bytes)
break;
}
for (j = sizeof(int64_t) -1; j != 0; j--) {
int64_t val;
val = v64 >> (j * 8);
if (val != 0)
break;
}
/* Putting length in the minimum number of bits ex: 5 = 3bits */
if (per_put_few_bits(po, j, i))
ASN__ENCODE_FAILED;
/* Consume the bits to align on octet */
if (aper_put_align(po) < 0)
ASN__ENCODE_FAILED;
/* Put the value */
for (i = 0; i <= j; i++) {
if(per_put_few_bits(po, (v64 >> (8 * (j - i))) & 0xff, 8))
ASN__ENCODE_FAILED;
}
}
ASN__ENCODED_OK(er);
}
if(ct && ct->lower_bound) {
ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
/* TODO: adjust lower bound */
ASN__ENCODE_FAILED;
}
for(buf = st->buf, end = st->buf + st->size; buf < end;) {
int need_eom = 0;
ssize_t mayEncode = aper_put_length(po, -1, end - buf, &need_eom);
if(mayEncode < 0)
ASN__ENCODE_FAILED;
if(per_put_many_bits(po, buf, 8 * mayEncode))
ASN__ENCODE_FAILED;
buf += mayEncode;
if(need_eom && aper_put_length(po, -1, 0, 0)) ASN__ENCODE_FAILED;
}
ASN__ENCODED_OK(er);
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <INTEGER.h>
/*
* INTEGER specific human-readable output.
*/
int
INTEGER_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {
const INTEGER_t *st = (const INTEGER_t *)sptr;
ssize_t ret;
(void)ilevel;
if(!st || !st->buf)
ret = cb("<absent>", 8, app_key);
else
ret = INTEGER__dump(td, st, cb, app_key, 0);
return (ret < 0) ? -1 : 0;
}

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