{"id":5438,"date":"2020-08-18T16:15:41","date_gmt":"2020-08-18T08:15:41","guid":{"rendered":"http:\/\/39.97.231.10\/?p=5438"},"modified":"2020-08-18T16:15:41","modified_gmt":"2020-08-18T08:15:41","slug":"tcp-ip-%e5%8d%8f%e8%ae%ae%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=5438","title":{"rendered":"TCP\/IP \u534f\u8bae\u4ecb\u7ecd"},"content":{"rendered":"<header class=\\\"entry-header\\\">\n<h1 class=\\\"entry-title\\\"><span style=\\\"font-size: 1.53846rem;\\\">\u7b2c1\u7ae0 \u6982\u5ff5\u4ecb\u7ecd<\/span><\/h1>\n<\/header>\n<div class=\\\"entry-content\\\">\n<div class=\\\"single-content\\\">\n<h2><span id=\\\"11_VLAN\\\">1.1 VLAN<\/span><\/h2>\n<h3><span id=\\\"111_VLAN\\\">1.1.1\u00a0\u4ec0\u4e48\u662fVLAN<\/span><\/h3>\n<p>VLAN(Virtual LAN)\uff0c\u7ffb\u8bd1\u6210\u4e2d\u6587\u662f\u201c\u865a\u62df\u5c40\u57df\u7f51\u201d\u3002LAN\u53ef\u4ee5\u662f\u7531\u5c11\u6570\u51e0\u53f0\u5bb6\u7528\u8ba1\u7b97\u673a\u6784\u6210\u7684\u7f51\u7edc\uff0c\u4e5f\u53ef\u4ee5\u662f\u6570\u4ee5\u767e\u8ba1\u7684\u8ba1\u7b97\u673a\u6784\u6210\u7684\u4f01\u4e1a\u7f51\u7edc\u3002VLAN\u6240\u6307\u7684LAN\u7279\u6307\u4f7f\u7528\u8def\u7531\u5668\u5206\u5272\u7684\u7f51\u7edc\u2014\u2014\u4e5f\u5c31\u662f\u5e7f\u64ad\u57df\u3002<\/p>\n<h3><span id=\\\"112_VLAN\\\">1.1.2\u00a0\u5212\u5206VLAN\u7684\u76ee\u7684<\/span><\/h3>\n<p>1.\u00a0\u00a0\u00a0\u00a0\u00a0\u63d0\u9ad8\u5b89\u5168\u6027<br \/>\na)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3e\u4e2a\u4f8b\u5b50:\u6ca1\u6709\u5212\u5206VLAN\u524d,\u4ea4\u6362\u673a\u7aef\u53e3\u8fde\u63a5\u4e0b\u7684\u6240\u6709PC\u90fd\u5904\u4e8e\u4e00\u4e2aVLAN\u4e2d\u5373\u4e00\u4e2a\u5e7f\u64ad\u57df\u4e2d,\u5b9e\u73b0ARP\u4e2d\u95f4\u4eba\u653b\u51fb\u592a\u7b80\u5355\u4e86.\u5212\u5206\u4e86VLAN\u4e4b\u540e,\u7f29\u5c0f\u4e86ARP\u653b\u51fb\u7684\u8303\u56f4.ARP\u62a5\u6587\u662f\u4e00\u4e2a2.5\u5c42\u7684\u62a5\u6587,\u53ea\u80fd\u5728\u540c\u4e00\u4e2aVLAN\u4e2d\u4f20\u64ad.<br \/>\n2.\u00a0\u00a0\u00a0\u00a0\u00a0\u63d0\u9ad8\u6027\u80fd<br \/>\na)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e0d\u5212\u5206VLAN,\u6574\u4e2a\u4ea4\u6362\u673a\u90fd\u5904\u4e8e\u4e00\u4e2a\u5e7f\u64ad\u57df,\u968f\u4fbf\u4e00\u53f0PC\u53d1\u9001\u7684\u5e7f\u64ad\u62a5\u6587\u90fd\u80fd\u4f20\u9001\u6574\u4e2a\u5e7f\u57df\u64ad,\u5360\u7528\u4e86\u5f88\u591a\u5e26\u5bbd.\u5212\u5206\u4e86VLAN,\u7f29\u5c0f\u7684\u5e7f\u64ad\u57df\u7684\u5927\u5c0f,\u7f29\u5c0f\u4e86\u5e7f\u64ad\u62a5\u6587\u80fd\u591f\u5230\u8fbe\u7684\u8303\u56f4.<\/p>\n<h3><span id=\\\"113_vlan\\\">1.1.3 vlan\u00a0\u914d\u7f6e<\/span><\/h3>\n<h4><span id=\\\"1131nbspvlan_20\\\">1.1.3.1\u00a0\u521b\u5efavlan 20<\/span><\/h4>\n<div class=\\\"cnblogs_code\\\">\n<pre>Switch(config)#vlan 20\nSwitch(config-vlan)#name test   #\u7ed9vlan\u547d\u540d\nSwitch(config-vlan)#exit<\/pre>\n<\/div>\n<h4><span id=\\\"11311nbspnbspnbspnbspnbspnbsp_vlan_20\\\">1.1.3.1.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fdb\u5165\u7aef\u53e3\u5c06\u7aef\u53e3\u5206\u914d\u5230vlan 20<\/span><\/h4>\n<div class=\\\"cnblogs_code\\\">\n<pre>Switch(config)#interface FastEthernet 0\/1\nSwitch(config-if)#switchport access vlan 20<\/pre>\n<\/div>\n<h4><span id=\\\"1132nbspvlan\\\">1.1.3.2\u00a0\u67e5\u770bvlan\u7684\u4fe1\u606f<\/span><\/h4>\n<div class=\\\"cnblogs_code\\\">\n<pre>Switch#show vlan brief\nVLAN Name                             Status    Ports\n---- -------------------------------- --------- -------------------------------\n1    default                          active    Fa0\/2, Fa0\/3, Fa0\/4, Fa0\/5\n                                                Fa0\/6, Fa0\/7, Fa0\/8, Fa0\/9\n                                                Fa0\/10, Fa0\/11, Fa0\/12, Fa0\/13\n                                                Fa0\/14, Fa0\/15, Fa0\/16, Fa0\/17\n                                                Fa0\/18, Fa0\/19, Fa0\/20, Fa0\/21\n                                                Fa0\/22, Fa0\/23, Fa0\/24\n20   test                             active    Fa0\/1\n1002 fddi-default                     active\n1003 token-ring-default               active\n1004 fddinet-default                  active\n1005 trnet-default                    active<\/pre>\n<\/div>\n<h2><span id=\\\"12_DoD\\\">1.2 DoD\u53c2\u8003\u6a21\u578b<\/span><\/h2>\n<p>\u5728OSI 7\u5c42\u6a21\u578b\u7684\u57fa\u7840\u4e0a\u8fdb\u884c\u4e86\u7cbe\u7b80\u548c\u4f18\u5316\uff0c\u4ea7\u751f\u4e86DoD\u53c2\u8003\u6a21\u578b<\/p>\n<p align=\\\"center\\\"><img src=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144312147-1001503122.png\\\" alt=\\\"TCP\/IP \u534f\u8bae\u7c07 \u7aef\u53e3 \u4e09\u6b21\u63e1\u624b \u56db\u6b21\u6325\u624b 11\u79cd\u72b6\u6001\u96c6\\\" data-original=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144312147-1001503122.png\\\" \/><\/p>\n<h2><span id=\\\"13_TCPIP\\\">1.3 TCP\/IP\u00a0\u534f\u8bae\u7c07<\/span><\/h2>\n<h3><span id=\\\"131\\\">1.3.1\u00a0\u7ec4\u6210<\/span><\/h3>\n<p>TCP\/IP\u534f\u8bae\u7c07\u662fInternet\u7684\u57fa\u7840\uff0c\u4e5f\u662f\u5f53\u4eca\u6700\u6d41\u884c\u7684\u7ec4\u7f51\u5f62\u5f0f\u3002TCP\/IP\u662f\u4e00\u7ec4\u534f\u8bae\u7684\u4ee3\u540d\u8bcd\uff0c\u5305\u62ec\u8bb8\u591a\u522b\u7684\u534f\u8bae\uff0c\u7ec4\u6210\u4e86TCP\/IP\u534f\u8bae\u7c07\u3002\u5176\u4e2d\u6bd4\u8f83\u91cd\u8981\u7684\u6709SLIP\u534f\u8bae\u3001PPP\u534f\u8bae\u3001IP\u534f\u8bae\u3001ICMP\u534f\u8bae\u3001ARP\u534f\u8bae\u3001TCP\u534f\u8bae\u3001UDP\u534f\u8bae\u3001FTP\u534f\u8bae\u3001DNS\u534f\u8bae\u3001SMTP\u534f\u8bae\u7b49\u3002<\/p>\n<h3><span id=\\\"132_tcpip\\\">1.3.2 tcp\/ip\u534f\u8bae\u7c07\u4e2d\u76f8\u5173\u534f\u8bae<\/span><\/h3>\n<p align=\\\"center\\\"><img src=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144452740-1035006513.png\\\" alt=\\\"TCP\/IP \u534f\u8bae\u7c07 \u7aef\u53e3 \u4e09\u6b21\u63e1\u624b \u56db\u6b21\u6325\u624b 11\u79cd\u72b6\u6001\u96c6\\\" data-original=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144452740-1035006513.png\\\" \/><\/p>\n<h3><span id=\\\"133\\\">1.3.3\u00a0\u534f\u8bae\u540d\u79f0\u4e0e\u5bf9\u5e94\u7aef\u53e3\u53f7<\/span><\/h3>\n<table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\n<tbody>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\"><strong>\u534f\u8bae\u540d\u79f0<\/strong><\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\"><strong>\u4e2d\u6587\u91ca\u4e49<\/strong><\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\"><strong>\u534f\u8bae\u7aef\u53e3<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">FTP\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u6587\u4ef6\u4f20\u8f93\u534f\u8bae<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">21<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">SSH\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u5b89\u5168 Shell\uff08SSH\uff09\u670d\u52a1<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">22<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">Telnet\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u8fdc\u7a0b\u767b\u9646\u670d\u52a1\u7684\u6807\u51c6\u534f\u8bae<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">23<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">SMTP\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u7b80\u5355\u90ae\u4ef6\u4f20\u8f93\u534f\u8bae<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">25(UDP)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">DHCP\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u52a8\u6001\u4e3b\u673a\u914d\u7f6e\u534f\u8bae<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">67 68(UDP)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">TFTP\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u7b80\u5355\u6587\u4ef6\u4f20\u8f93\u534f\u8bae<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">69<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">HTTP\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">80\/8080<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">POP3\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u90ae\u5c40\u534f\u8bae\u7248\u672c3<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">110<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">rpc\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528\u534f\u8bae<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">111<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">SNMP\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u7b80\u5355\u7f51\u7edc\u7ba1\u7406\u534f\u8bae<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">161<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">NFS\u534f\u8bae<\/p>\n<\/td>\n<td width=\\\"33%\\\">\n<p align=\\\"center\\\">\u00a0\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf<\/p>\n<\/td>\n<td nowrap=\\\"nowrap\\\" width=\\\"33%\\\">\n<p align=\\\"center\\\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span id=\\\"134\\\">1.3.4\u00a0\u7aef\u53e3\u53f7<\/span><\/h3>\n<p>\u6807\u793a\u534f\u8bae\u4fe1\u606f\uff0c\u4fbf\u4e8e\u8ba1\u7b97\u673a\u4e4b\u95f4\u8fdb\u884c\u8bc6\u522b<br \/>\n0\u00a0\u53f7\u7aef\u53e3\u5728udp\u548ctcp\u00a0\u4e2d\u90fd\u4e0d\u4f1a\u4f7f\u7528\u3002<\/p>\n<h2><span id=\\\"14_TCP_UDP\\\">1.4 TCP\u00a0\u4e0eUDP<\/span><\/h2>\n<p>TCP\u00a0\uff08\u4f20\u8f93\u63a7\u5236\u534f\u8bae\uff09\u9762\u5411\u8fde\u63a5\u7684\u7f51\u7edc\u534f\u8bae<br \/>\nUDP\u00a0\uff08\u7528\u6237\u62a5\u6587\u534f\u8bae\uff09\u9762\u5411\u65e0\u8fde\u63a5\u7684\u7f51\u7edc\u534f\u8bae<\/p>\n<h3><span id=\\\"141_TCPUDP\\\">1.4.1 TCP\u4e0eUDP\u00a0\u534f\u8bae\u5bf9\u6bd4\uff1a<\/span><\/h3>\n<table border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\n<tbody>\n<tr>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u4f20\u8f93\u63a7\u5236\u534f\u8bae\uff08TCP\uff09<\/td>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u7528\u6237\u6570\u636e\u62a5\u534f\u8bae\uff08UDP\uff09<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u9762\u5411\u8fde\u63a5<\/td>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u65e0\u8fde\u63a5<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u53ef\u9760\u4f20\u8f93<\/td>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u4e0d\u53ef\u9760\u4f20\u8f93<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u6d41\u63a7<\/td>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u5c3d\u529b\u800c\u4e3a\uff0c\u5c3d\u529b\u4f20\u9012<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u4f7f\u7528TCP\u5e94\u7528\uff1a<br \/>\nWEB\u6d4f\u89c8\u5668\uff1b\u7535\u5b50\u90ae\u4ef6\uff1b\u6587\u4ef6\u4f20\u8f93\u670d\u52a1<\/td>\n<td valign=\\\"top\\\" width=\\\"349\\\">\u4f7f\u7528UDP\u7684\u5e94\u7528\uff1a<br \/>\n\u57df\u540d\u7cfb\u7edf \uff08DNS\uff09\uff1b\u89c6\u9891\u6d41\uff1bip\u8bed\u97f3\uff08VoIP\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span id=\\\"15_TCP\\\">1.5\u00a0TCP\u62a5\u6587\u7684\u7ed3\u6784<\/span><\/h2>\n<p align=\\\"center\\\"><img src=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144509709-466484102.png\\\" alt=\\\"TCP\/IP \u534f\u8bae\u7c07 \u7aef\u53e3 \u4e09\u6b21\u63e1\u624b \u56db\u6b21\u6325\u624b 11\u79cd\u72b6\u6001\u96c6\\\" data-original=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144509709-466484102.png\\\" \/><\/p>\n<h3><span id=\\\"151_ACK\\\">1.5.1\u00a0\u786e\u8ba4\u5b57\u6bb5ACK<\/span><\/h3>\n<p>\u5f53ACK=1\u65f6\uff0c\u8868\u793a\u786e\u8ba4\uff0c\u4e14\u786e\u8ba4\u53f7\u6709\u6548\uff1b\u5f53ACK=0\u65f6\uff0c\u786e\u8ba4\u53f7\u5b57\u6bb5\u65e0\u6548<\/p>\n<h3><span id=\\\"152_SYN\\\">1.5.2\u00a0\u8bf7\u6c42\u8fde\u63a5\u5b57\u6bb5\u00a0SYN<\/span><\/h3>\n<p>\u5f53SYN=1\u65f6\uff0c\u8868\u793a\u53d1\u8d77\u4e00\u4e2a\u8fde\u63a5\u8bf7\u6c42\u3002<\/p>\n<h3><span id=\\\"153_FIN\\\">1.5.3\u00a0\u65ad\u5f00\u8fde\u63a5\u5b57\u6bb5FIN<\/span><\/h3>\n<p>\u7528\u6765\u91ca\u653e\u8fde\u63a5\u3002\u5f53FIN=1\u65f6\uff0c\u8868\u660e\u6b64\u62a5\u6587\u6bb5\u7684\u53d1\u9001\u7aef\u7684\u6570\u636e\u5df2\u53d1\u9001\u5b8c\u6210\uff0c\u5e76\u8981\u6c42\u91ca\u653e\u8fde\u63a5\u3002<\/p>\n<h3><span id=\\\"154_nbsp\\\">1.5.4\u00a0\u5e8f\u53f7\u00a0<\/span><\/h3>\n<p>\u6bcf\u4e00\u4e2aTCP\u62a5\u6587\u6bb5\u90fd\u4f1a\u6709\u4e00\u4e2a\u5e8f\u53f7\uff0c\u5e8f\u53f7\u5b57\u6bb5\u7684\u503c\u5176\u5b9e\u662f\u672c\u62a5\u6587\u6bb5\u6240\u53d1\u9001\u7684\u6570\u636e\u7684\u7b2c\u4e00\u4e2a\u5b57\u8282\u7684\u5e8f\u53f7\u3002<br \/>\n\u8fd9\u662f\u56e0\u4e3aTCP\u662f\u9762\u5411\u8fde\u63a5\u7684\u53ef\u9760\u670d\u52a1\uff0c\u5176\u6bcf\u4e00\u4e2a\u5b57\u8282\u90fd\u4f1a\u5bf9\u5e94\u4e00\u4e2a\u5e8f\u53f7\uff0c\u901a\u8fc7\u5e8f\u53f7\u6765\u786e\u4fdd\u670d\u52a1\u7684\u53ef\u9760\u6027\u548c\u6709\u5e8f\u6027\u3002<\/p>\n<h3><span id=\\\"155\\\">1.5.5\u00a0\u786e\u8ba4\u53f7<\/span><\/h3>\n<p>\u786e\u8ba4\u53f7\uff0c\u662f\u671f\u671b\u6536\u5230\u5bf9\u65b9\u7684\u4e0b\u4e00\u4e2a\u62a5\u6587\u6bb5\u7684\u6570\u636e\u7684\u7b2c\u4e00\u4e2a\u5b57\u8282\u7684\u5e8f\u53f7\u3002<\/p>\n<h4><span id=\\\"1551nbsp_nbspnbsp\\\">1.5.5.1\u00a0\u5e8f\u53f7\u4e0e\u786e\u8ba4\u53f7\u00a0<strong>\u00a0\u00a0<\/strong><\/span><\/h4>\n<blockquote><p>\u53d1\u9001\u7aef\u53d1\u9001\u4e00\u4e2aseq\u5e8f\u5217\u53f7x\uff0c\u63a5\u6536\u7aef\u9700\u8981\u56de\u590d\u4e00\u4e2a\u786e\u8ba4\u53f7x+1\uff0c\u5e76\u53d1\u9001\u4e00\u4e2a\u5e8f\u5217\u53f7Y<br \/>\n\u53d1\u9001\u7aef\u63a5\u6536\u4e00\u4e2aseq\u5e8f\u5217\u53f7y\uff0c\u63a5\u6536\u7aef\u9700\u8981\u56de\u590d\u4e00\u4e2a\u786e\u8ba4\u53f7y+1<\/p><\/blockquote>\n<h1><span id=\\\"2\\\">\u7b2c2\u7ae0\u00a0\u4e09\u6b21\u63e1\u624b\u4e0e\u56db\u6b21\u6325\u624b<\/span><\/h1>\n<h2><span id=\\\"21\\\">2.1\u00a0\u4e09\u6b21\u63e1\u624b<\/span><\/h2>\n<p align=\\\"center\\\"><img src=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144422584-1555079527.png\\\" alt=\\\"TCP\/IP \u534f\u8bae\u7c07 \u7aef\u53e3 \u4e09\u6b21\u63e1\u624b \u56db\u6b21\u6325\u624b 11\u79cd\u72b6\u6001\u96c6\\\" data-original=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144422584-1555079527.png\\\" \/><\/p>\n<h3><span id=\\\"211\\\">2.1.1\u00a0\u542b\u4e49<\/span><\/h3>\n<p>\uff081\uff09\u5ba2\u6237\u00a0\u7aef\u53d1\u9001\u4e00\u4e2a\u5e26SYN\u6807\u5fd7\u7684TCP\u62a5\u6587\u5230\u670d\u52a1\u5668\u3002<br \/>\n\uff082\uff09\u00a0\u670d\u52a1\u5668\u7aef\u56de\u5e94\u5ba2\u6237\u7aef\u7684\uff0c\u8fd9\u4e2a\u62a5\u6587\u540c\u65f6\u5e26ACK\u6807\u5fd7\u548cSYN\u6807\u5fd7\u3002\u56e0\u6b64\u5b83\u8868\u793a\u5bf9\u521a\u624d\u5ba2\u6237\u7aefSYN\u62a5\u6587\u7684\u56de\u5e94\uff1b\u540c\u65f6\u53c8\u6807\u5fd7SYN\u7ed9\u5ba2\u6237\u7aef\uff0c\u8be2\u95ee\u5ba2\u6237\u7aef\u662f\u5426\u51c6\u5907\u597d\u8fdb\u884c\u6570\u636e\u901a\u8baf\u3002<br \/>\n\uff083\uff09\u00a0\u5ba2\u6237\u5fc5\u987b\u518d\u6b21\u56de\u5e94\u670d\u52a1\u6bb5\u4e00\u4e2aACK\u62a5\u6587\u3002<\/p>\n<h3><span id=\\\"212\\\">2.1.2\u00a0\u4e94\u79cd\u72b6\u6001<\/span><\/h3>\n<table border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\n<tbody>\n<tr>\n<td valign=\\\"top\\\" width=\\\"189\\\"><strong>LISTEN\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"508\\\">\u4fa6\u542c\u6765\u81ea\u8fdc\u65b9TCP\u7aef\u53e3\u7684\u8fde\u63a5\u8bf7\u6c42\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"189\\\"><strong>SYN-SENT\u00a0\u00a0\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"508\\\">\u5728\u53d1\u9001\u8fde\u63a5\u8bf7\u6c42\u540e\u7b49\u5f85\u5339\u914d\u7684\u8fde\u63a5\u8bf7\u6c42\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"189\\\"><strong>SYN-RECEIVED<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"508\\\">\u5728\u6536\u5230\u548c\u53d1\u9001\u4e00\u4e2a\u8fde\u63a5\u8bf7\u6c42\u540e\u7b49\u5f85\u5bf9\u8fde\u63a5\u8bf7\u6c42\u7684\u786e\u8ba4<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"189\\\"><strong>ESTABLISHED\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"508\\\">\u4ee3\u8868\u4e00\u4e2a\u6253\u5f00\u7684\u8fde\u63a5\uff0c\u6570\u636e\u53ef\u4ee5\u4f20\u9001\u7ed9\u7528\u6237\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"189\\\"><strong>CLOSED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"508\\\">\u6ca1\u6709\u4efb\u4f55\u8fde\u63a5\u72b6\u6001\uff1b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span id=\\\"22\\\">2.2\u00a0\u56db\u6b21\u6325\u624b<\/span><\/h2>\n<h3><span id=\\\"221\\\">2.2.1\u00a0\u6587\u5b57\u8bf4\u660e<\/span><\/h3>\n<p>\uff081\uff09\u00a0TCP\u5ba2\u00a0\u6237\u7aef\u53d1\u9001\u4e00\u4e2aFIN\uff0c\u7528\u6765\u5173\u95ed\u5ba2\u6237\u5230\u670d\u52a1\u5668\u7684\u6570\u636e\u4f20\u9001\u3002<br \/>\n\uff082\uff09\u00a0\u670d\u52a1\u5668\u6536\u5230\u8fd9\u4e2aFIN\uff0c\u5b83\u53d1\u56de\u4e00\u4e2aACK\uff0c\u786e\u8ba4\u5e8f\u53f7\u4e3a\u6536\u5230\u7684\u5e8f\u53f7\u52a01\u3002\u548cSYN\u4e00\u00a0\u6837\uff0c\u4e00\u4e2aFIN\u5c06\u5360\u7528\u4e00\u4e2a\u5e8f\u53f7\u3002<br \/>\n\uff083\uff09\u00a0\u670d\u52a1\u5668\u5173\u95ed\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\uff0c\u53d1\u9001\u4e00\u4e2aFIN\u7ed9\u5ba2\u6237\u7aef\u3002<br \/>\n\uff084\uff09\u00a0\u5ba2\u6237\u6bb5\u53d1\u56deACK\u62a5\u6587\u786e\u8ba4\uff0c\u5e76\u5c06\u786e\u8ba4\u5e8f\u53f7\u8bbe\u7f6e\u4e3a\u6536\u5230\u5e8f\u53f7\u52a01\u3002<\/p>\n<h3><span id=\\\"222\\\">2.2.2\u00a0\u4e00\u5f62\u6001<\/span><\/h3>\n<p align=\\\"center\\\"><img src=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144536178-643617042.png\\\" alt=\\\"TCP\/IP \u534f\u8bae\u7c07 \u7aef\u53e3 \u4e09\u6b21\u63e1\u624b \u56db\u6b21\u6325\u624b 11\u79cd\u72b6\u6001\u96c6\\\" data-original=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144536178-643617042.png\\\" \/><\/p>\n<h3><span id=\\\"223\\\">2.2.3\u00a0\u5728\u56db\u6b21\u63e1\u624b\u4e2d\u7684\u72b6\u6001\u96c6<\/span><\/h3>\n<table border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\n<tbody>\n<tr>\n<td valign=\\\"top\\\" width=\\\"179\\\"><strong>ESTABLISHED<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"518\\\">\u4ee3\u8868\u4e00\u4e2a\u6253\u5f00\u7684\u8fde\u63a5\uff0c\u6570\u636e\u53ef\u4ee5\u4f20\u9001\u7ed9\u7528\u6237\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"179\\\"><strong>FIN-WAIT1\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"518\\\">\u7b49\u5f85\u8fdc\u7a0bTCP\u7684\u8fde\u63a5\u4e2d\u65ad\u8bf7\u6c42\uff0c\u6216\u5148\u524d\u7684\u8fde\u63a5\u4e2d\u65ad\u8bf7\u6c42\u7684\u786e\u8ba4\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"179\\\"><strong>FIN-WAIT2\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"518\\\">\u4ece\u8fdc\u7a0bTCP\u7b49\u5f85\u8fde\u63a5\u4e2d\u65ad\u8bf7\u6c42\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"179\\\"><strong>CLOSE-WAIT\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"518\\\">\u7b49\u5f85\u4ece\u672c\u5730\u7528\u6237\u53d1\u6765\u7684\u8fde\u63a5\u4e2d\u65ad\u8bf7\u6c42\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"179\\\"><strong>CLOSING\u00a0\u00a0\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"518\\\">\u7b49\u5f85\u8fdc\u7a0bTCP\u5bf9\u8fde\u63a5\u4e2d\u65ad\u7684\u786e\u8ba4\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"179\\\"><strong>LAST-ACK\u00a0\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"518\\\">\u7b49\u5f85\u539f\u6765\u53d1\u5411\u8fdc\u7a0bTCP\u7684\u8fde\u63a5\u4e2d\u65ad\u8bf7\u6c42\u7684\u786e\u8ba4\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"179\\\"><strong>TIME-WAIT\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"518\\\">\u7b49\u5f85\u8db3\u591f\u7684\u65f6\u95f4\u4ee5\u786e\u4fdd\u8fdc\u7a0bTCP\u63a5\u6536\u5230\u8fde\u63a5\u4e2d\u65ad\u8bf7\u6c42\u7684\u786e\u8ba4\uff1b<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"179\\\"><strong>CLOSED\u00a0\u00a0\u00a0\u00a0\u00a0<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"518\\\">\u6ca1\u6709\u4efb\u4f55\u8fde\u63a5\u72b6\u6001\uff1b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span id=\\\"224_CLOSING\\\">2.2.4\u00a0\u7b2c\u4e8c\u79cd\u5f62\u6001\uff08CLOSING\uff09<\/span><\/h3>\n<p><img src=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144556912-120110367.png\\\" alt=\\\"TCP\/IP \u534f\u8bae\u7c07 \u7aef\u53e3 \u4e09\u6b21\u63e1\u624b \u56db\u6b21\u6325\u624b 11\u79cd\u72b6\u6001\u96c6\\\" data-original=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144556912-120110367.png\\\" \/><\/p>\n<h2><span id=\\\"23\\\">2.3\u00a0\u5341\u4e00\u79cd\u72b6\u6001\u96c6<\/span><\/h2>\n<p><img src=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144639850-1415177562.png\\\" alt=\\\"TCP\/IP \u534f\u8bae\u7c07 \u7aef\u53e3 \u4e09\u6b21\u63e1\u624b \u56db\u6b21\u6325\u624b 11\u79cd\u72b6\u6001\u96c6\\\" data-original=\\\"https:\/\/clsn.io\/wp-content\/uploads\/2018\/03\/1190037-20180122144639850-1415177562.png\\\" \/><\/p>\n<h2><span id=\\\"24_procsysnetipv4ip_local_port_range\\\">2.4\u00a0\u968f\u673a\u7aef\u53e3\u53f7\u8303\u56f4(\/proc\/sys\/net\/ipv4\/ip_local_port_range\u00a0\u6587\u4ef6)<\/span><\/h2>\n<div class=\\\"cnblogs_code\\\">\n<pre>[root@clsn ~]# cat \/proc\/sys\/net\/ipv4\/ip_local_port_range\n32768   60999<\/pre>\n<\/div>\n<h2><span id=\\\"25_socketnbsp\\\">2.5 socket\u00a0\u00a0\u76d1\u542c<\/span><\/h2>\n<h3><span id=\\\"251\\\">2.5.1\u00a0\u76d1\u542c\u72b6\u6001<\/span><\/h3>\n<div class=\\\"cnblogs_code\\\">\n<pre>[root@clsn ~]# netstat -lntup|grep sshd\ntcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1140\/sshd\ntcp        0      0 :::22                       :::*                        LISTEN      1140\/sshd\n[root@clsn ~]# netstat -an|grep ES\ntcp        0     64 10.0.0.201:22               10.0.0.1:3868               ESTABLISHED<\/pre>\n<\/div>\n<h3><span id=\\\"252_socket\\\">2.5.2 socket\u00a0\u6761\u76ee\u00a0\u4e94\u5143\u7ec4\u6982\u5ff5<\/span><\/h3>\n<p>1\u3001\u534f\u8bae\u00a0tcp udp<br \/>\n2\u3001\u76ee\u6807ip\u5730\u5740<br \/>\n3\u3001\u76ee\u6807\u4e3b\u673a\u7aef\u53e3\u53f7<br \/>\n4\u3001\u6e90ip\u5730\u5740<br \/>\n5\u3001\u6e90\u7aef\u53e3\u53f7<\/p>\n<h2><span id=\\\"26_ssh\\\">2.6 ssh\u670d\u52a1\u5173\u95ed\u00a0\u4e3a\u4ec0\u4e48\u8fde\u63a5\u4e0d\u65ad<\/span><\/h2>\n<div class=\\\"cnblogs_code\\\">\n<pre>[root@clsn ~]# ps -ef |grep sshd\nroot       1140      1  0 Sep25 ?        00:00:00 \/usr\/sbin\/sshd\nroot       5861   1140  0 11:40 ?        00:00:00 sshd: root@pts\/0\nroot       5881   5863  0 11:40 pts\/0    00:00:00 grep --color=auto sshd\n[root@clsn ~]# \/etc\/init.d\/sshd stop\nStopping sshd:                                             [  OK  ]\n[root@clsn ~]# ps -ef |grep sshd\nroot       5861      1  0 11:40 ?        00:00:00 sshd: root@pts\/0\nroot       5899   5863  0 11:41 pts\/0    00:00:00 grep --color=auto sshd<\/pre>\n<\/div>\n<p>\u56e0\u4e3a\u6709\u4e00\u4e2a\u8fde\u63a5\u7684\u8fdb\u7a0b\u5b58\u5728\u3002<br \/>\n\u6ca1\u6709\u8fdb\u7a0b\u5c31\u4f1a\u65ad\u5f00\u3002<\/p>\n<h2><span id=\\\"27\\\">2.7\u00a0\u7f51\u7edc\u4e2d\u7684\u6ed1\u52a8\u7a97\u53e3<\/span><\/h2>\n<p>\u539f\u7406\uff1a<br \/>\nTCP\u4f7f\u7528\u7a97\u53e3\u673a\u5236\u8fdb\u884c\u6d41\u91cf\u63a7\u5236\u3002\u5f53\u8fde\u63a5\u5efa\u7acb\u540e\uff0c\u53d1\u9001\u65b9\u548c\u63a5\u6536\u65b9\u90fd\u8981\u5206\u914d\u4e00\u5757\u81ea\u5df1\u7684\u7f13\u51b2\u533a\u6765\u5b58\u50a8\u63a5\u6536\u7684\u6570\u636e\uff0c\u4e3a\u4e86\u9632\u6b62\u5c31\u6536\u65b9\u5df2\u7ecf\u6ca1\u6709\u7f13\u51b2\u533a\u8fdb\u884c\u63a5\u6536\u800c\u53d1\u9001\u65b9\u5728\u5728\u7ee7\u7eed\u53d1\u9001\uff0c\u51fa\u73b0\u7f51\u7edc\u62e5\u585e\u548c\u6545\u969c\u3002\u6240\u4ee5\u7528\u6ed1\u52a8\u7a97\u53e3\u8fdb\u884c\u4e86\u6d41\u63a7\u3002<br \/>\n\u5177\u4f53\u5b9e\u73b0\uff1a<br \/>\n\u63a5\u6536\u65b9\u5c06\u7f13\u51b2\u533a\u5269\u4f59\u7684\u5c3a\u5bf8\u548c\u671f\u5f85\u63a5\u6536\u7684\u4e0b\u4e00\u4e2a\u5b57\u8282\u5e8f\u53f7\u5728\u786e\u8ba4\u4fe1\u606f\u4e2d\u53d1\u9001\u7ed9\u53d1\u9001\u65b9\uff0c\u53d1\u9001\u65b9\u6839\u636e\u63a5\u6536\u65b9\u5269\u4f59\u7684\u5927\u5c0f\u7a7a\u95f4\u6765\u5b9a\u91cf\u7684\u53d1\u9001\u5408\u9002\u7684\u6570\u636e\u7ed9\u63a5\u6536\u65b9\u3002\u5b83\u4e5f\u662f\u5efa\u7acb\u5728\u201c\u786e\u8ba4\u91cd\u4f20\u201d\u7684\u57fa\u7840\u4e4b\u4e0a\u3002<\/p>\n<h2><span id=\\\"28\\\">2.8\u00a0\u7f51\u7edc\u4e2d\u8ff7\u9014\u60c5\u51b5<\/span><\/h2>\n<p>\u524d\u4e00\u4e2a\u8fde\u63a5\u6ca1\u6709\u53ca\u65f6\u5230\u8fbe\uff0c\u65b0\u7684\u8fde\u63a5\u53c8\u4ea7\u751f\u3002\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c1\u7ae0 \u6982\u5ff5\u4ecb\u7ecd 1.1 VLAN 1.1.1\u00a0\u4ec0\u4e48\u662fVLAN VLAN(Virtual LAN)\uff0c\u7ffb\u8bd1\u6210\u4e2d\u6587 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=5438\"> <span class=\"screen-reader-text\">TCP\/IP \u534f\u8bae\u4ecb\u7ecd<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","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":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[102,124],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"\u7b2c1\u7ae0 \u6982\u5ff5\u4ecb\u7ecd 1.1 VLAN 1.1.1\u00a0\u4ec0\u4e48\u662fVLAN VLAN(Virtual LAN)\uff0c\u7ffb\u8bd1\u6210\u4e2d\u6587&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5438"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5438"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5438\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5438"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}