Skip to main content
Mole connecting transports

Transport Protocols

Muti Metroo supports three transport protocols, each with different characteristics. You can mix transports within the same mesh.

Overview

TransportProtocolPortFirewall FriendlinessPerformance
QUICUDP4433 (default)MediumBest
HTTP/2TCP443/8443GoodGood
WebSocketTCP/HTTP443/80ExcellentFair

QUIC Transport

QUIC (Quick UDP Internet Connections) is the recommended transport for most deployments.

Characteristics

  • Protocol: UDP with built-in TLS 1.3
  • Multiplexing: Native stream multiplexing
  • Performance: Lowest latency, best throughput
  • Connection: Fast 0-RTT reconnection
  • Congestion: Modern congestion control (BBR)

When to Use

  • Direct server-to-server connections
  • Low-latency requirements
  • High-throughput scenarios
  • When UDP is not blocked

Configuration

Listener:

listeners:
- transport: quic
address: "0.0.0.0:4433"
tls:
cert: "./certs/agent.crt"
key: "./certs/agent.key"

Peer connection:

peers:
- id: "peer-id..."
transport: quic
address: "192.168.1.10:4433"
tls:
ca: "./certs/ca.crt"

Firewall Considerations

  • Requires UDP port to be open
  • May be blocked by corporate firewalls
  • NAT traversal generally works well
  • Some ISPs throttle or block UDP

HTTP/2 Transport

HTTP/2 provides a TCP-based alternative with good firewall compatibility.

Characteristics

  • Protocol: TCP with TLS 1.3
  • Multiplexing: HTTP/2 stream multiplexing
  • Performance: Good, but TCP head-of-line blocking
  • Connection: Standard TLS handshake
  • Compatibility: Works through most firewalls

When to Use

  • Corporate environments blocking UDP
  • When QUIC is not available
  • Standard HTTPS infrastructure
  • Load balancer compatibility needed

Configuration

Listener:

listeners:
- transport: h2
address: "0.0.0.0:8443"
path: "/mesh" # Optional URL path
tls:
cert: "./certs/agent.crt"
key: "./certs/agent.key"

Peer connection:

peers:
- id: "peer-id..."
transport: h2
address: "192.168.1.10:8443"
path: "/mesh"
tls:
ca: "./certs/ca.crt"

Firewall Considerations

  • Uses standard HTTPS port (443)
  • Passes through most corporate firewalls
  • Compatible with HTTP proxies (without CONNECT)
  • Can be hosted behind reverse proxies

WebSocket Transport

WebSocket provides maximum compatibility, especially through HTTP proxies.

Characteristics

  • Protocol: HTTP upgrade to WebSocket, then framed messages
  • Multiplexing: Application-level multiplexing over single connection
  • Performance: Highest overhead, most latency
  • Connection: HTTP handshake, then persistent
  • Compatibility: Maximum - works through HTTP proxies

When to Use

  • Restrictive corporate proxies
  • Browser-based clients (future)
  • When HTTP/2 is blocked or problematic
  • Through CDNs or WAFs

Configuration

Listener:

listeners:
- transport: ws
address: "0.0.0.0:443"
path: "/mesh" # URL path for WebSocket
tls:
cert: "./certs/agent.crt"
key: "./certs/agent.key"

Peer connection:

peers:
- id: "peer-id..."
transport: ws
address: "wss://relay.example.com:443/mesh"
tls:
ca: "./certs/ca.crt"

Through HTTP proxy:

peers:
- id: "peer-id..."
transport: ws
address: "wss://relay.example.com:443/mesh"
proxy: "http://proxy.corp.local:8080"
proxy_auth:
username: "${PROXY_USER}"
password: "${PROXY_PASS}"

Firewall Considerations

  • Uses standard HTTP/HTTPS ports
  • Works through HTTP proxies with CONNECT
  • Compatible with most corporate environments
  • May work through some WAFs and CDNs

Transport Comparison

Latency (per hop)

TransportLANWAN
QUIC1-2ms50-100ms
HTTP/22-5ms60-150ms
WebSocket3-10ms80-200ms

Throughput

TransportSingle StreamMulti-Stream
QUICExcellentExcellent
HTTP/2GoodGood
WebSocketFairFair

Connection Establishment

TransportInitialReconnect
QUIC1-RTT0-RTT
HTTP/22-RTT1-RTT (TLS resumption)
WebSocket2-RTT + HTTP upgrade2-RTT

Mixed Transport Deployments

You can mix transports in a single mesh:

                                      +----------------+
| Agent C |
+----------------+ QUIC | (Transit) |
| Agent A | ----------------> +----------------+
| (Ingress) | (direct LAN) |
+----------------+ | WebSocket
| | (through proxy)
| HTTP/2 v
| (corporate firewall) +----------------+
v | Agent D |
+----------------+ | (Exit) |
| Agent B | <--------------- +----------------+
| (Transit) | QUIC
+----------------+ (cloud)

Configuration Example

Agent A (multiple transports):

listeners:
- transport: quic
address: "0.0.0.0:4433"
tls:
cert: "./certs/agent.crt"
key: "./certs/agent.key"

- transport: h2
address: "0.0.0.0:8443"
path: "/mesh"
tls:
cert: "./certs/agent.crt"
key: "./certs/agent.key"

peers:
- id: "agent-b-id..."
transport: h2
address: "corporate-relay.example.com:443/mesh"
tls:
ca: "./certs/ca.crt"

- id: "agent-c-id..."
transport: quic
address: "192.168.1.50:4433"
tls:
ca: "./certs/ca.crt"

Transport Selection Guide

ScenarioRecommendedReason
Data center to data centerQUICBest performance, controlled network
Office to cloudHTTP/2 or QUICDepends on firewall policy
Home user to cloudQUICMost ISPs allow UDP
Corporate laptop to cloudWebSocketWorks through corporate proxies
Through CDN/WAFWebSocketHTTP-based, compatible
High-frequency tradingQUICLowest latency
Large file transfersQUICBest throughput

Troubleshooting

QUIC Connection Fails

# Check if UDP is reachable
nc -u -v target.example.com 4433

# Check firewall rules
sudo iptables -L -n | grep 4433

HTTP/2 Connection Fails

# Test HTTP/2 connectivity
curl -v --http2 https://target.example.com:8443/mesh

# Check TLS
openssl s_client -connect target.example.com:8443

WebSocket Connection Fails

# Test WebSocket connectivity
wscat -c wss://target.example.com:443/mesh

# Test through proxy
curl -v --proxy http://proxy:8080 https://target.example.com/mesh

Next Steps