• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 7  文章 - 6  trackbacks - 0
            <2011年7月>
            262728293012
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            常用鏈接

            留言簿(1)

            隨筆檔案

            文章分類

            搜索

            •  

            積分與排名

            • 積分 - 33041
            • 排名 - 610

            最新評論

            閱讀排行榜

            評論排行榜

            To understand the backlog argument, we must realize that for a given listening socket, the kernel maintains two queues :
            要明白backlog參數的含義,我們必須明白對于一個listening socket,kernel維護者兩個隊列:

            1.An incomplete connection queue, which contains an entry for each SYN that has arrived from a client for which the server is awaiting completion of the TCP three-way handshake. These sockets are in the SYN_RCVD state .
            1.一個未完成連接的隊列,此隊列維護著那些已收到了客戶端SYN分節信息,等待完成三路握手的連接,socket的狀態是SYN_RCVD

            2.A completed connection queue, which contains an entry for each client with whom the TCP three-way handshake has completed. These sockets are in the ESTABLISHED state
            2.一個已完成的連接的隊列,此隊列包含了那些已經完成三路握手的連接,socket的狀態是ESTABLISHED

            The backlog argument to the listen function has historically specified the maximum value for the sum of both queues.
            backlog參數歷史上被定義為上面兩個隊列的大小之和

            Berkeley-derived implementations add a fudge factor to the backlog: It is multiplied by 1.5
            Berkely實現中的backlog值為上面兩隊列之和再乘以1.5

            When a SYN arrives from a client, TCP creates a new entry on the incomplete queue and then responds with the second segment of the three-way handshake: the server's SYN with an ACK of the client's SYN (Section 2.6). This entry will remain on the incomplete queue until the third segment of the three-way handshake arrives (the client's ACK of the server's SYN), or until the entry times out. (Berkeley-derived implementations have a timeout of 75 seconds for these incomplete entries.)
            當客戶端的第一個SYN到達的時候,TCP會在未完成隊列中增加一個新的記錄然后回復給客戶端三路握手中的第二個分節(服務端的SYN和針對客戶端的ACK),這條記錄會在未完成隊列中一直存在,直到三路握手中的最后一個分節到達,或者直到超時(Berkeley時間將這個超時定義為75秒)

            If the queues are full when a client SYN arrives, TCP ignores the arriving SYN (pp. 930–931 of TCPv2); it does not send an RST. This is because the condition is considered temporary, and the client TCP will retransmit its SYN, hopefully finding room on the queue in the near future. If the server TCP immediately responded with an RST, the client's connect would return an error, forcing the application to handle this condition instead of letting TCP's normal retransmission take over. Also, the client could not differentiate between an RST in response to a SYN meaning "there is no server at this port" versus "there is a server at this port but its queues are full."
            如果當客戶端SYN到達的時候隊列已滿,TCP將會忽略后續到達的SYN,但是不會給客戶端發送RST信息,因為此時允許客戶端重傳SYN分節,如果返回錯誤信息,那么客戶端將無法分清到底是服務端對應端口上沒有相應應用程序還是服務端對應端口上隊列已滿這兩種情況

            posted on 2010-02-07 19:43 許海斌 閱讀(18821) 評論(2)  編輯 收藏 引用

            FeedBack:
            # re: 總算明白了tcp/ip協議listen函數中backlog參數的含義 2011-07-21 09:37 shan
            是這樣的么?如果backlog取5,那么這兩個隊列的大小是如何分配的呢?  回復  更多評論
              
            # re: 總算明白了tcp/ip協議listen函數中backlog參數的含義 2015-08-21 11:40 AutumnLight
            @shan
            linux的實現是不一樣的,在Linux下,backlog指定的是complete queue的大小,而incomplete queue的大小可以由系統管理員在 /proc/sys/net/ipv4/tcp_max_syn_backlog下進行統一配置。
            你可以看一看這篇文章。
            http://veithen.github.io/2014/01/01/how-tcp-backlog-works-in-linux.html  回復  更多評論
              
            久久综合狠狠色综合伊人| 久久精品国产WWW456C0M| 久久久久亚洲AV成人网人人网站| 深夜久久AAAAA级毛片免费看| 亚洲中文字幕无码久久2017 | 亚洲AV无码成人网站久久精品大| 无码伊人66久久大杳蕉网站谷歌| 2020最新久久久视精品爱| 久久久久久曰本AV免费免费| 人人狠狠综合久久亚洲婷婷| 久久亚洲AV无码精品色午夜| 久久精品国产精品国产精品污| 中文字幕亚洲综合久久菠萝蜜 | 久久综合精品国产一区二区三区 | 99久久无色码中文字幕人妻 | 青青草原综合久久大伊人| 狠狠色婷婷综合天天久久丁香 | 国产成人综合久久综合| 精品无码久久久久久久久久| 亚洲国产另类久久久精品 | 久久国产劲爆AV内射—百度| 久久福利片| 日本久久久精品中文字幕| 久久久久高潮毛片免费全部播放| 7777精品伊人久久久大香线蕉| 久久99精品国产99久久6| 精品久久久久久久久久中文字幕| 91精品国产91热久久久久福利 | 亚洲AV乱码久久精品蜜桃| 怡红院日本一道日本久久 | 一级女性全黄久久生活片免费 | 国产精品伦理久久久久久| 久久亚洲国产成人精品性色| 久久精品国产亚洲av麻豆蜜芽| 精品人妻伦一二三区久久| 久久国产美女免费观看精品| 99久久婷婷国产综合精品草原| 99精品伊人久久久大香线蕉| 国产精品日韩欧美久久综合| 日韩欧美亚洲国产精品字幕久久久| 久久人妻少妇嫩草AV无码蜜桃|