Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to NNG 2.0 for NanoRT #1154

Draft
wants to merge 222 commits into
base: main
Choose a base branch
from
Draft

Upgrade to NNG 2.0 for NanoRT #1154

wants to merge 222 commits into from

Conversation

JaylinYu
Copy link
Member

No description provided.

gdamore and others added 30 commits February 18, 2025 14:55
This is expected to be useful for new transports where we need
the sock address to properly reply (think UDP with multicast).

Signed-off-by: jaylin <[email protected]>
This is the initial implementation of UDP transport.
It does in order guarantees (and consequently filters duplicates),
but it does not guarantee delivery.  The protocol limits payloads
to 65000 bytes (minus headers for SP), but you really want to
keep it to much less -- probably best for short messages that within
a single MTU to avoid IP fragmentation and reassembly.

This is unicast only for now (although there are plans for some
support for multicast and broadcast as well as being able to
perform automatic mesh building, but that will be in following work.

Additional tunables are coming.  This is only lightly tested at
this point, and should be considered experimental.  Its also undocumented.
fix link to TLS build instructions file. It was renamed from docs/BUILD_TLS.adoc to docs/BUILD_TLS.md in commit 6e5cf29
XPG8 defines getentropy() as the only good source for random numbers.
However, real world use a bit more nuanced.  On BSD systems, we would
prefer to use arc4random as it avoids unnecessary system calls.  On
Linux however, getentropy is implemented in terms of getrandom, and should
be used directly when available.
This also allows to remove most of the transport headers.
Only zerotier.h sticks around, and only for now.  (We expect to
eject it into a separate module.)

Signed-off-by: jaylin <[email protected]>
JaylinYu and others added 11 commits February 24, 2025 15:15
This also avoids a potential leak of thread attributes. although
no current platform actually seems to do so.
Those old algorithms are not used anywhere, and are not recommended.
TLS 1.2 support has been prevalent for over a decade.
This functionality was provided principally for libnanomsg compatibility.
This saves some memory and eliminates some pointless functionality.

While here, updated the socket options documentation to remove references
to options already removed.

Signed-off-by: jaylin <[email protected]>
This was an undocumented capability provided for libnanomsg.  The
correct way to obtain the same functionality is to use `NNG_OPT_LOCADDR`.

Signed-off-by: jaylin <[email protected]>
@JaylinYu JaylinYu marked this pull request as draft February 24, 2025 11:49
JaylinYu and others added 18 commits February 25, 2025 12:56
The idea here is to reduce the dynamic allocations used for
URLs, and also the back and forth with parsing begin strings
and port numbers.  We always resolve to a port number, and
this is easier for everyone.

The real goal in the long term is to eliminate dynamic allocation
of the URL fields altogether, but that requires a little more
work.  This is a step in the right direction.

Signed-off-by: jaylin <[email protected]>
Also expose nng_url_sprintf() for users who need it.

This avoids some need to do dynamic memory on some things.  Soon
the entirety of nng_url will be allocation free in the usual case.

Signed-off-by: jaylin <[email protected]>
This eliminates most (but not all) of the dynamic allocations
associated with URL objects.  A number of convenience fields
on the URL are removed, but we are able to use common buffer
for most of the details.

Signed-off-by: jaylin <[email protected]>
the separation of nni_url and nng_url.

Signed-off-by: jaylin <[email protected]>
This provides safety by ensuring that applications do not
depend on the size or layout of nng_url itself.
The inline parsing will be used internally to avoid some allocations.
We moved some of the tests out of the older Convey framework into
the NUTS framework.
While TCP and UDP port numbers are 16-bits, ZT uses a larger (24-bit)
port number.
This is a step on cleaning up our logic around NNG_OPT_URL.

Signed-off-by: jaylin <[email protected]>
Signed-off-by: jaylin <[email protected]>
This is intended to replace NNG_OPT_URL.

Signed-off-by: jaylin <[email protected]>
Signed-off-by: jaylin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants