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...
- 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).
- the server reads how private ip address has been translated public ip address udp datagrams.
- 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).
- your udp server should send corresponding information other relevant peer(s).
- 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
Post a Comment