Project

General

Profile

Actions

Task #2039

closed

Controller: remote prefix registration

Added by Junxiao Shi about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Management
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

Extend ndn::nfd::Controller to allow generating ControlCommand for remote prefix registration.

Currently Controller only allows /localhost/nfd prefix, but remote prefix registration needs /localhop/nfd/rib prefix.


Related issues 4 (0 open4 closed)

Related to ndn-cxx - Task #2097: Delete deprecated Face::Face(shared_ptr<io_service>) and Face::ioService()ClosedJunxiao Shi

Actions
Related to NFD - Feature #2056: nrd: remote prefix registrationClosedYanbiao Li

Actions
Blocked by NFD - Task #2038: RibMgmt: remote prefix registrationClosedJunxiao Shi

Actions
Blocks ndn-cxx - Task #2138: Delete deprecated Controller functionsClosedJunxiao Shi

Actions
Actions #1

Updated by Junxiao Shi about 10 years ago

  • Blocked by Task #2038: RibMgmt: remote prefix registration added
Actions #2

Updated by Junxiao Shi about 10 years ago

  • Blocks Task #2040: ndn-autoconfig: remote prefix registration added
Actions #3

Updated by Alex Afanasyev about 10 years ago

This task will be rejected, as the applications WILL NOT do remote registrations.

This will be the job of NRD, which will automatically infer when to do localhop prefix registrations, based on the input from localhost registrations.

Actions #4

Updated by Alex Afanasyev about 10 years ago

If not rejected, this task should be very specific. Controller should send localhop registrations only when face is associated with non-local transport.

Actions #5

Updated by Junxiao Shi about 10 years ago

I agree that regular applications SHOULD NOT perform remote prefix registration. However, this is not the basis of rejecting this Task.

This Task allows remote prefix registration commands to be generated and signed by Controller.
This feature is intended to be used by the process who is supposed to send remote prefix registration commands, and certain administrative and testing tools.
This feature, similar to FIB Management commands, is not intended to be used by regular applications.

Controller itself shouldn't forbid remote prefix registration commands to be sent to a local face.
Face::registerPrefix, the public API for regular applications, makes the choice of whether to send a local or remote prefix registration command.

Actions #6

Updated by Junxiao Shi about 10 years ago

Actions #7

