{"id":733,"date":"2025-12-12T10:13:08","date_gmt":"2025-12-12T02:13:08","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=733"},"modified":"2025-12-12T10:13:08","modified_gmt":"2025-12-12T02:13:08","slug":"%e8%ae%a1%e7%ae%97%e6%9c%ba%e7%bd%91%e7%bb%9c%e5%ae%9e%e9%aa%8c","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2025\/12\/12\/%e8%ae%a1%e7%ae%97%e6%9c%ba%e7%bd%91%e7%bb%9c%e5%ae%9e%e9%aa%8c\/","title":{"rendered":"\u8ba1\u7b97\u673a\u7f51\u7edc\u5b9e\u9a8c"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4e3a\u4e86\u4fbf\u4e8e\u4f60\u76f4\u63a5\u4f7f\u7528\uff0c\u6211\u5148\u7ed9\u51fa\u4e00\u4efd<strong>\u7ed3\u6784\u5b8c\u6574\u3001\u9002\u7528\u4e8e\u8bfe\u7a0b\/\u4f5c\u4e1a\/\u62a5\u544a\u7684\u201c\u8ba1\u7b97\u673a\u7f51\u7edc\u5b9e\u9a8c\u603b\u89c8\u4e0e\u5178\u578b\u5b9e\u9a8c\u8bf4\u660e\u201d<\/strong>\u3002\u5982\u679c\u4f60\u544a\u8bc9\u6211\u5177\u4f53\u8981\u6c42\uff08\u4f8b\u5982\uff1a\u9700\u8981\u54ea\u7c7b\u5b9e\u9a8c\uff1f\u9700\u8981\u5199\u5b9e\u9a8c\u62a5\u544a\uff1f\u9700\u8981\u4ee3\u7801\uff1f\u9700\u8981\u6293\u5305\u5206\u6790\uff1f\u9700\u8981\u6309\u5b66\u6821\u6a21\u677f\u5199\uff1f\uff09\uff0c\u6211\u53ef\u4ee5\u8fdb\u4e00\u6b65\u751f\u6210\u5bf9\u5e94\u7248\u672c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u4e3a\u901a\u7528\u4e14\u5b8c\u6574\u7684\u5185\u5bb9\u6846\u67b6\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e00\u3001\u8ba1\u7b97\u673a\u7f51\u7edc\u5b9e\u9a8c\u7684\u4e3b\u8981\u7c7b\u578b<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ba1\u7b97\u673a\u7f51\u7edc\u8bfe\u7a0b\u5b9e\u9a8c\u4e00\u822c\u5206\u4e3a\u4ee5\u4e0b\u51e0\u7c7b\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u534f\u8bae\u7406\u89e3\u7c7b\u5b9e\u9a8c<\/strong><br>\u5982\uff1aIP\u3001TCP\u3001UDP\u3001ARP\u3001ICMP\u3001DNS\u3001HTTP \u6293\u5305\u4e0e\u5206\u6790\u3002<\/li>\n\n\n\n<li><strong>\u7f51\u7edc\u914d\u7f6e\u7c7b\u5b9e\u9a8c<\/strong><br>\u5982\uff1aCisco \u8bbe\u5907\u914d\u7f6e\u3001\u9759\u6001\u8def\u7531\u3001\u52a8\u6001\u8def\u7531\uff08RIP\u3001OSPF\uff09\u3001VLAN\u3001ACL\u3001NAT\u3002<\/li>\n\n\n\n<li><strong>\u7f51\u7edc\u7a0b\u5e8f\u8bbe\u8ba1\u7c7b\u5b9e\u9a8c<\/strong><br>\u5982\uff1aTCP\/UDP Socket \u7f16\u7a0b\u3001HTTP \u5ba2\u6237\u7aef\u7f16\u5199\u3001\u804a\u5929\u5ba4\u5e94\u7528\u5f00\u53d1\u3002<\/li>\n\n\n\n<li><strong>\u7f51\u7edc\u5de5\u5177\u4e0e\u4eff\u771f\u5b9e\u9a8c<\/strong><br>\u5982\uff1a\u4f7f\u7528 Wireshark\u3001Packet Tracer\u3001GNS3\u3001Mininet\u3002<\/li>\n\n\n\n<li><strong>\u7f51\u7edc\u5b89\u5168\u7c7b\u5b9e\u9a8c<\/strong><br>\u5982\uff1a\u7aef\u53e3\u626b\u63cf\uff08nmap\uff09\u3001ARP \u6b3a\u9a97\u3001\u9632\u706b\u5899\u89c4\u5219\u7f16\u5199\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u53ef\u4ee5\u544a\u8bc9\u6211\u4f60\u9700\u8981\u54ea\u4e00\u79cd\uff0c\u6211\u53ef\u4ee5\u5199\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u3001\u5178\u578b\u5b9e\u9a8c\u793a\u4f8b\uff08\u53ef\u76f4\u63a5\u4f5c\u4e3a\u5b9e\u9a8c\u62a5\u544a\u5185\u5bb9\uff09<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u9762\u5217\u51fa\u5e38\u89c1\u5b9e\u9a8c\uff0c\u5e76\u63d0\u4f9b\u53ef\u64cd\u4f5c\u6b65\u9aa4\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u9a8c\u4e00\uff1aWireshark \u6293\u5305\u4e0e\u534f\u8bae\u5206\u6790<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u76ee\u7684<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u638c\u63e1\u6570\u636e\u5305\u6355\u83b7\u6d41\u7a0b<\/li>\n\n\n\n<li>\u7406\u89e3 TCP \u4e09\u6b21\u63e1\u624b\u3001\u56db\u6b21\u6325\u624b<\/li>\n\n\n\n<li>\u5206\u6790 IP\u3001TCP\u3001HTTP \u7b49\u534f\u8bae\u683c\u5f0f<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u73af\u5883<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Wireshark \u4efb\u610f\u7248\u672c<\/li>\n\n\n\n<li>Windows \/ Linux \/ MacOS<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u6b65\u9aa4<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6253\u5f00 Wireshark\uff0c\u9009\u62e9<code>Wi-Fi<\/code>\u6216<code>Ethernet<\/code>\u7f51\u5361\u3002<\/li>\n\n\n\n<li>\u5728\u6d4f\u89c8\u5668\u8bbf\u95ee\u4efb\u610f\u7f51\u7ad9\u3002<\/li>\n\n\n\n<li>Wireshark \u8f93\u5165\u8fc7\u6ee4\u6761\u4ef6\uff0c\u4f8b\u5982\uff1a\n<ul class=\"wp-block-list\">\n<li><code>tcp<\/code><\/li>\n\n\n\n<li><code>http<\/code><\/li>\n\n\n\n<li><code>ip.addr == 8.8.8.8<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u627e\u5230\u4e00\u6bb5 TCP \u8fde\u63a5\uff0c\u5206\u6790\uff1a\n<ul class=\"wp-block-list\">\n<li>\u4e09\u6b21\u63e1\u624b\uff08SYN \u2192 SYN+ACK \u2192 ACK\uff09<\/li>\n\n\n\n<li>\u6570\u636e\u4f20\u8f93\uff08PSH ACK\uff09<\/li>\n\n\n\n<li>\u56db\u6b21\u6325\u624b\uff08FIN \u2192 ACK \u2192 FIN \u2192 ACK\uff09<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u67e5\u770b HTTP \u62a5\u6587\u5934\uff1a\n<ul class=\"wp-block-list\">\n<li>GET \/ POST \u8bf7\u6c42<\/li>\n\n\n\n<li>\u72b6\u6001\u7801<\/li>\n\n\n\n<li>Content-Length\u3001Host\u3001User-Agent \u7b49\u5b57\u6bb5<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u7ed3\u679c\u793a\u4f8b<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u622a\u56fe\u4e09\u6b21\u63e1\u624b\u8fc7\u7a0b<\/li>\n\n\n\n<li>\u5206\u6790\u5305\u5934\u5b57\u6bb5<\/li>\n\n\n\n<li>\u89e3\u91ca\u6bcf\u4e2a\u5b57\u6bb5\u542b\u4e49<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u9a8c\u4e8c\uff1aTCP Socket \u7f16\u7a0b<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u76ee\u7684<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u638c\u63e1\u5ba2\u6237\u7aef\/\u670d\u52a1\u5668\u901a\u4fe1\u6d41\u7a0b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u4ee3\u7801\uff08Python \/ Java \/ C \u90fd\u53ef\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u9762\u4ee5 Java \u793a\u4f8b\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Server \u7aef<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nServerSocket server = new ServerSocket(8080);\nSocket socket = server.accept();\n\nBufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\nPrintWriter out = new PrintWriter(socket.getOutputStream(), true);\n\nString msg = in.readLine();\nSystem.out.println(&quot;\u63a5\u6536\u5230\u4fe1\u606f\uff1a&quot; + msg);\n\nout.println(&quot;\u670d\u52a1\u7aef\u5df2\u6536\u5230\uff1a&quot; + msg);\n\nsocket.close();\nserver.close();\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">Client \u7aef<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSocket socket = new Socket(&quot;127.0.0.1&quot;, 8080);\n\nBufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\nPrintWriter out = new PrintWriter(socket.getOutputStream(), true);\n\nout.println(&quot;Hello Server&quot;);\nString resp = in.readLine();\nSystem.out.println(resp);\n\nsocket.close();\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u9a8c\u4e09\uff1a\u9759\u6001\u8def\u7531\u914d\u7f6e\uff08Cisco Packet Tracer\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u76ee\u7684<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u7406\u89e3\u8def\u7531\u8f6c\u53d1\u8fc7\u7a0b\u4e0e\u9759\u6001\u8def\u7531\u8868\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u62d3\u6251<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PC1 \u2014 R1 \u2014 R2 \u2014 PC2<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u6b65\u9aa4<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 R1 \u914d\u7f6e\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nR1(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u5728 R2 \u914d\u7f6e\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nR2(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.1\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PC1 ping PC2<\/li>\n\n\n\n<li>\u82e5\u80fd\u901a\u8bf4\u660e\u9759\u6001\u8def\u7531\u751f\u6548<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u9a8c\u56db\uff1aVLAN \u914d\u7f6e\uff08\u4ea4\u6362\u673a\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u76ee\u7684<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u638c\u63e1 VLAN \u5212\u5206\u4e0e Trunk \u914d\u7f6e\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9a8c\u6b65\u9aa4<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4ea4\u6362\u673a\u4e0a\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSwitch(config)# vlan 10\nSwitch(config)# vlan 20\n\nSwitch(config)# interface fa0\/1\nSwitch(config-if)# switchport access vlan 10\n\nSwitch(config)# interface fa0\/2\nSwitch(config-if)# switchport access vlan 20\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u914d\u7f6e trunk\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSwitch(config)# interface fa0\/24\nSwitch(config-if)# switchport mode trunk\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u3001\u5e38\u89c1\u5b9e\u9a8c\u62a5\u544a\u6a21\u677f\uff08\u53ef\u76f4\u63a5\u590d\u7528\uff09<\/h1>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5b9e\u9a8c\u76ee\u7684<\/strong><\/li>\n\n\n\n<li><strong>\u5b9e\u9a8c\u73af\u5883<\/strong><\/li>\n\n\n\n<li><strong>\u5b9e\u9a8c\u5185\u5bb9\u4e0e\u6b65\u9aa4<\/strong><\/li>\n\n\n\n<li><strong>\u6293\u5305\u622a\u56fe\/\u4ee3\u7801\/\u914d\u7f6e\u547d\u4ee4<\/strong><\/li>\n\n\n\n<li><strong>\u5206\u6790\u4e0e\u7ed3\u679c<\/strong><\/li>\n\n\n\n<li><strong>\u603b\u7ed3\u4e0e\u5fc3\u5f97<\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u9700\u8981\uff0c\u6211\u53ef\u4ee5\u76f4\u63a5\u5e2e\u4f60\u5199\u5b8c\u6574\u5b9e\u9a8c\u62a5\u544a\uff08\u542b\u622a\u56fe\u63d0\u793a\u548c\u5206\u6790\uff09\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u56db\u3001\u4f60\u73b0\u5728\u53ef\u4ee5\u544a\u8bc9\u6211\uff1a<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u9700\u8981\u7684\u662f\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u54ea\u4e00\u4e2a\u5177\u4f53\u5b9e\u9a8c\uff1f<\/li>\n\n\n\n<li>\u9700\u8981\u5199\u8be6\u7ec6\u5b9e\u9a8c\u6b65\u9aa4\u8fd8\u662f\u5b8c\u6574\u5b9e\u9a8c\u62a5\u544a\u6a21\u677f\uff1f<\/li>\n\n\n\n<li>\u662f\u5426\u9700\u8981\u4ee3\u7801\u3001Cisco \u914d\u7f6e\u3001Wireshark \u6293\u5305\u89e3\u6790\uff1f<\/li>\n\n\n\n<li>\u662f\u5426\u6309\u7167\u5b66\u6821\u8981\u6c42\u683c\u5f0f\uff1f<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u53ef\u4ee5\u6309\u4f60\u7684\u5185\u5bb9\u76f4\u63a5\u8f93\u51fa\u4e00\u4e2a\u53ef\u63d0\u4ea4\u7684\u5b9e\u9a8c\u62a5\u544a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4e86\u4fbf\u4e8e\u4f60\u76f4\u63a5\u4f7f\u7528\uff0c\u6211\u5148\u7ed9\u51fa\u4e00\u4efd\u7ed3\u6784\u5b8c\u6574\u3001\u9002\u7528\u4e8e\u8bfe\u7a0b\/\u4f5c\u4e1a\/\u62a5\u544a\u7684\u201c\u8ba1\u7b97\u673a\u7f51\u7edc\u5b9e&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2025\/12\/12\/%e8%ae%a1%e7%ae%97%e6%9c%ba%e7%bd%91%e7%bb%9c%e5%ae%9e%e9%aa%8c\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-733","post","type-post","status-publish","format-standard","hentry","category-12"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=733"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/733\/revisions"}],"predecessor-version":[{"id":734,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/733\/revisions\/734"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}