Task #4690
closed
URI of NameComponent: strict or ambiguous
Added by Junxiao Shi over 6 years ago.
Updated over 6 years ago.
Description
NDN Packet Format 0.3 encodes a NameComponent as follows:
- GenericNameComponent does not have a prefix.
- ImplicitSha256DigestComponent has the prefix
sha256digest=
.
- Other typed name components have prefix
<number>=
where <number>
is the TLV-TYPE encoded in decimal format without leading zero.
Since <number>=
is applied on "other typed name components" only, it is not permitted to use 8=
on GenericNameComponent or 1=
on ImplicitSha256DigestComponent.
However, there is proposal to loosen this requirement, and allow 8=
on GenericNameComponent or 1=
on ImplicitSha256DigestComponent.
This issue is to discuss such proposal, and make necessary protocol updates.
generic URI accepts tons of different representations and, given a potential divergence of implementations, you cannot assume a single URI form, which is simply a human-readable form. There is a strict representation on the wire.
I strongly disagree on allowing 1=
on ImplicitSha256DigestComponent (and likewise 2=
on ParametersSha256DigestComponent defined in #4658), because the encoding format after the equal sign is completely different from "other typed name components". ImplicitSha256DigestComponent uses plain HEX encoding after the equal sign, while other types use percent encoding.
I weakly disagree on allowing 8=
on GenericNameComponent. It is best to enforce only one encoding format and no other, so that names can be compared for equality via their URI string. Permitting multiple formats can break existing applications, and NDN Regular Expressions in particular.
We need to be careful when we change the NDN URI specification to support a different representation for a new typed name component.
For instance, if a new component with TLV-TYPE=42 is introduced and we specify that it can be URI-encoded as FooComponent=<value>
, all "old" URI decoder implementations are broken because they won't be able to decode a URI containing such a component.
Junxiao Shi wrote:
I strongly disagree on allowing 1=
on ImplicitSha256DigestComponent (and likewise 2=
on ParametersSha256DigestComponent defined in #4658), because the encoding format after the equal sign is completely different from "other typed name components". ImplicitSha256DigestComponent uses plain HEX encoding after the equal sign, while other types use percent encoding.
As I said in note-3, we cannot break backward compatibility every time we introduce a new typed name component. The "generic" syntax (<type in decimal>=<percent-encoded value>
) must always be allowed.
so that names can be compared for equality via their URI string. Permitting multiple formats can break existing applications, and NDN Regular Expressions in particular.
Using string equality on URIs is wrong and already broken. Don't do it. There isn't a single string representation of a URI.
- Status changed from New to Resolved
- Assignee set to Junxiao Shi
- Start date deleted (
08/02/2018)
- % Done changed from 0 to 50
- % Done changed from 50 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF