{"id":479187,"date":"2023-08-09T10:31:59","date_gmt":"2023-08-09T10:31:59","guid":{"rendered":""},"modified":"2023-11-30T04:11:58","modified_gmt":"2023-11-30T04:11:58","slug":"stun-server","status":"publish","type":"wiki","link":"https:\/\/oneproxy.pro\/cn\/wiki\/stun-server\/","title":{"rendered":"STUN \u670d\u52a1\u5668"},"content":{"rendered":"<p>STUN\uff08NAT \u4f1a\u8bdd\u904d\u5386\u5b9e\u7528\u7a0b\u5e8f\uff09\u670d\u52a1\u5668\u5728\u73b0\u4ee3\u7f51\u7edc\u901a\u4fe1\u4e2d\u53d1\u6325\u7740\u81f3\u5173\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u4f7f\u7f51\u7edc\u5730\u5740\u8f6c\u6362 (NAT) \u540e\u9762\u7684\u8bbe\u5907\u80fd\u591f\u53d1\u73b0\u5176\u516c\u5171\u5730\u5740\u548c\u7aef\u53e3\u53f7\u3002\u672c\u6587\u6df1\u5165\u63a2\u8ba8\u4e86 STUN \u670d\u52a1\u5668\u7684\u8be6\u7ec6\u4fe1\u606f\u3001\u5176\u6765\u6e90\u3001\u529f\u80fd\u3001\u5e94\u7528\u7a0b\u5e8f\u53ca\u5176\u4e0e\u4ee3\u7406\u670d\u52a1\u5668\u7684\u4ea4\u4e92\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">STUN \u670d\u52a1\u5668\u7684\u8d77\u6e90\u548c\u5386\u53f2<\/h2>\n\n\n\n<p>STUN \u670d\u52a1\u5668\u7684\u6982\u5ff5\u662f\u4e3a\u4e86\u5e94\u5bf9\u70b9\u5bf9\u70b9 (P2P) \u901a\u4fe1\u4e2d NAT\uff08\u7f51\u7edc\u5730\u5740\u8f6c\u6362\uff09\u5e26\u6765\u7684\u6311\u6218\u800c\u51fa\u73b0\u7684\u3002NAT \u65e8\u5728\u7f13\u89e3 IPv4 \u5730\u5740\u67af\u7aed\u7684\u95ee\u9898\uff0c\u5374\u65e0\u610f\u4e2d\u7ed9\u76f4\u63a5\u5bf9\u7b49\u901a\u4fe1\u5e26\u6765\u4e86\u969c\u788d\u3002\u9996\u6b21\u63d0\u5230 STUN \u662f\u5728 2003 \u5e74\u53d1\u5e03\u7684 IETF RFC 3489 \u4e2d\uff0c\u8be5\u534f\u8bae\u4e3a\u8be5\u534f\u8bae\u5960\u5b9a\u4e86\u57fa\u7840\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e3b\u8981\u7279\u70b9\u4e0e\u5206\u6790<\/h2>\n\n\n\n<p>STUN \u670d\u52a1\u5668\u6709\u52a9\u4e8e\u4fc3\u8fdb\u4e0d\u540c NAT \u7f51\u7edc\u4e2d\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u4e3b\u8981\u529f\u80fd\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>NAT \u53d1\u73b0\uff1a<\/strong> \u786e\u5b9a\u5ba2\u6237\u7aef\u4f4d\u4e8e\u7684 NAT \u8bbe\u5907\u7684\u7c7b\u578b\u3002<\/li>\n\n\n\n<li><strong>\u516c\u5171\u5e7f\u64ad\u5206\u8fa8\u7387\uff1a<\/strong> \u4f7f\u5ba2\u6237\u7aef\u80fd\u591f\u53d1\u73b0\u5176\u516c\u5171 IP \u5730\u5740\u548c\u7aef\u53e3\u3002<\/li>\n\n\n\n<li><strong>\u517c\u5bb9\u6027\uff1a<\/strong> \u4e0e\u5404\u79cd NAT \u7c7b\u578b\u65e0\u7f1d\u534f\u4f5c\uff0c\u5305\u62ec\u5168\u9525\u5f62\u3001\u9650\u5236\u9525\u5f62\u3001\u7aef\u53e3\u9650\u5236\u9525\u5f62\u548c\u5bf9\u79f0 NAT\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u4e9b\u529f\u80fd\u5bf9\u4e8e VoIP\uff08\u4e92\u8054\u7f51\u534f\u8bae\u8bed\u97f3\uff09\u3001\u89c6\u9891\u4f1a\u8bae\u548c\u5728\u7ebf\u6e38\u620f\u7b49\u5e94\u7528\u81f3\u5173\u91cd\u8981\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5e94\u7528\u3001\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848<\/h2>\n\n\n\n<p>STUN \u670d\u52a1\u5668\u5728\u9700\u8981\u76f4\u63a5\u70b9\u5bf9\u70b9\u901a\u4fe1\u7684\u573a\u666f\u4e2d\u5f97\u5230\u5e7f\u6cdb\u5e94\u7528\u3002\u5e38\u89c1\u5e94\u7528\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>VoIP \u670d\u52a1\uff1a<\/strong> \u4fc3\u8fdb\u76f4\u63a5\u8bed\u97f3\u901a\u4fe1\u3002<\/li>\n\n\n\n<li><strong>\u89c6\u9891\u4f1a\u8bae\uff1a<\/strong> \u786e\u4fdd\u7a33\u5b9a\u7684\u89c6\u9891\u548c\u97f3\u9891\u8fde\u63a5\u3002<\/li>\n\n\n\n<li><strong>\u5728\u7ebf\u6e38\u620f\uff1a<\/strong> \u652f\u6301\u5b9e\u65f6\u591a\u4eba\u6e38\u620f\u4f53\u9a8c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u7531\u4e8e STUN \u5728\u5904\u7406\u67d0\u4e9b NAT \u7c7b\u578b\uff08\u5c24\u5176\u662f\u5bf9\u79f0 NAT\uff09\u65b9\u9762\u7684\u5c40\u9650\u6027\uff0c\u56e0\u6b64\u7ecf\u5e38\u4f1a\u51fa\u73b0\u4e00\u4e9b\u6311\u6218\u3002\u6709\u65f6\uff0c\u6211\u4eec\u4f1a\u91c7\u7528 TURN\uff08\u4f7f\u7528\u4e2d\u7ee7\u7ed5\u8fc7 NAT\uff09\u670d\u52a1\u5668\u7b49\u66ff\u4ee3\u89e3\u51b3\u65b9\u6848\u6765\u514b\u670d\u8fd9\u4e9b\u5c40\u9650\u6027\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e0e\u540c\u7c7b\u6280\u672f\u7684\u5bf9\u6bd4\u5206\u6790<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u7279\u5f81<\/th><th>STUN \u670d\u52a1\u5668<\/th><th>TURN \u670d\u52a1\u5668<\/th><th>ICE \u534f\u8bae<\/th><\/tr><\/thead><tbody><tr><td>\u4e3b\u8981\u529f\u80fd<\/td><td>NAT \u904d\u5386<\/td><td>\u4e2d\u7ee7\u548c NAT \u904d\u5386<\/td><td>\u5168\u9762\u7684 NAT \u7a7f\u8d8a<\/td><\/tr><tr><td>\u9ad8\u67b6<\/td><td>\u4f4e\u7684<\/td><td>\u9ad8\u7684<\/td><td>\u7f13\u548c<\/td><\/tr><tr><td>\u517c\u5bb9\u6027<\/td><td>\u6709\u9650\u7684 NAT \u7c7b\u578b<\/td><td>\u6240\u6709 NAT \u7c7b\u578b<\/td><td>\u5e7f\u6cdb\u7684<\/td><\/tr><tr><td>\u4f7f\u7528\u6848\u4f8b<\/td><td>\u7b80\u5355\u7684 P2P \u8fde\u63a5<\/td><td>\u590d\u6742\u7684\u7f51\u7edc\u73af\u5883<\/td><td>\u591a\u529f\u80fd\u7f51\u7edc\u89e3\u51b3\u65b9\u6848<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u672a\u6765\u524d\u666f\u548c\u6280\u672f<\/h2>\n\n\n\n<p>STUN \u670d\u52a1\u5668\u7684\u672a\u6765\u4e0e\u7f51\u7edc\u6280\u672f\u7684\u53d1\u5c55\u5bc6\u5207\u76f8\u5173\u3002\u968f\u7740 IPv6 \u7684\u51fa\u73b0\u53ca\u5176\u6d88\u9664 NAT \u7684\u524d\u666f\uff0cSTUN \u7684\u4f5c\u7528\u53ef\u80fd\u4f1a\u53d1\u751f\u53d8\u5316\u6216\u51cf\u5f31\u3002\u7136\u800c\uff0c\u5728\u6b64\u671f\u95f4\uff0c\u9884\u8ba1 STUN \u534f\u8bae\u5c06\u5f97\u5230\u589e\u5f3a\uff0c\u4ee5\u66f4\u597d\u5730\u5904\u7406\u4e0d\u540c\u7684 NAT \u73af\u5883\u5e76\u4e0e 5G \u7b49\u65b0\u5174\u6280\u672f\u96c6\u6210\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528\u4ee3\u7406\u670d\u52a1\u5668\u548c STUN<\/h2>\n\n\n\n<p>\u4ee3\u7406\u670d\u52a1\u5668\u53ef\u4ee5\u901a\u8fc7\u63d0\u4f9b\u989d\u5916\u7684\u9690\u79c1\u548c\u5b89\u5168\u5c42\u6765\u8865\u5145 STUN \u670d\u52a1\u5668\u3002\u5728\u4ee3\u7406-STUN \u670d\u52a1\u5668\u7ec4\u5408\u4e2d\uff0c\u4ee3\u7406\u670d\u52a1\u5668\u53ef\u4ee5\u5145\u5f53\u4e2d\u4ecb\uff0c\u589e\u5f3a\u533f\u540d\u6027\u5e76\u53ef\u80fd\u6709\u52a9\u4e8e\u89c4\u907f\u67d0\u4e9b\u4e0e NAT \u76f8\u5173\u7684\u95ee\u9898\u3002\u8fd9\u79cd\u7ec4\u5408\u5728\u5b89\u5168\u548c\u9690\u79c1\u81f3\u5173\u91cd\u8981\u7684\u4f01\u4e1a\u73af\u5883\u4e2d\u5c24\u5176\u6709\u76ca\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u76f8\u5173\u94fe\u63a5<\/h2>\n\n\n\n<p>\u6709\u5173 STUN \u670d\u52a1\u5668\u3001\u5176\u6280\u672f\u89c4\u683c\u548c\u5e94\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u4ee5\u4e0b\u8d44\u6e90\u5f88\u6709\u4ef7\u503c\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/tools.ietf.org\/html\/rfc3489\" rel=\"nofollow noopener\" target=\"_blank\">IETF RFC 3489 \u2013 STUN \u2013 \u901a\u8fc7\u7f51\u7edc\u5730\u5740\u8f6c\u6362\u5668 (NAT) \u5bf9\u7528\u6237\u6570\u636e\u62a5\u534f\u8bae (UDP) \u8fdb\u884c\u7b80\u5355\u904d\u5386<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/webrtc.org\/\" rel=\"nofollow noopener\" target=\"_blank\">WebRTC.org \u2013 \u4e86\u89e3 STUN\/TURN<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.voip-info.org\/stun\/\" rel=\"nofollow noopener\" target=\"_blank\">VoIP-Info \u2013 STUN \u670d\u52a1\u5668\u548c\u534f\u8bae\u4fe1\u606f<\/a><\/li>\n<\/ol>\n\n\n\n<p>\u672c\u6587\u5168\u9762\u4ecb\u7ecd\u4e86 STUN \u670d\u52a1\u5668\u3001\u5b83\u4eec\u5728\u73b0\u4ee3\u7f51\u7edc\u4e2d\u7684\u91cd\u8981\u6027\u4ee5\u53ca\u5b83\u4eec\u4e0e\u4ee3\u7406\u670d\u52a1\u5668\u7684\u5171\u751f\u5173\u7cfb\u3002<\/p>","protected":false},"featured_media":479188,"menu_order":0,"template":"","meta":{"_acf_changed":false,"content-type":"","inline_featured_image":false,"footnotes":""},"class_list":["post-479187","wiki","type-wiki","status-publish","has-post-thumbnail","hentry"],"acf":{"faq_title":"Frequently Asked Questions about <mark><\/mark>","faq_items":[{"question":"What is a STUN Server?","answer":"A STUN (Session Traversal Utilities for NAT) server is a standardized protocol used in network applications to discover public Internet Protocol (IP) addresses and the type of NAT firewall they are behind. It's essential for enabling applications to traverse Network Address Translator (NAT) gateways and is widely used in VoIP, video conferencing, and real-time communication."},{"question":"When was the STUN Server Protocol First Defined?","answer":"The STUN protocol was initially defined in RFC 3489, published in March 2003 by the Internet Engineering Task Force (IETF). It has seen several updates, with the latest significant version defined in RFC 5389 in October 2008."},{"question":"How Does the STUN Server Work?","answer":"The STUN server works by receiving a query from a client behind a NAT, processing the request, and responding with the client's public IP address and port number. It consists of a listening component, a response component, and a mapping component, working together in a stateless manner to facilitate communication between hosts located behind NAT devices."},{"question":"What are the Key Features of a STUN Server?","answer":"Key features of a STUN server include its ability to traverse NAT, lightweight design, security measures such as authentication, and versatility in various real-time applications."},{"question":"What Types of STUN Servers Exist?","answer":"There are different types of STUN servers, including Classic STUN for traditional NAT traversal, TURN (Traversal Using Relays around NAT), and ICE (Interactive Connectivity Establishment)."},{"question":"What are Some Problems and Solutions Related to STUN Server Usage?","answer":"Some problems associated with STUN server usage include incompatibility with certain NAT types (Symmetric NAT) and security concerns. Solutions include utilizing TURN servers for complex NAT scenarios and implementing proper authentication and encryption."},{"question":"What are the Future Perspectives of STUN Technology?","answer":"Future perspectives of STUN technology include the integration with artificial intelligence, increased security measures, and enhanced scalability, driven by the ongoing development of real-time applications and IoT devices."},{"question":"How are Proxy Servers Associated with STUN Servers?","answer":"Proxy servers and STUN servers can work together to enhance privacy and security. While the STUN server facilitates NAT traversal, proxy servers add an extra layer of anonymity and content filtering."},{"question":"Where Can I Find More Information about STUN Servers?","answer":"More information about STUN servers can be found at <a href=\"https:\/\/tools.ietf.org\/html\/rfc5389\" target=\"_new\">IETF's Official RFC 5389<\/a>, <a href=\"https:\/\/www.html5rocks.com\/en\/tutorials\/webrtc\/infrastructure\/\" target=\"_new\">WebRTC's Overview of STUN\/TURN<\/a>, and <a href=\"https:\/\/oneproxy.pro\" target=\"_new\">OneProxy Services<\/a>."}]},"_links":{"self":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki\/479187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki"}],"about":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/types\/wiki"}],"version-history":[{"count":0,"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki\/479187\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/media\/479188"}],"wp:attachment":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/media?parent=479187"}],"curies":[{"name":"\u53ef\u6e7f\u6027\u7c89\u5242","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}