Can we find a sequence of packets that a host can transmit to determine whether it is located behind a NAT box?
I mean, without any special server support like STUN.
Can we find a sequence of packets that a host can transmit to determine whether it is located behind a NAT box?
I mean, without any special server support like STUN.
Well, if your interface has a RFC 1918 private address but you can still reach common Internet hosts, your host is behind a NAT somewhere. :-)
No there isn't unless the opposite end-point (call it B) purposefully (or not) include a reference to the IP of its peer (call it A). Another requirement on top of the aforementioned is that point B must not be using NAT itself.
In short, you either need the assistance of a standard/non-standard server (e.g. STUN or "home-made) or a leak in the communication abstraction. The latter should be considered a design flaw and considered unreliable (at some point somebody will probably fix it).
Apparently it can be done using the TTL field in the IP packets: http://www.sflow.org/detectNAT/.
I don't think it's possible. As far as I know, there's no real way to tell if NAT is being used.