XFRM: BEET IPsec mode for Linux
Subsystems (2)
On Tue, 2 Aug 2005, Diego Beltrami wrote:
Hi Herbert and others,
(sorry for the late comments - I am still on a holiday :)
Quoted 15 lines
after sending the first version of BEET patch and having received a valuable feedback and after the discussion based upon the BEET design, we now send the new BEET patch which allows for BEET to work without the inter-family transform (i.e. inner address family different than outer address family).
...As it was originally designed the BEET patch at the moment works for only ESP protocol.
As Pekka Nikader mentioned in one reply [1]: "[...] defining BEET mode for AH might be pretty tricky. [...] it probably would require some careful thinking to define the exact semantics, like what addresses (inner or outer) are covered by the AH integrity protection, what does the integrity protection really assert, etc. ".
Quoted 8 lines
As previously written, the inter-family transform has been left out at the moment since the xfrm architecture doesn't support it. As a result, as soon as the xfrm architecture will be enhanced, the inter-family case will be properly included as, for example, it can be useful for supporting HIP over IPv4 network. But, as already mentioned, this would require more work in properly designing the xfrm architecture (thing which we consider necessary in order to make xfrm as generic as possible).
Based on the comments from Pekka Nikander, it seems like to me that generalizing XFRM to support AH with different inner and outer families may not very useful (a). On the other hand, the different inner and outer families for BEET is *extremely* useful (b). Excluding this support from BEET restricts the HIP implementations and applications quite radically.
My own thinking logic tells me the (a) + (b) equals to supporting different inner and outer families in BEET in the way it is implemented currently. Don't fix it if it ain't broken!)
We have tested that the BEET with different inner and outer addresses does not break anything. Further, if you don't need it, you don't have to compile it in :) Later, if AH seems really useful with different inner and outer families, or a new XYZ header is introduced, we can refactor the architecture for greater modularity. Even then, the XFRM/PFKEY APIs should remain the same.
So, I'd vote for the original BEET patch, but of course it is up to you to decide. The BEET support is the minimal support required from the kernel in order for a usepace HIP implementation to work, and it would make both HIP implementors and users life much more easier :) Additionally, we would gain also more experience from using mixed inner and outer families within the XFRM architecture.
Signature · 1 line
Miika Komu [email protected] http://www.iki.fi/miika/
Quoted 6 lines · Diego Beltrami
after sending the first version of BEET patch and having received a valuable feedback and after the discussion based upon the BEET design, we now send the new BEET patch which allows for BEET to work without the inter-family transform (i.e. inner address family different than outer address family).
Thanks for the new patch. Unfortunately it really looks quite similar to the previous patch :)
net/ipv4/esp4.c
Quoted 2 lines
net/ipv4/esp4.c +0
-0
I thought getting rid of the interfamily stuff would remove the need to touch this file, no?
Thanks,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 7 lines
Well to me it's more of an issue of maintainability. BEET mode is more akin to transport/tunnel mode than AH/ESP/IPcomp. As such its implementation would be most at home where the existing encapsulation and decapsulation for transport/tunnel mode is done. That is, in xfrm[46]_input.c and xfrm[46]_output.c.
Quoted 5 lines
For instance, the reason the current patch has to touch
esp4.cat all is really because the patch toxfrm4_output.cisn't right. It should do what the comment says and setskb->hto the start of the payload, not the start of the ESP header. If it did that, thenesp_outputdoesn't have to care about BEET at all.
This is totally true, and I agree with you but then this is somehow a controversial thing with respect to the esp6_output. In fact the esp6_output has the same purpose of esp_output, but it requires the skb->h to be set at the beginning of ESP header.
Quoted 4 lines
Also, the outer header generation should be done before
x->type->outputis called, not after. That way, the AH semantics falls out quite naturally.
BEET has been designed to be compatible with HIP. This means that the ESP header should be computed with respect to the inner addresses.
In a very first implementation of BEET we were converting the inner addresses to the outer addresses before x->type->output, but we couldn't make interoperate BEET with HIP. That's the reason why the outer header generation has been after x->type->output.
This is one of the reasons why the AH, as Pekka Nikader said, is a bit trickier with respect to ESP (the AH protocol protects the IP datagram including immutable parts of the IP header like the IP addresses whereas for ESP the IP header is not included in the calculation process).
--Diego