java - How would I locate the correct IP address of another computer on my LAN which is not publicly accessible? -


i writing distributed java app, networking side of things stumping me. reason it's not working correctly. think it's because ip address through ipconfig /all not accessible outside lan. appreciate tips or advice.

overview

you need commonly-known "nat traversal", or ice. there 2 primary protocols used on internet today tcp , udp. tcp sockets carry significant amount of session state information in them; consequently more difficult protocol use p2p udp.

udp tunneling

the following list simplified outline of more general stun protocol (rfc 5389) use implement p2p service based on udp nat traversal...

  1. deploy udp server public address , start listening udp packets clients. clients embed private ip address inside udp packets sent server; idea implement form of authentication ensure getting connections valid client (instead of random packet scanner).
  2. the server reads how private ip address has been translated public ip address udp datagrams.
  3. if want make connections between specific users, embed information inside packets sent clients server; server implement username directory associate client udp socket information usernames (that peers try connect to).
  4. your udp server should send corresponding information other relevant peer(s).
  5. now, peers can communicate directly sending udp datagrams these translated addresses; these packets go through client nat devices in path long udp ports in question allowed , delay introduced protocol not trigger state timeouts in nat devices.

after have established udp connectivity, could form udp ssl vpn between 2 clients using openvpn; give trivial channel initiate tcp connection between clients. however, there non-trivial security , trust issues consider in connectivity model; unlikely useful between random users on internet.

tcp

if tcp connectivity required, suggest looking @ internet draft, mmusic-ice-tcp: tcp candidates interactive connectivity establishment (ice)


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -