
212 䡲 Security in an IPv6 Environment
IPsec treats everything in an IP datagram after the IP header as one unit. Usually,
an IP datagram has three parts: the IP header (for routing purpose only), the upper
layer protocol headers (e.g., the TCP header), and the user data (e.g., TCP data).
In transport mode, an IPsec header (AH or ESP) is inserted after the IP header and
before the upper-layer protocol header to protect the upper-layer protocols and user data.
In tunnel mode, the entire IP datagram is encapsulated in a new IPsec packet (a
new IP header followed by an AH or ESP header). See Figure 6.1. In either mode,
the upper-layer protocol ...