{"id":8176,"date":"2024-06-20T07:01:01","date_gmt":"2024-06-19T23:01:01","guid":{"rendered":""},"modified":"2024-06-20T07:01:01","modified_gmt":"2024-06-19T23:01:01","slug":"route\u547d\u4ee4\u8be6\u89e3_\u7a0b\u5e8f\u5458\u5fc5\u5907\u7684\u5b66\u4e60\u7b14\u8bb0\u300aTCP\/IP\u8be6\u89e3\u300bIP\u9009\u8def\u3001\u52a8\u6001\u9009\u8def\u3001UDP \u534f\u8bae...","status":"publish","type":"post","link":"https:\/\/mushiming.com\/8176.html","title":{"rendered":"route\u547d\u4ee4\u8be6\u89e3_\u7a0b\u5e8f\u5458\u5fc5\u5907\u7684\u5b66\u4e60\u7b14\u8bb0\u300aTCP\/IP\u8be6\u89e3\u300bIP\u9009\u8def\u3001\u52a8\u6001\u9009\u8def\u3001UDP \u534f\u8bae..."},"content":{"rendered":"
\u9009\u8def\u662f IP \u5c42\u6700\u91cd\u8981\u7684\u4e00\u4e2a\u529f\u80fd\u4e4b\u4e00\u3002\u524d\u9762\u7684\u90e8\u5206\u5df2\u7ecf\u7b80\u5355\u7684\u8bb2\u8fc7\u8def\u7531\u5668\u662f\u901a\u8fc7\u4f55\u79cd\u89c4\u5219\u6765\u6839\u636e IP \u6570\u636e\u5305\u7684 IP \u5730\u5740\u6765\u9009\u62e9\u8def\u7531\u3002 \u8fd9\u91cc\u5c31\u4e0d\u91cd\u590d\u4e86\u3002\u9996\u5148\u6765\u770b\u770b\u4e00\u4e2a\u7b80\u5355\u7684\u7cfb\u7edf\u8def\u7531\u8868\uff1a<\/strong><\/p>\n \u5bf9\u4e8e\u4e00\u4e2a\u7ed9\u5b9a\u7684\u8def\u7531\u5668,\u53ef\u4ee5\u6253\u5370\u51fa\u4e94\u79cd\u4e0d\u540c\u7684 flag\uff1a<\/strong><\/p>\n U \u6ca1\u5565\u53ef\u8bf4\u7684,G \u8bf4\u660e\u8fd9\u662f\u4e00\u4e2a\u7f51\u5173,\u5982\u679c\u4f60\u8981\u53d1\u6570\u636e\u7ed9 Destination,IP \u5934\u5e94\u8be5\u5199 Destination \u7684 IP \u5730\u5740,\u800c\u6570\u636e\u94fe\u8def\u5c42\u7684 MAC\u5730\u5740\u5c31\u5e94\u8be5\u662f GateWay \u7684 Mac \u5730\u5740\u4e86;\u53cd\u4e4b,\u5982\u679c\u6ca1\u6709 G \u6807\u5fd7,\u90a3\u4e48\u6570\u636e\u94fe\u8def\u5c42\u548c IP \u5c42\u7684\u5730\u5740\u5e94\u8be5\u662f\u5bf9\u5e94\u7684\u3002H \u8bf4\u660e\u4e86 Destination \u7684 \u6027\u8d28,\u5982\u679c\u662f H \u7684,\u5219\u8bf4\u660e\u8be5\u5730\u5740\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u5730\u5740,\u65e2\u6709\u7f51\u7edc\u53f7\u53c8\u6709\u4e3b\u673a\u53f7,\u90a3\u4e48\u518d\u5339\u914d\u7684\u65f6\u5019\u5c31\u65e2\u8981\u5339\u914d\u7f51\u7edc\u53f7,\u53c8\u8981\u5339\u914d\u4e3b \u673a\u53f7;\u53cd \u4e4b,Destination \u5c31\u4ee3\u8868\u4e00\u4e2a\u7f51\u7edc,\u5728\u5339\u914d\u7684\u65f6\u5019\u53ea\u8981\u5339\u914d\u4e00\u4e0b\u7f51\u7edc\u53f7\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u6837,IP \u9009\u8def\u7684\u65b9\u5f0f\u5c31\u53ef\u4ee5\u66f4\u52a0\u5177\u4f53\u5316\u4e86\u3002\u5982\u4e0b\uff1a<\/strong><\/p>\n \u987a\u4fbf\u63d0\u4e00\u4e0b\u90a3\u4e2a GenMask(\u8fd8\u8bb0\u5f97\u5b50\u7f51\u63a9\u7801\u4e48),\u5b83\u6307\u5b9a\u4e86\u76ee\u7684\u5730\u5740\u7684\u5b50\u7f51\u53f7,\u4f8b\u5982\u7b2c\u4e00\u6761\u7684\u5b50\u7f51\u5c31\u662f11\u3002<\/p>\n \u4e00\u822c,\u6211\u4eec\u5728\u914d\u7f6e\u597d\u4e00\u4e2a\u7f51\u7edc\u63a5\u53e3\u7684\u65f6\u5019,\u4e00\u4e2a\u8def\u7531\u5c31\u88ab\u76f4\u63a5\u521b\u5efa\u597d\u4e86\u3002\u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u624b\u52a8\u6dfb\u52a0\u8def\u7531\u3002\u7528 route add \u547d\u4ee4\u5c31\u53ef\u4ee5\u4e86\u3002\u800c\u5f53\u4e00\u4e2a IP \u5305\u5728\u67d0\u4e00\u4e2a\u8def\u7531\u5668\u7684\u65f6\u5019\u53d1\u73b0\u6ca1\u6709\u8def\u7531\u53ef\u8d70,\u90a3\u4e48\u8be5\u8def\u7531\u5668\u5c31\u4f1a\u7ed9\u6e90\u4e3b\u673a\u53d1\u9001\u201c\u4e3b\u673a\u4e0d\u53ef\u8fbe\u201d\u6216\u8005\u201c\u7f51\u7edc\u4e0d\u53ef\u8fbe\u201d\u7684 ICMP\u5305\u6765\u62a5\u9519\u3002\u6ce8\u610f,\u4e00\u822c\u7684\u64cd\u4f5c\u7cfb\u7edf\u9ed8\u8ba4\u662f\u6ca1\u6709\u8def\u7531\u529f\u80fd\u7684,\u8fd9\u9700\u8981\u81ea\u5df1\u914d\u7f6e\u3002\u8fd9\u4e9b\u5386\u53f2\u539f\u56e0\u5c31\u4e0d\u7ec6\u8bf4\u4e86\u3002<\/p>\n \u5f53 IP \u5305\u5728\u67d0\u4e00\u4e2a\u5730\u65b9\u8f6c\u5411\u7684\u65f6\u5019,\u90fd\u56de\u7ed9\u53d1\u9001 IP \u62a5\u7684\u6e90\u4e3b\u673a\u4e00\u4e2a ICMP \u91cd\u5b9a\u5411\u62a5\u6587,\u800c\u6e90\u4e3b\u673a\u5c31\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u4fe1\u606f\u6765\u66f4\u65b0\u81ea\u5df1\u7684\u8def\u7531\u8868,\u8fd9\u6837,\u968f\u7740\u7f51\u7edc\u901a\u4fe1\u7684\u9010\u6e10\u589e\u591a,\u8def\u7531\u8868\u4e5f\u5c31\u8d8a\u6765\u8d8a\u5b8c\u5907,\u6570\u636e\u8f6c\u53d1\u7684\u901f\u5ea6\u4e5f\u4f1a\u8d8a\u6765\u8d8a\u5feb\u3002\u6211\u4eec\u9700\u8981\u6ce8\u610f\u7684\u662f:<\/p>\n \u5728\u4e3b\u673a\u5f15\u5bfc\u7684\u65f6\u5019,\u4e00\u822c\u4f1a\u53d1\u9001\u5728\u7f51\u5185\u5e7f\u64ad\u4e00\u4e2a\u8def\u7531\u8bf7\u6c42\u7684 ICMP \u62a5\u6587,\u800c\u591a\u4e2a\u8def\u7531\u5668\u5219\u4f1a\u56de\u5e94\u4e00\u4e2a\u8def\u7531\u901a\u544a\u62a5\u6587\u3002\u800c\u4e14,\u8def\u7531\u5176\u672c\u8eab\u4e0d\u5b9a\u671f\u7684\u5728\u7f51\u7edc\u5185\u53d1 \u5e03\u8def\u7531\u901a\u544a\u62a5\u6587,\u8fd9\u6837,\u6839\u636e\u8fd9\u4e9b\u62a5\u6587,\u6bcf\u4e00\u4e2a\u4e3b\u673a\u90fd\u4f1a\u6709\u673a\u4f1a\u5efa\u7acb\u81ea\u5df1\u7684\u8def\u7531\u8868\u800c\u5b9e\u73b0\u7f51\u7edc\u901a\u4fe1\u3002\u8def\u7531 \u5668\u5728\u4e00\u4efd\u901a\u544a\u62a5\u6587\u4e2d\u53ef\u4ee5\u901a\u544a\u591a\u4e2a\u5730\u5740,\u5e76\u4e14\u7ed9\u51fa\u6bcf\u4e00\u4e2a\u5730 \u5740\u7684\u4f18\u5148\u7b49\u7ea7,\u8fd9\u4e2a\u4f18\u5148\u7b49\u7ea7\u662f\u8be5 IP \u4f5c\u4e3a\u9ed8\u8ba4\u8def\u7531\u7684\u7b49\u7ea7,\u81f3\u4e8e\u600e\u4e48\u7b97 \u7684\u5c31\u4e0d\u6df1\u7a76\u4e86\u3002\u8def\u7531\u5668\u4e00\u822c\u4f1a\u5728450-600\u79d2\u7684\u65f6\u95f4\u95f4\u9694\u5185\u53d1\u5e03\u4e00\u6b21\u901a\u544a,\u800c\u4e00\u4e2a\u7ed9\u5b9a\u7684\u901a\u544a\u62a5\u6587\u7684\u5bff\u547d\u662f30\u5206\u949f\u3002\u800c\u4e3b\u673a\u5728\u5f15\u5bfc\u7684\u65f6\u5019\u4f1a\u6bcf\u4e09\u79d2\u53d1 \u9001\u4e00\u6b21\u8bf7\u6c42\u62a5\u6587,\u4e00\u65e6\u63a5\u53d7\u5230\u4e00\u4e2a\u6709\u6548\u7684\u901a\u544a\u62a5\u6587,\u5c31\u505c\u6b62\u53d1\u9001\u8bf7\u6c42\u62a5\u6587\u3002\u5728 TCP\/IP \u8be6\u89e3\u7f16\u5199\u7684\u65f6\u5019,\u53ea\u6709 Solaris2.x \u652f\u6301\u8fd9\u4e24\u79cd\u62a5\u6587,\u5927\u591a\u6570\u7cfb\u7edf\u8fd8\u4e0d\u652f\u6301\u8fd9\u4e24\u79cd\u62a5\u6587\u3002(\u540e\u9762\u8fd8\u4f1a\u8bb2\u5230\u4e00\u4e9b\u6709\u7528\u7684\u8def\u7531 \u62a5\u6587)<\/p>\n \u524d\u9762\u7684\u9009\u8def\u65b9\u6cd5\u53eb\u505a\u9759\u6001\u9009\u8def,\u7b80\u8981\u5730\u8bf4\u5c31\u662f\u5728\u914d\u7f6e\u63a5\u53e3\u7684\u65f6\u5019,\u4ee5\u9ed8\u8ba4\u7684\u65b9\u5f0f\u751f\u6210\u8def\u7531\u8868\u9879\u3002\u5e76\u901a\u8fc7 route \u6765\u589e\u52a0\u8868\u9879,\u6216\u8005 \u901a\u8fc7 ICMP \u62a5\u6587\u6765\u66f4\u65b0\u8868\u9879(\u901a\u5e38\u5728\u9ed8\u8ba4\u65b9\u5f0f\u51fa\u9519\u7684\u60c5\u51b5\u4e0b)\u3002 \u800c\u5982\u679c\u4e0a\u8bc9\u4e09\u79cd\u65b9\u6cd5\u90fd\u4e0d\u80fd\u6ee1\u8db3,\u90a3\u4e48\u6211\u4eec\u5c31\u4f7f\u7528\u52a8\u6001\u9009\u8def\u3002\u52a8\u6001\u9009\u8def\u534f\u8bae\u662f\u7528\u4e8e\u52a8\u6001\u9009\u8def\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206,\u4f46\u662f\u4ed6\u4eec\u53ea\u662f\u4f7f\u7528\u5728\u8def\u7531\u5668\u4e4b\u95f4,\u76f8\u90bb\u8def\u7531\u5668\u4e4b\u95f4\u4e92\u76f8\u901a\u4fe1\u3002\u7cfb\u7edf(\u8def\u6709\u9009\u62e9\u7a0b \u5e8f)\u9009\u62e9\u6bd4\u8f83\u5408\u9002\u7684\u8def\u6709\u653e\u5230 \u6838\u5fc3\u8def\u7531\u8868\u4e2d,\u7136\u540e\u7cfb\u7edf\u5c31\u53ef\u4ee5\u6839\u636e\u8fd9\u4e2a\u6838\u5fc3\u8def\u6709\u8868\u627e\u5230\u6700\u5408\u9002\u7684\u7f51\u8def\u3002\u4e5f\u5c31\u662f\u8bf4,\u52a8\u6001\u9009\u8def\u662f\u5728\u7cfb\u7edf \u6838\u5fc3\u7f51\u7edc\u5916\u90e8\u8fdb\u884c\u7684,\u5b83\u53ea\u662f\u7528\u4e00\u4e9b\u9009\u8def\u7684\u7b56\u7565\u5f71\u54cd\u8def\u7531\u8868, \u800c\u4e0d\u4f1a\u5f71\u54cd\u5230\u6700\u540e\u901a\u8fc7\u8def\u7531\u8868\u9009\u62e9\u8def\u7531\u7684\u90a3\u4e00\u90e8\u5206\u3002\u9009\u8def\u534f\u8bae\u6709\u4e00\u5927\u7c7b \u5e38\u7528\u7684\u53eb\u505a\u5185\u90e8\u7f51\u5173\u534f\u8bae(IGP),\u800c\u5728 IGP \u4e2d,RIP \u5c31\u662f\u5176\u4e2d\u6700\u91cd\u8981\u7684\u534f\u8bae\u3002\u4e00\u79cd\u65b0 \u7684 IGP \u534f\u8bae\u53eb\u505a\u5f00\u653e\u6700\u77ed\u8def\u7ecf\u4f18\u5148(OSPF)\u534f\u8bae,\u5176\u610f\u5728\u53d6\u4ee3 RIP\u3002\u53e6\u4e00\u79cd\u6700\u65e9\u7528\u5728\u7f51\u8def\u9aa8\u5e72\u7f51\u4e0a\u7684 IGP \u534f\u8bae--HELLO,\u73b0\u5728\u5df2\u7ecf\u4e0d\u7528\u4e86\u3002\u5982\u4eca,\u4efb\u4f55\u652f\u6301\u52a8\u6001\u9009\u8def\u7684\u8def\u7531\u5668\u90fd\u5fc5\u987b\u540c\u65f6\u652f\u6301 OSPF \u548c RIP,\u8fd8\u53ef\u4ee5\u9009\u62e9\u6027\u7684\u652f\u6301\u5176\u4ed6\u7684 IGP \u534f\u8bae\u3002<\/p>\n Unix \u7cfb\u7edf\u4e0a\u9762\u901a\u5e38\u90fd\u6709\u8def\u7531\u5b88\u62a4\u7a0b\u5e8f--routed\u3002\u8fd8\u6709\u4e00\u4e2a\u53eb\u505a gate\u3002gate \u6240\u652f\u6301\u7684\u534f\u8bae\u8981\u6bd4 routed \u591a,routed \u53ea\u662f\u652f\u6301 RIPv1\u7248\u672c\u3002\u800c gate \u5219\u652f\u6301 RIPv1\u3001v2,BGPv1 \u7b49\u7b49\u3002<\/p>\n \u5b83\u7684\u5b9a\u4e49\u53ef\u4ee5\u5728 RFC1058\u5185\u627e\u5230,\u8fd9\u79cd\u534f\u8bae\u4f7f\u7528 UDP \u4f5c\u4e3a\u8f7d\u4f53(\u4e5f\u5c31\u662f UDP \u7684\u4e0a\u5c42\u534f\u8bae)\u3002\u6211\u4eec\u6700\u5173\u5fc3\u7684\u5c31\u662f RIP \u5176\u4e2d\u7684\u4e00\u4e2a\u6bb5,\u53eb\u505a\u5ea6\u91cf\u7684 \u6bb5,\u8fd9\u662f\u4e00\u4e2a\u4ee5 hop \u4f5c\u4e3a\u8ba1\u6570\u5668(\u5c31\u662f\u4ee5\u8d70\u8fc7\u591a\u5c11\u8def\u7531\u4e3a\u8ba1\u6570\u5668)\u7684\u6bb5(IP \u534f\u8bae\u91cc\u9762\u4e5f\u6709\u4e00\u4e2a TTL \u4e0d\u662f\u4e48)\u3002\u8fd9\u4e2a\u5ea6 \u91cf\u6bb5\u5c06\u6700\u7ec8\u5f71\u54cd\u5230\u8def\u7531\u8868\u7684\u5efa\u7acb\u3002\u53c2\u8003\u56fe:<\/strong><\/p>\n \u4e00\u822c\u8bf4\u6765 routed \u8981\u627f\u62c5\u5982\u4e0b\u7684\u5de5\u4f5c:<\/strong><\/p>\n \u8fd9\u4e2a\u534f\u8bae\u770b\u8d77\u6765\u4f1a\u5de5\u4f5c\u7684\u5f88\u597d,\u4f46\u662f,\u8fd9\u91cc\u9762\u5176\u5b9e\u6709\u5f88\u591a\u9690\u85cf\u7684\u5fe7\u60a3,\u6bd4\u5982\u8bf4 RIP \u6ca1\u6709\u5b50\u7f51\u7684\u6982\u5ff5,\u6bd4\u5982\u8bf4\u73af\u8def\u7684\u5371\u9669\u3002\u800c\u4e14 hop\u6570\u7684\u4e0a\u9650\u4e5f\u9650\u5236\u4e86\u7f51\u7edc\u7684\u5927\u5c0f\u3002\u56e0\u6b64,\u51fa\u73b0\u4e86\u5f88\u591a RIPv1\u7684\u66ff\u4ee3\u54c1,\u6bd4\u5982\u8bf4 RIPv2,\u6bd4\u5982\u8bf4 OSPF\u3002\u4ed6\u4eec\u90fd\u662f\u901a\u8fc7\u67d0\u79cd\u7b56\u7565\u6765\u5f71\u54cd\u8def\u7531\u8868,\u6240\u4ee5\u5c31\u4e0d\u8bf4\u4e86\u3002<\/p>\n UDP \u662f\u4f20\u8f93\u5c42\u534f\u8bae,\u548c TCP \u534f\u8bae\u5904\u4e8e\u4e00\u4e2a\u5206\u5c42\u4e2d,\u4f46\u662f\u4e0e TCP \u534f\u8bae\u4e0d\u540c,UDP \u534f\u8bae\u5e76\u4e0d\u63d0\u4f9b\u8d85\u65f6\u91cd\u4f20,\u51fa\u9519\u91cd\u4f20\u7b49\u529f\u80fd,\u4e5f\u5c31\u662f\u8bf4\u5176\u662f\u4e0d\u53ef\u9760\u7684\u534f\u8bae\u3002<\/p>\n \u7531\u4e8e\u5f88\u591a\u8f6f\u4ef6\u9700\u8981\u7528\u5230 UDP \u534f\u8bae,\u6240\u4ee5 UDP \u534f\u8bae\u5fc5\u987b\u901a\u8fc7\u67d0\u4e2a\u6807\u5fd7\u7528\u4ee5\u533a\u5206\u4e0d\u540c\u7684\u7a0b\u5e8f\u6240\u9700\u8981\u7684\u6570\u636e\u5305\u3002\u7aef\u53e3\u53f7\u7684\u529f\u80fd\u5c31\u5728\u4e8e\u6b64,\u4f8b\u5982\u67d0\u4e00\u4e2a UDP \u7a0b\u5e8f A \u5728\u7cfb\u7edf\u4e2d\u6ce8\u518c\u4e863000\u7aef\u53e3,\u90a3\u4e48,\u4ee5\u540e\u4ece\u5916\u9762\u4f20\u8fdb\u6765\u7684\u76ee\u7684\u7aef\u53e3\u53f7\u4e3a3000\u7684 UDP \u5305\u90fd\u4f1a\u4ea4\u7ed9\u8be5\u7a0b\u5e8f\u3002\u7aef \u53e3\u53f7\u7406\u8bba\u4e0a\u53ef\u4ee5\u67092^16\u8fd9\u4e48\u591a\u3002\u56e0\u4e3a\u5b83\u7684\u957f \u5ea6\u662f16\u4e2a bit\u3002<\/p>\n \u8fd9\u662f\u4e00\u4e2a\u53ef\u9009\u7684\u9009\u9879,\u5e76\u4e0d\u662f\u6240\u6709\u7684\u7cfb\u7edf\u90fd\u5bf9 UDP \u6570\u636e\u5305\u52a0\u4ee5\u68c0\u9a8c\u548c\u6570\u636e(\u76f8\u5bf9 TCP \u534f\u8bae\u7684\u5fc5\u987b\u6765\u8bf4),\u4f46\u662f RFC \u4e2d\u6807\u51c6\u8981\u6c42, \u53d1\u9001\u7aef\u5e94\u8be5\u8ba1\u7b97\u68c0\u9a8c\u548c\u3002UDP \u68c0\u9a8c\u548c\u8986\u76d6 UDP \u534f\u8bae\u5934\u548c\u6570\u636e,\u8fd9\u548c IP \u7684\u68c0\u9a8c\u548c\u662f\u4e0d\u540c\u7684,IP \u534f\u8bae\u7684\u68c0\u9a8c\u548c\u53ea\u662f\u8986\u76d6 IP \u6570\u636e\u5934,\u5e76\u4e0d\u8986\u76d6\u6240\u6709\u7684\u6570\u636e\u3002 UDP \u548c TCP \u90fd\u5305\u542b \u4e00\u4e2a\u4f2a\u9996\u90e8,\u8fd9\u662f\u4e3a\u4e86\u8ba1\u7b97\u68c0\u9a8c\u548c\u800c\u6444\u5236\u7684\u3002\u4f2a\u9996\u90e8\u751a\u81f3\u8fd8\u5305\u542b IP \u5730\u5740\u8fd9\u6837\u7684 IP \u534f\u8bae\u91cc\u9762\u90fd\u6709\u7684\u4fe1\u606f,\u76ee\u7684\u662f \u8ba9 UDP \u4e24\u6b21\u68c0\u67e5\u6570\u636e\u662f\u5426\u5df2\u7ecf\u6b63\u786e\u5230\u8fbe\u76ee\u7684\u5730\u3002 \u5982\u679c\u53d1\u9001\u7aef\u6ca1\u6709\u6253\u5f00\u68c0\u9a8c\u548c\u9009\u9879,\u800c\u63a5\u6536\u7aef\u8ba1\u7b97\u68c0\u9a8c\u548c\u6709\u5dee\u9519,\u90a3\u4e48 UDP \u6570\u636e\u5c06\u4f1a \u88ab\u6084\u6084\u7684\u4e22\u6389(\u4e0d\u4fdd\u8bc1\u9001\u8fbe),\u800c\u4e0d\u4ea7\u751f\u4efb\u4f55\u5dee\u9519\u62a5\u6587\u3002<\/p>\n UDP \u53ef\u4ee5\u5f88\u957f\u5f88\u957f,\u53ef\u4ee5\u670965535\u5b57\u8282\u90a3\u4e48\u957f\u3002\u4f46\u662f\u4e00\u822c\u7f51\u7edc\u5728\u4f20\u9001\u7684\u65f6\u5019,\u4e00\u6b21\u4e00\u822c\u4f20\u9001\u4e0d\u4e86\u90a3\u4e48\u957f\u7684\u534f\u8bae(\u6d89\u53ca\u5230 MTU \u7684\u95ee \u9898),\u5c31\u53ea\u597d\u5bf9\u6570\u636e \u5206\u7247,\u5f53\u7136,\u8fd9\u4e9b\u662f\u5bf9 UDP \u7b49\u4e0a\u7ea7\u534f\u8bae\u900f\u660e\u7684,UDP \u4e0d\u9700\u8981\u5173\u5fc3 IP \u534f\u8bae\u5c42\u5bf9\u6570\u636e\u5982\u4f55\u5206\u7247,\u4e0b\u4e00\u4e2a\u7ae0\u8282\u5c06\u4f1a\u7a0d \u5fae\u8ba8\u8bba\u4e00\u4e9b\u5206\u7247\u7684\u7b56\u7565\u3002<\/p>\n IP\u5728\u4ece\u4e0a\u5c42\u63a5\u5230\u6570\u636e\u4ee5\u540e,\u8981\u6839\u636eIP\u5730\u5740\u6765\u5224\u65ad\u4ece\u90a3\u4e2a\u63a5\u53e3\u53d1\u9001\u6570\u636e(\u901a\u8fc7\u9009\u8def),\u5e76\u8fdb\u884cMTU\u7684\u67e5\u8be2,\u5982\u679c\u6570\u636e\u5927\u5c0f\u8d85\u8fc7MTU \u5c31\u8fdb\u884c\u6570\u636e\u5206\u7247\u3002\u6570 \u636e\u7684\u5206\u7247\u662f\u5bf9\u4e0a\u5c42\u548c\u4e0b\u5c42\u900f\u660e,\u800c\u6570\u636e\u4e5f\u53ea\u662f\u5230\u8fbe\u76ee\u7684\u5730\u8fd8\u4f1a\u88ab\u91cd\u65b0\u7ec4\u88c5,\u4e0d\u8fc7\u4e0d\u7528\u62c5\u5fc3,IP \u5c42\u63d0\u4f9b\u4e86\u8db3\u591f\u7684\u4fe1 \u606f\u8fdb\u884c\u6570\u636e\u7684\u518d\u7ec4\u88c5\u3002\u5728 IP \u5934\u91cc\u9762,16bit \u8bc6\u522b\u53f7\u552f\u4e00\u8bb0\u5f55\u4e86\u4e00\u4e2a IP \u5305\u7684 ID,\u5177\u6709\u540c\u4e00\u4e2a ID \u7684 IP \u7247\u5c06\u4f1a\u88ab\u91cd\u65b0\u7ec4\u88c5;\u800c13\u4f4d\u7247\u504f\u79fb\u5219\u8bb0\u5f55\u4e86\u67d0 IP \u7247\u76f8\u5bf9\u6574\u4e2a\u5305\u7684 \u4f4d\u7f6e;\u800c\u8fd9\u4e24\u4e2a\u8868\u793a\u4e2d\u95f4\u76843bit \u6807\u5fd7\u5219\u6807\u793a\u7740\u8be5\u5206\u7247\u540e\u9762\u662f\u5426\u8fd8\u6709\u65b0\u7684\u5206\u7247\u3002\u8fd9\u4e09\u4e2a\u6807\u793a\u5c31\u7ec4\u6210\u4e86 IP \u5206\u7247\u7684\u6240\u6709\u4fe1\u606f,\u63a5 \u53d7\u65b9\u5c31\u53ef\u4ee5\u5229\u7528\u8fd9\u4e9b\u4fe1\u606f\u5bf9 IP \u6570\u636e \u8fdb\u884c\u91cd\u65b0\u7ec4\u7ec7(\u5c31\u7b97\u662f\u540e\u9762\u7684\u5206\u7247\u6bd4\u524d\u9762\u7684\u5206\u7247\u5148\u5230,\u8fd9\u4e9b\u4fe1\u606f\u4e5f\u662f\u8db3\u591f\u4e86)\u3002\u56e0\u4e3a\u5206\u7247\u6280\u672f\u5728\u7f51\u7edc\u4e0a\u88ab\u7ecf\u5e38\u7684\u4f7f\u7528,\u6240\u4ee5\u4f2a\u9020 IP \u5206\u7247\u5305\u8fdb\u884c\u6d41\u6c13\u653b\u51fb\u7684\u8f6f\u4ef6\u548c\u4eba\u4e5f\u5c31\u5c42\u51fa\u4e0d\u7a77\u3002\u53ef\u4ee5\u7528 Trancdroute \u7a0b\u5e8f\u6765\u8fdb\u884c\u7b80\u5355\u7684 MTU \u4fa6\u6d4b\u3002\u8bf7\u53c2\u770b\u6559\u6750\u3002<\/p>\n \u8fd9\u662f\u4e0d\u5e38\u88ab\u4eba\u6ce8\u610f\u5230\u7684\u4e00\u4e2a\u7ec6\u8282,\u8fd9\u662f\u9488\u5bf9\u4e00\u4e9b\u7cfb\u7edf\u5730\u5b9e\u73b0\u6765\u8bf4\u7684\u3002\u5f53 ARP \u7f13\u5b58\u8fd8\u662f\u7a7a\u7684\u65f6\u5019\u3002UDP \u5728\u88ab\u53d1\u9001\u4e4b\u524d\u4e00\u5b9a\u8981\u53d1\u9001\u4e00\u4e2a ARP \u8bf7\u6c42\u6765\u83b7\u5f97\u76ee\u7684 \u4e3b\u673a\u7684 MAC \u5730\u5740,\u5982\u679c\u8fd9\u4e2a UDP \u7684\u6570\u636e\u5305\u8db3\u591f\u5927,\u5927\u5230 IP \u5c42\u4e00\u5b9a\u8981\u5bf9\u5176\u8fdb\u884c\u5206\u7247\u7684\u65f6\u5019,\u60f3\u8c61\u4e2d,\u8be5 UDP \u6570\u636e\u5305\u7684\u7b2c\u4e00\u4e2a\u5206\u7247\u4f1a\u53d1\u51fa\u4e00\u4e2a ARP \u67e5\u8be2\u8bf7\u6c42, \u6240\u6709\u7684\u5206\u7247\u90fd\u8f89\u7b49\u5230\u8fd9\u4e2a\u67e5\u8be2\u5b8c\u6210\u4ee5\u540e\u518d\u53d1\u9001\u3002\u4e8b\u5b9e\u4e0a\u662f\u8fd9\u6837\u5417?\u7ed3\u679c\u662f,\u67d0\u4e9b\u7cfb\u7edf\u4f1a\u8ba9\u6bcf\u4e00\u4e2a\u5206\u7247\u90fd\u53d1\u9001\u4e00\u4e2a ARP \u67e5\u8be2,\u6240\u6709\u7684\u5206\u7247\u90fd\u5728\u7b49\u5f85,\u4f46\u662f\u63a5\u53d7\u5230\u7b2c\u4e00\u4e2a\u56de\u5e94\u7684\u65f6\u5019,\u4e3b\u673a\u5374\u53ea\u53d1\u9001\u4e86 \u6700\u540e\u4e00\u4e2a\u6570\u636e\u7247\u800c\u629b\u5f03\u4e86\u5176 \u4ed6,\u8fd9\u5b9e\u5728\u662f\u8ba9\u4eba\u532a\u5937\u6240\u601d\u3002\u8fd9\u6837,\u56e0\u4e3a\u5206\u7247\u7684\u6570\u636e\u4e0d\u80fd\u88ab\u53ca\u65f6\u7ec4\u88c5,\u63a5\u53d7\u4e3b\u673a\u5c06\u4f1a\u5728\u4e00\u6bb5\u65f6\u95f4\u5185\u5c06\u6c38\u8fdc \u65e0\u6cd5\u7ec4\u88c5\u7684 IP \u6570\u636e\u5305\u629b\u5f03,\u5e76\u4e14\u53d1\u9001\u7ec4\u88c5\u8d85\u65f6\u7684 ICMP \u62a5\u6587(\u5176\u5b9e\u5f88\u591a\u7cfb\u7edf\u4e0d\u4ea7\u751f\u8fd9\u4e2a\u5dee\u9519),\u4ee5\u4fdd\u8bc1\u63a5\u53d7\u4e3b\u673a\u81ea\u5df1\u7684\u63a5\u6536\u7aef\u7f13\u5b58\u4e0d \u88ab\u90a3\u4e9b\u6c38\u8fdc\u5f97\u4e0d\u5230\u7ec4\u88c5\u7684\u5206\u7247\u6ee1\u3002<\/p>\n \u5f53\u76ee\u6807\u4e3b\u673a\u7684\u5904\u7406\u901f\u5ea6\u8d76\u4e0d\u4e0a\u6570\u636e\u63a5\u6536\u7684\u901f\u5ea6,\u56e0\u4e3a\u63a5\u53d7\u4e3b\u673a\u7684 IP \u5c42\u7f13\u5b58\u4f1a\u88ab\u5360\u6ee1,\u6240\u4ee5\u4e3b\u673a\u5c31\u4f1a\u53d1\u51fa\u4e00\u4e2a\u201c\u6211\u53d7\u4e0d\u4e86\u201d\u7684\u4e00\u4e2a ICMP \u62a5\u6587\u3002<\/p>\n UDP \u534f\u8bae\u7684\u67d0\u4e9b\u7279\u6027\u5c06\u4f1a\u5f71\u54cd\u6211\u4eec\u7684\u670d\u52a1\u5668\u7a0b\u5e8f\u8bbe\u8ba1,\u5927\u81f4\u603b\u7ed3\u5982\u4e0b:<\/strong><\/p>\n \u53e6\u5916\u8fd8\u6709\u4e00\u4e9b\u5173\u4e8ec++ Linux\u540e\u53f0\u670d\u52a1\u5668\u5f00\u53d1\u7684\u4e00\u4e9b\u77e5\u8bc6\u70b9\u5206\u4eab\uff1aLinux\uff0cNginx\uff0cMySQL\uff0cRedis\uff0cP2P\uff0cK8S\uff0cDocker\uff0cTCP\/IP\uff0c\u534f\u7a0b\uff0cDPDK\uff0cwebrtc\uff0c\u97f3\u89c6\u9891\u7b49\u7b49\u89c6\u9891\u3002<\/strong><\/p>\n \u559c\u6b22\u7684\u670b\u53cb\u53ef\u4ee5\u540e\u53f0\u79c1\u4fe1\u30101\u3011\u83b7\u53d6\u5b66\u4e60\u89c6\u9891<\/strong><\/p>\n\n
\n
\u5176\u4ed6\u6709\u5173\u8def\u7531\u8868\u7684\u77e5\u8bc6<\/h2>\n
ICMP \u7684 IP \u91cd\u5b9a\u5411\u62a5\u6587\u548c\u8def\u7531\u53d1\u73b0\u62a5\u6587<\/h2>\n
\n
\u52a8\u6001\u9009\u8def\u534f\u8bae<\/h2>\n
Unix \u9009\u8def\u7a0b\u5e8f<\/h2>\n
RIP:\u9009\u8def\u4fe1\u606f\u534f\u8bae<\/h2>\n
\n
UDP \u7b80\u8981\u4ecb\u7ecd<\/h2>\n
UDP \u534f\u8bae\u5934<\/h2>\n
UDP \u7aef\u53e3\u53f7<\/h2>\n
UDP \u68c0\u9a8c\u548c<\/h2>\n
UDP \u957f\u5ea6<\/h2>\n
IP \u5206\u7247<\/h2>\n
UDP \u548c ARP \u4e4b\u95f4\u7684\u4ea4\u4e92\u5f0f\u7528<\/h2>\n
ICMP \u6e90\u7ad9\u6291\u5236\u5dee\u9519<\/h2>\n
UDP \u670d\u52a1\u5668\u8bbe\u8ba1<\/h2>\n
\n