Class UdpTransport
java.lang.Object
ai.badmonkey.agentspaces.transport.dtls.UdpTransport
- All Implemented Interfaces:
Transport, AutoCloseable
The bare
udp binding (SRAD dtls-support ยง1.2.2, group U): the
recovery sublayer over plaintext UDP, for closed test ranges, links already
encrypted underneath, and devices with no budget for a handshake. Frames
stay signed, so integrity and attribution hold end to end; confidentiality
and channel attestation do not, and an on-path attacker can forge
acknowledgements and break delivery. It reports RELIABLE, ORDERED
only, so a node requiring attestation refuses it, and the hosts register it
only under dev-local or an explicit allow-plaintext.
An association starts with a cleartext exchange: the dialer sends
HELLO(nonce), padded to 28 bytes; the listener
answers HELLO_ACK(nonce, token), smaller than the hello, where the
token is a keyed hash of the dialer's address under a secret rotated every
60 s. The listener allocates nothing until a PDU arrives carrying a valid
token, and every PDU carries it.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Transport
Transport.Capability -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReports what this binding provides.voidclose()counters()Opens a connection to a peer address.listen(String bindAddress, Consumer<TransportConnection> onAccept) Starts listening for inbound connections.options(DtlsOptions options) Sets the tunables (the datagram budget, window, idle timeout, and hello rate apply; the DTLS-only options are ignored); valid before first use.scheme()Returns the transport scheme, e.g.
-
Field Details
-
SCHEME
-
-
Constructor Details
-
UdpTransport
public UdpTransport()Creates the binding with the default options.
-
-
Method Details
-
options
Sets the tunables (the datagram budget, window, idle timeout, and hello rate apply; the DTLS-only options are ignored); valid before first use.- Parameters:
options- the options- Returns:
- this transport
-
counters
- Returns:
- this transport's counters
-
scheme
-
capabilities
Description copied from interface:TransportReports what this binding provides. The default is the reliable, ordered, unencrypted, non-attesting posture every binding has at least; bindings that encrypt or attest override it.- Specified by:
capabilitiesin interfaceTransport- Returns:
- the capabilities, never empty
-
dial
Description copied from interface:TransportOpens a connection to a peer address.- Specified by:
dialin interfaceTransport- Parameters:
address- a transport-specific address- Returns:
- the open connection
- Throws:
IOException- if the peer cannot be reached
-
listen
public AutoCloseable listen(String bindAddress, Consumer<TransportConnection> onAccept) throws IOException Description copied from interface:TransportStarts listening for inbound connections.- Specified by:
listenin interfaceTransport- Parameters:
bindAddress- a transport-specific bind addressonAccept- invoked for each accepted connection- Returns:
- a handle that stops listening when closed
- Throws:
IOException- if the address cannot be bound
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-