It is useful in the virtual private network. For example, if two distant trusted networks are to be connected using unreliable networks such as the Internet, IPSec can protect private networks from unreliable networks. In this case, IPSec engines work on the each gateways.