Re: [icnrg] Questions about an empty name segment

<Marc.Mosko@parc.com> Mon, 22 October 2018 18:33 UTC

Return-Path: <Marc.Mosko@parc.com>
X-Original-To: icnrg@ietfa.amsl.com
Delivered-To: icnrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1726F124BAA for <icnrg@ietfa.amsl.com>; Mon, 22 Oct 2018 11:33:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.901
X-Spam-Level:
X-Spam-Status: No, score=-6.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001] 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 kh5gfV1Lda74 for <icnrg@ietfa.amsl.com>; Mon, 22 Oct 2018 11:32:57 -0700 (PDT)
Received: from smtp.parc.xerox.com (smtp.parc.com [13.1.64.93]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6431E1277C8 for <icnrg@irtf.org>; Mon, 22 Oct 2018 11:32:57 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by smtp.parc.xerox.com (Postfix) with ESMTP id 004ED6C00E4; Mon, 22 Oct 2018 11:32:55 -0700 (PDT)
X-Virus-Scanned: Debian amavisd-new at newalpha.parc.com
Received: from smtp.parc.xerox.com ([127.0.0.1]) by localhost (smtp.parc.xerox.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id prpInOLDg5iK; Mon, 22 Oct 2018 11:32:54 -0700 (PDT)
Received: from exchangehub.parc.xerox.com (e2010hub1.parc.xerox.com [13.2.12.22]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.parc.xerox.com (Postfix) with ESMTPS id C27FB6C00CE; Mon, 22 Oct 2018 11:32:54 -0700 (PDT)
Received: from E2010DAG5.corp.ad.parc.com ([fe80::3d0b:7158:aec4:e05e]) by e2010hub1.corp.ad.parc.com ([fe80::8945:a39d:8c92:373f%11]) with mapi id 14.03.0415.000; Mon, 22 Oct 2018 11:32:54 -0700
From: Marc.Mosko@parc.com
To: a-ooka@ieee.org
CC: icnrg@irtf.org
Thread-Topic: [icnrg] Questions about an empty name segment
Thread-Index: AQHUafFdBQmpiKIH4k+fUUJM7vlj1qUsDLsA
Date: Mon, 22 Oct 2018 18:32:54 +0000
Message-ID: <09CA5EE1-D8AD-42D0-960E-C466FB04191C@parc.com>
References: <CAPuTSfuHZjCJh1BPQTMavEy=5HsWs2VVx3Si6T2hsa+76=Yjww@mail.gmail.com>
In-Reply-To: <CAPuTSfuHZjCJh1BPQTMavEy=5HsWs2VVx3Si6T2hsa+76=Yjww@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [50.0.67.90]
Content-Type: text/plain; charset="utf-8"
Content-ID: <CC9F9266C679FC4F9B787E9171EFF777@ad.parc.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/icnrg/lDxI56xxGVS_OxI1l6aX6lpCOE8>
Subject: Re: [icnrg] Questions about an empty name segment
X-BeenThere: icnrg@irtf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Information-Centric Networking research group discussion list <icnrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/icnrg>, <mailto:icnrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/icnrg/>
List-Post: <mailto:icnrg@irtf.org>
List-Help: <mailto:icnrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/icnrg>, <mailto:icnrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Oct 2018 18:33:00 -0000

Dr. Ooka,

Thank you for the question, as there are several important distinctions here.

=================
Definitions
=================

A Name has two primary use cases: (1) in a protocol message and in the PIT, (2) in an implementation’s FIB.

In case 1, the syntax of a Name is defined in the ABNF of [2], which correspond to the “exact” name concept (Sec 3 of [2]).  It identifies a specific content object, but not including the ConObjHash restriction (which would make it a “full” name).

In case 2, in the FIB, one wants the ability to specify the “prefix” name concept.  These specify a prefix of an exact name.

In a protocol message (case 1), the Name maybe (1.a) missing, (1.b) exactly 1 name segment, where the 1st name segment cannot be 0 length, or (1c) more than 1 name segment, where the 1st name segment cannot be 0 length, but any or all subsequent name segments could be 0 length.  In case 1.a, it is a so-called nameless object and processed as per the specs; note that here the name is missing, it is not a 0-length name.  In the PIT, the name is the same as it is in a protocol message (as the PIT records the protocol message’s name).

In the FIB in case 2, you can have (1.b) or (1.c) or a (2.a) 0-length name, or (2b) a 1-segment name with 0-length.  In case 2.a, this is considered the default route and would match any name.  In case 2.b, it is a typed default route and would match any name with a specific first name segment type.  In cases 1.b or 1.c, it works the obvious way.

In ccnxmessages, a 0-length name is defined as the NAME TLV with T = T_NAME, L = 0.  A 1-segment name with 0-length is (T = T_NAME, L = 4, V = (T = x, L = 0)), where x is some name segment type.

Note that in the specs we do not say how an implementation must encode a default route in its FIB.  We only specify how it is externally represented in the CCNX URI spec.  The actual value in the FIB or how the the implementation uses a default route is up to the implementation.  The default route, for example, could be in a separate data structure and only used if there’s no match in the FIB.

=================
Usage
=================

In an application (and thus in protocol messages), I do not think it is typical for a name segment to be empty, but this is a way to express a null value.  In CCNx 0.x, for example, a 0-length name segment was sometimes used because it was always short-lex sorted before any other value in the name segment.  Sometimes it used a 0-length name segment to represent the value “0” rather than encode a %00.  In CCNx 1.0 (the IETF spec), we steered away from this sort of usage because saving 1 byte was not considered as important as avoiding the confusion this sort of usage engendered.  Also, a competent compression scheme would fix the byte usage.  We preferred to encode a 0 as %00 and encode null as 0-length.

Here is a simple made-up example.  An application might have some application-defined name components where the name components might be “first_name” and “middle_name” and “family_name”.  Some people might not have a middle_name and in that case the application could represent null as a 0-length name component.  Another way to represent this would be to discard the middle_name name component.

Examples: 
ccnx:/name=foo/name=bar/name=my_app/APP:00=alice/APP:01=jane/APP:02=smith
ccnx:/name=foo/name=bar/name=my_app/APP:00=bob/APP:01=/APP:02=tucker

In a certain application, perhaps we use distinguished first name component types to distinguish a service, where we want different routing based on the _type_ of the name component, not the actual name.  For example, these two names should have different routing:

ccnx:/APP:00=gold/name=foo/name=bar => FIB prefix = ccnx:/APP:01=
ccnx:/APP:01=gold/name=foo/name=bar => FIB prefix = ccnx:/APP:01=

Note that we are routing on the name component _type_ not the _value_.

This same technique can also be used mid-way through the name, such as to distinguish between /NAME=foo/APP:00=silver and /NAME=foo/APP:01=silver.  

Marc


> On Oct 22, 2018, at 3:23 AM, Atsushi Ooka <a-ooka@ieee.org> wrote:
> 
> Dear all.
> 
> I have some questions about an empty name segment
> such as "ccnx:/NAME=" and "ccnx:/foo/bar/NAME=".
> 
> Why is an empty name segment needed, and how can it be used?
> 
> I have read Internet-Drafts (IDs) [1,2,3] and
> confirmed the behavior of Metis [4] and iping [5];
> however, it is not clear for me how to use them.
> 
> Thank you in advance.
> 
> Best regards,
> Atsushi Ooka
> 
> [1] https://tools.ietf.org/html/draft-irtf-icnrg-ccnxmessages-08
> [2] https://tools.ietf.org/html/draft-irtf-icnrg-ccnxsemantics-09
> [3] https://tools.ietf.org/html/draft-mosko-icnrg-ccnxurischeme-01
> [4] Metis (FD.IO sb-forwareder) https://wiki.fd.io/view/Sb-forwarder
> [5] iping (FD.IO libicnet) https://wiki.fd.io/view/Libicnet
> 
> ----------------------------------------------------------------------
> Atsushi Ooka, Ph.D.
> 
> Network Science and Convergence Device Technology Laboratory,
> Network System Research Institute,
> National Institute of Information and Communications Technology (NICT)
> 
> E-mail: a-ooka@ieee.org
> Tel: +81-42-327-6847
> URL: http://www.nict.go.jp
> ----------------------------------------------------------------------
> 
> _______________________________________________
> icnrg mailing list
> icnrg@irtf.org
> https://www.irtf.org/mailman/listinfo/icnrg