NAT Check

手把手教你用即迅会议系统搭建私有化远程办公平台(含Docker部署教程) 本文提供了一份详尽的私有化远程办公平台搭建指南,重点介绍了基于Docker容器化技术部署即迅会议系统的完整流程。内容涵盖从环境规划、核心服务部署、网络与安全优化到日常运维的实战步骤,帮助企业构建安全可控、高性能的内部会议系统,有效规避公有云服务的数据风险与网络延迟问题。 阅读详情

Version 3, with UDP and TCP support

Check Your Network Address Translator
for Compatibility with Peer-to-Peer Protocols

NAT Check by Bryan Ford, web magic by Dave Andersen

Hosted by the MIDCOM-P2P project on SourceForge This page, the NAT servers, and the results database are no longer being actively maintained. (Sorry, just no time; I have to focus on other projects now!) For a detailed overview of P2P hole punching techniques for both TCP and UDP, as well as some compatibility statistics generated using NAT Check, please see my USENIX '05 paper:
Peer-to-Peer Communication Across Network Address Translators, Bryan Ford, Pyda Srisuresh, and Dan Kegel. USENIX, April 2005. PDF PS HTML. (BibTeX)

You can still find the NAT Check code below, but to use it you'll have to run your own set of servers and modify the code to point to those servers. Note that the "natbouncer" program the page incorrectly mentioned for a while is actually just part of the "natserver" program now: just run "natserver 1" and "natserver 2" on the primary servers, and run "natserver 3" on the third ("bouncer") server .

You may also wish to check out the following related papers by others:


(old page starts here)

Introduction

If you are accessing the Internet from behind a Network Address Translator (NAT) of some kind, I would appreciate your help in surveying the behavior of different NATs, in terms of how and whether they support a certain technique for enabling peer-to-peer communication between NATted hosts (particularly when both endpoints are behind NATs). See below for a brief technical summary of the technique and the properties of a NAT tested by NAT Check. For an extended discussion of this technique and related issues, please read my Internet Draft on the topic. (Comments and feedback are greatly appreciated!) Note: this draft does NOT yet include a discussion of the new TCP-based NAT P2P hole punching technique that version 3 of NAT Check tests for. A new version of teh Internet-Draft should be available shortly.

