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?
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.