Nat类型检测

Determining NAT Mapping Behavior
   This will require at most three tests.  In test I, the client
   performs the UDP connectivity test.  The server will return its
   alternate address and port in OTHER-ADDRESS in the binding response.
   If OTHER-ADDRESS is not returned, the server does not support this
   usage and this test cannot be run.  The client examines the XOR-
   MAPPED-ADDRESS attribute.  If this address and port are the same as
   the local IP address and port of the socket used to send the request,
   the client knows that it is not NATed and the effective mapping will
   be Endpoint-Independent.
   In test II, the client sends a Binding Request to the alternate
   address, but primary port.  If the XOR-MAPPED-ADDRESS in the Binding
   Response is the same as test I the NAT currently has Endpoint-
   Independent Mapping.  If not, test III is performed: the client sends
   a Binding Request to the alternate address and port.  If the XOR-
   MAPPED-ADDRESS matches test II, the NAT currently has Address-
   Dependent Mapping; if it doesn’t match it currently has Address and
   Port-Dependent Mapping.


Determining NAT Filtering Behavior
   This will also require at most three tests.  These tests are
   sensitive to prior state on the NAT.
   In test I, the client performs the UDP connectivity test.  The server
   will return its alternate address and port in OTHER-ADDRESS in the
   binding response.  If OTHER-ADDRESS is not returned, the server does
   not support this usage and this test cannot be run.
   In test II, the client sends a binding request to the primary address
   of the server with the CHANGE-REQUEST attribute set to change-port
   and change-IP.  This will cause the server to send its response from
   its alternate IP address and alternate port.  If the client receives
   a response, the current behavior of the NAT is Endpoint-Independent
   Filtering.
   If no response is received, test III must be performed to distinguish
   between Address-Dependent Filtering and Address and Port-Dependent
   Filtering.  In test III, the client sends a binding request to the
   original server address with CHANGE-REQUEST set to change-port.  If
   the client receives a response, the current behavior is Address-
   Dependent Filtering; if no response is received, the current behavior
   is Address and Port-Dependent Filtering.
 
    

Independent Mapping, Independent Filter = Fullcone NAT 
Independent Mapping, Address Dependent Filter = Restricted Cone NAT 
Independent Mapping, Port Dependent Filter = Port-Restricted Cone NAT 
Dependent Mapping = Symmetric NAT 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值