流浪的枫之羽
日历
网志分类
· 所有网志 (41)
· C++学习 (7)
· .net学习 (0)
· 计算机图形学 (4)
· GIS (4)
· Win32平台开发 (10)
· 浙大CS之梦 (4)
· P2P (2)
· 搜索引擎 (4)
· 游戏开发 (0)
· 博客生活 (6)
站内搜索
友情链接
· 歪酷博客
· 我的歪酷 非非共享界
· 葡萄是一种水果,很好吃哦!
· 可爱的小蓓
· 上帝保佑善良的小孩
· DOOMIII队友
· 我写的小东西

订阅 RSS

0006044

歪酷博客

搜索、游戏、IT,博客、广告、生活
« 上一篇: 出道数学题! 下一篇: 关于光棍节 »
枫之羽 @ 2007-11-05 15:32

在微软的 NAT 技术文档"How NAT Works"中可以发现: http://technet2.microsoft.com/WindowsServer/en/library/0f4bad59-5237-4452-a693-708ac61fe1671033.mspx 如果无法打开, 你自己到微软的网站搜索得到链接. If a client on the private network makes a TCP connection to two different computers on the public network from the same source port, the NAT driver will choose different source ports for those mappings. If a client on the private network sends UDP packets to two different computers on the public network from the same source port, the NAT driver will use the same source port for both mappings. 所以必须使用 UDP 穿透. TCP 穿透据说已经实现, 但是太依赖技巧性, 而且不成熟. How NAT determines whether an inbound packet matches an existing dynamic or static mapping. For UDP, however, an inbound packet must match only the protocol, destination address, and destination port of a mapping — the source address and source port of the packet are effectively ignored. This “loose matching behavior” applies only if the private port is greater than 1024. Allowing this behavior for ports below 1024 would introduce a security risk... NAT 对内网同一个 IP:PORT 使用同一条映射, 所以任何机器都可以根据这条映射, 往内网 IP:PORT 对应的 公网 IP:PORT 发送 UDP 数据报(会被 NAT 转发给内网 IP:PORT). 要让其它人能知道这条映射, 内网 IP:PORT 只需要在 NAT 的 UDP idle-time 时间内往固定的外网服务器发送报告, 外网服务器就可以从 UDP 包中提取 公网 IP:PORT. 另外, 一篇 rfc 草案也能帮助你: http://midcom-p2p.sourceforge.net/draft-ford-midcom-p2p-01.txt




评论 / 个人网页 / 扔小纸条
* 昵称

已经注册过? 请登录

新用户请先注册 以便能显示头像及追踪评论回复

Email
网址
* 评论
表情
 


 

分类小组论坛
杂谈 , 娱乐、八卦 , 文学、艺术 , 体育 , 旅游、同城 , 象牙塔 , 情感 , 时尚、生活 , 星座 , 科技

请注意遵守中华人民共和国法律法规, 如威胁到本站生存, 将依法向有关部门报告, 同时本站的相关记录可能成为对您不利的证据.

相关法律法规
全国人大常委会关于维护互联网安全的决定
中华人民共和国计算机信息系统安全保护条例
中华人民共和国计算机信息网络国际联网管理暂行规定
计算机信息网络国际联网安全保护管理办法
计算机信息系统国际联网保密管理规定