0

How to send rate control(250Kb/s, 500Kb/s) packet in TCP/IP stack? Because In my understanding after tcp buffer filled then the Tx packets happening. Is my understanding is correct then How do I send the packet before the buffer full?

  • If I understand your question, you are talking about the PSH (push) flag. – Ron Trunk Jun 21 '16 at 12:43
  • Actually my problem is whenever I have send packets the stack fill the packets with buffer (or) window size . After buffer is full the packets get transmitted. How to control this behaviour? How to I send the packet befor the buffer is full.? – G.Balamurugan Jun 21 '16 at 13:18
  • Unfortunately, questions about host/server behavior/ configuration are off-topic here, as are questions about programming, which could be asked on Stack Overflow. – Ron Maupin Dec 21 '20 at 17:45
1

You need to set the PSH flag to tell the receiver to process the data even though the buffer is not full. Here is a good explanation.

Consider what would happen to a Telnet session, for instance, if TCP waited until there was enough data to fill a packet before it would send one: You would have to type over a thousand characters before the first packet would make it to the remote device. Not very useful.

This is where the PSH flag comes in. The socket that TCP makes available at the session level can be written to by the application with the option of "pushing" data out immediately, rather than waiting for additional data to enter the buffer. When this happens, the PSH flag in the outgoing TCP packet is set to 1 (on). Upon receiving a packet with the PSH flag set, the other side of the connection knows to immediately forward the segment up to the application.

  • Please explain with some sample c code, Because when I send the packet with write function always the push flag is set by default. So I am not differentiate the operation of setting push flag. – G.Balamurugan Jun 23 '16 at 9:58
  • Sorry, I haven't written C code in over thirty years. If you have a programming question, this is the wrong forum for it. you should try Stack Overflow. – Ron Trunk Jun 23 '16 at 11:45

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