Project

General

Profile

Task #4838

Possible issues hashing the name URI, not the TLV

Added by Jeff Thompson 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Low
Assignee:
-
Target version:
-
Start date:
02/06/2019
Due date:
% Done:

0%

Estimated time:

Description

This is a low priority observation. When ProducerBase::updateSeqNo computes the new hash, it uses the name URI string.
https://github.com/named-data/PSync/blob/0cf4b600e91455ee07c38eb22876aa6b653bc14b/PSync/producer-base.cpp#L121

uint32_t newHash = murmurHash3(N_HASHCHECK, prefixWithSeq.toUri());

I don't think that the NDN packet spec guarantees that all implementations will create the same URI string for a Name. For example upper/lower case for hex digits, different ways of representing the name component type number, different choices of which values to percent escape, etc. Also, because of lots of conversion from binary to decimal/hexadecimal values and string concatenation, it can be less efficient to get the URI string than to encode the name TLV. (Of course, if consumers and producers have different implementations of toUri(), their hashes will not match.)

For these reasons, I humbly suggest that PSync should compute the hash from the Name TLV encoding, not from the URI string.

History

#1 Updated by Jeff Thompson 3 months ago

  • Description updated (diff)

#2 Updated by Jeff Thompson 3 months ago

  • Description updated (diff)

Also available in: Atom PDF