SUMTEC -- There's a thing in my bloglet.

But it's not only one. It's many. It's the same as other things but it exactly likes nothing else...

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  263 随笔 :: 19 文章 :: 2992 评论 :: 22 引用
感谢hBifTs提供的网址,学到了不少的东西。
其中这篇And这篇给我带来了很多新的知识。
有空我要做一下总结。

再次感谢hBifTs
posted on 2004-04-21 18:43 Sumtec 阅读(4146) 评论(11) 编辑 收藏

评论

#1楼 2004-04-21 18:56 juqiang
呵呵,恭喜恭喜!!!
 回复 引用   

#2楼 2004-04-21 22:55 hBifTs
不用客气~

btw,像这种非技术的文章可以放到非技术区:P
 回复 引用   

#3楼 2004-04-22 07:18 sumtec
oo,我以为这里面的两个文章也算作技术的。哎呀,看来还是不太熟悉这边的情况。
 回复 引用   

#4楼 2004-04-22 07:52 hBifTs
呵呵~不要紧的,,不知者无罪嘛..

:P
希望你能多发一些技术文章哦:P
 回复 引用   

#5楼 2004-04-22 07:56 hBifTs
不过就现在博客园的情况而言,你的这个作为技术文章没问题的:P
..嘿~
 回复 引用   

#6楼 2004-08-23 16:12 mrgump
很高兴来到这里,因为我也对同样的问题有着浓厚的兴趣。最近收集资料中有幸来到这里,看到这么多朋友一起讨论研究,真的很受鼓舞。从
大家身上学到了很多知识,开拓了眼界。呵呵,支持斑竹。希望以后有机会能够很好的交流,mail: mlhdyx <at> 21cn.com
 回复 引用   

#7楼 2004-08-24 14:47 Mrgump

Clients Behind Different NATs

   Suppose clients A and B both have private IP addresses and lie behind

   different network address translators.  The peer-to-peer application

   running on clients A and B and on server S each use UDP port 1234.  A

   and B have each initiated UDP communication sessions with server S,

   causing NAT A to assign its own public UDP port 62000 for A's session

   with S, and causing NAT B to assign its port 31000 to B's session

   with S, respectively.

                                Server S

                            18.181.0.31:1234

                                   |

                                   |

            +----------------------+----------------------+

            |                                             |

          NAT A                                         NAT B

    155.99.25.11:62000                            138.76.29.7:31000

            |                                             |

            |                                             |

         Client A                                      Client B

      10.0.0.1:1234                                 10.1.1.3:1234

   Now suppose that client A wants to establish a UDP communication

   session directly with client B.  If A simply starts sending UDP

   requests to B's public address, 138.76.29.7:31000, then NAT B will

   typically discard these incoming messages because the source address

   and port number does not match those of S, with which the original

   outgoing session was established.  Similarly, if B simply starts

   sending UDP requests to A's public address, then NAT A will discard

   these messages.

   Suppose A starts sending UDP requests to B's public address, however,

   and simultaneously relays a request through server S to B, asking B

   to start sending UDP requests to A's public address.  A's outgoing

   messages directed to B's public address (138.76.29.7:31000) will

   cause NAT A to open up a new communication session between A's

   private address and B's public address.  At the same time, B's

   messages to A's public address (155.99.25.11:62000) will cause NAT B

   to open up a new communication session between B's private address

   and A's public address.  Once the new UDP sessions have been opened

   up in each direction, client A and B can communicate with each other

   directly without further reference to or burden on the "introduction"

   server S

 回复 引用   

#8楼 2004-12-18 16:42 龙龙      
都E文,呜……
 回复 引用 查看   

#9楼 2005-02-12 16:59 kuludy
我想使用P2P技术在两个不同的LAN中通讯,如何完成,有没有这方面的实用例子,不知哪位大侠能帮助小弟,QQ:56167607
 回复 引用   

#10楼 2005-08-27 11:16 fisher[未注册用户]
如果NAT A和NAT B其中一个是动态,(我说的动态是端口临时分配,比如说NAT A是动态的,则Client A在使用1234端口与不用的用户通讯时,NAT分配给他的端口是不一样),两个之间怎么通讯。
如果NAT A和NAT B都是动态,Client A和Client B能否通讯吗
 回复 引用   

#11楼 2005-08-28 10:44 sumtec
都是动态的理论上可以,我没有试过。根据上面提到的文章,需要有两个公网固定IP才能够较好的保证。需要双方分别连接公网IP1:port1/port2以及IP2:port3,这样就可以知道是什么类型的NAT了,也可以猜测NAT对于同一个IP不同端口,以及不同IP的时候如何为内网设备分配IP:是不变,还是Port加一,还是成平房增长。这样就可以预测双方互联的时候各自的公网动态IP了,接下来就是把握好时机,同时向对方的猜测地址发送信息。当然,还有一些东西要注意,自己看那些文章吧。
 回复 引用