summaryrefslogtreecommitdiff
path: root/ref/tran/udp.html
diff options
context:
space:
mode:
authorgdamore <gdamore@users.noreply.github.com>2025-01-02 17:32:19 +0000
committergdamore <gdamore@users.noreply.github.com>2025-01-02 17:32:19 +0000
commitde6a8290a3bd69b6d32a1d323228d03584867d68 (patch)
tree0034171dce7e0978d848d6a25451b3de22b055a4 /ref/tran/udp.html
parent2bd762d472334c6cd612ff0c57bb87718254ff8c (diff)
downloadnng-de6a8290a3bd69b6d32a1d323228d03584867d68.tar.gz
nng-de6a8290a3bd69b6d32a1d323228d03584867d68.tar.bz2
nng-de6a8290a3bd69b6d32a1d323228d03584867d68.zip
deploy: 2e15032c278e279b67909c06c2d47c9051a493cc
Diffstat (limited to 'ref/tran/udp.html')
-rw-r--r--ref/tran/udp.html40
1 files changed, 26 insertions, 14 deletions
diff --git a/ref/tran/udp.html b/ref/tran/udp.html
index b74bc971..f7cb9039 100644
--- a/ref/tran/udp.html
+++ b/ref/tran/udp.html
@@ -236,7 +236,7 @@ that all messages sent will arrive.</p>
</p>
<p>This transport is <em>experimental</em>.</p>
</div>
-<h2 id="uri-format"><a class="header" href="#uri-format">URI Format</a></h2>
+<h2 id="url-format"><a class="header" href="#url-format">URL Format</a></h2>
<p>This transport uses URIs using the scheme <a name="a005"></a><code>udp://</code>, followed by
an IP address or hostname, followed by a colon and finally a
UDP <a name="a006"></a>port number.
@@ -278,18 +278,21 @@ and could be used to listen to port 9999 on the host:</p>
<li><code>udp://:9999</code></li>
</ol>
<h2 id="socket-address"><a class="header" href="#socket-address">Socket Address</a></h2>
-<p>When using an <a href="%5BTODO.html"><code>nng_sockaddr</code></a> structure,
+<p>When using an <a href="/TODO.html"><code>nng_sockaddr</code></a> structure,
the actual structure is either of type
-<a href="%5BTODO.html"><code>nng_sockaddr_in</code></a> (for IPv4) or
-<a href="%5BTODO.html"><code>nng_sockaddr_in6</code></a> (for IPv6).</p>
+<a href="/TODO.html"><code>nng_sockaddr_in</code></a> (for IPv4) or
+<a href="/TODO.html"><code>nng_sockaddr_in6</code></a> (for IPv6).</p>
<h2 id="transport-options"><a class="header" href="#transport-options">Transport Options</a></h2>
<p>The following transport options are supported by this transport,
where supported by the underlying platform.</p>
-<ul>
-<li><a href="%5BTODO.html"><code>NNG_OPT_LOCADDR</code></a></li>
-<li><a href="%5BTODO.html"><code>NNG_OPT_REMADDR</code></a></li>
-</ul>
-<p>TODO: Document other options.</p>
+<div class="table-wrapper"><table><thead><tr><th>Option</th><th>Type</th><th>Description</th></tr></thead><tbody>
+<tr><td><a href="/api/sock.html#NNG_OPT_LOCADDR"><code>NNG_OPT_LOCADDR</code></a></td><td><a href="/TODO.html"><code>nng_sockaddr</code></a></td><td>The locally bound address, will be either <a href="/TODO.html"><code>nng_sockaddr_in</code></a> or <a href="/TODO.html"><code>nng_sockaddr_in6</code></a>.</td></tr>
+<tr><td><a href="/api/sock.html#NNG_OPT_REMADDR"><code>NNG_OPT_REMADDR</code></a></td><td><a href="/TODO.html"><code>nng_sockaddr</code></a></td><td>The remote peer address, will be either <a href="/TODO.html"><code>nng_sockaddr_in</code></a> or <a href="/TODO.html"><code>nng_sockaddr_in6</code></a>. Only valid for <a href="/TODO.html">pipe</a> and <a href="/TODO.html">dialer</a> objects.</td></tr>
+<tr><td><a href="/api/sock.html#NNG_OPT_RECVMAXSZ"><code>NNG_OPT_RECVMAXSZ</code></a></td><td><code>size_t</code></td><td>Maximum size of incoming messages, will be limited to at most 65000.</td></tr>
+<tr><td><code>NNG_OPT_UDP_COPY_MAX</code><a name="NNG_OPT_UDP_COPY_MAX"></a></td><td><code>size_t</code></td><td>Threshold above which received messages are “loaned” up, rather than a new message being allocated and copied into.</td></tr>
+<tr><td><code>NNG_OPT_UDP_BOUND_PORT</code><a name="NNG_OPT_UDP_BOUND_PORT"></a></td><td><code>int</code></td><td>The locally bound UDP port number (1-65535), read-only for <a href="/TODO.html">listener</a> objects only.</td></tr>
+</tbody></table>
+</div>
<h2 id="maximum-message-size"><a class="header" href="#maximum-message-size">Maximum Message Size</a></h2>
<p>This transport maps each SP message to a single UDP packet.
In order to allow room for network headers, we thus limit the maximum
@@ -298,19 +301,28 @@ message size to 65000 bytes, minus the overhead for any SP protocol headers.</p>
very much smaller messages, ideally those that will fit within a single network
packet without requiring fragmentation and reassembly.</p>
<p>For Ethernet without jumbo frames, this typically means an <a name="a008"></a>MTU of a little
-less than 1500 bytes. (Specifically, 1452, which allows 28 bytes for IP and UDP,
-and 20 bytes for the this transport).
-Other link layers may have different MTUs.</p>
+less than 1500 bytes. (Specifically, 1452, which allows 28 bytes for IPv4 and UDP,
+and 20 bytes for the this transport. Reduce by an additional 20 bytes for IPv6.)</p>
+<p>Other link layers may have different MTUs, however IPv6 requires a minimum MTU of 1280,
+which after deducting 48 bytes for IPv6 and UDP headers, and 20 bytes for our transport
+header, leaves 1212 bytes for user data. If additional allowances are made for SP protocol
+headers with a default TTL of 8 (resulting in 72 additional bytes for route information),
+the final user accessible payload will be 1140 bytes. Thus this can be likely be viewed
+as a safe maximum to employ for SP payload data across all transports.</p>
<p>The maximum message size is negotiated as part of establishing a peering relationship,
and oversize messages will be dropped by the sender before going to the network.</p>
-<p>The maximum message size to receive can be configured with the
-<a href="%5BTODO.html"><code>NNG_OPT_RECVMAXSZ</code></a> option.</p>
+<p>The maximum message size to receive can be configured with the <a href="/api/sock.html#NNG_OPT_RECVMAXSZ"><code>NNG_OPT_RECVMAXSZ</code></a> option.</p>
<h2 id="keep-alive"><a class="header" href="#keep-alive">Keep Alive</a></h2>
<p>This transports maintains a logical “connection” with each peer, to provide a rough
facsimile of a connection based semantic. This requires some resource on each peer.
In order to ensure that resources are reclaimed when a peer vanishes unexpectedly, a
keep-alive mechanism is implemented.</p>
<p>TODO: Document the tunables for this.</p>
+<!-- Symbol cross reference -->
+<!-- Macros -->
+<!-- Protocols -->
+<!-- Transports -->
+<!-- Concept index -->
</main>