Pages: [1]   Go Down
Author Topic: TCP or UDP?  (Read 1505 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
« Last Edit: June 17, 2010, 11:09:17 am by kebo04 » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 112
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No trees were harmed by the transmission of this message. However a few million electrons were temporarily inconvenienced.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 112
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No trees were harmed by the transmission of this message. However a few million electrons were temporarily inconvenienced.

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6373
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Canby, OR
Offline Offline
Full Member
***
Karma: 1
Posts: 158
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 112
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No trees were harmed by the transmission of this message. However a few million electrons were temporarily inconvenienced.

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8922
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.  smiley-wink
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
« Last Edit: June 18, 2010, 02:00:01 pm by bcook » Logged

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8922
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Pages: [1]   Go Up
Jump to: