From: Michael Becker <michbec@t-online.de>
To: k8 s <uint32@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re[2]: IPSec Inbound Processing Basic Doubt
Date: Tue, 28 Jun 2005 23:41:57 +0200 [thread overview]
Message-ID: <1267256797.20050628234157@t-online.de> (raw)
In-Reply-To: <699a19ea05062810087b79f12f@mail.gmail.com>
Hello,
ks> heard that IPSec is kept in a UDP packet and sent. How does the tx
ks> side processing happen (the host from which the udp encapsulated ipsec
ks> packet originated). The last call in the stackable destination is
ks> ip_output() as you said.
ks> How does it go back to udp(transport) layer in this case.
It doesn't go back.
UDP encapsulation is done for ...
INPUT:
- udp_rcv
|
--- udp_queue_rcv_skb
|
--- udp_encap_rcv (strips of udp)
|
--- xfrm4_rcv_encap (usual procedure)
OUTPUT:
- Done in esp_output as part of a stacked destination
(e.g. net/ipv4/esp4.c)
NAT-Traversal does only make sense for ESP, as AH protocol
authenticates ("hashes") whole IP header including
IP src / dst address, so you can't manipulate afterwards
like SNAT / DNAT would do.
exerpt from net/ipv4/esp4.c
/* this is non-NULL only with UDP Encapsulation */
71 if (x->encap) {
72 struct xfrm_encap_tmpl *encap = x->encap;
.. ...
81
82 switch (encap->encap_type) {
83 default:
84 case UDP_ENCAP_ESPINUDP:
.. ....
87 case UDP_ENCAP_ESPINUDP_NON_IKE:
.. ....
91 break;
92 }
93
94 top_iph->protocol = IPPROTO_UDP;
95 } else
96 top_iph->protocol = IPPROTO_ESP;
As you see input and output processing isn't symetric any way,
with or without UDP encapsulation (NAT-T)
Have a look at http://lxr.linux.no which helps a lot sorting out
different pathes in the code. It's a complete cross reference of
the latest and some previous kernels
Best regards
Michael Becker
Hochschule Niederrhein - Krefeld, Germany
prev parent reply other threads:[~2005-06-28 21:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-23 17:55 k8 s
2005-06-27 16:24 ` Michael Becker
2005-06-28 17:08 ` k8 s
2005-06-28 17:31 ` k8 s
2005-06-28 21:53 ` Re[2]: " Michael Becker
2005-06-28 21:41 ` Michael Becker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267256797.20050628234157@t-online.de \
--to=michbec@t-online.de \
--cc=linux-kernel@vger.kernel.org \
--cc=uint32@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®