FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | ipsec_itf_t_ |
A dedicated IPSec interface type. More... | |
Typedefs | |
typedef struct ipsec_itf_t_ | ipsec_itf_t |
A dedicated IPSec interface type. More... | |
typedef walk_rc_t(* | ipsec_itf_walk_cb_t) (ipsec_itf_t *itf, void *ctx) |
Functions | |
int | ipsec_itf_create (u32 user_instance, tunnel_mode_t mode, u32 *sw_if_indexp) |
int | ipsec_itf_delete (u32 sw_if_index) |
void | ipsec_itf_adj_stack (adj_index_t ai, u32 sai) |
void | ipsec_itf_adj_unstack (adj_index_t ai) |
u8 * | format_ipsec_itf (u8 *s, va_list *a) |
ipsec_itf_t * | ipsec_itf_get (index_t ii) |
void | ipsec_itf_walk (ipsec_itf_walk_cb_t cd, void *ctx) |
typedef struct ipsec_itf_t_ ipsec_itf_t |
A dedicated IPSec interface type.
In order to support route based VPNs one needs 3 elements: an interface, for routing to resolve routes through, an SA from the peer to describe security, and encap, to describe how to reach the peer. There are two ways one could model this:
interface + encap + SA = (interface + encap) + SA = ipip-interface + SA transport mode
or
interface + encap + SA = interface + (encap + SA) = IPSec-interface + SA tunnel mode
It's a question of where you add the parenthesis, from the perspective of the external user the effect is identical.
The IPsec interface serves as the encap-free interface to be used in conjunction with an encap-describing tunnel mode SA.
VPP supports both models, which modelshould you pick? A route based VPN could impose 0, 1 or 2 encaps. the support matrix for these use cases is:
| 0 | 1 | 2 |
ipip | N | Y | Y | ipsec | P | Y | P |
Where P = potentially. ipsec could potnetially support 0 encap (i.e. transport mode) since neither the interface nor the SA requires encap. However, for a route beased VPN to use transport mode is probably wrong since one shouldn't use thransport mode for transit traffic, since without encap it is not guaranteed to return. ipsec could potnetially support 2 encaps, but that would require the SA to describe both, something it does not do at this time.
ipsec currently does not support:
Internally the difference is that the midchain adjacency for the IPSec interface has no associated encap (whereas for an ipip tunnel it describes the peer). Consequently, features on the output arc see packets without any encap. Since the protecting SAs are in tunnel mode, they apply the encap. The midchain adj is stacked only once the proctecting SA is known, since only then is the peer known. Otherwise the VLIB graph nodes used are the same: (routing) --> ipX-michain --> espX-encrypt --> adj-midchain-tx --> (routing) where X = 4 or 6.
Some benefits to the ipsec interface:
The best recommendations i can make are:
gun reloaded, fire away.
typedef walk_rc_t(* ipsec_itf_walk_cb_t) (ipsec_itf_t *itf, void *ctx) |
Definition at line 113 of file ipsec_itf.h.
Definition at line 413 of file ipsec_format.c.
void ipsec_itf_adj_stack | ( | adj_index_t | ai, |
u32 | sai | ||
) |
Definition at line 64 of file ipsec_itf.c.
void ipsec_itf_adj_unstack | ( | adj_index_t | ai | ) |
Definition at line 58 of file ipsec_itf.c.
int ipsec_itf_create | ( | u32 | user_instance, |
tunnel_mode_t | mode, | ||
u32 * | sw_if_indexp | ||
) |
Definition at line 272 of file ipsec_itf.c.
int ipsec_itf_delete | ( | u32 | sw_if_index | ) |
Definition at line 320 of file ipsec_itf.c.
ipsec_itf_t* ipsec_itf_get | ( | index_t | ii | ) |
void ipsec_itf_walk | ( | ipsec_itf_walk_cb_t | cd, |
void * | ctx | ||
) |