Project

General

Profile

Actions

Task #3226

closed

Redesign faces/enable-local-control

Added by Junxiao Shi about 9 years ago. Updated over 8 years ago.

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

100%

Estimated time:
2.00 h

Description

In FaceMgmt, faces/enable-local-control and faces/disable-local-control was designed to enable/disable LocalControlHeader features.

They are no longer relevant when NDNLPv2 replaces LocalControlHeader.

This issue is to redesign this part of FaceMgmt protocol, and provide a meaningful replacement for these commands.


Related issues 2 (0 open2 closed)

Blocks NFD - Feature #3731: FaceManager commands: LocalFieldsEnabledClosedEric Newberry

Actions
Blocks NFD - Feature #3732: Face datasets: Flags fieldClosedEric Newberry

Actions
Actions #1

Updated by Junxiao Shi about 9 years ago

http://gerrit.named-data.net/2477 implements a temporary workaround, where faces/enable-local-control enables all local fields in GenericLinkService, and faces/disable-local-control disables all local fields in GenericLinkService.

Actions #2

Updated by Alex Afanasyev almost 9 years ago

  • Target version changed from v0.4 to v0.5
Actions #3

Updated by Eric Newberry over 8 years ago

Was anyone already planning to work on this?

Actions #4

Updated by Junxiao Shi over 8 years ago

  • Assignee set to Junxiao Shi

I'll write the spec.

Implementation will be separate.

Actions #5

Updated by Junxiao Shi over 8 years ago

I discussed with Eric on Jul 08.

The plan is:

  • eliminate faces/enable-local-control and faces/disable-local-control commands
  • extend faces/update command to allow a "local fields enabled" property
  • there would be no protocol limitation on changing this property for other faces (but validator can restrict that)
Actions #6

Updated by Junxiao Shi over 8 years ago

Alex approves note-5 idea 20160719 call.

Actions #7

Updated by Junxiao Shi over 8 years ago

  • Status changed from New to In Progress

I'm thinking how to represent "local fields enabled" property in faces/update command.

It's important to know that a faces/update command may or may not want to update this property, and it's undesirable to require the client to retrieve the current value of this property before executing the command.

Solution A

Introduce an explicit LocalFieldsEnabled field, which possible values "no" and "yes" (encoded as enum numbers, of course).

The presence of this field indicates the client wants to update "local fields enabled" property.

The value of this field indicates the new setting.

Solution B

Use two bits in the Flags field: "enable local fields" and "disable local fields".

Setting "enable local fileds" bit enables local fields; setting "disable local fields" bit disables local fields; setting both bits is an error; setting neither bits keeps the "local fields enabled" property unchanged.

Solution C

Use one bit in the Flags field: "local fields enabled"; and introduce another Mask field.

Setting "local fields enabled" bit in Mask indicates the client wants to update "local fields enabled" property.

The corresponding bit in Flags field indicates the new setting.

Solution D

Introduce a "local fields enabled" field to FaceStatus.

Redesign ControlCommand protocol to use FaceStatus instead of ControlParameters, and eventually eliminate ControlParameters type.


Solution A, B, or C requires the least amount of implementation work.

The effective setting of "local fields enabled" property is be exposed in FaceStatus, but this is no worse than faces/enable-local-control.

Solution D is an aggressive solution but it solves the problem raised in #1397-3.
It creates consistency between face commands and face datasets: the successful response of a command carries a complete FaceStatus same as the dataset.
This is helpful for #3444 and #2542.

Actions #8

Updated by Eric Newberry over 8 years ago

For solutions B and C, where is the Flags field documented? It's mentioned on the ControlCommand page, but I can't find any specific documentation.

If we have a chance to make this feature more intuitive and logical, we should. Therefore, I think solution D might be the best.

Actions #9

Updated by Junxiao Shi over 8 years ago

For solutions B and C, where is the Flags field documented?

ControlParameters struct covers every field that existing commands want to use, but the semantics of each field is up to the definition of each command.

RibMgmt rib/register uses Flags field for route inheritance flags.
I don't know about any other usage.

If we have a chance to make this feature more intuitive and logical, we should. Therefore, I think solution D might be the best.

Yes, solution D is my eventual goal.

The concern is: we just spent the entire 2015 on "management refactoring" #2107; if we change the protocol, another refactoring is coming.
It affects ControlCommands only and requires small changes in Dispatcher, but converting the large number of test cases is much more work.

Actions #10

Updated by Junxiao Shi over 8 years ago

I asked Beichuan about this on 20160803. His opinion is that we can proceed with the protocol change only if it won't take a whole year.

Can Eric estimate how much time it would take to implement the change? Give two estimates on "FaceMgmt only" and "all management modules".

Actions #11

Updated by Eric Newberry over 8 years ago

There is currently a mismatch between the fields in ControlParameters and FaceStatus. In order to use FaceStatus for any management operations, fields from ControlParameters will need to be added to its design in ndn-cxx. These fields are Name, Origin, Cost, Flags, Strategy, and LocalFields (from #3226). Adding these fields to FaceStatus should take approximately 1 to 2 hours. Modifying and ensuring the correctness of the FaceStatus test case (ManagementNfdFaceStatus) could take up to 2 hours. These steps will be required for both options.

In order to replace ControlParameters with FaceStatus only in the Face Manager, ControlCommand, Controller, Dispatcher, DummyClientFace, and Face::Impl in ndn-cxx and ManagerBase and NfdManagerBase in NFD will need to be changed to accept both ControlParameters and FaceStatus (in the form of a template). In addition, checks should be created so that the FIB Manager, the Strategy Choice Manager, and the Forwarder Status Manager will not be provided with a FaceStatus and that the Face Manager will not be provided with a ControlParameters. This could take up to 8 hours. The Face Manager itself will need to be modified to use FaceStatus, which should take 2 to 3 hours. The ndn-autoconfig and nfdc tools will also need to be modified to use the appropriate blocks for each manager. These modifications and testing their correctness could take up to 5 hours. In addition, correcting unit tests and adding cases to cover the new functionality could take up to 6 hours.

In order to replace ControlParameters with FaceStatus in the entirety of management, all of the classes and tools specified in the previous paragraph will need to modified. However, instead of using templates, all instances of ControlParameters will be replaced with FaceStatus, which is more straightforward. Therefore, I would estimate that those steps would take roughly half the time in the second option. In addition, RegisteredPrefix in ndn-cxx and FibManager and StrategyChoiceManager in NFD will need to be modified to use FaceStatus. I estimate that this would take 1 hour. I estimate that modifying their test cases would take 3 hours. In addition, AutoPrefixPropagator, FibUpdater, Rib, and RibManager will need to modified as well, taking 3 to 4 hours. Various associated test cases will need to be updated, taking around 4 hours. MulticastDiscovery in nfd-autoconfig and nfd-autoreg will need to modified to use FaceStatus, taking up to 2 hours.

From the above estimates, the total amount of time to only modify FaceMgmt would be up to 26 hours. The time to refactor all of management would be up to 24 hours. These figures are arbitrary best-guesses based upon my past coding work in ndn-cxx and NFD. Of course, there will almost certainly be unexpected or overlooked changes that must be made, so the above figures should be multiplied by 1.5x to 2x for a more accurate upper bound.

Files that I believe would need to be modified in option 1:

  • (ndn-cxx) src/detail/face-impl.hpp
  • (ndn-cxx) src/management/nfd-control-command.cpp
  • (ndn-cxx) src/management/nfd-control-command.hpp
  • (ndn-cxx) src/management/nfd-controller.cpp
  • (ndn-cxx) src/management/nfd-controller.hpp
  • (ndn-cxx) src/management/nfd-face-status.cpp
  • (ndn-cxx) src/management/nfd-face-status.hpp
  • (ndn-cxx) src/mgmt/dispatcher.cpp
  • (ndn-cxx) src/mgmt/dispatcher.hpp
  • (ndn-cxx) src/util/dummy-client-face.cpp
  • (ndn-cxx) tests/unit-tests/management/nfd-control-command.t.cpp
  • (ndn-cxx) tests/unit-tests/management/nfd-controller.t.cpp
  • (ndn-cxx) tests/unit-tests/management/nfd-face-status.t.cpp
  • (ndn-cxx) tests/unit-tests/mgmt/dispatcher.t.cpp
  • (NFD) core/manager-base.cpp
  • (NFD) core/manager-base.hpp
  • (NFD) daemon/mgmt/face-manager.cpp
  • (NFD) daemon/mgmt/face-manager.hpp
  • (NFD) daemon/mgmt/nfd-manager-base.cpp
  • (NFD) daemon/mgmt/nfd-manager-base.hpp
  • (NFD) tests/core/manager-base.t.cpp
  • (NFD) tests/daemon/mgmt/face-manager.t.cpp
  • (NFD) tests/daemon/mgmt/nfd-manager-base.t.cpp
  • (NFD) tests/manager-common-fixture.cpp
  • (NFD) tests/manager-common-fixture.hpp
  • (NFD) tools/ndn-autoconfig/base.cpp
  • (NFD) tools/ndn-autoconfig/base.hpp
  • (NFD) tools/nfdc.cpp
  • (NFD) tools/nfdc.hpp

Files for option 2:

  • All files from option 1
  • (ndn-cxx) src/detail/registered-prefix.hpp
  • (NFD) daemon/mgmt/fib-manager.cpp
  • (NFD) daemon/mgmt/fib-manager.hpp
  • (NFD) daemon/mgmt/strategy-choice-manager.cpp
  • (NFD) daemon/mgmt/strategy-choice-manager.hpp
  • (NFD) rib/auto-prefix-propagator.cpp
  • (NFD) rib/auto-prefix-propagator.hpp
  • (NFD) rib/fib-updater.cpp
  • (NFD) rib/rib.hpp
  • (NFD) rib/rib-manager.cpp
  • (NFD) rib/rib-manager.hpp
  • (NFD) tests/daemon/mgmt/fib-manager.t.cpp
  • (NFD) tests/daemon/mgmt/strategy-choice-manager.t.cpp
  • (NFD) tests/rib/auto-prefix-propagator.t.cpp
  • (NFD) tests/rib/rib-manager.t.cpp
  • (NFD) tests/rib/rib-status-publisher-common.hpp
  • (NFD) tools/ndn-autoconfig/multicast-discovery.cpp
  • (NFD) tools/nfd-autoreg.cpp
Actions #12

Updated by Junxiao Shi over 8 years ago

note-11 is an impressive analysis.

In order to use FaceStatus for any management operations
instead of using templates, all instances of ControlParameters will be replaced with FaceStatus

These two points are wrong. FaceStatus can only be used with FaceMgmt. Other management module should use other structs, such as ndn::nfd::StrategyChoice for StrategyChoice commands, so you can't avoid templates.

Then I realize this is where the complexity comes from: we don't have a suitable struct for FibMgmt and RibMgmt commands.

fib/add-nexthop, for example, needs {name prefix, nexthop face, cost}, but the struct in FIB dataset ndn::nfd::FibEntry contains all nexthop records associated with a name prefix.
Although we could use ndn::nfd::FibEntry for fib/add-nexthop command, there's additional complexity: do we want to restrict to only one nexthop record, or do we want to support adding multiple nexthops together?

Similarly, if we use ndn::nfd::FibEntry in fib/remove-nexthop command, "cost" field is not needed in the request, and this requires modification in the encoding/decoding procedures.

Based on this reasoning and the 26-hour estimate given in note-11, I think changing parameter types would take longer than 26 hours, and thus we should not change FaceMgmt commands parameter type to FaceStatus.

On the other side, we can consider changing the response payload to FaceStatus to represent the current state of a face and better support nfdc, but this should be left for a separate issue.

Actions #13

Updated by Eric Newberry over 8 years ago

If solution D is not pursued, I would argue for solution C. It seems to be the most logical and efficient solution, as the Flag and Mask fields could be used for a variety of other face options in the future.

Actions #14

Updated by Junxiao Shi over 8 years ago

20160809 call agrees with pursue Solution C. I'll update spec accordingly.

Actions #15

Updated by Junxiao Shi over 8 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

ControlCommand r26 adds Mask field to ControlParameters, and removes LocalControlFeature field.

This revision also replaces links to SignedInterest as CommandInterest due to #2376-6.

This revision also changes <body>? under ControlResponse as <body> because <body> itself can be empty.

FaceMgmt r52 deletes faces/enable-local-control and faces/disable-local-control commands, and adds Flags+Mask fields to faces/create and faces/update commands as well as FaceStatus dataset struct.

This revision also clarifies error codes in faces/create command.

Actions #16

Updated by Junxiao Shi over 8 years ago

  • Blocks Feature #3731: FaceManager commands: LocalFieldsEnabled added
Actions #17

Updated by Junxiao Shi over 8 years ago

Actions #18

Updated by Junxiao Shi over 8 years ago

  • Description updated (diff)
Actions #19

Updated by Eric Newberry over 8 years ago

The spec at the specified wiki pages looks good.

Actions #20

Updated by Junxiao Shi over 8 years ago

  • Status changed from Resolved to Closed

Thanks for approval.

Actions #21

Updated by Eric Newberry over 8 years ago

From faces/update in FaceMgmt:

If all optional property fields are omitted or Mask is specified as zero, this command does nothing, but is still considered successful.

This statement is confusing me a bit. There are other static property fields besides Flags and Mask. However, from what I understand from this statement, if FacePersistency is included, but Mask is still set to 0, the face persistency will not be updated. Is this correct? If not, this wording should be changed to state the intended behavior.

Actions #22

Updated by Junxiao Shi over 8 years ago

note-21 problem is corrected in FaceMgmt r53.

Actions #23

Updated by Eric Newberry over 8 years ago

From "Face Status Change Notification" in FaceMgmt:

FaceEventKind indicates the kind of event. Its possible values are:

  • 1: face is created
  • 2: face is destroyed

Should these notifications also be sent when the static properties of the face are updated? If so, a third type of event should be added, indicating "face is updated", "static properties are updated", or something similar.

Actions #24

Updated by Junxiao Shi over 8 years ago

Reply to note-23:

Not at the moment. If there's a use case, I can extend the protocol in a separate issue.

Actions

Also available in: Atom PDF