$ show HMBSbige/NatTypeTester
NatTypeTester is a cross-platform NAT type testing tool that implements STUN protocols (RFC 3489 and RFC 5780) to determine network characteristics. The application provides desktop (Avalonia), Android, and command-line interfaces for testing NAT type, mapping behavior, filtering behavior, and public endpoint detection. It follows a clean layered architecture with MVVM pattern, dependency injection, and separation of concerns. The core STUN protocol implementation is packaged as a reusable NuGet library (Stun.Net) that supports UDP, TCP, TLS, and DTLS transports with SOCKS5 proxy capabilities.
The LLM identified 3 files worth highlighting for reuse:
Implements the RFC 3489 classic NAT type discovery algorithm as a clean state machine. Processes STUN responses to determine NAT type through a well-defined sequence of tests (Test I, Test II, Test I#2, Test III). Demonstrates exceptional skill in protocol state machine design with clear phase handling, proper error conditions, and isolated logic that depends only on STUN message parsing, not networking concerns.
Implements RFC 5780 NAT behavior discovery for binding, mapping, and filtering tests. Features a sophisticated state machine with scoped testing modes (binding-only, mapping-only, filtering-only, full) and clean state transitions. Shows non-obvious skill in handling complex protocol interactions, proper scoping of tests, and clean separation between different test types while sharing common infrastructure.
Provides factory methods for building STUN attributes and extraction methods for parsing them from responses. Handles the complex bit-level manipulations required for STUN attributes including XOR obfuscation (RFC 5389), proper byte ordering, and attribute length calculations. Demonstrates excellence in binary protocol handling with well-tested, reusable utilities that solve recurring problems in network protocol implementation.