To participate, please download, compile, and run this trivial C program on your system: natcheck.c. (If you are on a 64-bit machine, then either add "-DHAVE_STDINT" to your compile command line or edit the #define's toward the beginning appropriately.) Alternatively, if you are the trusting type, the following pre-compiled binaries are available:

  • Linux-x86, md5sum 5b4b7c1f5e7f37c66ff4500431bfffcd.
  • FreeBSD-x86, md5sum 7daef2cd6ec398d3d025aa61e270a383.
  • Win32-x86, md5sum 1cf715d6d8d4d4f168d34b9c4421c627. (Thanks to Philippe Verdy for this port!)
Still at version 2, needs updating:

Then run the natcheck program and submit the results here. You can view the accumulated results at this page. (Sorry, these no longer work - I'll try to recover and post a final snapshot of the database when I can.)

Thank you very much for your help!

- Bryan


Technical Explanation

This technique is fairly simple, has been pointed out before (e.g., here and here), and has been implemented in a variety of on-line games and other peer-to-peer applications. The purpose of this page is mainly to draw more attention to the technique and to discover how widely compatible the technique is with current NATs.

The Technique

Suppose there are three communicating hosts: A, B, and C. Host A is a "well-known" Internet server with a permanent IP address, which acts as an "introducer" for the other two nodes. (For example, Host A might be a well-known ultrapeer or a game catalog server of some kind.) Host B, using Host A's "introduction" services, would like to establish a direct peer-to-peer connection with host C. Both B and C, however, are behind (probably different) network address/port translators, and neither of them has exclusive use of any public IP address.

To initiate a peer-to-peer connection with host C, host B first sends A a message requesting an "introduction" to host C. A sends B a reply message containing C's IP address and UDP port number as reported by host C, in addition to C's IP address and UDP port number as observed by A. (If C is behind a NAT, then these two address/port combinations will be different.) At the same time, host A sends host C a message containing B's IP address and UDP port numbers - again, both the ones reported by B and the ones observed by A, which will be different if B is behind a NAT.

Now B and C each know that they want to initiate a connection with each other, and they know each other's public (NATted) as well as original IP addresses and UDP port numbers. Both B and C now start attempting to send UDP messages directly to each other, at each of the available addresses. If B and C happen to be behind the same NAT, then they will be able to communicate with each other directly using their "originally reported" IP addresses and UDP port numbers.

In the more common case where B and C are behind different NATs, the "originally reported" addresses will be useless because they will both be private IP addresses in different addressing domains. Instead, the IP address/UDP port combinations observed by A can be used in this case to establish direct communication. Although B's NAT will initially filter out any UDP packets arriving from C's public (NATted) UDP port directed at B's public port, the first UDP message B sends to C will cause B's NAT to open up a new UDP session keyed on C's public port, allowing future incoming traffic from C to pass through the NAT to B. Similarly, the first few messages from B to C may be filtered out by C's NAT, but will be able to start passing through the firewall as soon as C's first message to B causes C's NAT to open up a new session. In this way, each NAT is tricked into thinking that its respective internal host is the "initiator" of this new session, when in fact the session is fully symmetrical and was initiated (with A's help) simultaneously in each direction.

Required NAT Behavior

There is one important requirement that the NATs must satisfy in order for this technique to work: the NATs must be designed so that they assign only one (public IP address, public UDP port) pair to each (internal IP address, internal UDP port) combination, rather than allocating and assigning a new public UDP port for each new UDP session. Recall that a "session" in Internet terminology is defined by the IP addresses and port numbers of both communicating endpoints, so host B's communication with host A is considered to be one session while host B's communication with host C is a different session. If B's NAT, for example, assigns one public UDP port for B's communication with A, and then assigns B a different public UDP port for the new session B tries to open up with C, then the above technique for peer-to-peer communication will not work because C's messages to B will be directed to the wrong UDP port.

RFC 3022 explicitly allows and suggests that NATs behave in the former, "desirable" fashion, by maintaining a single (public IP, public port) mapping for a given (internal IP, internal port) combination independent of the number of active sessions involving this mapping. This behavior is not only good for compatibility with UDP applications, but it also helps to conserve the NAT's scarce pool of public port numbers. Maintaining a consistent public port mapping does not adversely affect security in any way, either, because incoming traffic can still be filtered on a per-session basis regardless of how addresses are translated. There in fact appears to be no good reason not to implement the desirable behavior in a NAT, except perhaps for the implementation simplicity of naively allocating a new public port for every new session. Unfortunately, RFC 3022 does not require NATs to implement the desirable behavior, which has led me to wonder just how many real NATs actually do, and hence this page.

What NAT Check Does

The program natcheck.c is basically just a program that "pings" a well-known UDP port at two different servers that are publically accessible on the Internet. Both of these servers run the program natserver.c, with the command-line arguments "1" and "2" respectively. In addition, there a third "conspiring" server runs natserver with the command-line argument "3". Whenever each of the first two servers receives a UDP request, it not only sends a reply directly to the sender of that request, but also sends a message to the third server, which in turn "bounces" the reply back to the original client. The effect is that the client will receive not only solicited "ping" replies from the server the request was directed to, but also "unsolicited" replies from the third server.

To determine if the network address translator in use is implementing the desirable behavior of maintaining a single (public IP address, public port) mapping for a given (client IP address, client port), the client program natcheck.c basically just initiates a sequence of simultaneous pings to the first two servers (in case some of the requests or replies are lost in transit) and checks that the client's address and UDP port as reported by both servers is the same. If the NAT naively allocates a new public port for each new session, then the source port as reported by the two servers will be different, and it's time to upgrade your NAT.

The replies echoed from the third server are used only to check whether the NAT properly filters out unsolicited incoming traffic on a per-session basis. Since the client never sends any messages to the third server, if the NAT is properly implementing firewall functionality, the client should never see the third server's echoed replies even after opening up active communication sessions with the first two servers.

Changes in Version 2

Version 2 of NAT Check contains the following enhancements:
  • The NAT Check client no longer attempts to guess whether you have Basic NAT or Network Address/Port Translation (NAPT). It turns to be quite difficult to test for this property reliably, because many NAPTs attempt to bind a private UDP port to a public port with the same port number if that port number is available, causing NAT Check to falsely report Basic NAT. The only way to test for this property reliably would be to run NAT Check on at least two client machines simultaneously, and since this property isn't terribly important to P2P apps it's just not worth the trouble.
  • The NAT Check client now tests for one additional NAT feature, which I call loopback translation. If a NAT supports loopback translation, it means that a host on the private network behind the NAT can communicate with other hosts on the same private network using public (translated) port bindings assigned by the NAT. Most NATs probably do not support this feature yet, but it may become increasingly important in the future where P2P clients may be located behind a common ISP-deployed NAT as well as individual home NATs. More details on loopback translation will appear in the next version of my Internet-Draft, to be released soon.
  • The NAT Check client program now has a command-line option, "-v", which turns on verbose messages during the test.

Related Links

2、深入探究网络安全:Check Point FireWall - 1 NG FP3的变革与升级 本文深入解析了Check Point FireWall-1 NG FP3的变革与升级,详细介绍了其在NAT配置、自动ARP功能和升级路径上的改进。从网络安全市场背景到具体技术实施,全面探讨了从4.x版本升级到NG FP3的关键变化和操作实践,为管理员提供了配置建议和风险应对策略,旨在帮助企业更好地实现网络安全防护。 阅读详情

相关推荐

Skype网络通信与防火墙配置指南

本文深入探讨了Skype在不同网络环境下如何通过NAT和防火墙进行通信,以及如何优化网络设备设置以提高Skype的通话质量和性能。内容涵盖了家庭用户、中小型企业以及大型企业如何根据自身需求配置网络,以及Skype的网络基础设施和端口需求。

weixin_42596011的博客 451

检查你的NAT (Network Address Translator) 和p2p协议的兼容性

原文: http://midcom-p2p.sourceforge.net/NAT CheckVersion 3, with TCP Support!检查你的NAT (Network Address Translator) 和p2p协议的兼容性NAT Check by Bryan Ford, web magic by Dave AndersenHosted by the MIDCOM-P2P pr

坚持到底 3199

NAT检测程序

本程序分为:UDP服务器与UDP客户端。服务器运行在公网上且绑定两个公网IP;客户端运行在本地。 可检测的NAT类型包括: 1. 完全锥形 NAT 2. 限制锥形 NAT 3. 端口限制锥形 NAT 4. 对称 NAT

NAT Check - test NATs and firewalls for P2P-friendliness

检测NAT类型客户端程序http://midcom-p2p.sourceforge.net/natcheck.c检测NAT类型服务端程序http://midcom-p2p.sourceforge.net/natserver.c这个代码分成2部分:server.c部分是运行在国外的某些机器上,配合我们本机程序检测NAT穿透的服务程序;natcheck.c是运行在本机的检测程序。  

坚持到底 3207

自动驾驶仿真(六)—— SIL软件在环仿真测试

自动驾驶仿真六—— SIL软件在环仿真测试1. 在环仿真测试2. SIL软件在环仿真测试2.1 模型配置参数2.2 S function生成实现2.3 结果对比3. 参考学习的书目教材 博主前面的博文已经简要介绍了Carsim、Prescan 与 Simulink 在 “V”型开发流程的一些应用,现今成熟的汽车控制系统软件都是以(Model Based Design,MBD)来开发,它以图形化的方式表达复杂的逻辑、代码可读性、可移植性、开发调试便利程度都大大增强,同时利用成熟的代码生成工具链,也避免了手工代

zhudj08的博客 8660

Cesium 模拟飞机坠毁功能

Cesium 模拟飞机坠毁功能,粒子模拟

QQhelphelp的博客 1070

VC++实现NAT穿透之NAT类型检测

  // NatCheck.cpp : Defines the entry point for the console application.//#include "stdafx.h"    #include    #include     #include #include "winsock2.h" #include "./Include/packet.h"#pragma comment(

尹成的技术博客 6468

(侧边抽屉)移动端APP汉堡页设计全解:从规范落地到体验优化

汉堡页是一种隐藏式侧边导航组件,由汉堡图标(三条水平横线)、侧边抽屉面板、主界面遮罩层三部分构成。点击汉堡图标后,面板通常从左侧滑入,覆盖主界面部分区域(或悬浮于主界面之上);关闭时可通过点击关闭按钮、遮罩层、返回键或侧滑手势完成,是移动端特有的空间优化设计模式。

qq_67370502的博客 617

NAT连通性测试工具以及Flash P2P中的NAT穿透原理

RTMFP connectivity Checker(NAT检查工具): http://cc.rtmfp.net/ 由于公网IP有限,NAT几乎是无处不在。比如我们在家里,牵一个ADSL,用Modem拨号得到一个公网IP,然后在Modem后面再接一个路由使得多个设备能同时上网。路由会有一个公网IP一个私网IP,然后家里的其它设备都用的是私网IP。此时路有器就要完成一个很重要的职责:对于...

guozy_u的专栏 1958

[终于解决]Ubuntu14.04 32位安装移动网卡(0bda:b711)驱动8188gu tplink-WN726n

大致梳理一下问题解决的流程 首先,在台式机做了双系统,台式机只有一个网线接口,由于项目要求,需要占用网口传输数据,所以用之前买的tplink-WN726n免驱版2.0的移动网卡 【note】免驱版只能在Windows下安装使用,在Ubuntu系统中无法使用,所以,需要另辟蹊径。 找了很多资料,尝试很多方法,有的复杂有的简单,终于解决。 【思路】首先在Ubuntu系统中输入lsusb,查看是否检测到USB网卡设备。然后从Github中复制代码,构建,安装,然后modprobe一下,到前面那步还不行,就再来一步

瑞o 1万+

国家自然基金研究方向选定后,关键词只能下拉吗?——不是的,国家自然科学基金(NSFC)的关键词并不是只能下拉选择,而是:[特殊字符] “可选 + 可填”的混合模式(但以规范词为主)

你可以手动输入关键词用于表达新兴方向或细分领域✔ 适用情况:新概念(如“电场调控纳米流体”)交叉领域(如“电流体力学传热耦合”)电场调控电流体力学可以自己填,但必须以系统标准关键词为主,自定义为辅如果你愿意,我可以帮你做一件更关键的事:👉根据你题目,反向设计“最容易中标”的关键词组合 + 学科代码搭配这个比写内容本身还更影响送审质量。你可以手动输入关键词用于表达新兴方向或细分领域✔ 适用情况:新概念(如“电场调控纳米流体”)交叉领域(如“电流体力学传热耦合”)电场调控电流体力学。

qq_15963745的博客 82

amule_health_check.sh Log Rotate

该脚本 amule_health_check.sh 用于定期检查 aMule 下载客户端的连接状态,并记录日志。脚本通过 amulecmd 命令获取 aMule 的状态信息,包括连接状态(HighID 或 LowID)、下载和上传速度,并将这些信息记录到日志文件 amule_status.log 中。如果日志文件超过 120 行,脚本会自动进行日志轮换,保留最多 5 个旧日志文件。日志内容包括时间戳、连接状态、下载和上传速度,若连接失败则记录错误信息。该脚本可通过 crontab 定时执行,确保 aMule

fareast_mzh的博客 287

【机器学习-18】特征筛选:提升模型性能的关键步骤

我们将介绍不同类型的特征筛选方法,包括基于统计的方法、基于模型的方法和嵌入式方法等,并详细解释每种方法的原理和适用场景。通过特征筛选,我们可以减少数据集的维度,降低模型的复杂度,提高模型的泛化能力,并加速模型的训练过程。通过选择适当的特征筛选方法,我们可以减少模型的复杂度,提高模型的泛化能力,并加速模型的训练过程。然而,并非所有的特征都对模型的性能提升有所贡献,有些特征甚至可能是冗余的、噪声较大的或者与目标变量无关的。我们的目标是通过特征筛选选择出对欺诈检测最有用的特征,以提高模型的预测精度。

qq_38614074的博客 1万+

Vmware 中Linux中NAT网络异常解决方法

如果在Vmware Workstation中出现Bringing up interface eth0: Error: Connection activation failed: Device not managed by NetworkManager or unavailable或者Determining IP information for eth0... failed; ...

weixin_34399060的博客 168

【Java面试题汇总】Spring篇(2026版)

IoC、DI、aop、事务、为什么不建议@Transactional、事务传播级别、@Autowired和@Resource注解的区别、BeanFactory和FactoryBean的区别、Bean的作用域,以及默认的作用域、Bean的生命周期、循环依赖、三级缓存、

种一棵树最好的时间是十年前,其次是现在 7376

DFI协议时序

参数名称典型值应用场景关键影响tcmd_lat1-2个时钟周期命令与地址锁存同步地址错误风险tphy_wrlat1-2个时钟周期写操作响应速度写带宽与延迟2-3个时钟周期写操作端到端延迟系统吞吐量1-2个时钟周期连续写命令间隔信号干扰与资源冲突tphy_rdlat1-2个时钟周期读操作响应速度读带宽与延迟trddata_en由CL决定(如0.41 ns)读数据返回时间系统延迟10-20 ps写数据与命令对齐数据丢失风险<1 µs低功耗模式切换。

qq_43134430的博客 5104

Nat 检测代码,udp实现

 // Author : Sadusaga// Data: 2008.09.10// 目的: NAT Check//.h#ifndef _NAT_CHECK_H_#define _NAT_CHECK_H_#if _MSC_VER > 1000#pragma once#endif#include "windows.h"typedef enu

programmerES 1087

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Checkpoint SPLAT Manual Proxy ARP Configuration Example

(adsbygoogle = window.adsbygoogle || []).push({}); Checkpoint manual NAT configuration is a quite useful method to remedy the weakness of auto nat . For me, I always mix them according to d...

Cyber Security Memo 114

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

LVS+keepalived实现同一网段NAT模式

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_33693070的博客 679

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

虚拟机NAT模式下无法获取IP的解决方法

错误信息 no link present check cable 方法 在ifcfg-eth0配置文件加上check_link_down(),,不过不管用 后来发现,是虚拟机的NAT服务没有开启 运行输入services.msc打开服务,然后找到VMware的相关dhcp、nat服务启动, 然后在重启网卡,发现能正常获取ip 问题和下面的链接问题一样,感谢他提供的解决思路 参考链接...

libinbin_1014的专栏 7840

Linux群集 keepalived+lvs_nat配置

virtual_server 192.168.1.254 80{ //虚拟服务器地址(vip)、端口,与漂移地址一样。virtual_router_id 1 //虚拟路由器的ID号,每个热备组保持一致。virtual_router_id 1 //虚拟路由器的ID号,每个热备组保持一致。delay_before_retry 3 //重试间隔(秒)delay_before_retry 3 //重试间隔(秒)

a2690573958的博客 1856

Natter源码解析:STUN协议实现与端口转发机制

Natter是一款强大的网络工具,能够将处于全锥形NAT(Network Address Translation)后的TCP/UDP端口暴露到互联网,实现内网服务的对外访问。本文将深入解析Natter的核心源码,重点探讨STUN协议实现与端口转发机制,帮助开发者理解其工作原理与实现细节。 ## STUN协议实现:NAT类型检测的关键 STUN(Session Traversal Utiliti

gitblog_00985的博客 498

LVS-Nat模式+Keepalived

四台机器: 两台做lvs-nat模式的keepalived集群 两台做RS(Nginx提供静态页面即可) 两台lvs操作 lvs的master节点配置文件 [root@lvs-master ~]# yum -y install ipvsadm keepalived [root@lvs-master ~]# cat /etc/keepalived/keepalived.conf ! Configur...

晨光运维之路 1876
上一篇: p2p之rfc2663
下一篇: 病毒多态
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值