[p2p-hackers] UDP file transfer link speed identification
David Barrett
dbarrett at quinthar.com
Thu Jul 21 20:49:01 UTC 2005
How do you decide how fast to send UDP file-transfer packets?
Lots of people on this list make file sharing applications. Many of
those applications use UDP. A big drawback of using UDP for file
transfers is you can't rely upon the link-speed detection capabilities
of TCP. As a result, if you send UDP too slow, you're not maximizing
your connection. But if you send it too fast, you'll congest your
upstream and/or the remote peer's downstream connection, causing packet
loss at the very least, as well as possibly denial of service.
How have you resolved this problem? I'm using an approach where the the
client (receiving peer) provides continuous feedback to the server
(sending peer) as to how fast it should send data. Thus the client can
control the rate at which it receives data from the server.
But the question is: how does the client know how fast to request data?
The overall approach I'm using is to request data at a certain rate,
measure how fast it is actually received, calculate what new rate should
be tried, repeat.
However, I'm finding this surprisingly tricky. Either I ramp up too
slow, or I ramp up and down erratically. I've considered some FSM
approaches, and some formulaic approaches, and I still haven't come up
with something I like. I've read the TCP RFC for guidance, but it
leaves the specifics left as an exercise to the reader. Other than
that, I'm not sure where else to read for inspiration.
So I'm curious, how have you solved this problem? What can you advise?
-david
More information about the P2p-hackers
mailing list