Bug #1504
closedadding a nexthop with double "/" at the beginning of the prefix result in the creation of "/" entry
0%
Description
I accidentally added a name with multiple '//' at the beginning, and a FIB entry was created for the '/' prefix:
$build/bin/nfdc add-nexthop ndn://bla 7 90
$build/bin/nfd-status
...
FIB:
/localhost/nfd nexthops={faceid=1 (cost=0)}
/ nexthops={faceid=7 (cost=90)}
is this the expected behavior?
Updated by Alex Afanasyev about 10 years ago
This is correct behavior. This is related to URI format. Check defintion of name URI scheme here: http://named-data.net/doc/ndn-tlv/name.html#ndn-uri-scheme
Actually, I personally never use ndn:
in front. Less typing and less confusion with these double slashes.
Updated by Junxiao Shi about 10 years ago
- Status changed from New to Rejected
In ndn://bla
, "bla" is the authority part of the URI, which is ignored.
Updated by Beichuan Zhang about 10 years ago
However, in practice, this kind of typo will probably happen to many users/apps, and they'll have a strange / FIB entry without their knowledge. I feel we should fix it, e.g., by returning an error code for ndn://blah .
Updated by Junxiao Shi about 10 years ago
Unfortunately this is not something NFD can do.
The authority component (the part after the initial // in the familiar http and ftp URI schemes) is not relevant to NDN. It should not be present, and it is ignored if it is present.
Library's Name::set
follows this rule and ignores authority.
When the command reaches NFD, it's already in TLV format of ndn:/
.
Protocol should have defined "Authority MUST NOT be present"
Updated by Alex Afanasyev about 10 years ago
This is an old "problem" originated in ccnx and people (at least me) are well aware of it.
Though the question is why can't we simply ignore URI definition and treat authority as just a name (i.e., why we would keep the protocol as is and don't change that)? What is the implication of that?
Updated by Beichuan Zhang about 10 years ago
I knew what the protocol said. My question was: any reason not to change it?