[anonsec] Fwd: Review of draft-ietf-btns-abstract-api-01

Julien Laganier <julien.IETF@laposte.net> Wed, 09 April 2008 13:54 UTC

Return-Path: <anonsec-bounces@postel.org>
X-Original-To: ietfarch-btns-archive-waDah9Oh@core3.amsl.com
Delivered-To: ietfarch-btns-archive-waDah9Oh@core3.amsl.com
Received: from localhost (localhost []) by core3.amsl.com (Postfix) with ESMTP id 84B8528C244 for <ietfarch-btns-archive-waDah9Oh@core3.amsl.com>; Wed, 9 Apr 2008 06:54:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[AWL=-0.100, BAYES_00=-2.599, J_CHICKENPOX_64=0.6]
Received: from mail.ietf.org ([]) by localhost (core3.amsl.com []) (amavisd-new, port 10024) with ESMTP id tt9FaJDQhKDa for <ietfarch-btns-archive-waDah9Oh@core3.amsl.com>; Wed, 9 Apr 2008 06:54:46 -0700 (PDT)
Received: from boreas.isi.edu (boreas.isi.edu []) by core3.amsl.com (Postfix) with ESMTP id A80A13A68FB for <btns-archive-waDah9Oh@lists.ietf.org>; Wed, 9 Apr 2008 06:54:46 -0700 (PDT)
Received: from boreas.isi.edu (localhost []) by boreas.isi.edu (8.13.8/8.13.8) with ESMTP id m39Dbnbg005073; Wed, 9 Apr 2008 06:37:49 -0700 (PDT)
Received: from wa-out-1112.google.com (wa-out-1112.google.com []) by boreas.isi.edu (8.13.8/8.13.8) with ESMTP id m39Daokm004837 for <anonsec@postel.org>; Wed, 9 Apr 2008 06:36:51 -0700 (PDT)
Received: by wa-out-1112.google.com with SMTP id m28so2095801wag.13 for <anonsec@postel.org>; Wed, 09 Apr 2008 06:36:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date:user-agent:mime-version:cc:content-type:message-id:sender; bh=uPYj7fuTN3Z4jMoxLVdFVxDKp+n5CYnY07cgO0Az1XA=; b=KUFNrN7Ug8o+5WaeAOKOzTPEF63GMU5iKFAOVTfBMCgz0vDx9rGhIkxRgsQT81OpYpFCL6i+knuNFNzRmUamkill8EbiBvfbO+BBvQufJ/kfgROtEGVJksQM9x942U5ali6esqRRzdTysJkKlC99DYnQjU881E55OUruYkUe87s=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:cc:content-type:message-id:sender; b=gWp9cnouFYU1RDggzH7FXZkMgaE8sNIlRqfmBpuQTsUohTo0snaz3HxEFLV6hx5R3qhw4ZJrZEj34LRuZ5M4fF6lksxNVNik0lyIkN2/ovp4ScbcfB9VVF5B8nl8OHA6lS8kYgWMqXmymy1yHIjjXZzsQ6XJopVYx7iZsWaYYVE=
Received: by with SMTP id s1mr113621wab.162.1207748210006; Wed, 09 Apr 2008 06:36:50 -0700 (PDT)
Received: from ? ( []) by mx.google.com with ESMTPS id q20sm440347pog.0.2008. (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Apr 2008 06:36:49 -0700 (PDT)
From: Julien Laganier <julien.IETF@laposte.net>
To: anonsec@postel.org
Date: Wed, 9 Apr 2008 15:36:50 +0200
User-Agent: KMail/1.9.6
MIME-Version: 1.0
Content-Type: Multipart/Mixed; boundary="Boundary-00=_yZM/HNE56vh7U/g"
Message-Id: <200804091536.50852.julien.IETF@laposte.net>
X-ISI-4-43-8-MailScanner: Found to be clean
X-MailScanner-From: julien.laganier@gmail.com
Cc: Love =?iso-8859-1?q?H=F6rnquist_=C5strand?= <lha@it.su.se>, "Vijay K. Gurbani" <vkg@alcatel-lucent.com>
Subject: [anonsec] Fwd: Review of draft-ietf-btns-abstract-api-01
X-BeenThere: anonsec@postel.org
X-Mailman-Version: 2.1.6
Precedence: list
List-Id: "Discussions of anonymous Internet security." <anonsec.postel.org>
List-Unsubscribe: <http://mailman.postel.org/mailman/listinfo/anonsec>, <mailto:anonsec-request@postel.org?subject=unsubscribe>
List-Archive: <http://mailman.postel.org/pipermail/anonsec>
List-Post: <mailto:anonsec@postel.org>
List-Help: <mailto:anonsec-request@postel.org?subject=help>
List-Subscribe: <http://mailman.postel.org/mailman/listinfo/anonsec>, <mailto:anonsec-request@postel.org?subject=subscribe>
Sender: anonsec-bounces@postel.org
Errors-To: anonsec-bounces@postel.org


Vijay Gurbani has reviewed the BTNS abstract API and kindly agreed to 
let me forward it to the mailing list, please see it below. 

Many thanks to Vijay!

--- Begin Message ---
Dr. Richardson: I was asked by the Applications area to review
draft-ietf-btns-abstract-api-01 and draft-ietf-btns-c-api.  Here is
a review of draft-ietf-btns-abstract-api-01; I will send out a review
of draft-ietf-btns-c-api by the end of this week or early next week.

This is a valuable document to have for the exact reasons that the
author mentions in S2.  Having dispensed with why such a document
is important, here are more focused comments on the contents of
the draft.  Designing a good and intuitive API is actually very
hard (if you are interested, I can dig up some published literature
on how to do a good enough job in designing one.)

- S3, opening paragraph: s/major kinds of objects/major objects

- S3, opening paragraph: objects are not "abstracted into unique
  opaque tokens" as much as they are *represented* by such constructs.
  I would suggest a rewrite as follows:
      Here we use the term "opaque token" to mean much what "object"
      means in a typical object-oriented programming language, but
      with no public fields (only methods or generic functions).
      The objects are represented by opaque tokens that can be used
      through the public accessor and mutator methods associated with
      the object.

- S3: It is written that, "The API provides a mechanism to query
  the value of attributes of the token."  Do you also provide
  a mechanism to change (or mutate) the state of the object?  Or
  are all operations on the object read-only?  I ask this because
  the Abstract promises that an application may "specify that IPsec
  should be used."  If that is the case, then the application may
  have to use mutators to set the state of the object appropriately.
  And if that is the case, you may want to list the mutators in
  a separate section much as you intend to list accessors in a
  separate section (S9, which is currently empty).

- S3.1: Is the pToken per socket?  In other words, within a process,
  there may be many different sockets.  Does each socket has a unique
  pToken?  It seems from S3.1 that the answer is no; the pToken is
  per process.  However, S5 says in its first paragraph that, "[an
  application] needs to get a protection token that is associated with
  the socket."  Thus, it seems that each socket has a unique pToken.
  You may want to elaborate on this some more to set up the model

- S3.1 says that "It SHOULD always be possible to obtain a current
  protection token for an established connection (whether for a
  connection-oriented transport protocol or for a "connected" UDP
  socket). that is equivalent to any previous protection token
  that was obtained."  A few comments on this.

  First, note the spurious "." after the closing brace; please remove.

  Second, and this goes back to establishing the model of a pToken,
  is the pToken a singleton?  That is, when an application gets the
  current pToken object, does that pToken object correspond to
  the one-and-only pToken object established in that process's space?
  Or is that pToken object a *clone* of the one-and-only pToken
  object (i.e., contents of the objects are the same, but they are
  distinct objects.  Deleting one has no bearing on the other.)

  In software engineering terms, there is the concept of a singleton
  pattern that states that objects with this property are created
  only once within the system.  Whenever an application wants to
  access a singleton object, the system passes a handle to the
  existing one-and-only singleton object to the caller.

  ISTM that a pToken is a singleton object, but then S5 confuses me
  because that seems to lend credence to the fact that there can
  be many pToken objects in a process, each corresponding to a
  socket created by the application.

- S3.3 says that "It is permitted for one protection token to be
  replaced with another (equivalent) protection token due to a node
  moving, suspending and resuming, ..."  This is perplexing, and
  points to the pToken NOT being a singleton object.

  If a node moves, why would the pToken be replaced?  Some
  characteristics -- like the attachment point and network
  identifiers -- may change, but the pToken should remain the same
  object, right?  Likewise, if the node is suspended, then presumably
  the state of the process is saved.  The pToken, as any other
  variable in the system, will be saved and subsequently resurrected
  when the system resumes.  So why is this a special case?  I
  do not understand.

- S4: "All symbols (functions, macros, etc.) defined by this API are
  prefixed with "ipsec_". "  The draft does not specify any APIs
  as such.  So this is probably a place-holder for the future.  If so,

- S4: "Specific rules for capitalizations should be driven by the
  specific language binding."  I don't think any modern languages
  mandates capitalization in naming objects, or methods; it is
  purely a syntactic sugar.  You probably want to say instead:

   Specific rules for capitalizations for the identifiers following
   the prefix "ipsec_" should follow the local programming
   conventions.  This draft does not mandate the convention to name
   objects or methods in any way beyond requiring the "ipsec_" prefix.

- S5 says that: As the pToken will not change during the connection.
  (see notes about rekeying).  A simple function is provided to return
  a pToken from a file descriptor.  Many implementions are likely to
  implement this using getsockopt(2), but an interface in those terms
  is not specified in order to keep it more abstract, and therefore
  more portable.

  Some comments on this.

  First, note the gratuitous periods in the first 3 sentences.

  Second, and of more importance, is how do we design such an API?
  One way is to use the getsockopt(2) API that is mentioned and
  its disadvantages.  If a decision is made not to go through this
  route, then something like

      pToken *ipsec_get_ptoken(const int sock);

  could be considered.  The advantage is that this is close enough
  to the Unix system call

      int fileno(FILE *stream);

  that transforms a FILE * object into a file descriptor that the
  legions of *nix programmers would be happy.  For non-*nix
  programmers ... well, they should move to *nix ;-)  Just kidding.
  But seriously, the fileno() function has been in existence for
  so long that it is not tied to *nix platform only.

- S5, fourth paragraph:
  s/received may be received may arrive/received may arrive

- S5, fourth and fifth paragraphs: I am not sure I understand what
  is going on here.  Is it the case that when a peer gets a datagram, it
  also gets some additional data -- the sending peer's pToken --
  as ancillary data?  If so, why would a peer send its pToken, which
  is presumably something to keep secret, to another peer?  I am
  sure you had some reason to put this text in, it is just not
  apparent to the casual reader.

- S6: s/do-not-care values./defaulted accordingly.

- S7: Are these the properties of pToken objects or a pToken object
  template?  The discussion involves default values, which leads
  me to think that they are template values.

- S7, tunnelMode discussion.  Since you have tunnelMode, do you
  also need transportMode?

- S8: Are these the properties of iToken objects or a iToken object
  template?  The discussion involves default values, which leads
  me to think that they are template values.

  or better yet, LEAP_OF_FAITH; much more readable that way.

- S9, 10, and 11 appear to be place-holders.

- S11: Some things you may want to mention here is what do applications
  do when the IPSec characteristics set by one application are not
  acceptable to others?  Unlike TLS, each application cannot choose
  the specific properties it wants applied to the channel.

  Also, if one application sets the IPSec characteristics, is it a
  problem if another one queries them and sends them to someone else?
  For instance, if the IPSec instance is using a group pre-shared
  key, what happens if one application surreptitiously sends the
  key to a malicious party?  ISTM on a cursory reading that
  certain characteristics of the IPSec connection should not be
  made available to applications even on a read-only basis.

Hope that helps!

- vijay
Vijay K. Gurbani, Bell Laboratories, Alcatel-Lucent
2701 Lucent Lane, Rm. 9F-546, Lisle, Illinois 60532 (USA)
Email: vkg@{alcatel-lucent.com,bell-labs.com,acm.org}
WWW:   http://www.alcatel-lucent.com/bell-labs

--- End Message ---