Class UdpTransport

java.lang.Object
ai.badmonkey.agentspaces.transport.dtls.UdpTransport
All Implemented Interfaces:
Transport, AutoCloseable

public final class UdpTransport extends Object implements 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.

  • Field Details

  • Constructor Details

    • UdpTransport

      public UdpTransport()
      Creates the binding with the default options.
  • Method Details

    • options

      public UdpTransport 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.
      Parameters:
      options - the options
      Returns:
      this transport
    • counters

      public DtlsCounters counters()
      Returns:
      this transport's counters
    • scheme

      public String scheme()
      Description copied from interface: Transport
      Returns the transport scheme, e.g. tcp, ws, mem.
      Specified by:
      scheme in interface Transport
    • capabilities

      public Set<Transport.Capability> capabilities()
      Description copied from interface: Transport
      Reports 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:
      capabilities in interface Transport
      Returns:
      the capabilities, never empty
    • dial

      public TransportConnection dial(String address) throws IOException
      Description copied from interface: Transport
      Opens a connection to a peer address.
      Specified by:
      dial in interface Transport
      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: Transport
      Starts listening for inbound connections.
      Specified by:
      listen in interface Transport
      Parameters:
      bindAddress - a transport-specific bind address
      onAccept - 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:
      close in interface AutoCloseable