Header sizes in ESP implementation
"Francesco Trotta" <[email protected]>
| Newsgroups | gmane.network.freeswan.devel |
|---|---|
| Message-ID | <[email protected]> |
I am trying to calculate the overhead due to the ESP in a IP packet.
I am using FreeS/WAN 1.98b but I wonder the implementation of ESP should be
the same even in 1.99.
So far I have used manual keying mode, but settings that I have made should
apply also for the automatic mode.
If I am not wrong, 3DES is used for encryption. I set HMAC with MD5 as
authentication hash.
Reading the Compatibility Guide and RFC 2451, it should be like this:
1| 2| 3| 4|
0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Security Parameters Index (4 bytes) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number (4 bytes) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Inizialitazion Vector (8 bytes) |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
| Payload (variable) | |
+ + look
~ ~ |
| | at
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| | Padding (0-255 bytes) | me
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| | Pad Length(1)| Next Header(1)| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
| Authentication Data (12 bytes) |
+ +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The "look at me" part has to be X bytes long, where
X mod 8 = 0 (condition 1)
What I would know is this: Is the length of the padding the MINIMUM that
guarantees the condition 1? Or can be even more?
If you have any other information that can help me know the size of the
payload, knowing the size of the whole packet, please tell me.
Thank you
Francesco Trotta