[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ANN: Experimental Chat System



Andy McFadden wrote:
Terry Olsen <tolsen64@hotmail.com> wrote:

Anyhow, if you do use it, let me know how it works. I do expect problems as I know UDP isn't a "reliable" protocol, but I am interested in finding out just how well it performs, or doesn't perform. It works perfectly on my LAN, but I haven't tried it over the internet.


You're unlikely to lose UDP packets on a LAN.  The reliability is such
that some network card manufacturers used to turn off UDP checksums,
assuming the packets wouldn't be sent over the Internet, which made
life interesting.

You will lose UDP packets from time to time.  How much you lose depends on
lots of things you have no control over and little visibility into.  When
I was playing with network protocols I added a feature that caused the
receiver to randomly discard 20% of incoming traffic.  I figured if I could
handle that reasonably well, I could handle normal lossage.  (Turns out you
tend to lose things in bursts, so it's not quite right, but for a chat
system it should do.)

A good way of coping with this for a chat environment would be to
serialize packets, so that a receiver could detect missed packets
(and discard repeated ones).  A receiver could then send a "request"
for a resend of the missing packet, within a suitable window, like
five minutes.

This requires all senders to keep sent packets for five minutes or so,
and interpret resend requests.

You may also want to consider "polling" senders that you have not
heard from for, say, four minutes, just to make sure that you didn't
miss their last packet and haven't heard from them since.

An alternative would be for all senders to send a (possibly null)
packet at least every four minutes, so most missed packets would be
detected within the resend window.

BTW, all this works fine in a broadcast environment, too.

Of course, the time windows I mentioned should be a function of the
frequency of packets, and could even be made adaptive, if the frequency
varies a lot!

Aren't protocols fun?  ;-)

-michael

Music synthesis for 8-bit Apple II's!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it is seriously underused."