zoukankan      html  css  js  c++  java
  • NAT 穿透

    /*********************************************************************************
     *                                  NAT 穿透
     * 说明:
     *     NAT网络数据穿透,了解一下。
     *
     *                                              2017-10-30 深圳 南山平山村 曾剑锋
     ********************************************************************************/
    
    一、参考文档:
        1. 怎样用python实现NAT穿透
            https://groups.google.com/forum/#!topic/python-cn/qwEpn_nP5ZU
        2. Python实现STUN+TURN+P2P聊天
            https://laike9m.com/blog/pythonshi-xian-stunturnp2pliao-tian,29/
        3. PyPunchP2P
            https://github.com/laike9m/PyPunchP2P
    
    二、NAT类型:
        1. Full Cone(完全穿透): Any external host can send a packet to the internal host, by sending a packet to the mapped external address.(任何外部主机发送数据包到内部主机映射的外部地址,内部主机都能接收到数据包。)
        2. Restricted Cone(Address Restricted Cone 地址限制穿透): An external host (with IP address X) can send a packet to the internal host only if the internal host had previously sent a packet to IP address X. Once an internal address (iAddr:port1) is mapped to an external address (eAddr:port2), any packets from iAddr:port1 will be sent through eAddr:port2. Any external host can send packets to iAddr:port1 by sending packets to eAddr:port2。(只有当一个内部主机已经提前发送了一个数据包给外部主机(IP地址X),外部主机才能发送数据包到内部主机。一旦一个内部主机地址(iAddr:port1)映射到外部主机地址(eAddr:port2),任何从iAddr:port1发送的数据包都会通过eAddr:port2发出去,任何外部主机可以发送数据包到eAddr:port2转发到iAddr:port1中。)
        3. Port Restricted Cone(端口限制穿透): A port restricted cone NAT is like a restricted cone NAT, but the restriction includes port numbers.(端口限制穿透NAT很像地址限制穿透NAT,其中的限制条件还要加上端口号。)
        4. Symmetric NAT(对称穿透): Each request from the same internal IP address and port to a specific destination IP address and port is mapped to a unique external source IP address and port. If the same internal host sends a packet even with the same source address and port but to a different destination, a different mapping is used. Only an external host that receives a packet from an internal host can send a packet back.(每个相同的内部IP、Port都会映射成唯一的外部IP、Prort,如果内部的同一台主机发送数据包给不同的目标主机,会采用不同的映射,只有收到内部主机发送的数据包的外部主机才能发送回数据。)
  • 相关阅读:
    centos7 下安装MongoDB
    centos7 学习笔记
    MongoDB相关资料收集
    centos 下安装.net core
    sql server 2008 r2 中的oracle发布使用笔记
    sql server 与oracle数据互导的一种思路--sql server链接服务器
    Visual Studio 2015正式版/产品密钥 Win10正式版官方原版ISO镜像下载大全&安装激活教程
    Modbus库开发笔记:Modbus ASCII Slave开发
    PID控制器开发笔记之十一:专家PID控制器的实现
    μCUnit,微控制器的单元测试框架
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/7755860.html
Copyright © 2011-2022 走看看