Chinaunix首页 | 论坛 | 博客
  • 博客访问: 259371
  • 博文数量: 74
  • 博客积分: 1470
  • 博客等级: 上尉
  • 技术积分: 793
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-25 21:01
文章分类

全部博文(74)

文章存档

2011年(1)

2010年(32)

2009年(32)

2008年(9)

我的朋友

分类: 系统运维

2010-04-04 21:11:18

网络地址转换(NAT)有很多种类型,不同的类型适用于不同的应用层通信.比如在一些应用层协议中会用到IP地址,如果这个应用层软件被用于私网中,那么它就需要知道经过NAT伪装后的公网IP地址.举一个实际的例子,在P2P的一些协议中,一个torrent文件必须包含此文件所在主机的IP地址,这样其他peer才能够探测到它.所以,STUN(Simple traversal of UDP over NATs)应运而生.它把NAT分为full cone NAT, (address) restricted cone NAT, port restricted cone NAT 和 symmetric NAT,并提出了一些方法来检测这些NAT.

full cone NAT(全双工锥形NAT)
当内部主机发出一个“外出”的连接会话,就会创建了一个公网/私网 地址,一旦这个地址对被创建,全双工锥形NAT会接收随后任何外部端口传入这个公共端口地址的通信.因此,全双工锥形NAT有时候又被称为"混杂"NAT
Accepts any datagrams to a port that has been previously used. Will accept the first datagram from the remote peer.


restricted cone NAT(受限制锥形NAT)
受限制的锥形NAT 会对传入的数据包进行筛选,当内部主机发出“外出”的会话时,NAT会记录这个外部主机的IP地址信息,所以,也只有这些有记录的外部IP地址,能够将信息传入到NAT内部,受限制的锥形NAT 有效的给防火墙提炼了筛选包的原则——即限定只给那些已知的外部地址“传入”信息到NAT内部
Accepts datagrams to a port as long as the datagram source IP address is a system we have already sent to. Will accept the first datagram if both systems send simultaneously. Otherwise, will accept the first datagram after we have sent one datagram.


port restricted cone NAT(端口受限锥形NAT)
端口受限制的锥形NAT,与受限制的锥形NAT不同的是:它同时记录了外部主机的IP地址和端口信息,端口受限制的锥形NAT给内部节点提供了同一级别的保护,在维持端口“同一性”过程中,将会丢弃对称NAT传回的信息.
Same as address-restricted cone NAT, but we had to send to both the correct remote IP address and correct remote port. The same source address and port to a different destination uses the same mapping.


symmetric NAT(对称NAT)
对称NAT,与Cone NAT是大不相同的,并不对会话进行端口绑定,而是分配一个全新的公网端口给每一个新的会话.
A different port is chosen for every remote destination. The same source address and port to a different destination uses a different mapping. Since the port will be different, the first external punchthrough attempt will fail. For this to work it requires port-prediction (MAX_PREDICTIVE_PORT_RANGE>1) and that the router chooses ports sequentially.



文件: NAType.rar
大小: 251KB
下载: 下载


阅读(1622) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~