View previous topic :: View next topic |
Author |
Message |
ysaacb
Joined: 12 Jun 2006 Posts: 19
|
two pic's talking in the internet? |
Posted: Tue Dec 04, 2007 3:54 am |
|
|
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
|
|
Posted: Tue Dec 04, 2007 4:48 am |
|
|
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
|
|
Posted: Wed Dec 05, 2007 3:50 am |
|
|
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
|
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Wed Dec 05, 2007 7:28 am |
|
|
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
|
|
Posted: Wed Dec 05, 2007 3:14 pm |
|
|
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
|
|
Posted: Thu Dec 06, 2007 1:05 am |
|
|
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
|
re |
Posted: Thu Dec 06, 2007 7:31 am |
|
|
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
|
|
Posted: Tue Dec 23, 2008 9:58 am |
|
|
Hi, may i know, how to exchange data within the local area network between 2 PICs? thanks |
|
|
|