English | 中文
A command-line tool for discovering IPv6 path MTU and detecting TCP MSS clamping.
- IPv6 Path MTU Discovery using ICMP6 probes
- TCP MSS clamping detection (client and server modes)
- MSS integrity verification and tampering detection
- Binary search algorithm for efficient MTU discovery
- Cross-platform support (Linux, macOS, Windows)
- Detailed progress reporting and statistics
- Network error scenario handling
- Concurrent operation support
- Go 1.19 or later
- Root/Administrator privileges (for raw socket operations)
- IPv6 network connectivity
git clone <repository-url>
cd ipv6-mtu-discovery
make deps
make buildmake install# Basic MTU discovery
sudo ./ipv6-mtu-discovery -t 2001:db8::1
# Verbose output
sudo ./ipv6-mtu-discovery -t 2001:db8::1 -v
# Custom timeout
sudo ./ipv6-mtu-discovery -t 2001:db8::1 -T 10# Client mode MSS detection
sudo ./ipv6-mtu-discovery -t 2001:db8::1 -m tcp-client -p 80
# Server mode MSS detection
sudo ./ipv6-mtu-discovery -t :: -m tcp-server -p 8080
# MSS integrity verification
sudo ./ipv6-mtu-discovery -t 2001:db8::1 -m mss-integrity -p 80 --control-port 8080 --test-mss 1460-t, --target: Target IPv6 address (required)-m, --mode: Operation mode (mtu, tcp-client, tcp-server, mss-integrity) [default: mtu]-p, --port: TCP port for MSS detection [default: 80]-v, --verbose: Enable verbose output-T, --timeout: Timeout in seconds [default: 5]
--min-mtu: Minimum MTU value [default: 68]--max-mtu: Maximum MTU value [default: 1500]
--control-port: Control connection port--test-mss: Test MSS value
--log-level: Log level (debug, info, warn, error)--log-file: Enable file logging--log-path: Log file path
make build # Build the binary
make test # Run tests
make clean # Clean build artifacts
make deps # Download dependencies
make lint # Format and vet code
make install # Install system-widemake test# Run all tests (including integration tests)
./test_integration.sh
# Run unit tests only
./test_integration.sh unit
# Run integration tests only
./test_integration.sh integrationThe tool is organized into several packages:
cmd/: Main application entry pointinternal/app/: Application logic and state managementinternal/cli/: Command line interface and argument parsinginternal/probe/: ICMP6 probing and packet handlinginternal/network/: TCP connection and MSS detectioninternal/validator/: IPv6 address and permission validationinternal/algorithm/: Binary search implementationinternal/display/: Result formatting and displayinternal/config/: Configuration managementinternal/stats/: Statistics collectioninternal/logging/: Logging systeminternal/platform/: Platform-specific functionality
Performs IPv6 Path MTU Discovery using ICMP6 echo requests:
- Uses binary search algorithm for efficient MTU determination
- Handles ICMP6 "Packet Too Big" responses
- Provides detailed probe progress and statistics
Detects MSS clamping as a TCP client:
- Connects to specified server and port
- Detects negotiated MSS value
- Identifies MSS clamping scenarios
Detects MSS clamping as a TCP server:
- Listens on specified port for connections
- Captures client MSS values
- Analyzes MSS modifications
Verifies MSS value integrity:
- Establishes control connection for verification exchange
- Detects MSS tampering and modifications
- Provides detailed integrity analysis reports
# Discover path MTU to Google IPv6 DNS
sudo ./ipv6-mtu-discovery -t 2001:4860:4860::8888 -v
# Example output:
# Starting IPv6 Path MTU Discovery to 2001:4860:4860::8888
# Testing MTU 784... Success
# Testing MTU 1142... Success
# Testing MTU 1321... Failed (Packet Too Big, reported MTU: 1280)
# Testing MTU 1280... Success
#
# MTU Discovery Results:
# Final MTU: 1280 bytes
# Probe attempts: 4
# Success rate: 75%# Verify if MSS is modified by intermediate devices
sudo ./ipv6-mtu-discovery -t 2001:db8::1 -m mss-integrity \
-p 80 --control-port 8080 --test-mss 1460 -v
# Example output:
# Starting MSS Integrity Verification
# Test MSS: 1460, Control Port: 8080
# Establishing control connection...
# Performing MSS integrity verification...
#
# MSS Integrity Results:
# Client sent MSS: 1460
# Server received MSS: 1440
# MSS Modified: Yes
# Modification Delta: -20
# Tampering Detected: Yes (Medium severity)Supports YAML configuration file for advanced settings:
# config.yaml example
network:
timeout_ms: 5000
max_retries: 3
mtu_discovery:
min_mtu: 68
max_mtu: 1500
probe_timeout_ms: 3000
mss_verification:
session_timeout_ms: 10000
handshake_timeout_ms: 5000
logging:
level: "info"
file_enabled: true
file_path: "logs/ipv6-mtu-discovery.log"-
Permission Denied
# Error: socket: operation not permitted # Solution: Run with sudo sudo ./ipv6-mtu-discovery -t ::1
-
IPv6 Not Supported
# Check IPv6 support ip -6 addr show # Enable IPv6 loopback sudo sysctl net.ipv6.conf.lo.disable_ipv6=0
-
Firewall Blocking
# Temporarily allow ICMP6 sudo ip6tables -I INPUT -p ipv6-icmp -j ACCEPT
[License information to be added]
Contributions are welcome! Please see Contributing Guidelines.
- Clone the repository
- Install Go 1.19+
- Run
make depsto install dependencies - Run
make testto ensure tests pass - Use
make lintto check code quality
For questions or suggestions:
Note: This tool requires raw socket privileges. Please ensure you use it in a trusted environment.