Skip to content

Repository files navigation

Neuron P2P Diagnostics

A comprehensive, standalone command-line tool to diagnose P2P networking issues. This tool provides detailed analysis of network connectivity, NAT behavior, and port mapping for P2P protocols.

Developed by NeuronInnovations - Advanced P2P networking diagnostics for modern applications.

Features

The tool performs the following advanced diagnostic tests:

  1. Internet Connectivity - Tests basic internet access
  2. Local Network Interface - Checks for active network interfaces and IP addresses
  3. Port Availability - Tests specific P2P ports (61336-61346 range) with alternative detection
  4. NAT Type Detection - STUN-based NAT detection with port mapping analysis
  5. UPnP Router Support - Tests UPnP discovery capability
  6. DNS Resolution - Verifies DNS functionality
  7. UDP Connectivity - Real UDP connectivity testing with echo verification
  8. Relay Echo Test - Tests connectivity to relay/echo servers
  9. P2P Communication - Tests local UDP communication within port range
  10. Firewall Analysis - Comprehensive firewall blocking detection

Quick Start

Test specific port:

./network-diagnostics 61340

Run with default port (61336):

./network-diagnostics

Run directly with Go:

go run network-diagnostics.go 61340

Using the Makefile:

make diagnostics    # Run directly
make run           # Build and run
make build         # Just build

Output Format

The tool provides clear, color-coded output:

  • OK - Test passed
  • ⚠️ WARNING - Test passed but with potential issues
  • NOT OK - Test failed

Example output:

🔍 P2P Network Diagnostics Tool
=================================

✅ Internet Connectivity: OK
   Internet connection working
   Details: Successfully connected to external network

⚠️ NAT Type Detection: WARNING
   Behind NAT (private IP detected)
   Details: Local IP: 192.168.1.100, Private: true

📊 SUMMARY
==========
✅ Tests Passed: 6
⚠️  Tests with Warnings: 1
❌ Tests Failed: 1
📈 Success Rate: 75.0%

⚠️  Some warnings detected, but network should work for P2P.
   Consider configuring port forwarding for better connectivity.

Troubleshooting

Common Issues and Solutions:

  1. Port Blocking: Configure your router to forward the required ports
  2. NAT Issues: Enable UPnP on your router or manually configure port forwarding
  3. Firewall: Check Windows Firewall or antivirus software settings
  4. ISP Restrictions: Contact your ISP if you're behind a restrictive NAT

Port Mapping Detection

The tool specifically detects port mapping issues where your local port doesn't match your public port:

⚠️ PORT MAPPING: Local port 61340 != Public port 54321
This may cause issues for your protocol!

Why routers do port mapping:

  • Security: Prevents direct port scanning and attacks
  • Load Balancing: Distributes traffic across multiple internal servers
  • Port Conflicts: Avoids conflicts when multiple devices use same ports
  • ISP Policies: Some ISPs implement port mapping for traffic management

Port Range

The tool tests the P2P port range 61336-61346:

  • Tests your specific port first
  • Finds alternatives if your port is blocked
  • Suggests closest available alternative

Requirements

  • Go 1.19 or later
  • Windows, macOS, or Linux
  • Internet connection for testing

Building for Different Platforms

# Windows
make build-windows

# Linux
make build-linux

# macOS
make build-mac

KISS Principle

This tool follows the Keep It Simple, Stupid principle:

  • Single file with no external dependencies
  • Clear, actionable output
  • No complex configuration required
  • Immediate results

Downloads

Pre-compiled binaries are available in the Releases section:

  • Windows: network-diagnostics-windows.exe
  • macOS: network-diagnostics-macos
  • Linux: network-diagnostics-linux

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Issues and pull requests are welcome! This tool is designed to help the P2P community diagnose networking issues.

About

Advanced P2P network diagnostics tool with port mapping detection and STUN-based NAT analysis

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages