There are two modes for IPSec. Transport mode and Tunnel mode. Transport mode is for securing end-to-end communication between two computers and tunnel mode is for securing gateway-to-gateway communication.
Refer the following links for more info.
http://www.omnisecu.com/security/ipsec/ipsec-transport-mode.htm
http://www.omnisecu.com/security/ipsec/ipsec-tunnel-mode.htm