{"id":123171,"date":"2018-10-11T08:58:08","date_gmt":"2018-10-11T00:58:08","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=123171"},"modified":"2018-10-08T08:59:05","modified_gmt":"2018-10-08T00:59:05","slug":"tcp-protocol","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/tcp-protocol.html","title":{"rendered":"TCP\/IP\u5b66\u4e60\u7b14\u8bb0\uff088\uff09-tcp\u534f\u8bae"},"content":{"rendered":"
\u7ec8\u4e8e\u770b\u5230\u4e86TCP\u534f\u8bae\uff0c\u8fd9\u662fTCP\/IP\u8be6\u89e3\u91cc\u9762\u6700\u91cd\u8981\u4e5f\u662f\u6700\u7cbe\u5f69\u7684\u90e8\u5206\uff0c\u8981\u82b1\u5927\u529b\u6c14\u6765\u8bfb\u3002<\/p>\n
TCP\u548cUDP\u5904\u5728\u540c\u4e00\u5c42---\u4f20\u8f93\u5c42\uff0c\u4f46\u662fTCP\u548cUDP\u6700\u4e0d\u540c\u7684\u5730\u65b9\u662f\uff0cTCP\u63d0\u4f9b\u4e86\u4e00\u79cd\u53ef\u9760\u7684\u6570\u636e\u4f20\u8f93\u670d\u52a1\uff0cTCP\u662f\u9762\u5411\u8fde\u63a5\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5229\u7528TCP\u901a\u4fe1\u7684\u4e24\u53f0\u4e3b\u673a\u9996\u5148\u8981\u7ecf\u5386\u4e00\u4e2a\u201c\u62e8\u6253\u7535\u8bdd\u201d\u7684\u8fc7\u7a0b\uff0c\u7b49\u5230\u901a\u4fe1\u51c6\u5907\u7ed3\u675f\u624d\u5f00\u59cb\u4f20\u8f93\u6570\u636e\uff0c\u6700\u540e\u7ed3\u675f\u901a\u8bdd\u3002\u6240\u4ee5TCP\u8981\u6bd4UDP\u53ef\u9760\u7684\u591a\uff0cUDP\u662f\u628a\u6570\u636e\u76f4\u63a5\u53d1\u51fa\u53bb\uff0c\u800c\u4e0d\u7ba1\u5bf9\u65b9\u662f\u4e0d\u662f\u5728\u6536\u4fe1\uff0c\u5c31\u7b97\u662fUDP\u65e0\u6cd5\u9001\u8fbe\uff0c\u4e5f\u4e0d\u4f1a\u4ea7\u751fICMP\u5dee\u9519\u62a5\u6587\uff0c\u8fd9\u4e00\u7ecf\u65f6\u91cd\u7533\u4e86\u5f88\u591a\u904d\u4e86\u3002<\/p>\n
\u628aTCP\u4fdd\u8bc1\u53ef\u9760\u6027\u7684\u7b80\u5355\u5de5\u4f5c\u539f\u7406\u6458\u6284\u5982\u4e0b\uff1a
\n1. \u5e94\u7528\u6570\u636e\u88ab\u5206\u5272\u6210TCP\u8ba4\u4e3a\u6700\u9002\u5408\u53d1\u9001\u7684\u6570\u636e\u5757\u3002\u8fd9\u548cUDP\u5b8c\u5168\u4e0d\u540c\uff0c\u5e94\u7528\u7a0b\u5e8f\u4ea7\u751f\u7684 \u6570\u636e\u62a5\u957f\u5ea6\u5c06\u4fdd\u6301\u4e0d\u53d8\u3002\u7531TCP\u4f20\u9012\u7ed9IP\u7684\u4fe1\u606f\u5355\u4f4d\u79f0\u4e3a\u62a5\u6587\u6bb5\u6216\u6bb5\uff08 segment\uff09\u3002
\n2. \u5f53TCP\u53d1\u51fa\u4e00\u4e2a\u6bb5\u540e\uff0c\u5b83\u542f\u52a8\u4e00\u4e2a\u5b9a\u65f6\u5668\uff0c\u7b49\u5f85\u76ee\u7684\u7aef\u786e\u8ba4\u6536\u5230\u8fd9\u4e2a\u62a5\u6587\u6bb5\u3002\u5982\u679c\u4e0d\u80fd \u53ca\u65f6\u6536\u5230\u4e00\u4e2a\u786e\u8ba4\uff0c\u5c06\u91cd\u53d1\u8fd9\u4e2a\u62a5\u6587\u6bb5\u3002
\n3. \u5f53TCP\u6536\u5230\u53d1\u81eaTCP\u8fde\u63a5\u53e6\u4e00\u7aef\u7684\u6570\u636e\uff0c\u5b83\u5c06\u53d1\u9001\u4e00\u4e2a\u786e\u8ba4\u3002\u8fd9\u4e2a\u786e\u8ba4\u4e0d\u662f\u7acb\u5373\u53d1\u9001\uff0c\u901a\u5e38\u5c06\u63a8\u8fdf\u51e0\u5206\u4e4b\u4e00\u79d2\u3002
\n4. TCP\u5c06\u4fdd\u6301\u5b83\u9996\u90e8\u548c\u6570\u636e\u7684\u68c0\u9a8c\u548c\u3002\u8fd9\u662f\u4e00\u4e2a\u7aef\u5230\u7aef\u7684\u68c0\u9a8c\u548c\uff0c\u76ee\u7684\u662f\u68c0\u6d4b\u6570\u636e\u5728\u4f20\u8f93 \u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u53d8\u5316\u3002\u5982\u679c\u6536\u5230\u6bb5\u7684\u68c0\u9a8c\u548c\u6709\u5dee\u9519\uff0c T P\u5c06\u4e22\u5f03\u8fd9\u4e2a\u62a5\u6587\u6bb5\u548c\u4e0d\u786e\u8ba4\u6536\u5230\u6b64\u62a5\u6587\u6bb5\uff08\u5e0c\u671b\u53d1\u7aef\u8d85\u65f6\u5e76\u91cd\u53d1\uff09\u3002
\n5. \u65e2\u7136TCP\u62a5\u6587\u6bb5\u4f5c\u4e3aIP\u6570\u636e\u62a5\u6765\u4f20\u8f93\uff0c\u800cIP\u6570\u636e\u62a5\u7684\u5230\u8fbe\u53ef\u80fd\u4f1a\u5931\u5e8f\uff0c\u56e0\u6b64TCP\u62a5\u6587\u6bb5 \u7684\u5230\u8fbe\u4e5f\u53ef\u80fd\u4f1a\u5931\u5e8f\u3002\u5982\u679c\u5fc5\u8981\uff0c TCP\u5c06\u5bf9\u6536\u5230\u7684\u6570\u636e\u8fdb\u884c\u91cd\u65b0\u6392\u5e8f\uff0c\u5c06\u6536\u5230\u7684\u6570\u636e\u4ee5\u6b63\u786e\u7684\u987a\u5e8f\u4ea4\u7ed9\u5e94\u7528\u5c42\u3002
\n6. TCP\u8fd8\u80fd\u63d0\u4f9b\u6d41\u91cf\u63a7\u5236\u3002TCP\u8fde\u63a5\u7684\u6bcf\u4e00\u65b9\u90fd\u6709\u56fa\u5b9a\u5927\u5c0f\u7684\u7f13\u51b2\u7a7a\u95f4\u3002TCP\u7684\u63a5\u6536\u7aef\u53ea\u5141\u8bb8\u53e6\u4e00\u7aef\u53d1\u9001\u63a5\u6536\u7aef\u7f13\u51b2\u533a\u6240\u80fd\u63a5\u7eb3\u7684\u6570\u636e\u3002\u8fd9\u5c06\u9632\u6b62\u8f83\u5feb\u4e3b\u673a\u81f4\u4f7f\u8f83\u6162\u4e3b\u673a\u7684\u7f13\u51b2\u533a\u6ea2\u51fa\u3002
\n\u4ece\u8fd9\u6bb5\u8bdd\u4e2d\u53ef\u4ee5\u770b\u5230\uff0cTCP\u4e2d\u4fdd\u6301\u53ef\u9760\u6027\u7684\u65b9\u5f0f\u5c31\u662f\u8d85\u65f6\u91cd\u53d1\uff0c\u8fd9\u662f\u6709\u9053\u7406\u7684\uff0c\u867d\u7136TCP\u4e5f\u53ef\u4ee5\u7528\u5404\u79cd\u5404\u6837\u7684ICMP\u62a5\u6587\u6765\u5904\u7406\u8fd9\u4e9b\uff0c\u4f46\u662f\u8fd9\u4e5f\u4e0d\u662f\u53ef\u9760\u7684\uff0c\u6700\u53ef\u9760\u7684\u65b9\u5f0f\u5c31\u662f\u53ea\u8981\u4e0d\u5f97\u5230\u786e\u8ba4\uff0c\u5c31\u91cd\u65b0\u53d1\u9001\u6570\u636e\u62a5\uff0c\u76f4\u5230\u5f97\u5230\u5bf9\u65b9\u7684\u786e\u8ba4\u4e3a\u6b62\u3002<\/p>\n
TCP\u7684\u9996\u90e8\u548cUDP\u9996\u90e8\u4e00\u6837\uff0c\u90fd\u6709\u53d1\u9001\u7aef\u53e3\u53f7\u548c\u63a5\u6536\u7aef\u53e3\u53f7\u3002\u4f46\u662f\u663e\u7136\uff0cTCP\u7684\u9996\u90e8\u4fe1\u606f\u8981\u6bd4UDP\u7684\u591a\uff0c\u53ef\u4ee5\u770b\u5230\uff0cTCP\u534f\u8bae\u63d0\u4f9b\u4e86\u53d1\u9001\u548c\u786e\u8ba4\u6240\u9700\u8981\u7684\u6240\u6709\u5fc5\u8981\u7684\u4fe1\u606f\u3002\u53ef\u4ee5\u60f3\u8c61\u4e00\u4e2aTCP\u6570\u636e\u7684\u53d1\u9001\u5e94\u8be5\u662f\u5982\u4e0b\u7684\u4e00\u4e2a\u8fc7\u7a0b\u3002
\n1. \u53cc\u65b9\u5efa\u7acb\u8fde\u63a5
\n2. \u53d1\u9001\u65b9\u7ed9\u63a5\u53d7\u65b9TCP\u6570\u636e\u62a5\uff0c\u7136\u540e\u7b49\u5f85\u5bf9\u65b9\u7684\u786e\u8ba4TCP\u6570\u636e\u62a5\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u5c31\u91cd\u65b0\u53d1\uff0c\u5982\u679c\u6709\uff0c\u5c31\u53d1\u9001\u4e0b\u4e00\u4e2a\u6570\u636e\u62a5\u3002
\n3. \u63a5\u53d7\u65b9\u7b49\u5f85\u53d1\u9001\u65b9\u7684\u6570\u636e\u62a5\uff0c\u5982\u679c\u5f97\u5230\u6570\u636e\u62a5\u5e76\u68c0\u9a8c\u65e0\u8bef\uff0c\u5c31\u53d1\u9001ACK(\u786e\u8ba4)\u6570\u636e\u62a5\uff0c\u5e76\u7b49\u5f85\u4e0b\u4e00\u4e2aTCP\u6570\u636e\u62a5\u7684\u5230\u6765\u3002\u76f4\u5230\u63a5\u6536\u5230FIN(\u53d1\u9001\u5b8c\u6210\u6570\u636e\u62a5)\u3002
\n4. \u4e2d\u6b62\u8fde\u63a5
\n\u53ef\u4ee5\u60f3\u89c1\uff0c\u4e3a\u4e86\u5efa\u7acb\u4e00\u4e2aTCP\u8fde\u63a5\uff0c\u7cfb\u7edf\u53ef\u80fd\u4f1a\u5efa\u7acb\u4e00\u4e2a\u65b0\u7684\u8fdb\u7a0b\uff08\u6700\u5dee\u4e5f\u662f\u4e00\u4e2a\u7ebf\u7a0b\uff09\uff0c\u6765\u8fdb\u884c\u6570\u636e\u7684\u4f20\u9001\u3002<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.cnblogs.com\/fengzanfeng\/articles\/1339347.html<\/a><\/p>\n