Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame^] | 1 | .. _name: |
| 2 | |
| 3 | Name |
| 4 | ---- |
| 5 | |
| 6 | An NDN Name is a hierarchical name for NDN content, which contains a sequence of name components. |
| 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. |
| 14 | There is no restriction on the Value field in a name component and it may not contain any bytes:: |
| 15 | |
| 16 | Name ::= NAME-TYPE TLV-LENGTH NameComponent* |
| 17 | NameComponent ::= NAME-COMPONENT-TYPE TLV-LENGTH BYTE+ |
| 18 | |
| 19 | .. % 0 or many name components in name |
| 20 | .. % 0 or many bytes in name component |
| 21 | |
| 22 | |
| 23 | NDN URI Scheme |
| 24 | ~~~~~~~~~~~~~~ |
| 25 | |
| 26 | For textual representation, it is often convenient to use URI to represent NDN names. |
| 27 | Please refer to RFC 3986 (URI Generic Syntax) for background. |
| 28 | |
| 29 | - The scheme identifier is ``ndn``. |
| 30 | |
| 31 | - When producing a URI from an NDN Name, only the generic URI unreserved characters are left unescaped. |
| 32 | 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 (-). |
| 33 | All other characters are escaped using either the percent-encoding method of the URI Generic Syntax or a ``ndn`` scheme specific hexadecimal string escape starting with the EQUALS (=) and an even number of characters from the set of hex digits. |
| 34 | Once an EQUALS has been encountered in a component the hexadecimal encoding persists until the end of the component. |
| 35 | The hex digits in these escaped encodings should always use upper-case letters, i.e., A-Z. |
| 36 | |
| 37 | - 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. |
| 38 | |
| 39 | - The authority component (the part after the initial ``//`` in the familiar http and ftp URI schemes) is not relevant to NDN. |
| 40 | It should not be present, and it is ignored if it is present. |
| 41 | |
| 42 | Implicit Digest Component |
| 43 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 44 | |
| 45 | The Name of every piece of content includes as its final component a derived digest that ultimately makes the name unique. |
| 46 | This digest may occur in an Interest Name as an ordinary Component (the last one in the name). |
| 47 | This final component in the name is never included explicitly in the Data packet when it is transmitted on the wire. |
| 48 | It can be computed by any node based on the Data packet content. |
| 49 | |
| 50 | 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: |
| 51 | |
| 52 | - Identify one specific Data packet and no other. |
| 53 | |
| 54 | - Exclude a specific Data packet in an Interest (independent from whether it has a valid signature). |
| 55 | |
| 56 | Canonical Order |
| 57 | ~~~~~~~~~~~~~~~ |
| 58 | |
| 59 | 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: |
| 60 | |
| 61 | - If *a* is shorter than *b* (i.e., has fewer bytes), then *a* comes before *b*. |
| 62 | |
| 63 | - If *a* and *b* have the same length, then they are compared in ASCII lexicographic order (e.g., ordering based on memcmp() operation.) |
| 64 | |
| 65 | |
| 66 | For Names, the ordering is just based on the ordering of the first component where they differ. |
| 67 | If one name is a proper prefix of the other, then it comes first. |
| 68 | |
| 69 | Changes from CCNx |
| 70 | ~~~~~~~~~~~~~~~~~ |
| 71 | |
| 72 | - The name encoding is changed from binary XML to TLV format. |
| 73 | |
| 74 | - The discussions on naming conventions and the use of special markers inside NameComponents are removed from packet specification, and will be covered by a separate technical document |
| 75 | |
| 76 | .. (\cite{NamingConvention}). |
| 77 | |
| 78 | - Deprecated zero-length name component. |