TCP or UDP?

I'm working on a remote console that communicates through an Arduino Ethernet Shield through ethernet to a computer that controls an Autonomous Underwater Vehicle.

The software is already on the computer mentioned. I'll be using the Duemilanove to communicate with the computer. I will send commands and receive updated status reports.

Right now I'm doing heavy research on the protocol I should be using for communication. Is TCP the way to go or should I look into UDP?

Where could I find more information on this subject/idea? Any projects out there similar to what I have in mind that I could look at?

Thanks!

I don't know about that shields capabilities, but it all depends on what you are doing. IF what you are doing is time critical like for example: If you don't get a certain data on a certain time span then is not needed anymore Ex. 500 ms. If you are transferring data that you are just going to collect on a file and then upload, I would use TCP.

For what I can see on your case, I would definitely use UDP. I use UDP for real time data acquisition my self like NMEA and DPT strings for example, because I use software on the topside to use this data real time.

The remote will be used to take control of a submarine once it reaches the ocean's surface to navigate it toward the ship's crane where it can be hoisted out of the water.

You were correct in your assumption. It needs to be very real time with very low latency. I believe we will be using NMEA strings as well.

Any ideas of where I can find some more information on this? I'm rather new to the area of data acquisition via UDP. Thanks!

There are many options that required no use of a micro controller to do the communication from the remote side to the top side, Serial to UDP servers can do this very easily with very low latency. I use the NPorts from Moxa my self.

UDP does not provide reliable data transmission (no checking for dropped packets, no retransmission.)

TCP isn't inherently slower than UDP; the circumstances under which TCP latency would exceed 500ms are the same under which UDP would completely fail to receive the packet.

To add reliable transmission to UDP would mean essentially re-inventing major parts of TCP. You might want to look at RTP (although it is designed for audio/video, and I vaguely recall that it's big features involve the easy identification of "obsolete" data.) Or SCTP (more likely?) But you can forget about getting on-chip protocol support (ala Wiznet) for the less popular protocols, I think.)

http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol http://en.wikipedia.org/wiki/Real-time_Transport_Protocol

Stick with TCP you’ll save yourself a TON of headaches down the road.

I have to disagree, I use UDP for most of my real time data acquisition and for what he needs it, it will work so much better...remember that positioning information is sent at least once a second and if he happen to miss a position for one second "which I don't see happen" it is ok, but if he receives it late it will be no good anyway.

The remote will be used to take control of a submarine once it reaches the ocean’s surface to navigate it toward the ship’s crane where it can be hoisted out of the water.

Definately an application that needs split second timing. :wink:

Yes, I need everything as real-time as possible. And as previously mentioned, if a position is lost then there is no point in recovering that information because the submarine would be at a new position anyway.

From what I've looked at elsewhere and from the replies on this forum, I feel like UDP is probably my best option. However at this point, I am completely a newbie in using transmission protocols. My experience with Arduino boards is limited to the analog and digital input/output. I don't have any experience with the Ethernet Shield either but I don't feel like that will be too challenging.

How much does this change my programming? Where do I get started?

How many links (routers, hubs, switches) are between the two sides of your Ethernet connection?

What is the expected number of bytes per second?

What is the "line rate" (e.g. 10Mps) of your Ethernet connection?

Why not just use the controls like the people below (unless it is a really fast submarine)?

http://www.youtube.com/watch?v=fUXL7Ju0LuE