Network Configuration

The network section configures how your node connects to the Manta platform manager and how it provides services to running tasks.

Overview

Network configuration controls:

  • Manager service connection settings

  • Light service (local gRPC) endpoints

  • Connection timeouts and retries

  • Network optimization parameters

Configuration Example

[network]
manager_host = "localhost"
manager_port = 50051
light_service_host = "0.0.0.0"
light_service_port = 0  # Auto-assigned

Configuration Fields

manager_host

Type: string

Default: "localhost"

Description: Hostname or IP address of the Manta manager service

Examples:

# Local development
manager_host = "localhost"
manager_host = "127.0.0.1"

# Production deployments
manager_host = "manager.manta.io"
manager_host = "10.0.1.100"
manager_host = "manta-manager.internal"

# Environment variable
manager_host = "${MANTA_MANAGER_HOST:localhost}"

DNS Resolution:

  • Supports both IPv4 and IPv6 addresses

  • Can use hostnames with DNS resolution

  • Validates connectivity on startup

manager_port

Type: integer

Default: 50051

Description: Port number for manager gRPC service

Valid Range: 1024-65535

Examples:

# Standard gRPC port
manager_port = 50051

# Custom port
manager_port = 8080

# Environment variable
manager_port = ${MANTA_MANAGER_PORT:50051}

Common Ports:

  • 50051: Default gRPC port

  • 443: HTTPS/gRPC with TLS

  • 8080: Alternative HTTP/2 port

light_service_host

Type: string

Default: "0.0.0.0"

Description: Bind address for the node’s local gRPC service

Details:

  • Service accessed by task containers

  • Provides LocalServicer and WorldServicer

  • Usually binds to all interfaces

Examples:

# Bind to all interfaces (default)
light_service_host = "0.0.0.0"

# Bind to localhost only
light_service_host = "127.0.0.1"

# Bind to specific interface
light_service_host = "192.168.1.100"

Security Considerations:

  • 0.0.0.0: Accessible from containers

  • 127.0.0.1: Local only (may break container access)

  • Specific IP: Restricted access

light_service_port

Type: integer or null

Default: null (auto-assigned)

Description: Port for the node’s local gRPC service

Details:

  • null or 0: System assigns available port

  • Specific port: Fixed port binding

  • Port communicated to tasks via environment

Examples:

# Auto-assign port (recommended)
light_service_port = 0
light_service_port = null

# Fixed port
light_service_port = 50052
light_service_port = 8081

Port Assignment:

  • Auto-assignment prevents conflicts

  • Fixed ports useful for debugging

  • Tasks receive port via LIGHT_SERVICE_PORT env var

Network Patterns

Local Development

[network]
manager_host = "localhost"
manager_port = 50051
light_service_host = "0.0.0.0"
light_service_port = 0

Cloud Deployment

[network]
manager_host = "api.manta-platform.io"
manager_port = 443  # HTTPS/gRPC
light_service_host = "0.0.0.0"
light_service_port = 0

Edge Device

[network]
manager_host = "${EDGE_MANAGER_HOST}"
manager_port = 50051
light_service_host = "0.0.0.0"
light_service_port = 0

Container/Docker

[network]
manager_host = "host.docker.internal"  # Docker Desktop
manager_port = 50051
light_service_host = "0.0.0.0"
light_service_port = 0

Connection Management

Connection Lifecycle

  1. DNS Resolution: Resolve manager hostname

  2. TCP Connection: Establish socket connection

  3. gRPC Channel: Create gRPC communication channel

  4. TLS Handshake: If security enabled

  5. Registration: Send node registration request

  6. Heartbeat: Maintain connection with periodic pings

Connection Resilience

The node implements automatic reconnection:

  • Exponential backoff on failures

  • Maximum retry attempts

  • Connection health monitoring

  • Automatic failover (if configured)

Network Requirements

Outbound connections:

  • Manager gRPC service (TCP)

  • MQTT broker (TCP, port 1883/8883)

  • Docker registry (HTTPS, port 443)

Inbound connections:

  • Light service from containers (TCP)

  • Health check endpoints (optional)

Troubleshooting

Connection Refused

Error: Failed to connect to manager at localhost:50051
Connection refused

Solutions:

  1. Verify manager is running: docker ps

  2. Check correct host/port: netstat -an | grep 50051

  3. Test connectivity: telnet localhost 50051

  4. Check firewall rules: iptables -L

DNS Resolution Failed

Error: Failed to resolve manager.manta.io

Solutions:

  1. Check DNS: nslookup manager.manta.io

  2. Use IP address instead of hostname

  3. Check /etc/hosts file

  4. Verify network connectivity: ping 8.8.8.8

Port Already in Use

Error: Failed to bind light service to port 50052
Address already in use

Solutions:

  1. Use auto-assignment: light_service_port = 0

  2. Find process using port: lsof -i :50052

  3. Choose different port

  4. Kill conflicting process

Container Cannot Connect

Error: Task cannot connect to light service

Solutions:

  1. Use 0.0.0.0 for light_service_host

  2. Check Docker network mode

  3. Verify port is exposed

  4. Check container environment variables

Performance Tuning

Latency Optimization

For low-latency requirements:

[network]
# Use local manager
manager_host = "localhost"

# Reduce network hops
light_service_host = "0.0.0.0"

High-Throughput

For high data transfer:

[network]
# Use high-bandwidth connection
manager_host = "10.0.1.100"  # Same subnet

# Optimize for throughput
light_service_host = "0.0.0.0"

Network Diagnostics

Test network performance:

# Test latency
ping -c 10 manager.manta.io

# Test bandwidth
iperf3 -c manager.manta.io

# Check route
traceroute manager.manta.io

# Monitor connections
netstat -an | grep ESTABLISHED

Security Considerations

Network Isolation

  1. Firewall rules: Restrict access to necessary ports

  2. Network segmentation: Use VLANs or subnets

  3. Private networks: Use VPN for remote connections

  4. IP whitelisting: Limit manager access

Secure Bindings

[network]
# Restrict light service access
light_service_host = "127.0.0.1"  # Local only

# Or bind to specific interface
light_service_host = "192.168.1.100"  # Internal network

Port Security

  1. Use non-standard ports to avoid scanning

  2. Enable port knocking if supported

  3. Use TLS for all connections

  4. Monitor for unauthorized access

Environment Variables

All network fields support environment variables:

# Set environment
export MANTA_MANAGER_HOST="api.manta.io"
export MANTA_MANAGER_PORT="443"
export LIGHT_SERVICE_HOST="0.0.0.0"
export LIGHT_SERVICE_PORT="0"
# Reference in config
[network]
manager_host = "${MANTA_MANAGER_HOST}"
manager_port = ${MANTA_MANAGER_PORT}
light_service_host = "${LIGHT_SERVICE_HOST}"
light_service_port = ${LIGHT_SERVICE_PORT}

Advanced Configurations

Multi-Manager Setup

For high availability (future feature):

[network]
manager_host = "manager1.manta.io"
manager_port = 50051

# Future: fallback managers
# fallback_managers = [
#   "manager2.manta.io:50051",
#   "manager3.manta.io:50051"
# ]

Proxy Configuration

For environments requiring proxy:

# Set proxy environment
export HTTP_PROXY="http://proxy:8080"
export HTTPS_PROXY="http://proxy:8080"
export NO_PROXY="localhost,127.0.0.1"

NAT Traversal

For nodes behind NAT:

[network]
# Manager should be publicly accessible
manager_host = "public-api.manta.io"

# Light service binds locally
light_service_host = "0.0.0.0"

See Also