CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

two pic's talking in the internet?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ysaacb



Joined: 12 Jun 2006
Posts: 19

View user's profile Send private message

two pic's talking in the internet?
PostPosted: Tue Dec 04, 2007 3:54 am     Reply with quote

Hi everibody:
it is possible for 2 pic's that are in two diferent LAN two interchange UDP messages?

In the same LAN should be easy. But about doing the same in the internet?
Guest








PostPosted: Tue Dec 04, 2007 4:48 am     Reply with quote

you have to create the routes in the modem through the used port udp.
if you are using an internet connection that gives you a dinamic IP, you have also to create a redirection using one dns service like no-ip.org or other else.
ysaacb



Joined: 12 Jun 2006
Posts: 19

View user's profile Send private message

PostPosted: Wed Dec 05, 2007 3:50 am     Reply with quote

I look around in the internet. There is a technique called "UDP Punch Hole"
(wich skype is based), have anybody an idea how to implement in with PIC's
ysaacb



Joined: 12 Jun 2006
Posts: 19

View user's profile Send private message

PostPosted: Wed Dec 05, 2007 3:58 am     Reply with quote

This is the link
http://www.heise-security.co.uk/articles/82481
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Dec 05, 2007 7:28 am     Reply with quote

Going back to the original question. Yes it is easy and normal to use UDP between PICs over the internet. I use UDP to communicate with devices all over the world.

The issues raised by others is relevant if you have a dynamic IP address in which case you do not know the target IP address to use. In this case you need some dynamic DNS mechanism to resolve a logical name to a dynamic IP address.

If the IP address for the server application, the one listening for a connection , is well known (stays th same) or is linked to a DNS (fixed or dynamic) then it is not necessary for the address of the other to be known.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
jguarin2002



Joined: 11 Nov 2007
Posts: 5

View user's profile Send private message Send e-mail

PostPosted: Wed Dec 05, 2007 3:14 pm     Reply with quote

Well i guees there are more questions to make...

For example ... are you going to write the UDP protocol for your PIC?... also, that protocol should be supported by an IP stack as well as Data Link mechanisms... like the MAC address etc, and those protocols should be hosted too.. will they be supported on your pic or by an external cpu resource?.

Supposing you have all this lower level stack issues solved you got to have in count that UDP should be used between error-free trusted hosts, why? because UDP unlike TCP doesn't support error handle/correction mechs .

That's why UDP is used in applications that typically involves to hosts in the same LAN or network, nothing beyond the gateway.

However it is possible to implement "internet wide" applications with UDP but the problem is that you will have to implement an error protocol by yourself.

Regards.
_________________
Julián Andrés Guarín
ysaacb



Joined: 12 Jun 2006
Posts: 19

View user's profile Send private message

PostPosted: Thu Dec 06, 2007 1:05 am     Reply with quote

well, I'm going to use the CCS Stack that includes the UDP layer and PIC18F4620+ENC28J60.
But thi is the main problem: when the two pic's are behind a router, the firewall dosn't let anybody from the outside send any mesage. The only way I can see is to make a "hole" in the firewall as described in
http://www.heise-security.co.uk/articles/82481
I know that ther is no error cheking in UDP. I can deal with this.
Regards
Ysaac
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

re
PostPosted: Thu Dec 06, 2007 7:31 am     Reply with quote

you could implement a checksum for the data in the packet. the checksum could be used to check only your data.

thanks
arunb
leejok2003
Guest







PostPosted: Tue Dec 23, 2008 9:58 am     Reply with quote

Hi, may i know, how to exchange data within the local area network between 2 PICs? thanks
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group