Re: [TLS] Maximum Fragment Length negotiation

Raja ashok <raja.ashok@huawei.com> Wed, 30 November 2016 10:49 UTC

Return-Path: <raja.ashok@huawei.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A5A80129651 for <tls@ietfa.amsl.com>; Wed, 30 Nov 2016 02:49:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.697
X-Spam-Level:
X-Spam-Status: No, score=-5.697 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.497, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01, T_KAM_HTML_FONT_INVALID=0.01] autolearn=ham autolearn_force=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 mjuESpm98NQY for <tls@ietfa.amsl.com>; Wed, 30 Nov 2016 02:49:18 -0800 (PST)
Received: from lhrrgout.huawei.com (lhrrgout.huawei.com [194.213.3.17]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AD8F4129F22 for <tls@ietf.org>; Wed, 30 Nov 2016 02:49:11 -0800 (PST)
Received: from 172.18.7.190 (EHLO lhreml702-cah.china.huawei.com) ([172.18.7.190]) by lhrrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CWH40092; Wed, 30 Nov 2016 10:49:07 +0000 (GMT)
Received: from BLREML407-HUB.china.huawei.com (10.20.4.45) by lhreml702-cah.china.huawei.com (10.201.5.99) with Microsoft SMTP Server (TLS) id 14.3.301.0; Wed, 30 Nov 2016 10:49:00 +0000
Received: from BLREML509-MBX.china.huawei.com ([169.254.7.90]) by BLREML407-HUB.china.huawei.com ([10.20.4.45]) with mapi id 14.03.0301.000; Wed, 30 Nov 2016 16:18:49 +0530
From: Raja ashok <raja.ashok@huawei.com>
To: Thomas Pornin <pornin@bolet.org>, "Fossati, Thomas (Nokia - GB)" <thomas.fossati@nokia.com>
Thread-Topic: [TLS] Maximum Fragment Length negotiation
Thread-Index: AQHSSnJUUXQAYc6WmEWL9A2VSlDz2KDxTA1w
Date: Wed, 30 Nov 2016 10:48:49 +0000
Message-ID: <FDFEA8C9B9B6BD4685DCC959079C81F5E1913EAC@BLREML509-MBX.china.huawei.com>
References: <20161124195002.GA32346@bolet.org> <D45D053C.76B0A%thomas.fossati@alcatel-lucent.com> <20161129185451.GA4541@bolet.org>
In-Reply-To: <20161129185451.GA4541@bolet.org>
Accept-Language: en-US, zh-CN
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [10.18.213.121]
Content-Type: multipart/related; boundary="_004_FDFEA8C9B9B6BD4685DCC959079C81F5E1913EACBLREML509MBXchi_"; type="multipart/alternative"
MIME-Version: 1.0
X-CFilter-Loop: Reflected
X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.583EAEA5.045D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=169.254.7.90, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32
X-Mirapoint-Loop-Id: 8d984ef14dd4107c0d3325b626759228
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/S0qenpX_iWtwg5Fobhu38h2e_Yc>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Maximum Fragment Length negotiation
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 30 Nov 2016 10:49:20 -0000

Hi Thomas



Your idea of defining a new similar extension is the only choice for us. Because as per existing max_fragment_length extension in RFC 6066, client should fail if it receives different value from server.

And also your idea of making the new extension as mandatory for TLS1.3 is good, as it will be more useful for constraint server.



Earlier in our team also we were discussing about defining new extension specially for constraint client and server. I suggest we should include the below points for new fragment length extension

      1) As per RFC 6066, if 512 is negotiated then both entity should keep buffer of size 805 bytes (5 byte - record header, 512 bytes - data, 256 bytes - padding, 32 bytes - MAC). I think we should change this in our new fragment extension. If 512 is negotiated then both entity should not send any [D]TLS record of size more than that (includes record header and payload).  Because the control overhead of 256 bytes padding and 32 bytes MAC are not applicable for recent AEAD algorithms. That too in AES_CCM there is no need of padding.

      2) Currently least value supported by max_fragment_length is 512. I prefer we should add support for 256 and 128 also. If AES_CCM_8 is used, the control overhead on application record is 21 bytes (5 byte - record header, 8 byte - IV and 8 byte - MIC). If its DTLS record, overhead is 29 bytes. So if max fragment length is 128, we get 99 bytes for data. This is more than sufficient for a constraint protocol like CoAP.

      Note : Existing max_fragment_length extension cannot be extended to support new values like 128 and 256.

      3) If a client sends both old and new extension, then priority should be given to new extension. Server MUST not send both the extension.



I feel the current IoT world needs this kind of new extension. This is the time to do.



Regards,

Ashok



________________________________
Raja Ashok VK
华为技术有限公司 Huawei Technologies Co., Ltd.
[Company_logo]

Phone:
Fax:
Mobile:
Email:
地址:深圳市龙岗区坂田华为基地 邮编:518129
Huawei Technologies Co., Ltd.
Bantian, Longgang District,Shenzhen 518129, P.R.China
http://www.huawei.com
________________________________
本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁
止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中
的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
This e-mail and its attachments contain confidential information from HUAWEI, which
is intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by
phone or email immediately and delete it!





-----Original Message-----
From: TLS [mailto:tls-bounces@ietf.org] On Behalf Of Thomas Pornin
Sent: 30 November 2016 00:25
To: Fossati, Thomas (Nokia - GB)
Cc: tls@ietf.org
Subject: Re: [TLS] Maximum Fragment Length negotiation



On Thu, Nov 24, 2016 at 09:10:00PM +0000, Fossati, Thomas (Nokia - GB)

wrote:

> I like your proposal, but I'm not convinced that overloading the

> semantics of an already existing extension when used in combination

> with a specific version of the protocol is necessarily the best

> strategy.  Besides, I'd like to be able to deploy a similar mechanism

> in 1.2.



Defining a new extension is certainly possible. However, it would then require deciding on the intended behaviour when both that new extension and the RFC 6066 extension are present.



Tentatively, one could try this:



  - The new extension documents the maximum record length supported

    by whoever sends it. Encoding is as in RFC 6066: one byte of

    value x for a maximum record plaintext length of 2^(x+8) bytes).

    We extend that to the whole 1..8 range so that larger records

    may be used by implementations who can afford them and obtain

    some performance increase by doing so (actual maximum plaintext

    length will be slightly less than 65535 bytes becose the length

    header is 16-bit and there must be some room for the MAC).



  - If a client sends both the RFC 6066 extension and the new extension,

    and the server supports the new extension, then the RFC 6066

    extension is ignored and only the new extension is used. A server

    MUST NOT send both extensions.



  - All implementations that support the extension MUST have the

    ability to apply a shorter size limit than their maximum limit

    (this is for _sending_ records).



  - The length sent by the server is the one that will be applied to

    subsequent records on the connection, in both directions. This

    applies to the whole connection, including subsequent handshakes

    (renegotiations), unless both client and server send the new

    extension again in a renegotiation (in which case the new length

    appplies).



  - If using TLS 1.3, then the following extra rules apply:



     - All TLS 1.3 implementations MUST support the extension.



     - If the client does not send the new extension, then this is

       equivalent to the client sending the new extension with a

       value of 6 (i.e. maximum plaintext length is 2^14 = 16384 bytes).

       In particular, this allows the server to send the extension.



     - If the server does not send the new extension, then this is

       equivalent to the server sending the new extension with the

       same value as the one from the client. (So, if neither sends

       the extension, then the usual 16384-byte limit applies.)



  - If using TLS 1.2 or a previous version, then there is no implicit

    usage:



     - The server MUST NOT send the new extension unless the client sent

       it.



     - The maximum plaintext limit shall be enforced only if the server

       sent the extension; that limit is the one defined by the server's

       extension.



     - If the client and/or the server does not send the extension, then

       the maximum plaintext length is the one that was in force at that

       point, i.e. 16384 bytes for a new connection, or whatever was

       used before the new handshake in case of renegotiation.



Some noteworthy points:



  * TLS 1.3 has no renegotiation, so the renegotiation behaviour is

    for TLS 1.2 and previous. This avoids tricky issues with the

    TLS 1.3 implicit behaviour in case of renegotiation.



  * A client SHOULD send the new extension in all ClientHello if it

    is ready to use TLS 1.2 or previous, so that a non-1.3-aware

    server may have the possibility to negotiate a shorter maximum

    plaintext length.



  * The initial ClientHello may use records larger than what the server

   is willing to accept, and before the server has any chance to

    advertise its own maximum record size. However, since the initial

    records are unprotected, implementations may be able to process

    partial records, and thus could accept un-MACed records larger

    than their incoming buffer (at least BearSSL can do that).





The "implicit" behaviour (both for client and server) with TLS 1.3 is a way to make the extension free (with regards to network usage) in the common case. It cannot be applied unless the extension support is made mandatory for TLS 1.3. Making it mandatory is also an important feature, since otherwise such an extension would likely remain unimplemented by "big" clients (e.g. Web browsers).





Any comments?

I can try to write the corresponding text for inclusion in the TLS 1.3 draft. What is the process for submitting such text?





      --Thomas Pornin



_______________________________________________

TLS mailing list

TLS@ietf.org<mailto:TLS@ietf.org>

https://www.ietf.org/mailman/listinfo/tls