dst-nim-lsquic-test

Tests License: Apache 2.0 License: MIT

This repository is for testing nim-lsquic as a transport layer, evaluating its latency characteristics in message sending scenarios.

Overview

The repository provides:

  • Message sender/receiver tools: For measuring delivery latency with timestamped messages

How It Works

The message sender embeds a timestamp and message ID in each message before sending. The receiver computes the delivery delay upon reception and logs the results. This allows measuring end-to-end latency for QUIC message delivery.

Message Format

Each message contains:

  • Message ID (8 bytes): Unique identifier for tracking
  • Timestamp (8 bytes): Sender's monotonic timestamp in nanoseconds
  • Payload length (4 bytes): Size of the payload
  • Payload (N bytes): Message data

Send Modes

Mode Description
sequential All messages sent on a single stream, one after another
parallel Each message sent on its own stream, concurrently (up to 100 streams)

Message Sender/Receiver

lsquic_msg_receiver

Receives timestamped messages and computes delivery delay.

lsquic_msg_receiver [OPTIONS]

Options:
  --listen, -l ADDR   Listen address (default: 0.0.0.0)
  --port, -p PORT     Port (default: 14555)
  --help, -h          Show this help

Output format:

Received msgID=1 size=1044 bytes delay=1.234 ms

lsquic_msg_sender

Sends timestamped messages with configurable parameters.

lsquic_msg_sender [OPTIONS]

Options:
  --server, -s ADDR       Server address (default: 127.0.0.1)
  --port, -p PORT         Port (default: 14555)
  --count, -c COUNT       Number of messages to send (default: 100)
  --size, -z SIZE         Message payload size in bytes (default: 1024)
  --interval, -i MS       Interval between messages/batches in ms
  --mode, -m MODE         Send mode: 'sequential' or 'parallel' (default: sequential)
  --max-streams MAX       Max concurrent streams in parallel mode (default/max: 100)
  --help, -h              Show this help

Examples:

# Send 100 messages of 1KB each sequentially
lsquic_msg_sender --server 127.0.0.1 --count 100 --size 1024

# Send 50 messages in parallel
lsquic_msg_sender --server 127.0.0.1 --count 50 --mode parallel

# Send 500 messages in parallel, 100 streams at a time, 50ms between batches
lsquic_msg_sender --server 127.0.0.1 --count 500 --mode parallel --max-streams 100 --interval 50

Building

Prerequisites

  • Nim >= 2.0.0
  • A working C/C++ toolchain (g++ or clang++)
  • zlib
  • Git (for submodules)

Clone and Build

git clone --recursive https://github.com/vacp2p/nim-lsquic.git
cd nim-lsquic
nimble install

# Build message tools
nim c --threads:on -d:release --path:. --out:benchmarks/lsquic_msg_sender benchmarks/lsquic_msg_sender.nim
nim c --threads:on -d:release --path:. --out:benchmarks/lsquic_msg_receiver benchmarks/lsquic_msg_receiver.nim

Docker Build

# Build the image
docker build -f benchmarks/Dockerfile.dst -t nim-lsquic-dst:latest .

Running Tests

Local Testing

# Terminal 1: Start receiver
./benchmarks/lsquic_msg_receiver --port 14555

# Terminal 2: Run sender
./benchmarks/lsquic_msg_sender --server 127.0.0.1 --port 14555 --count 100 --size 1024

Docker Testing

# Run receiver
docker run -d --name receiver -p 14555:14555/udp nim-lsquic-dst:latest \
  /usr/local/bin/lsquic_msg_receiver --listen 0.0.0.0 --port 14555

# Run sender
docker run --rm --network host nim-lsquic-dst:latest \
  /usr/local/bin/lsquic_msg_sender --server 127.0.0.1 --port 14555 --count 100

Kubernetes

S
Description
A repository for testing nim-lsquic
Readme
7.5 MiB
Languages
Nim 99.6%
Shell 0.4%