This invention provides a method for providing network security services, such
as those provided by the IPSEC protocol, through network address translation (NAT).
The method is based on determining the transformations that occur on a packet and
compensating for the transformations. Because only TCP and UDP protocols work through
NATs, the IPSEC AH/ESP packets are encapsulated into UDP packets for transport.
Special operations are performed to allow reliable communications in such environments.