explaingit

hmbsbige/nattypetester

4,550C#Audience · developerComplexity · 2/5Setup · easy

TLDR

A Windows tool written in C# that checks how your router handles NAT by running STUN protocol tests, reporting your external IP address, mapping behavior, and whether peer-to-peer connections will work.

Mindmap

mindmap
  root((repo))
    What it does
      NAT type detection
      STUN protocol tests
    Protocols supported
      RFC 3489
      RFC 5780
      RFC 8489
    Features
      IPv4 and IPv6
      UDP and TCP testing
      Mapping and filtering info
    Use cases
      P2P troubleshooting
      Game connectivity
      C# library reuse
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Check your NAT type before building a peer-to-peer app to understand if direct connections between clients will work.

USE CASE 2

Use the Stun.Net NuGet package to add STUN-based NAT detection to your own C# application.

USE CASE 3

Diagnose why a video call or online game has connection problems by identifying your NAT mapping and filtering behavior.

USE CASE 4

Test both IPv4 and IPv6 NAT behavior over UDP and TCP in one tool.

Tech stack

C#.NETNuGet

Getting it running

Difficulty · easy Time to first run · 5min

No installation instructions are included, download and run the Windows executable directly.

In plain English

NatTypeTester is a Windows tool written in C# that checks what kind of NAT your network connection uses. NAT stands for Network Address Translation, and it is the system your router uses to let multiple devices share a single public internet address. Different routers implement NAT in different ways, and the specific behavior matters for things like online games, video calls, and peer-to-peer applications. If two devices are both behind certain types of NAT, they may have trouble connecting directly to each other. The tool uses a protocol called STUN, which was designed specifically to help software figure out NAT behavior by contacting a server on the public internet and examining how responses come back. NatTypeTester supports three generations of the STUN specification: RFC 3489, RFC 5780, and RFC 8489. Running tests from multiple specs gives you a more complete picture of how your router behaves. Beyond just detecting your external IP address, the tool can determine your NAT mapping behavior (whether the same internal address always maps to the same external address) and your NAT filtering behavior (which incoming packets your router will allow through). It supports both IPv4 and IPv6, and it can run tests over UDP, TCP, and encrypted variants of both. The underlying STUN library is also published separately as a NuGet package called Stun.Net, so developers can use it in their own C# applications. The README for this project is sparse and mainly consists of protocol references and screenshots. No installation instructions are included in what was provided.

Copy-paste prompts

Prompt 1
I need to check if my network supports peer-to-peer connections for an online game. Walk me through running the RFC 5780 test in NatTypeTester and interpreting the NAT mapping and filtering results.
Prompt 2
I'm building a C# P2P app and want to use the Stun.Net NuGet package to detect NAT type at runtime. Show me the code to run a STUN test and read back the mapping behavior.
Prompt 3
My video call software fails to connect with some users. Help me use NatTypeTester to determine if a symmetric NAT is the cause and what options I have to work around it.
Prompt 4
I want to test my IPv6 NAT setup using NatTypeTester. Explain what the IPv6 test checks and how to read the results.
Open on GitHub → Explain another repo

← hmbsbige on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.