{"id":94863,"date":"2024-07-02T09:06:54","date_gmt":"2024-07-02T01:06:54","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=94863"},"modified":"2024-07-02T09:07:20","modified_gmt":"2024-07-02T01:07:20","slug":"pdddcsjsjs","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/94863.html","title":{"rendered":"P2P\u70b9\u5bf9\u70b9\u4f20\u8f93\u6280\u672f\u4ecb\u7ecd"},"content":{"rendered":"\n
\u3000\u3000\u70b9\u5bf9\u70b9\u4f20\u8f93\u6280\u672f(Peer-to-Peer\uff0c\u7b80\u79f0P2P)<\/strong>\u662f\u4e00\u79cd\u7f51\u7edc\u901a\u4fe1\u6a21\u5f0f\uff0c\u5176\u6838\u5fc3\u601d\u60f3\u662f\u901a\u8fc7\u7f51\u7edc\u4e2d\u7684\u5404\u4e2a\u8282\u70b9\u76f4\u63a5\u8fdb\u884c\u6570\u636e\u4ea4\u6362\u548c\u5171\u4eab\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u4e8e\u4e2d\u5fc3\u670d\u52a1\u5668\u3002\u8fd9\u79cd\u6280\u672f\u4f7f\u5f97\u6bcf\u4e2a\u8282\u70b9\u65e2\u53ef\u4ee5\u4f5c\u4e3a\u5ba2\u6237\u7aef\uff0c\u4e5f\u53ef\u4ee5\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u4ece\u800c\u5b9e\u73b0\u8d44\u6e90\u7684\u9ad8\u6548\u5229\u7528\u548c\u4f20\u8f93\u3002<\/p>\n\n\n\n \u3000\u3000P2P\u6280\u672f\u7684\u57fa\u672c\u539f\u7406\u662f\u5c06\u7f51\u7edc\u4e2d\u7684\u6bcf\u4e2a\u8282\u70b9\u90fd\u89c6\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684\u5b9e\u4f53\uff0c\u8fd9\u4e9b\u8282\u70b9\u4e4b\u95f4\u53ef\u4ee5\u76f4\u63a5\u8fdb\u884c\u901a\u4fe1\u548c\u8d44\u6e90\u5171\u4eab\u3002\u4e0e\u4f20\u7edf\u7684\u5ba2\u6237\u7aef\/\u670d\u52a1\u5668\u6a21\u5f0f\u4e0d\u540c\uff0cP2P\u7f51\u7edc\u5141\u8bb8\u6240\u6709\u8282\u70b9\u5728\u6ca1\u6709\u4e2d\u592e\u670d\u52a1\u5668\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u76f4\u63a5\u901a\u4fe1\u3002\u8fd9\u79cd\u53bb\u4e2d\u5fc3\u5316\u7684\u7279\u6027\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u7075\u6d3b\u6027\u548c\u6269\u5c55\u6027\uff0c\u8fd8\u80fd\u6709\u6548\u51cf\u5c11\u5355\u70b9\u6545\u969c\u7684\u98ce\u9669\u3002<\/p>\n\n\n\n \u3000\u3000P2P\u7f51\u7edc\u7684\u5de5\u4f5c\u6d41\u7a0b\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n\n\n\n \u3000\u3000P2P\u6280\u672f\u7684\u5e94\u7528\u975e\u5e38\u5e7f\u6cdb\uff0c\u5305\u62ec\u6587\u4ef6\u5171\u4eab\u3001\u5373\u65f6\u901a\u8baf\u3001\u5206\u5e03\u5f0f\u5b58\u50a8\u3001\u533a\u5757\u94fe\u7b49\u3002\u4f8b\u5982\uff0c\u5728\u6587\u4ef6\u5171\u4eab\u5e94\u7528\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7P2P\u7f51\u7edc\u76f4\u63a5\u4e0b\u8f7d\u548c\u4e0a\u4f20\u6587\u4ef6\uff0c\u800c\u4e0d\u9700\u8981\u901a\u8fc7\u4e2d\u592e\u670d\u52a1\u5668\u3002\u5728\u533a\u5757\u94fe\u6280\u672f\u4e2d\uff0cP2P\u7f51\u7edc\u4e5f\u88ab\u7528\u4e8e\u8282\u70b9\u4e4b\u95f4\u7684\u6570\u636e\u540c\u6b65\u548c\u4ea4\u6613\u9a8c\u8bc1\u3002<\/p>\n\n\n\n \u3000\u3000\u6b64\u5916\uff0cP2P\u6280\u672f\u8fd8\u9762\u4e34\u4e00\u4e9b\u6311\u6218\uff0c\u5982NAT\u7a7f\u900f\u95ee\u9898\u548c\u5e26\u5bbd\u5229\u7528\u7387\u95ee\u9898\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u901a\u5e38\u4f1a\u91c7\u7528\u4e00\u4e9b\u7279\u5b9a\u7684\u534f\u8bae\u548c\u6280\u672f\uff0c\u5982Raysync\u8d85\u9ad8\u901f\u4f20\u8f93\u534f\u8bae\u548c\u4e2d\u95f4\u670d\u52a1\u5668\u534f\u52a9\u5efa\u7acb\u6620\u5c04\u8868\u7b49\u3002<\/p>\n\n\n\n \u3000\u3000P2P\u70b9\u5bf9\u70b9\u4f20\u8f93\u6280\u672f\u901a\u8fc7\u53bb\u4e2d\u5fc3\u5316\u7684\u65b9\u5f0f\u5b9e\u73b0\u4e86\u9ad8\u6548\u3001\u5b89\u5168\u7684\u6570\u636e\u4f20\u8f93\u548c\u8d44\u6e90\u5171\u4eab\uff0c\u5177\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u524d\u666f\u548c\u53d1\u5c55\u6f5c\u529b.<\/p>\n\n\n\n \u3000\u3000\u5728P2P\u70b9\u5bf9\u70b9\u4f20\u8f93\u6280\u672f\u4e2d\uff0c\u8282\u70b9\u53d1\u73b0\u7b97\u6cd5\u7684\u6700\u65b0\u7814\u7a76\u8fdb\u5c55\u4e3b\u8981\u96c6\u4e2d\u5728\u4ee5\u592a\u574a\u7f51\u7edc\u4e2d\u7684\u5e94\u7528\u3002\u4ee5\u592a\u574a\u4f7f\u7528\u4e86\u7ecf\u5178\u7684Kademlia\u7f51\u7edc(\u7b80\u79f0KAD)\u6765\u8fdb\u884c\u8282\u70b9\u53d1\u73b0\u3002KAD\u7b97\u6cd5\u7684\u6838\u5fc3\u6570\u636e\u7ed3\u6784\u662fNodeTable\u7c7b\uff0c\u5b83\u8d1f\u8d23\u7ef4\u62a4\u4e00\u4e2a\u7f51\u7edc\u8282\u70b9\u5217\u8868\uff0c\u4f9b\u4e0a\u5c42\u4f7f\u7528\u3002<\/p>\n\n\n\n \u3000\u3000\u5177\u4f53\u6765\u8bf4\uff0c\u4ee5\u592a\u574a\u7684\u8282\u70b9\u53d1\u73b0\u673a\u5236\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n\n\n\n \u3000\u3000\u6b64\u5916\uff0c\u4ee5\u592a\u574a\u7684\u8282\u70b9\u53d1\u73b0\u673a\u5236\u6709\u591a\u4e2a\u7248\u672c\uff0c\u5176\u4e2dv4\u9002\u7528\u4e8e\u5168\u8282\u70b9\uff0c\u901a\u8fc7discover.ListenUDP\u4f7f\u7528\uff0c\u800cv5\u9002\u7528\u4e8e\u8f7b\u8282\u70b9\u901a\u8fc7discv5.ListenUDP\u4f7f\u7528\u3002\u8fd9\u79cd\u673a\u5236\u4f7f\u5f97\u672c\u5730\u8282\u70b9\u80fd\u591f\u5f97\u77e5\u5176\u4ed6\u8282\u70b9\u7684\u4fe1\u606f\uff0c\u8fdb\u800c\u52a0\u5165\u5230P2P\u7f51\u7edc\u4e2d\u3002<\/p>\n\n\n\n \u3000\u3000\u6700\u65b0\u7684\u7814\u7a76\u8fd8\u6307\u51fa\uff0c\u4ee5\u592a\u574a\u8282\u70b9\u5728\u53d1\u73b0\u90bb\u5c45\u8282\u70b9\u76848\u6b21\u5faa\u73af\u4e2d\uff0c\u6240\u67e5\u627e\u7684\u8282\u70b9\u5747\u5728\u8ddd\u79bb\u4e0a\u5411\u968f\u673a\u751f\u6210\u7684TargetId\u6536\u655b\uff0c\u8fd9\u4e0e\u4f20\u7edfKad\u7f51\u7edc\u5728\u8ddd\u79bb\u4e0a\u5411\u8282\u70b9\u672c\u8eab\u6536\u655b\u7684\u65b9\u5f0f\u6709\u6240\u4e0d\u540c\u3002<\/p>\n\n\n\n \u3000\u3000\u5728P2P\u7f51\u7edc\u4e2d\uff0c\u89e3\u51b3NAT\u7a7f\u900f\u95ee\u9898\u548c\u5e26\u5bbd\u5229\u7528\u7387\u95ee\u9898\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a<\/p>\n\n\n\n \u3000\u3000ICE\u662f\u4e00\u79cd\u7efc\u5408\u8fd0\u7528STUN\u3001TURN\u7b49\u534f\u8bae\u7684\u901a\u7528\u89e3\u51b3\u65b9\u6848\u3002\u5b83\u80fd\u591f\u6839\u636e\u4e0d\u540c\u7684\u7f51\u7edc\u73af\u5883\u9009\u62e9\u6700\u9002\u5408\u7684\u7a7f\u900f\u7b56\u7565\uff0c\u4ece\u800c\u63d0\u9ad8NAT\u7a7f\u900f\u7684\u6210\u529f\u7387\u3002<\/p>\n\n\n\n \u3000\u3000\u591a\u5c42NAT\u7a7f\u900f\u6280\u672f\u901a\u8fc7\u9010\u5c42\u7a7f\u900fNAT\uff0c\u89e3\u51b3\u4e86\u5355\u5c42\u7a7f\u900f\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u3002\u8fd9\u79cd\u65b9\u6cd5\u9700\u8981\u5bf9\u4e0d\u540c\u7c7b\u578b\u7684NAT\u8fdb\u884c\u5206\u6790\uff0c\u5e76\u8bbe\u8ba1\u76f8\u5e94\u7684\u7a7f\u900f\u7b56\u7565\u3002<\/p>\n\n\n\n \u3000\u3000\u901a\u8fc7NAT\u63a2\u6d4b\u548c\u7a7f\u900f\u534f\u8bae(\u5982STUN\/TURN)\uff0c\u670d\u52a1\u5668\u53ef\u4ee5\u63a2\u6d4bNAT\u7c7b\u578b\u5e76\u5bf9\u5176\u8fdb\u884c\u7a7f\u900f\u5904\u7406\u3002\u5f53NAT\u53ef\u4ee5\u76f4\u63a5\u7a7f\u900f\u65f6\uff0c\u670d\u52a1\u5668\u4f1a\u81ea\u52a8\u8c03\u6574\u7b56\u7565\u4ee5\u5b9e\u73b0\u901a\u4fe1\u3002<\/p>\n\n\n\n \u3000\u3000\u4e09\u3001 Raysync\u8d85\u9ad8\u901f\u4f20\u8f93\u534f\u8bae\u7684\u5de5\u4f5c\u539f\u7406\u53ca\u5176\u6027\u80fd\u4f18\u52bf\u662f\u4ec0\u4e48?<\/p>\n\n\n\n \u3000\u3000Raysync\u8d85\u9ad8\u901f\u4f20\u8f93\u534f\u8bae\u7684\u5de5\u4f5c\u539f\u7406\u4e3b\u8981\u662f\u57fa\u4e8eUDP\u534f\u8bae\u8fdb\u884c\u6df1\u5ea6\u4f18\u5316\uff0c\u4ee5\u5b9e\u73b0\u8d85\u9ad8\u901f\u3001\u7a33\u5b9a\u548c\u5b89\u5168\u7684\u6570\u636e\u4f20\u8f93\u670d\u52a1\u3002\u8be5\u534f\u8bae\u901a\u8fc7\u7a81\u7834\u6027\u4f20\u8f93\u6280\u672f\u5f7b\u5e95\u6d88\u9664\u5e95\u5c42\u74f6\u9888\uff0c\u514b\u670d\u4f20\u7edf\u7f51\u7edc\u548c\u786c\u4ef6\u7684\u9650\u5236\uff0c\u5145\u5206\u5229\u7528\u7f51\u7edc\u5e26\u5bbd\uff0c\u5b9e\u73b0\u8d85\u4f4e\u5ef6\u65f6\u3001\u9ad8\u901f\u3001\u7aef\u5230\u7aef\u7684\u8f93\u51fa\u670d\u52a1\u3002<\/p>\n\n\n\n \u3000\u3000\u5176\u6027\u80fd\u4f18\u52bf\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a<\/p>\n\n\n\n \u3000\u3000\u5728\u5206\u5e03\u5f0f\u5b58\u50a8\u7cfb\u7edf\u4e2d\uff0cP2P\u6280\u672f\u7684\u5e94\u7528\u6848\u4f8b\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a<\/p>\n\n\n\n \u3000\u3000\u533a\u5757\u94fe\u6280\u672f\u4e0eP2P\u7f51\u7edc\u7ed3\u5408\u7684\u6700\u65b0\u53d1\u5c55\u8d8b\u52bf\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a<\/p>\n\n\n\n \u70b9\u5bf9\u70b9\u4f20\u8f93\u6280\u672f(Peer-to-Peer\uff0c\u7b80\u79f0P2P)\u662f\u4e00\u79cd\u7f51\u7edc\u901a\u4fe1\u6a21\u5f0f\uff0c\u5176\u6838\u5fc3\u601d\u60f3\u662f\u901a\u8fc7\u7f51\u7edc\u4e2d\u7684\u5404\u4e2a\u8282\u70b9\u76f4\u63a5\u8fdb\u884c\u6570\u636e\u4ea4\u6362\u548c\u5171\u4eab\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u4e8e\u4e2d\u5fc3\u670d\u52a1\u5668\u3002<\/p>\n","protected":false},"author":1,"featured_media":92869,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[249,155],"class_list":["post-94863","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-ddd","tag-dddtx"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/94863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=94863"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/94863\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/92869"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=94863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=94863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=94863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
\u3000\u3000\u4e00\u3001 P2P\u70b9\u5bf9\u70b9\u4f20\u8f93\u6280\u672f\u4e2d\u8282\u70b9\u53d1\u73b0\u7b97\u6cd5\u7684\u6700\u65b0\u7814\u7a76\u8fdb\u5c55\u662f\u4ec0\u4e48?<\/h2>\n\n\n\n
\n
\u3000\u3000\u4e8c\u3001 \u5728P2P\u7f51\u7edc\u4e2d\uff0c\u5982\u4f55\u6709\u6548\u89e3\u51b3NAT\u7a7f\u900f\u95ee\u9898\u548c\u5e26\u5bbd\u5229\u7528\u7387\u95ee\u9898?<\/h2>\n\n\n\n
\u3000\u30001. STUN\u548cTURN\u534f\u8bae<\/strong>\uff1a<\/h3>\n\n\n\n
\n
\u3000\u30002. \u4f18\u5316\u5e26\u5bbd\u5229\u7528\u7387<\/strong>\uff1a<\/h3>\n\n\n\n
\n
\u3000\u30003. \u9632\u706b\u5899\u7b56\u7565\u4f18\u5316<\/strong>\uff1a<\/h3>\n\n\n\n
\n
\n
\u3000\u3000\u56db\u3001 \u5206\u5e03\u5f0f\u5b58\u50a8\u7cfb\u7edf\u4e2dP2P\u6280\u672f\u7684\u5e94\u7528\u6848\u4f8b\u6709\u54ea\u4e9b?<\/h2>\n\n\n\n
\n
\u3000\u3000\u4e94\u3001 \u533a\u5757\u94fe\u6280\u672f\u4e0eP2P\u7f51\u7edc\u7ed3\u5408\u7684\u6700\u65b0\u53d1\u5c55\u8d8b\u52bf\u662f\u4ec0\u4e48?<\/h2>\n\n\n\n
\n