Understanding assigned kernel-local addresses in udp socket
I am developing a java application using jstun library (hxxp: //jstun.javawi.de/) and I need to compare my public ip with the selected kernel (substitution address is hxxp: //java.sun.com/j2se/1.5. 0 / docs / api / java / net / DatagramSocket.html # DatagramSocket ()) when I create udp socket.
what i don't understand is if my local ip on my natted network is in the form 192.168.1.x why am i getting ip like 10.xxx?
is there a particular reason why these two are totally unrelated? if I wasn't for nat, would the kernel bind the socket to my public address?
Many thanks! asymmetrical
a source to share
I didn't mention a rather important thing: I am developing for android and running my code on an android emulator, which explains the thing with the address 10.xxx.
I have to delve deeper into this ... thanks for the help!
for those of you interested: hxxp: //developer.android.com/guide/developing/tools/emulator.html#networkaddresses
a source to share
For a sending socket, the source IP will be determined by the host's routing table according to the destination IP; for the receiving socket, the destination IP is what you get. The "public" IP address you see is the source address of your packet, which is rewritten by NAT for any internal addresses translated to.
a source to share