Delay between TCP send and actual write to the NIC











up vote
0
down vote

favorite












While looking for solution to a problem in socket programming with python described here (In short the problem is: I want my message(~ 25 Bytes) sent by a client over a TCP socket to be dispatched(flushed) immediately.), I came across this article.



In the 6th paragraph of the section "How Established Connections Work" the article says following:




The actual transmission of the data to the NIC could be somewhat delayed from when the user actually calls write(2) if the network is busy, if the TCP send window is full, if there are traffic shaping policies in effect, etc.




My questions are:




  • With a very fast and private network(I can guarantee availability) and TCP send window not being full. Will my small messages of size ~25 bytes be sent immediately?

  • What could these traffic shaping policies be in default case in recent Ubuntu like 14, 16 and 18?










share|improve this question




















  • 1




    Why not use UDP? Furthermore, why not doing/testing it instead of asking the same question both in SO and U&L?
    – Rui F Ribeiro
    Nov 27 at 23:14












  • Question at SO is different that this.
    – PHcoDer
    Nov 28 at 18:40










  • It is as different as one question asking if you drive and another asking if you have a driving license, I think. However the more pressing question is, why you do not try it yourself?
    – Rui F Ribeiro
    Nov 28 at 19:23












  • No it is not the first question is about specific python api. This is more about how will linux behave.
    – PHcoDer
    Nov 28 at 19:59















up vote
0
down vote

favorite












While looking for solution to a problem in socket programming with python described here (In short the problem is: I want my message(~ 25 Bytes) sent by a client over a TCP socket to be dispatched(flushed) immediately.), I came across this article.



In the 6th paragraph of the section "How Established Connections Work" the article says following:




The actual transmission of the data to the NIC could be somewhat delayed from when the user actually calls write(2) if the network is busy, if the TCP send window is full, if there are traffic shaping policies in effect, etc.




My questions are:




  • With a very fast and private network(I can guarantee availability) and TCP send window not being full. Will my small messages of size ~25 bytes be sent immediately?

  • What could these traffic shaping policies be in default case in recent Ubuntu like 14, 16 and 18?










share|improve this question




















  • 1




    Why not use UDP? Furthermore, why not doing/testing it instead of asking the same question both in SO and U&L?
    – Rui F Ribeiro
    Nov 27 at 23:14












  • Question at SO is different that this.
    – PHcoDer
    Nov 28 at 18:40










  • It is as different as one question asking if you drive and another asking if you have a driving license, I think. However the more pressing question is, why you do not try it yourself?
    – Rui F Ribeiro
    Nov 28 at 19:23












  • No it is not the first question is about specific python api. This is more about how will linux behave.
    – PHcoDer
    Nov 28 at 19:59













up vote
0
down vote

favorite









up vote
0
down vote

favorite











While looking for solution to a problem in socket programming with python described here (In short the problem is: I want my message(~ 25 Bytes) sent by a client over a TCP socket to be dispatched(flushed) immediately.), I came across this article.



In the 6th paragraph of the section "How Established Connections Work" the article says following:




The actual transmission of the data to the NIC could be somewhat delayed from when the user actually calls write(2) if the network is busy, if the TCP send window is full, if there are traffic shaping policies in effect, etc.




My questions are:




  • With a very fast and private network(I can guarantee availability) and TCP send window not being full. Will my small messages of size ~25 bytes be sent immediately?

  • What could these traffic shaping policies be in default case in recent Ubuntu like 14, 16 and 18?










share|improve this question















While looking for solution to a problem in socket programming with python described here (In short the problem is: I want my message(~ 25 Bytes) sent by a client over a TCP socket to be dispatched(flushed) immediately.), I came across this article.



In the 6th paragraph of the section "How Established Connections Work" the article says following:




The actual transmission of the data to the NIC could be somewhat delayed from when the user actually calls write(2) if the network is busy, if the TCP send window is full, if there are traffic shaping policies in effect, etc.




My questions are:




  • With a very fast and private network(I can guarantee availability) and TCP send window not being full. Will my small messages of size ~25 bytes be sent immediately?

  • What could these traffic shaping policies be in default case in recent Ubuntu like 14, 16 and 18?







tcp socket






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 at 23:06









Rui F Ribeiro

38.4k1478127




38.4k1478127










asked Nov 27 at 21:57









PHcoDer

1012




