adding code to do NAT type detection.