Solved

Solution of P2P over NAT (UDP or SIP?)

Posted on 2006-07-23
4
1,153 Views
Last Modified: 2008-01-16
Dear experts,

I am working on a project that require me to develop a P2P-like system. The brief description of the project is that there is a home device (possibly installed with windows or linux) and it can accept command from mobile devices (possibly it can be PC, mobile device installed with Symbian, plam OS or ARM linux .. etc as long as it can be used by human and it can be connected to the Internet).

Both the home device and mobile device are behind firewall with NAT feature. So, up to now, we have 2 ideas to solve it out:

1. Use UDP.
Advantage:
- UDP can pass through NAT by using some techniques. For example, by using a server storing the public address (ip, port) information of each other and ask those peers to open a session by sending dummy message through the firewall to the peer and keep the session alive by sending message to the server periodically.
Disadvantage:
- UDP is unreliable, that means, we have to implement a reliable messaging protocol which contain the re-send mechanism and lose detection .. etc. So, it can be solved by employing some existing library like UDT (http://udt.sourceforge.net/) or implement it yourself. However, it raises another problem that we need to port the code to the mobile platform like Symbian, PlamOS or Java ... etc. So, what bad is that it is time consuming and hard to manage well of all the source in different platform. Also, some said that Nokia phone doesn't open the UDP API for those application usage, if so, UDP is limited in some device or platform.
Also, under symmetric NAT (old NAT design), UDP still not ensure the message can be arrived to destination.

2. Use SIP
Advantage:
- SIP is an IETF standard and is becoming very popular in the world. And because it is a standard, there is no need to worry the problem of incompatibility. You can use the SIP library provided in different platform and communicate without any problem (Most Symbian and Java MIDP support SIP now). Also, it can ensure the message be arrived to the destination even the peer are behind whatever kind of firewall (e.g. Symmetric NAT, which will make the above UDP method fail)
Also, SIP is supported in Windows, WinCE, Symbian, J2ME MIDP, Linux ... etc. It will save us a lot of development time.
Disadvantage:
- SIP is becoming very large and a lot of feature is not useful to us (like Media, VoIP ... etc). As we just want to send some simple cmmand and UDP seem thin enough to meet our need.

So, experts, would you please suggest me which method above is better to our case and share with me the experience you have? And have other suggestion?

Points can be rasied on reasonable request.

Thanks a lot
0
Comment
Question by:liuhoihing
4 Comments
 
LVL 11

Accepted Solution

by:
NetoMeter Screencasts earned 200 total points
ID: 17168874
Hi!
It depends on the level of control that you want to achieve.
Here is an example. I am running an Asterisk server (linux platform) and besides using it as a full featured telephone system I have a special menu (requires authentication – sequence of numbers) which allows me to perform series of tasks on my server (like restarting the server, changing the dial plan, redirecting calls to different locations etc).
I am using successfully two protocols for these tasks.
The first one is SIP – I am registering to a SIP provider so I can get external phone calls and perform the commands through my cell phone.
The second one is IAX so I can connect through other (internet connected) IAX devices or IAX gateways.
Asterisk server is free and stable, so all you have to do is choose the options for your menu.

Dean
0
 

Author Comment

by:liuhoihing
ID: 17169189
Thx Dean,

It seem quite good. I first heard of Asterisk. I always try to google "SIP server" and it never return me "Asterisk". I guess it maybe that Asterisk is not famous for its SIP function. It is feature rich in its "Call feature".

As I just see the feature list and it just mention it supports SIP protocol. However, in SIP, we always want to know what SIP feature it support like "Presense", "SIP registrar", "SIP Proxy", "NAT Transversal" ... etc. And "NAT Transversal" is the most important part to me.

Thanks for your information again and I will try it soon.

Hing
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Article by: IanTh
Hi Guys After a whole weekend getting wake on lan over the internet working, I thought I would share the experience. Your firewall has to have a port forward for port 9 udp to your local broadcast x.x.x.255 but if that doesnt work, do it to a …
Some time ago I was asked to set up a web portal PC to put at our entrance. When customers arrive, they could see a webpage 'promoting' our company. So I tried to set up a windows 7 PC as a kiosk PC.......... I will spare you all the annoyances I…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now