Updated by Junxiao Shi about 10 years ago

  • Blocks deleted (Task #2040: ndn-autoconfig: remote prefix registration)
Actions #8

Updated by Junxiao Shi about 10 years ago

  • Blocked by Task #2008: Delete deprecated Command Interest functions added
Actions #9

Updated by Junxiao Shi about 10 years ago

  • Blocked by deleted (Task #2008: Delete deprecated Command Interest functions)
Actions #10

Updated by Junxiao Shi about 10 years ago

  • Status changed from New to In Progress

A straightforward API is to add a commandPrefix parameter to Controller::start.
But we already have five parameters in this method, and adding another makes it uglier.

I plan to make signing identity, timeout, and command prefix properties of Controller, so that Controller::start call can be simplier.

The reason is: Controller is a client of ControlCommand protocol, which is used to interact with one server.

The new API would be:

interface Controller
{
  Controller(Face&);

  void setDefaultSigningIdentity();
  void setSigningIdentity(Name identityName);
  void setSigningCertificate(IdentityCertificate);

  void setTimeout(time::milliseconds);

  void setCommandPrefix(Name commandPrefix);

  void start<Command>(CommandParameters, CommandSucceedCallback, CommandFailCallback);
};

Old APIs will be deprecated, and deleted after next release.

Face::registerPrefix allows specifying signing identity for each prefix, which relies on deprecated API.
I don't see why an application wants to use different identities for different prefixes: local RIB daemon should be configured to accept the application's certificate for all prefixes it needs.

Actions #11

Updated by Junxiao Shi about 10 years ago

20141024 conference call rejects the design in note-10.

Reason for this rejection is: If we allow application to change signing identity on the Controller owned by Face, prefix unregistration command may incorrectly use different signing identity than prefix registration command.

An alternate design is agreed:

interface Controller
{
  Controller(Face&);

  void start<Command>(CommandParameters, CommandSucceedCallback, CommandFailCallback, CommandOptions);
};

struct CommandOptions
{
  union {
    void useDefaultSigningIdentity;
    Name signingIdentity;
    IdentityCertificate signingCertificate;
  }; // either one of these three should be satisfied; implement shouldn't use 'union'

  time::milliseconds timeout;
  Name prefix;
};

Face::registerPrefix and similar methods should take optional CommandOptions, and don't need multiple overloads.

Controller no longer owns a KeyChain, but uses the KeyChain from Face.
Face constructor can take KeyChain:

Face(shared_ptr<Transport> transport, io_service& io, KeyChain& keyChain);
Actions #12

Updated by Alex Afanasyev about 10 years ago

void useDefaultSigningIdentity => bool useDefaultSigningIdentity

Actions #13

Updated by Junxiao Shi about 10 years ago

void useDefaultSigningIdentity => bool useDefaultSigningIdentity

The union shown in note-11 is an abstract which indicates three properties are mutually exclusive.

The implementation is likely to have an enum to indicate which option is chosen, and two fields for identityName and certificate.

Callers can access those fields via getters/setters similar to those in note-10.

Actions #14

Updated by Junxiao Shi about 10 years ago

  • % Done changed from 0 to 30

Change-Id: I51111d84c73c25265d03f303fad238f314264a08 implements CommandOptions type.

Upcoming commits:

  • change Controller::start to take CommandOptions, and deprecate old overloads
  • change Face::registerPrefix and other methods to use Controller::start overload that takes CommandOptions; make Face own KeyChain
Actions #15

Updated by Junxiao Shi about 10 years ago

  • % Done changed from 30 to 70

Change-Id: I8c405498597bdca115b71eec87acf23d28a266b1 changes Controller::start to take CommandOptions.

Controller::start<RibRegisterCommand> will be capable of sending remote prefix registration commands once this Change is merged.

Actions #16

Updated by Junxiao Shi about 10 years ago

Change-Id: Iecc60c45ba6134dbcc34f58dcdf6a171e7b05253 gives Face class an internal KeyChain.

Upcoming commits:

  • In Face::registerPrefix and similar methods, use CommandOptions
  • Put DEPRECATED macros on all deprecated items in this Task, in order to warn library users
Actions #17

Updated by Junxiao Shi about 10 years ago

  • Blocks Task #2097: Delete deprecated Face::Face(shared_ptr<io_service>) and Face::ioService() added
Actions #18

Updated by Junxiao Shi about 10 years ago

http://gerrit.named-data.net/1369 lets Face::registerPrefix use CommandOptions and no longer uses deprecated overloads of Controller::start.

Actions #19

Updated by Junxiao Shi about 10 years ago

  • Blocks deleted (Task #2097: Delete deprecated Face::Face(shared_ptr<io_service>) and Face::ioService())
Actions #20

Updated by Junxiao Shi about 10 years ago

  • Blocks deleted (Feature #2056: nrd: remote prefix registration)
Actions #21

Updated by Junxiao Shi about 10 years ago

  • Related to Task #2097: Delete deprecated Face::Face(shared_ptr<io_service>) and Face::ioService() added
Actions #22

Updated by Junxiao Shi about 10 years ago

  • Related to Feature #2056: nrd: remote prefix registration added
Actions #23

Updated by Junxiao Shi about 10 years ago

  • % Done changed from 70 to 90

The last thing left in this Task is:

  • Put DEPRECATED macros on all deprecated items in this Task, in order to warn library users

I'll defer this after Nov 09.

This Task is no longer blocking #2056, because necessary features are available now.

Actions #24

Updated by Junxiao Shi about 10 years ago

  • Blocks Task #2138: Delete deprecated Controller functions added
Actions #25

Updated by Junxiao Shi about 10 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 90 to 100

Last commit for this Task is in: http://gerrit.named-data.net/1420

Sadly, NFD and NLSR still have reference to Controller(Face&). They are fixed in http://gerrit.named-data.net/1421 and http://gerrit.named-data.net/1422.

I didn't check other owned projects, because they are not supposed to use Controller directly.

Actions #26

Updated by Junxiao Shi about 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF