On Wed, 25 Jul 2007 21:17:09 -0700, Rotsey
<ma***********@RemoveThis.optusnet.com.auwrote:
[...]
Would UDP be ok for this when it is fairly critical for that data to
arrive
promptly and not duplicated.
UDP does have the advantage that there's no built-in delay mechanism. TCP
uses the Nagel algorithm, which delays some transmissions for a very short
period of time, in case additional data is sent that can be combined with
the previously sent data...this is more efficient, but of course causes
some data to be sent later than it otherwise could have been.
Keep in mind that even though UDP in theory can result in more timely
delivery at least some of the time, in practice you may not realize the
benefit. It all depends on the network traffic, and things like whether
coalescing TCP traffic improves communication efficiency enough to reduce
lost IP datagrams forcing data to be resent.
IMHO, if you have a need for reliable delivery, you should just use TCP.
Don't switch to UDP unless you find that you have some serious problems
with the timeliness of the data, and even then don't expect switching to
UDP to be a panacea.
If you don't have a need for reliable delivery, and can easily implement
whatever minimal validation you do need, then UDP might be a good choice.
[...]
Pete, is port tunneling the same thing as "Hole punching"?
I have heard both terms used for the same thing, yes.
Is this easy to do for a first timer?
The basic idea is easy. Two different client contact a common server
reachable by both. The common server reports each client's actual network
address information to the other, and the clients then use that
information to attempt to contact each other directly.
Getting it to work in practice is tricky, mainly because there's no
specification requiring NAT routers to support it. So the first step in
testing an implementation is somehow making sure you're using a NAT router
that will behave in a way for port tunneling to work.
There was a recent article that I saw on the web six or twelve months ago
on the topic that was pretty detailed. I'm sorry I don't have the URL
handy, but a Google search may turn up something for you.
Personally, I'm not sure I would bother with it. It will only work with
some NAT routers, it does have the requirement of a public server your
peers can all reach, and you will be better off supporting something like
UPnP (not 100% available, but getting pretty close these days) and being
prepared to offer at least some minimal guidance to customers for
configuration of their routers to support your program.
Pete