Re: throttling suggestions ? (and quantity in send queue)
Re: throttling suggestions ? (and quantity in send queue)
- Subject: Re: throttling suggestions ? (and quantity in send queue)
- From: Peter Sichel <email@hidden>
- Date: Wed, 28 Apr 2004 16:37:35 -0400
On Apr 28, 2004, at 11:16 AM, Nicolas Berloquin wrote:
I guess I'm doing more or less (1) :
...
And each peer has its own buffer that's waiting to be sent.
Since TCP will retransmit data that isn't acknowledged, the
only way to tell how much data has been successfully transfered
versus being buffered or in flight is by what the remote peer
has acknowledged.
If you have control over the protocol exchange, you can have
the remote peer tell you when it has received some appropriate
amount of data.
If you don't control the protocol, you can look at the TCP stats
the stack keeps for each connection. Use sysctl to retrieve a
list of connections, find the corresponding entry, and look
at the "next unacknowledged" byte in sequence (snd_una in tcp_var.h).
But I don't understand your (2).
I understand adjusting window size (I didn't think about it, would that
mean that I should set the send window size to the expected size
sent at each round, per second, ... ?
I don't understand the ACK part. I thought that I sent ACKs when I
received data, not when I send some.
This technique requires that your code be operating below the TCP layer
either as an NKE or in some intermediary device.
You examine packets as they go by to adjust the advertised window and
withhold or insert ACKs. TCP can only send enough bytes to fill the
advertised window. When an ACK is received, TCP can send more bytes
to fill the unused portion of the window. If your code is clever about
keeping track of each connection and modifying packets as they go by,
you can control when and how much data TCP sends without any additional
queueing.
Kind Regards,
- Peter
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.