????????????????
???????????? ???????[ 2012/6/29 9:50:25 ] ????????
????TCP????????????????RWIN(TCP Receive Window Size)??????????????????????TCP???????????Sender????ack??????????????????????????????????????Sender??????Receiver??????ack??Sender???????????????????????????????????????????????TCP???????????????????????????????????ж????????????TCP?????????????????????(????????)?????????????????????????????????????????????£?
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
???????????????????RWIN??????ó???????? * ??·???Sender???buffer??ú?RWIN????????С?????Sender???????????????Receiver???????????????????buffer??С????????????????????????????????????????????????????????????????磬??????????buffer???????????????ack?????Щ?????????????????????磬???????Щbuffer???????????ж???(??????ack)??buffer??????????????????????TCP??????е??????????????????????(???????????????£???????????????) ?????????????????????????????綪???????????С(????????????LAN??)??????????????????????????????buffer???и???????紫??????(????????????????????)??
??????????????????????????????????????????????????????????????????????????????????????????????????????????????UDP????????????????????
????B)UDP????
???????UDP?????????Щ???????????????????MTU???????(??????TCP???????????????·????????)????ν????????????????????·??????????????????????????????70????????????·??????????????????·??????????100??????????????ζ????????????7000???????????????????????????????????????20???????????????2000??????????·???(???????)???????? ???????????????UDP??????????????????????MTU?????????????????????????????????????????????MTU?????????1500??????????4352????802.11????????7981???????????????TCP/UDP????????????????Ч????Payload??????????????IPЭ??????20??????UDP?????8?????(TCP??????)?????????????????????UDP??????????1500-8-20=1472???????????????С?????????????ù??????? ????????????Щ??(??????£??????ЩNB?????????????????????????????????????????????????С??????MTU??????????fragment?????????????????????飬?????????????д?????)
??????????£????Socket???????????????setsockopt() ???? SO_SNDBUF/SO_RCVBUF ???С??TTL??KeepAlive??Щ??????????????????к???????????????Socket?????
??????????UDP??????????????multi-cast??????????????????????????????????????????????Ч?????????????????????????????(?????????????????????)?????????
????C)????????
????????????????????????????????????????????????????????Linux?£??????????ifconfig?????????????????????????overrun??????????????????????????txqueuelen????(???????1000)?????????????Щ???磺ifconfig eth0 txqueuelen 5000??Linux????????????У?ethtool?????????????????????????С????Windows?£?????????????????????е???????е??????????(?磺Receive Buffers?? Transmit Buffer?????????????в???????)????Buffer???????????????????????紫??????Ч??
????D)????????????
?????????·???ü?????????????????????????е?TCP?????????????????????????????select???????????????????1024??????????????poll??????????1024???????????select??poll??????????????????????????????????????????????????O(n)???????????epoll???????epoll???????????????????????????????????????callback?????????????????????????????Linux Kernel 2.6???????(?????2.5.44???????)?????????????е?????????????????????epoll_ctl??????????????????????????????????
?????????????Щ??DNS Lookup?????????С??????磺gethostbyaddr/gethostbyname????????????????????????????????????????????????DNS??????????????????????????????????????????????time out?????????????????hosts?????????????????????????й???????????????????????????????????ζ??顣?????????????棬gethostbyname??????????????????????????????gethostbyname??????????????????????gethostbyname???????????????????????С???(?????????GNU??gethostbyname_r()???????????????Щ) ?????????????????????????磬??????Linux?????NIS??????NFS???Щ?????????????????ú??????????С???
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11