Skip to main content
Mole measuring limits

Limits and Performance Characteristics

Configurable Limits

ParameterConfig KeyDefaultDescription
Max Hopsrouting.max_hops16Maximum hops for route advertisements
Route TTLrouting.route_ttl5mRoute expiration time
Advertise Intervalrouting.advertise_interval2mRoute advertisement frequency
Node Info Intervalrouting.node_info_interval2mNode info frequency
Stream Open Timeoutlimits.stream_open_timeout30sStream open round-trip time
Buffer Sizelimits.buffer_size256 KBPer-stream buffer at each hop
Max Streams/Peerlimits.max_streams_per_peer1000Concurrent streams per peer
Max Total Streamslimits.max_streams_total10000Total concurrent streams
Max Pending Openslimits.max_pending_opens100Pending stream opens
Idle Thresholdconnections.idle_threshold5mKeepalive interval
Connection Timeoutconnections.timeout90sKeepalive timeout

Protocol Constants (Non-configurable)

ConstantValueDescription
Max Frame Payload16 KBMaximum payload per frame
Max Frame Size16398 bytesPayload + 14-byte header
Header Size14 bytesFrame header size
Protocol Version0x01Current wire protocol version
Control Stream ID0Reserved for control channel

Proxy Chain Practical Limits

Important: max_hops only limits route advertisement propagation, NOT stream path length. Stream paths are limited by the 30-second open timeout.

Use CaseRecommended Max HopsLimiting Factor
Interactive SSH8-12 hopsLatency (5-50ms per hop)
Video Streaming6-10 hopsBuffering (256KB × hops)
Bulk Transfer12-16 hopsThroughput (16KB chunks)
High-latency WAN4-6 hops30s stream open timeout

Per-hop overhead:

  • Latency: +1-5ms (LAN), +50-200ms (WAN)
  • Memory: +256KB buffer per active stream
  • CPU: Frame decode/encode at each relay

Topology Support

The flood-based routing supports arbitrary mesh topologies:

  • Linear chains: A → B → C → D
  • Tree structures: A → B → C and A → B → D
  • Full mesh: Any agent to any agent
  • Redundant paths: Multiple paths (lowest metric wins)

Loop prevention via SeenBy lists in route advertisements.

Prometheus Metrics

All metrics prefixed with muti_metroo_.

Connection Metrics

  • peers_connected (gauge): Connected peers
  • peers_total (counter): Total peer connections
  • peer_connections_total (counter): By transport/direction
  • peer_disconnects_total (counter): By reason

Stream Metrics

  • streams_active (gauge): Active streams
  • streams_opened_total (counter): Total streams opened
  • streams_closed_total (counter): Total streams closed
  • stream_open_latency_seconds (histogram): Open latency
  • stream_errors_total (counter): By error type

Data Transfer Metrics

  • bytes_sent_total (counter): By type
  • bytes_received_total (counter): By type
  • frames_sent_total (counter): By frame type
  • frames_received_total (counter): By frame type

Routing Metrics

  • routes_total (gauge): Routes in table
  • route_advertises_total (counter): Advertisements processed
  • route_withdrawals_total (counter): Withdrawals processed
  • route_flood_latency_seconds (histogram): Flood latency

SOCKS5 Metrics

  • socks5_connections_active (gauge): Active connections
  • socks5_connections_total (counter): Total connections
  • socks5_auth_failures_total (counter): Auth failures
  • socks5_connect_latency_seconds (histogram): Connect latency

Exit Handler Metrics

  • exit_connections_active (gauge): Active exit connections
  • exit_connections_total (counter): Total exit connections
  • exit_dns_queries_total (counter): DNS queries
  • exit_dns_latency_seconds (histogram): DNS latency
  • exit_errors_total (counter): By error type

Protocol Metrics

  • handshake_latency_seconds (histogram): Handshake time
  • handshake_errors_total (counter): By error type
  • keepalives_sent_total (counter): Keepalives sent
  • keepalives_received_total (counter): Keepalives received
  • keepalive_rtt_seconds (histogram): Round-trip time

RPC Metrics

  • rpc_calls_total (counter): By result and command
  • rpc_call_duration_seconds (histogram): By command
  • rpc_bytes_received_total (counter): Request bytes
  • rpc_bytes_sent_total (counter): Response bytes