1012








  • 1




    Why not use UDP? Furthermore, why not doing/testing it instead of asking the same question both in SO and U&L?
    – Rui F Ribeiro
    Nov 27 at 23:14












  • Question at SO is different that this.
    – PHcoDer
    Nov 28 at 18:40










  • It is as different as one question asking if you drive and another asking if you have a driving license, I think. However the more pressing question is, why you do not try it yourself?
    – Rui F Ribeiro
    Nov 28 at 19:23












  • No it is not the first question is about specific python api. This is more about how will linux behave.
    – PHcoDer
    Nov 28 at 19:59














  • 1




    Why not use UDP? Furthermore, why not doing/testing it instead of asking the same question both in SO and U&L?
    – Rui F Ribeiro
    Nov 27 at 23:14












  • Question at SO is different that this.
    – PHcoDer
    Nov 28 at 18:40










  • It is as different as one question asking if you drive and another asking if you have a driving license, I think. However the more pressing question is, why you do not try it yourself?
    – Rui F Ribeiro
    Nov 28 at 19:23












  • No it is not the first question is about specific python api. This is more about how will linux behave.
    – PHcoDer
    Nov 28 at 19:59








1




1




Why not use UDP? Furthermore, why not doing/testing it instead of asking the same question both in SO and U&L?
– Rui F Ribeiro
Nov 27 at 23:14






Why not use UDP? Furthermore, why not doing/testing it instead of asking the same question both in SO and U&L?
– Rui F Ribeiro
Nov 27 at 23:14














Question at SO is different that this.
– PHcoDer
Nov 28 at 18:40




Question at SO is different that this.
– PHcoDer
Nov 28 at 18:40












It is as different as one question asking if you drive and another asking if you have a driving license, I think. However the more pressing question is, why you do not try it yourself?
– Rui F Ribeiro
Nov 28 at 19:23






It is as different as one question asking if you drive and another asking if you have a driving license, I think. However the more pressing question is, why you do not try it yourself?
– Rui F Ribeiro
Nov 28 at 19:23














No it is not the first question is about specific python api. This is more about how will linux behave.
– PHcoDer
Nov 28 at 19:59




No it is not the first question is about specific python api. This is more about how will linux behave.
– PHcoDer
Nov 28 at 19:59










1 Answer
1






active

oldest

votes

















up vote
2
down vote













Traffic shaping policies get set on the backbone of your ISP, not by Ubuntu, so that's a non-issue if you have a very fast and private network that you manage yourself (E.G.: not corporate: if corporate, talk to the network engineers which ports to use).



The TCP window is 64K on modern OSes so unless you're running this on DOS (8K) or kernel 2.16 if memory serves me right (16K) that's not an issue neither so:



Yes, I believe the 25 bytes will be sent immediately on Ubuntu, using a private network.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484528%2fdelay-between-tcp-send-and-actual-write-to-the-nic%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    Traffic shaping policies get set on the backbone of your ISP, not by Ubuntu, so that's a non-issue if you have a very fast and private network that you manage yourself (E.G.: not corporate: if corporate, talk to the network engineers which ports to use).



    The TCP window is 64K on modern OSes so unless you're running this on DOS (8K) or kernel 2.16 if memory serves me right (16K) that's not an issue neither so:



    Yes, I believe the 25 bytes will be sent immediately on Ubuntu, using a private network.






    share|improve this answer



























      up vote
      2
      down vote













      Traffic shaping policies get set on the backbone of your ISP, not by Ubuntu, so that's a non-issue if you have a very fast and private network that you manage yourself (E.G.: not corporate: if corporate, talk to the network engineers which ports to use).



      The TCP window is 64K on modern OSes so unless you're running this on DOS (8K) or kernel 2.16 if memory serves me right (16K) that's not an issue neither so:



      Yes, I believe the 25 bytes will be sent immediately on Ubuntu, using a private network.






      share|improve this answer

























        up vote
        2
        down vote










        up vote
        2
        down vote









        Traffic shaping policies get set on the backbone of your ISP, not by Ubuntu, so that's a non-issue if you have a very fast and private network that you manage yourself (E.G.: not corporate: if corporate, talk to the network engineers which ports to use).



        The TCP window is 64K on modern OSes so unless you're running this on DOS (8K) or kernel 2.16 if memory serves me right (16K) that's not an issue neither so:



        Yes, I believe the 25 bytes will be sent immediately on Ubuntu, using a private network.






        share|improve this answer














        Traffic shaping policies get set on the backbone of your ISP, not by Ubuntu, so that's a non-issue if you have a very fast and private network that you manage yourself (E.G.: not corporate: if corporate, talk to the network engineers which ports to use).



        The TCP window is 64K on modern OSes so unless you're running this on DOS (8K) or kernel 2.16 if memory serves me right (16K) that's not an issue neither so:



        Yes, I believe the 25 bytes will be sent immediately on Ubuntu, using a private network.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 27 at 22:53

























        answered Nov 27 at 22:44









        Fabby

        3,21911127




        3,21911127






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484528%2fdelay-between-tcp-send-and-actual-write-to-the-nic%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre