View Single Post
  #8   Spotlight this post!  
Unread 01-02-2011, 18:51
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Re: Receiving UDP packets on the CRIO

Quote:
Originally Posted by Tom Bottiglieri View Post
Wouldn't that be a better reason to use UDP? If there's less of a chance of dropped packets, why bother with the added overhead of TCP?
Because the "overhead" of TCP is barely noticeable (the information density is ~94%, with ~6% left for headers) and really only comes into play when you have a noisy connection, where packets would be missed and therefore resent, and during the initiation of a connection, which you do once. Dropped packets are a non-issue, as well, and wouldn't affect TCP's performance. It happens, but very rarely (comparatively) and in everything I've experienced it's rarely anything but hardware problem.

Besides apparently not being able to use UDP, TCP is generally easier to use, as a stream, than to have to fit everything into a fixed datagram and then unpack it (this is more of a personal choice, though). The only benefit of UDP will be if you are sending time sensitive information, otherwise I see no reason why it would be chosen to use.

It doesn't matter either way. You can do some time tests with TCP vs UDP, if you want.
Reply With Quote