I have already done some research about NAT traversal, and got some suggestions from the web about the P2P applications. But my case is somewhat different than one traditional P2P applications.I already have one public Server, i just need to access the devices behind NAT from the known public Server.
The detail info about my case is as following:
1.PC-A have public IP
2.PC-B is behind NAT, does not have public IP. In my case PC-A and PC-B is under full control.
3.PC-C is also behind NAT, and could be reached from PC-B
The question is that:
Your PC-A is often called a 'relay' in P2P talk.
The basic principle is that all peers behind firewalls (PC-B and PC-C in your case) establish outbound connections to PC-A. PC-A then "links/bonds" the connections. Usually these connections are made over HTTP, which is firewall friendly. So for PC-B to talk to PC-C, a simplified sequence is:
Things get (very) complicated when you throw in
Most P2P frameworks implement some kind of relays. This is the case for JXTA and XMPP (check ICE).
I believe Ian Mc Ginniss also developed something called HTTP Tunnel as part of the Netty project (originally as replacement for JXTA relays which are somewhat sub-optimals)