Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 1 | .. _Name: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 2 | |
| 3 | Name |
| 4 | ---- |
| 5 | |
Alexander Afanasyev | 406749e | 2014-03-27 18:45:26 -0700 | [diff] [blame] | 6 | An NDN Name is a hierarchical name for NDN content, which contains a sequence of name components. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 7 | |
| 8 | NDN Name Format |
| 9 | ~~~~~~~~~~~~~~~ |
| 10 | |
| 11 | We use a 2-level nested TLV to represent a name. |
| 12 | The Type in the outer TLV indicates this is a Name. |
| 13 | All inner TLVs have the same Type indicating that they each contain a name component. |
Junxiao Shi | a0d3682 | 2014-09-21 11:32:09 -0700 | [diff] [blame^] | 14 | There is no restriction on the Value field in a name component and it may contain any byte sequence. |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 15 | |
| 16 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 17 | |
| 18 | Name ::= NAME-TYPE TLV-LENGTH NameComponent* |
Junxiao Shi | a0d3682 | 2014-09-21 11:32:09 -0700 | [diff] [blame^] | 19 | NameComponent ::= NAME-COMPONENT-TYPE TLV-LENGTH BYTE* |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 20 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 21 | |
| 22 | NDN URI Scheme |
| 23 | ~~~~~~~~~~~~~~ |
| 24 | |
| 25 | For textual representation, it is often convenient to use URI to represent NDN names. |
| 26 | Please refer to RFC 3986 (URI Generic Syntax) for background. |
| 27 | |
Alexander Afanasyev | 406749e | 2014-03-27 18:45:26 -0700 | [diff] [blame] | 28 | - The scheme identifier is ``ndn``. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 29 | |
Alexander Afanasyev | 406749e | 2014-03-27 18:45:26 -0700 | [diff] [blame] | 30 | - When producing a URI from an NDN Name, only the generic URI unreserved characters are left unescaped. |
| 31 | These are the US-ASCII upper and lower case letters (A-Z, a-z), digits (0-9), and the four specials PLUS (+), PERIOD (.), UNDERSCORE (\_), and HYPHEN (-). |
| 32 | All other characters are escaped using the percent-encoding method of the URI Generic Syntax. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 33 | |
Junxiao Shi | a0d3682 | 2014-09-21 11:32:09 -0700 | [diff] [blame^] | 34 | - To unambiguously represent name components that would collide with the use of . and .. for relative URIs, any component that consists solely of zero or more periods is encoded using three additional periods. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 35 | |
| 36 | - The authority component (the part after the initial ``//`` in the familiar http and ftp URI schemes) is not relevant to NDN. |
Alexander Afanasyev | 406749e | 2014-03-27 18:45:26 -0700 | [diff] [blame] | 37 | It should not be present, and it is ignored if it is present. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 38 | |
| 39 | Implicit Digest Component |
| 40 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 41 | |
| 42 | The Name of every piece of content includes as its final component a derived digest that ultimately makes the name unique. |
| 43 | This digest may occur in an Interest Name as an ordinary Component (the last one in the name). |
| 44 | This final component in the name is never included explicitly in the Data packet when it is transmitted on the wire. |
| 45 | It can be computed by any node based on the Data packet content. |
| 46 | |
| 47 | The **implicit digest component** consists of the SHA-256 digest of the entire Data packet without the signature component. Having this digest as the last name component enables us to achieve the following two goals: |
| 48 | |
Alexander Afanasyev | 406749e | 2014-03-27 18:45:26 -0700 | [diff] [blame] | 49 | - Identify one specific Data packet and no other. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 50 | |
| 51 | - Exclude a specific Data packet in an Interest (independent from whether it has a valid signature). |
| 52 | |
| 53 | Canonical Order |
| 54 | ~~~~~~~~~~~~~~~ |
| 55 | |
Junxiao Shi | a0d3682 | 2014-09-21 11:32:09 -0700 | [diff] [blame^] | 56 | In several contexts in NDN packet processing, it is useful to have a consistent ordering of names and name components. NDN names consist of a sequence of NameComponents, and each NameComponent is a sequence of zero or more 8-bit bytes. The ordering for components is such that: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 57 | |
| 58 | - If *a* is shorter than *b* (i.e., has fewer bytes), then *a* comes before *b*. |
| 59 | |
| 60 | - If *a* and *b* have the same length, then they are compared in ASCII lexicographic order (e.g., ordering based on memcmp() operation.) |
| 61 | |
| 62 | |
| 63 | For Names, the ordering is just based on the ordering of the first component where they differ. |
| 64 | If one name is a proper prefix of the other, then it comes first. |