From cb33dc2d7a566d571c86b950b4aa92dd7ae01c3c Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Thu, 16 Feb 2017 16:49:46 +0000 Subject: Implemented IKEv2 initiator features: - IKE_SA_INIT and IKE_AUTH initial exchanges - Delete IKA SA - Rekey and delete Child SA - Child SAs lifetime policy To set up one VPP instance as the initiator use the following CLI commands (or API equivalents): ikev2 profile set responder ikev2 profile set ike-crypto-alg ike-integ-alg ike-dh ikev2 profile set esp-crypto-alg esp-integ-alg esp-dh ikev2 profile set sa-lifetime and finally ikev2 initiate sa-init to initiate the IKE_SA_INIT exchange Child SA re-keying process: 1. Child SA expires 2. A new Child SA is created using the Child SA rekey exchange 3. For a set time both SAs are alive 4. After the set time interval expires old SA is deleted Any additional settings will not be carried over (i.e. settings of the ipsec interface associated with the Child SA) CLI API additions: ikev2 profile set responder ikev2 profile set ike-crypto-alg ike-integ-alg ike-dh ikev2 profile set esp-crypto-alg esp-integ-alg esp-dh ikev2 profile set sa-lifetime ikev2 initiate sa-init ikev2 initiate del-child-sa ikev2 initiate del-sa ikev2 initiate rekey-child-sa Sample configurations: Responder: ikev2 profile add pr1 ikev2 profile set pr1 auth shared-key-mic string Vpp123 ikev2 profile set pr1 id local fqdn vpp.home.responder ikev2 profile set pr1 id remote fqdn vpp.home.initiator ikev2 profile set pr1 traffic-selector remote ip-range 192.168.125.0 - 192.168.125.255 port-range 0 - 65535 protocol 0 ikev2 profile set pr1 traffic-selector local ip-range 192.168.124.0 - 192.168.124.255 port-range 0 - 65535 protocol 0 Initiator: ikev2 profile add pr1 ikev2 profile set pr1 auth shared-key-mic string Vpp123 ikev2 profile set pr1 id local fqdn vpp.home.initiator ikev2 profile set pr1 id remote fqdn vpp.home.responder ikev2 profile set pr1 traffic-selector local ip-range 192.168.125.0 - 192.168.125.255 port-range 0 - 65535 protocol 0 ikev2 profile set pr1 traffic-selector remote ip-range 192.168.124.0 - 192.168.124.255 port-range 0 - 65535 protocol 0 ikev2 profile set pr1 responder TenGigabitEthernet3/0/1 192.168.40.20 ikev2 profile set pr1 ike-crypto-alg aes-cbc 192 ike-integ-alg sha1-96 ike-dh modp-2048 ikev2 profile set pr1 esp-crypto-alg aes-cbc 192 esp-integ-alg sha1-96 esp-dh ecp-256 ikev2 profile set pr1 sa-lifetime 3600 10 5 0 Change-Id: I1db9084dc787129ea61298223fb7585a6f7eaf9e Signed-off-by: Radu Nicolau --- src/vnet/devices/dpdk/ipsec/esp_decrypt.c | 2 ++ src/vnet/devices/dpdk/ipsec/esp_encrypt.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src/vnet/devices/dpdk') diff --git a/src/vnet/devices/dpdk/ipsec/esp_decrypt.c b/src/vnet/devices/dpdk/ipsec/esp_decrypt.c index 53b2d122e9f..760076093cb 100644 --- a/src/vnet/devices/dpdk/ipsec/esp_decrypt.c +++ b/src/vnet/devices/dpdk/ipsec/esp_decrypt.c @@ -174,6 +174,8 @@ dpdk_esp_decrypt_node_fn (vlib_main_t * vm, } } + sa0->total_data_size += b0->current_length; + if (PREDICT_FALSE(sa0->integ_alg == IPSEC_INTEG_ALG_NONE) || PREDICT_FALSE(sa0->crypto_alg == IPSEC_CRYPTO_ALG_NONE)) { diff --git a/src/vnet/devices/dpdk/ipsec/esp_encrypt.c b/src/vnet/devices/dpdk/ipsec/esp_encrypt.c index b6f000048f9..6eb1afc9501 100644 --- a/src/vnet/devices/dpdk/ipsec/esp_encrypt.c +++ b/src/vnet/devices/dpdk/ipsec/esp_encrypt.c @@ -177,6 +177,8 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm, goto trace; } + sa0->total_data_size += b0->current_length; + sa_sess = pool_elt_at_index (cwm->sa_sess_d[1], sa_index0); if (PREDICT_FALSE (!sa_sess->sess)) { -- cgit 1.2.3-korg