Re: [IPsec] New Version Notification for draft-smyslov-ipsecme-ikev2-compression-00.txt

"Valery Smyslov" <svanru@gmail.com> Wed, 13 January 2016 15:09 UTC

Return-Path: <svanru@gmail.com>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 220961B2E94 for <ipsec@ietfa.amsl.com>; Wed, 13 Jan 2016 07:09:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.909
X-Spam-Level: *
X-Spam-Status: No, score=1.909 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_SORBS_WEB=0.77, SPF_PASS=-0.001, STOX_REPLY_TYPE=0.439] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id en8W_tdRApIm for <ipsec@ietfa.amsl.com>; Wed, 13 Jan 2016 07:09:27 -0800 (PST)
Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 183921B2E8C for <ipsec@ietf.org>; Wed, 13 Jan 2016 07:09:27 -0800 (PST)
Received: by mail-lb0-x231.google.com with SMTP id x4so35642357lbm.0 for <ipsec@ietf.org>; Wed, 13 Jan 2016 07:09:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:references:subject:date:mime-version :content-type:content-transfer-encoding; bh=HQzaHHdhgbQdfM4F7tzAvtpZ5F43oWZxpb8xj7cvF4c=; b=kLVawCMAbK2nlKqOpxpe4wgW4N8jugLRdvJgp9az4jP+QyUz7kCG2MxPsnv/JBZoUr bnCaMZTNaw4ijPqnTl2Rljy/xYHbWfe7+BAG497ToK8SpnuZ7Xj4PbADHZjkj2MJrayB TfEOZlMHS/W0HbUx9JXaXbMkM35E5LlQ60mllRaUJoBmDbCuPj+JX8xi7eBvtuq/4Mer nTnw4CCRzfv74FjnP4HeRcW880kJutAwCTtzrqx1PYSPB8ERdlwhdvHgrr/JVWzCzrEv iH6N1/A/1vfVPhlC2M0L7qgck3i0dsBYVMAET3FrGSbjR+gpQOqsvk7Ov5iO6Ql1rt5w uAxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:references:subject:date :mime-version:content-type:content-transfer-encoding; bh=HQzaHHdhgbQdfM4F7tzAvtpZ5F43oWZxpb8xj7cvF4c=; b=KGegAHsw9kGDPI/4CDS8PRCgBffQCBWfKIF2qHC81XdIcT1eXV94AnQK3rB+c/YnU9 dRceV5PfkSJ0vg+pep+J7KgVSzHgEJQxAG+Mg6DpgQZlvYgCJZYCmzoVU+9tk+hi2NUk FnlKjsavuJJg8EsiVEW4JdGrKb2hsWS0rAbb6fuUAIbrNogvpJ51MZcsMfMooJlxX2X+ XMudLicY9YF+qb+QFNvaKcdWtZk994HAciLKcVbcwS5NAC8tTKZEX3RI9y5jEwZYdKdK EEA01IDWwpqIbnkv53lcdPZVGNkd7PqTDKC4IpJ1BsERtVuu4fht0Blt82wBXHDY4njC Msow==
X-Gm-Message-State: ALoCoQlhI3OEQLldXvyChPWOJ+qEER3CMosJKMUnozYNz9Y49jvoXYHdYNcvYCeHblcal+y5ZikIkU0VjosAEDUNo1xH4Jlyug==
X-Received: by 10.112.129.134 with SMTP id nw6mr51566851lbb.10.1452697765258; Wed, 13 Jan 2016 07:09:25 -0800 (PST)
Received: from buildpc ([82.138.51.4]) by smtp.gmail.com with ESMTPSA id f4sm237722lbs.10.2016.01.13.07.09.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jan 2016 07:09:24 -0800 (PST)
Message-ID: <766BDC320C824A3793FE8DD74566FC06@buildpc>
From: Valery Smyslov <svanru@gmail.com>
To: Tommy Pauly <tpauly@apple.com>
References: <7A83C993003E493EB2E895E2B8CFEC61@buildpc> <DC3EFDC3-3482-4DDD-AE06-27E24FB6F5C5@gmail.com> <22163.54776.641819.67931@fireball.acr.fi> <4C042BBC-C27F-4B87-8EB5-56862B309A63@apple.com>
Date: Wed, 13 Jan 2016 18:09:26 +0300
MIME-Version: 1.0
Content-Type: text/plain; format="flowed"; charset="UTF-8"; reply-type="original"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
Archived-At: <http://mailarchive.ietf.org/arch/msg/ipsec/LQ_iVd4HxTPrYvFSjWG8X29QSd8>
Cc: IPsecME WG <ipsec@ietf.org>, Tero Kivinen <kivinen@iki.fi>, Yoav Nir <ynir.ietf@gmail.com>
Subject: Re: [IPsec] New Version Notification for draft-smyslov-ipsecme-ikev2-compression-00.txt
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jan 2016 15:09:29 -0000

Hi Tommy,

>> In those environments the IKEv2 is used to negotiate link keys between
>> two devices. The payloads are already quite compacted, i.e. there will
>> not be several proposals for ciphers, only one, and all extra payloads
>> are omitted anyways.
>
> Tero’s comments seem to confirm the idea that constrained devices will generally
> be using a small set of proposals, and thus do not need compression.

Well, I'm not an expert in IoT devices. And it's true that with minimal set of transforms
and with reduced number of supported features the compression won't help much in IKEv2.
However, I'm a bit afraid of oversimplifying the whole picture. It seems to me that
there may be different kinds of constrained devices, and some of them would
be more advanced, then the most restricted ones. And I think that the IoT world
won't be isolated, so that at least some of the IoT devices would have to communicate
with the "big world" peers and thus would have to support more IKEv2 features and extensions,
that would make their messages larger. And for those devices the compression could be useful.

