ntrip-test-client

command
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

README

NTRIP Test Client

A specialized tool for stress testing NTRIP casters by creating multiple concurrent connections to simulate high-load scenarios.

Overview

The NTRIP Test Client is designed for:

  • Load testing NTRIP casters under high concurrent connection scenarios
  • Performance benchmarking of NTRIP infrastructure
  • Connection stability testing with automatic reconnection
  • Latency analysis of RTCM3 message delivery
  • Source table retrieval for caster discovery

Features

  • Multiple Concurrent Clients: Create hundreds of simultaneous connections
  • Configurable Parameters: Customize host, credentials, mountpoints, and connection settings
  • Real-time Latency Monitoring: Track RTCM3 message delivery latency
  • RTCM3 Message Analysis: Parse and analyze observation messages
  • Source Table Support: Retrieve and display caster source tables
  • Graceful Shutdown: Handle termination signals cleanly
  • Structured Logging: JSON-formatted logs for monitoring and analysis
  • Automatic Reconnection: Robust connection handling with configurable retry delays

Installation

Prerequisites
  • Go 1.19 or later
  • Git
Build from Source
# Clone the repository
git clone https://gitlab.com/earthscope/gnsstools.git
cd gnsstools

# Build the tool
cd cmd/test/ntrip-test-client
go build -o ntrip-test-client .

# Or build for multiple platforms
make all

Usage

Basic Syntax
ntrip-test-client [flags]
Required Options
  • --host: NTRIP caster host and port (e.g., caster.example.com:2101)
  • --user: Username for authentication
  • --pass: Password for authentication
Optional Options
  • --clients: Number of concurrent clients to start (default: 1)
  • --mountpoints: Comma-separated list of mountpoints (default: P420_RTCM3)
  • --lat: Receiver latitude (default: 40.0)
  • --lon: Receiver longitude (default: -105.0)
  • --tls: Use TLS/SSL encryption
  • --debug: Enable debug logging
  • --srctab: Retrieve source table instead of streaming data

Examples

Basic Stress Test
# Single client connection
ntrip-test-client \
  --host caster.example.com:2101 \
  --user testuser \
  --pass testpass

# Multiple concurrent clients
ntrip-test-client \
  --clients 10 \
  --host caster.example.com:2101 \
  --user testuser \
  --pass testpass
Load Testing with Multiple Mountpoints
# Test multiple mountpoints with many clients
ntrip-test-client \
  --clients 50 \
  --host caster.example.com:2101 \
  --user testuser \
  --pass testpass \
  --mountpoints "MOUNT1,MOUNT2,MOUNT3"
Source Table Retrieval
# Get source table from caster
ntrip-test-client \
  --srctab \
  --host caster.example.com:2101 \
  --user testuser \
  --pass testpass
TLS Connection
# Connect using TLS encryption
ntrip-test-client \
  --host caster.example.com:443 \
  --user testuser \
  --pass testpass \
  --tls
Debug Mode
# Enable detailed debug logging
ntrip-test-client \
  --host caster.example.com:2101 \
  --user testuser \
  --pass testpass \
  --debug

Output

Latency Data

When streaming data, the tool outputs latency information in CSV format:

MOUNT1-abc12345, 1077, 1250, 1640995200
MOUNT1-abc12345, 1077, 1180, 1640995201

Format: mountpoint-clientid, message_number, latency_ms, epoch_unix_timestamp

Logs

Structured JSON logs are written to stderr:

{"level":"info","timestamp":"2024-01-01T12:00:00Z","caller":"stress_test.go:123","msg":"Starting NTRIP client","client_id":"abc12345","mountpoint":"MOUNT1"}
{"level":"info","timestamp":"2024-01-01T12:00:01Z","caller":"stress_test.go:145","msg":"Connected to NTRIP server","client_id":"abc12345","mountpoint":"MOUNT1"}

Performance Considerations

Connection Limits
  • Server Capacity: Ensure the target caster can handle the number of concurrent connections
  • Network Bandwidth: Monitor network utilization during high-load tests
  • System Resources: Each client consumes memory and file descriptors
  1. Baseline Test: Start with 1-5 clients to establish baseline performance
  2. Gradual Load: Increase client count incrementally (10, 25, 50, 100+)
  3. Sustained Load: Run tests for extended periods to check for memory leaks
  4. Peak Load: Test maximum capacity to identify breaking points
Monitoring

Monitor these metrics during stress testing:

  • Connection Success Rate: Percentage of successful connections
  • Message Latency: RTCM3 message delivery times
  • Reconnection Frequency: How often clients need to reconnect
  • Error Rates: Failed connections, parsing errors, etc.

Error Handling

The tool includes robust error handling:

  • Connection Failures: Automatic reconnection with configurable delays
  • Authentication Errors: Clear error messages for credential issues
  • Network Issues: Graceful handling of network interruptions
  • Signal Handling: Clean shutdown on SIGINT/SIGTERM

Configuration

Environment Variables

You can set default values using environment variables:

export NTRIP_HOST="caster.example.com:2101"
export NTRIP_USER="testuser"
export NTRIP_PASS="testpass"
Configuration File

For complex testing scenarios, consider using a configuration file with multiple test profiles.

Troubleshooting

Common Issues

"Connection refused"

  • Verify host and port are correct
  • Check if the caster is running and accessible
  • Ensure firewall allows the connection

"Authentication failed"

  • Verify username and password are correct
  • Check if the account has access to the specified mountpoints

"Mountpoint not found"

  • Use --srctab to see available mountpoints
  • Verify the mountpoint name is correct

High latency or timeouts

  • Check network connectivity
  • Monitor server load and capacity
  • Consider reducing the number of concurrent clients
Debug Mode

Enable debug logging to see detailed connection information:

ntrip-test-client --debug --host ... --user ... --pass ...

Development

Building
# Development build
go build -o ntrip-test-client .

# Production build with optimizations
go build -ldflags "-s -w" -o ntrip-test-client .

# Cross-platform builds
make all
Testing
# Run tests
go test ./...

# Test with a local caster
ntrip-test-client --host localhost:2101 --user test --pass test --debug
  • ntrip-client: Single-client NTRIP connection tool
  • gnss-inspect: GNSS data format inspection tool
  • gnss-convert: GNSS data format conversion tool

License

This tool is part of the gnsstools project. See the main repository for license information.

Contributing

Contributions are welcome! Please see the main repository for contribution guidelines.

Support

For issues and questions:

  1. Check the troubleshooting section above
  2. Review the debug logs
  3. Open an issue in the main repository

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL