Re: [tcpm] TCP-AO Option Layout - Alignment and Padding

YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> Tue, 29 July 2008 10:51 UTC

Return-Path: <tcpm-bounces@ietf.org>
X-Original-To: tcpm-archive@megatron.ietf.org
Delivered-To: ietfarch-tcpm-archive@core3.amsl.com
Received: from [127.0.0.1] (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id B788A3A6B51; Tue, 29 Jul 2008 03:51:31 -0700 (PDT)
X-Original-To: tcpm@core3.amsl.com
Delivered-To: tcpm@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 5227A3A6A39 for <tcpm@core3.amsl.com>; Tue, 29 Jul 2008 03:51:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 3.656
X-Spam-Level: ***
X-Spam-Status: No, score=3.656 tagged_above=-999 required=5 tests=[AWL=1.450, BAYES_00=-2.599, CHARSET_FARAWAY_HEADER=3.2, HELO_MISMATCH_NET=0.611, RELAY_IS_203=0.994]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jBIvoC54K+Le for <tcpm@core3.amsl.com>; Tue, 29 Jul 2008 03:51:29 -0700 (PDT)
Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by core3.amsl.com (Postfix) with ESMTP id 6527D3A68CB for <tcpm@ietf.org>; Tue, 29 Jul 2008 03:51:29 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id BBDF233B46; Tue, 29 Jul 2008 19:51:50 +0900 (JST)
Date: Tue, 29 Jul 2008 06:51:49 -0400
Message-Id: <20080729.065149.22600370.yoshfuji@linux-ipv6.org>
To: touch@ISI.EDU
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
In-Reply-To: <488EF15F.4070302@isi.edu>
References: <20080729.060448.112613043.yoshfuji@linux-ipv6.org> <488EF15F.4070302@isi.edu>
Organization: USAGI Project
X-URL: http://www.yoshifuji.org/%7Ehideaki/
X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc
X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEa<!5P`&C$@oP>ZBLP
X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.1 (AOI)
Mime-Version: 1.0
Cc: tcpm@ietf.org
Subject: Re: [tcpm] TCP-AO Option Layout - Alignment and Padding
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://www.ietf.org/mailman/private/tcpm>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tcpm-bounces@ietf.org
Errors-To: tcpm-bounces@ietf.org

Hello.

In article <488EF15F.4070302@isi.edu> (at Tue, 29 Jul 2008 03:30:55 -0700), Joe Touch <touch@ISI.EDU> says:

> | With this layout, An implementation will end up put it like this
> |                                     +---------+---------+
> |                                     | Kind=?? | Length  |
> |                                     +---------+---------+
> |                 +--------------...--+---------+
> |                 |       MAC         |  KeyID  |
> |                 +--------------...--+---------+
> 
> Why is this the case? IP with no options is 20 bytes; the base TCP is 20
> bytes, so the options begin aligned; noting that most MAC sizes are
> multiples of 4 bytes, the alignment is most likely to result in:
> 
> ~                 +---------+---------+--------------------+
> ~                 | Kind=?? | Length  |   MAC...           |
> ~                 +---------+---------+--------------------+
> ~                 ...
> ~                 ....
> ~                 +-------------------+---------+
> ~                 |       MAC         |  KeyID  |
> ~                 +-------------------+---------+
> 
> In this case, the prepad is 0 and the postpad is 1, but the MAC is only
> half-word aligned.

Well, memory cop works much better if the memory regions are on 32bit
word aligned.  (We put timestamp etc.'s "value" on 32bit aligned.)

> If we want to reduce padding and keep the MAC aligned, the best option is:
> 
> ~                 +---------+---------+---------+---------+
> ~                 | Kind=?? | Length  |  KeyID  |   0     |
> ~                 +---------+---------+---------+---------+
> ~                 ...
> ~                 ...
> ~                 +---------------------------------------+
> ~                 |       MAC...                          |
> ~                 +---------------------------------------+

I support this.

> I.e., pad ourselves. We suggest that the option start word-aligned. This
> wastes space, IMO.

I don't think this is a waste of space and good thing to have -
to save CPU cycle(s).

> I would favor a more economical approach that recognizes that a few bits
> of MAC could be sacrificed for our KeyID, e.g.:
> 
> ~                 +---------+---------+-----+--------------+
> ~                 | Kind=?? | Length  | KID |  MAC'...     |
> ~                 +---------+---------+-----+--------------+
> ~                 ...
> ~                 ....
> ~                 +-------------------+
> ~                 |       MAC'        |
> ~                 +-------------------+
> 
> Use 2 bits for the KID; 1 is insufficient, and 2 is more than sufficient
> IMO.
> 
> The MAC' is a half-word aligned MAC with the top 2 bits overwritten
> (i.e., it is NOT shifted right); the KID occupies those top 2 bits.
> 
> If a user wants word alignment, pick a MAC length of N-2 bytes.
> 
> Wouldn't that be simpler and more space efficient?

We have 256 keys, and it is not enough.
And is NOT simple and more complex from implemntation point of view
- eats a lot of cpu cycles.

--yoshfuji
_______________________________________________
tcpm mailing list
tcpm@ietf.org
https://www.ietf.org/mailman/listinfo/tcpm