> The document referred to in the draft as IPSEC-IOT-REQS, draft-mglt-6lo-diet-esp-requirements-01,
> recommends essentially one algorithm for the Child SA algorithm (AES-CCM),
> so it may be safe to assume that IoT devices could converge to a small set of IKE SA algorithms
> to standardly use. And, while this document does recommend compression for ESP packets,
> I can see more of an argument being made for compressing ESP traffic (which may be many packets)
> than for compressing the IKE_SA_INIT packet, which is already a one-time-cost small packet.

The compression draft is not only about the IKE_SA_INIT messages. It also allows the subsequent
messages to be compressed. While the IKE_AUTH is also one-time message, I can imagine
that some restricted devices could use IKE SA to transmit application data (it can appear to be easier
than to implement ESP). In this case the compression would be useful too.

> Valery, do you have specific real-world examples of IKE_SA_INIT packets that are being used
> by IoT devices that get a benefit from this compression? Without this, it seems that adding
> compression to IKE would add a fair amount of complexity to optimize a packet that is already
> fairly inexpensive to send.

As I've already said I'm not an expert in the IoT world. And I still think that the compression can
also be used in a "big world". It would allow to keep the IKE_SA_INIT message size bounded
when more features are added into the protocol. And I don't see it as an alternative to
TCP encapsulation. As you wrote in the TCP encapsulation draft it has a number of issues
(for example TCP in TCP) and thus it should be considered as a "last resort". Compression
would make those occasions when TCP encapsulation is needed more rare,
when it is _really_ needed (e.g. when UDP traffic is blocked). Sure compression cannot
replace TCP encapsulation.

And here some data from my experiments with compression
of the IKEv2 messages using DEFLATE algorithm:

1. IKE_SA_INIT, single transform of each type:

HDR,
 SA[48]{
   P[44]{
    Encryption=AES-CBC {KeyLen=128},
    PRF=SHA1-HMAC,
    Integrity=SHA1-HMAC96,
    Group=MODP-1536}},
  NONCE[36],
  KE[200](MODP-1536),
  N[28](NAT_DETECTION_SOURCE_IP),
  N[28](NAT_DETECTION_DESTINATION_IP),
  N[8](IKEV2_FRAGMENTATION_SUPPORTED),
  N[16](SIGNATURE_HASH_ALGORITHMS){SHA1, SHA2-256, SHA2-384, SHA2-512},
  N[8](REDIRECT_SUPPORTED),
  VID[26]

In this case using compression results in roughly the same message size
(you can save or loose a few bytes).

2. IKE_SA_INIT, multiple transforms of each type:

HDR,
  SA[264]{
   P[104]{
    Encryption=AES-CBC {KeyLen=256}, AES-CBC {KeyLen=128},
    PRF=SHA2.256-HMAC, SHA2.384-HMAC, SHA2.512-HMAC,
    Integrity=SHA2.256-HMAC128, SHA2.384-HMAC192, SHA2.512-HMAC256,
    Group=ECP-256, ECP-384, ECP-521},
   P[84]{
    Encryption=AES-CBC {KeyLen=128}, 3DES-CBC,
    PRF=SHA1-HMAC, SHA2.256-HMAC,
    Integrity=SHA1-HMAC96, SHA2.256-HMAC128,
    Group=MODP-1024, ECP-224, ECP-256},
   P[72]{
    Encryption=DES-CBC,
    PRF=SHA1-HMAC, MD5-HMAC,
    Integrity=SHA1-HMAC96, MD5-HMAC96,
    Group=MODP-1024, MODP-768, ECP-192}},
  NONCE[36],
  KE[72](ECP-256),
  N[28](NAT_DETECTION_SOURCE_IP),
  N[28](NAT_DETECTION_DESTINATION_IP),
  N[8](IKEV2_FRAGMENTATION_SUPPORTED),
  N[16](SIGNATURE_HASH_ALGORITHMS){SHA1, SHA2-256, SHA2-384, SHA2-512},
  N[8](REDIRECT_SUPPORTED),
  VID[26]

In this case using compressions results in saving of ~150 bytes out of initial ~530 bytes (~30%).

3. IKE_AUTH with certificate, single proposal of each type, simple traffic selectors:

HDR,
 SK[1720]{
  IDi[63](DN),
  CERT[1167](X.509 Cert),
  CERTREQ[45](X.509 Cert),
  IDr[38](DN),
  AUTH[150](Sig){sha1RSA[13]},
  N[8](INITIAL_CONTACT),
  N[8](IKEV2_MESSAGE_ID_SYNC_SUPPORTED),
  N[12](SET_WINDOW_SIZE),
  CP[16](REQUEST),
  SA[44]{
   P[40]{
    Encryption=AES-CBC {KeyLen=128},
    Integrity=SHA1-HMAC96,
    ESN=Off}},
  TSi[40],
  TSr[40],
  N[8](ESP_TFC_PADDING_NOT_SUPPORTED),
  N[8](NON_FIRST_FRAGMENTS_ALSO),
  N[28](QCD_TOKEN),
  N[8](TICKET_REQUEST)}

In this case using compression results in saving ~350 bytes out of ~1750 (~20%).
In this particular example the resulting message would become ~1400 bytes, that
would avoid IP fragmentation in most cases (and thus avoid using IKE fragmentation).
Using compression here would be more effective if more transforms are included
in the SA payload, more attributes are requested in the CP payload or more complex
traffic selectors are included.

> Thanks,
> Tommy

Regards,
Valery.