Subject: Re: theoretical ipsec question
To: Mipam <mipam@ibb.net>
From: Jason R Thorpe <thorpej@zembu.com>
List: tech-net
Date: 12/18/2000 14:04:31
On Mon, Dec 18, 2000 at 10:34:15PM +0100, Mipam wrote:

 > Sure sure, it's not the osi model, in there the ip header is on level 3
 > and the data is level 7.

...first, let's be perfectly clear, the Internet protocol suite does not
have a direct mapping to the OSI model.  Call it bug, call it feature (I
call it feature, because it means the Internet protocol suite is more
flexible, but others have differing opinions), but that's the way it is.

 > But lets look more shortly: |ip header|tcp|data|
 > When you do AH, then it'll be like this:
 > 
 > |ip header|ah|tcp|data|
 > 
 > AH contains cryptographic hashes of the data and identification information.
 > It also has hashes of the source/destination addresses.
 > Now my confusion is about the form of the packet.
 > Is the AH header inserted between the ip and tcp header of the packet
 > or is the AH a part of the ip header in which case the layer 3 has become
 > ip header + ah?

The AH header is inserted between the IP and TCP headers.  It is separate
from the IP header completely.

 > ESP is the encapsulation protocol, it adds headers which describe what to
 > do with the incoming secured packets. It encrypts the tcp and above
 > headers.
 > After applying esp a packet looks like:
 > |ip header|esp header|tcp|data|esp trailer|esp auth|
 >                      ----------------------
 > 		       encrypted
 > 
 > In here i have a bit the same question as before, is the esp header inserted
 > or is it part of the tcp layer? In case the header is inserted you have an
 > 8 layered packet :) Or isnt this the case, i am confused about it.

It is inserted.

Again, you're making the mistake of applying the OSI model to the Internet
protocol suite.  There's not a direct mapping, and it's a mistake to try to
apply the model.

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>