0

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?
  • 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 '18 at 23:14
  • Question at SO is different that this. – PHcoDer Nov 28 '18 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 '18 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 '18 at 19:59
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.