Project

General

Profile

Actions

Feature #4016

closed

ProtocolFactory::createFace accepts LocalUri

Added by Alex Afanasyev about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Faces
Target version:
Start date:
03/27/2017
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

In particular, the task is to change API of createFace in ProtocolFactory and related classes to

  virtual void
  createFace(const FaceUri& remoteUri,
             const FaceUri& localUri,
             ndn::nfd::FacePersistency persistency,
             bool wantLocalFieldsEnabled,
             const FaceCreatedCallback& onCreated,
             const FaceCreationFailedCallback& onFailure) = 0;

Also, the relevant changes need to be added to management to extract and pass information from the create command.


Related issues 2 (0 open2 closed)

Related to ndn-cxx - Feature #4015: Accept LocalUri in FaceCreateCommandClosedTeng Liang03/27/2017

Actions
Blocked by ndn-cxx - Feature #4014: ControlCommand: LocalUri in ControlParametersClosedEric Newberry03/27/2017

Actions
Actions #1

Updated by Alex Afanasyev about 7 years ago

  • Blocked by Feature #4015: Accept LocalUri in FaceCreateCommand added
Actions #2

Updated by Alex Afanasyev about 7 years ago

Actions #3

Updated by Junxiao Shi about 7 years ago

  • Tracker changed from Task to Feature
  • Subject changed from Extend FaceSystem to support LocalUri when creating faces to ProtocolFactory::createFace accepts LocalUri
  • Estimated time set to 3.00 h
Actions #4

Updated by Junxiao Shi about 7 years ago

  • Blocked by deleted (Feature #4015: Accept LocalUri in FaceCreateCommand)
Actions #5

Updated by Junxiao Shi about 7 years ago

  • Related to Feature #4015: Accept LocalUri in FaceCreateCommand added
Actions #6

Updated by Davide Pesavento about 7 years ago

  • Description updated (diff)
Actions #7

Updated by Junxiao Shi about 7 years ago

Actions #8

Updated by Eric Newberry about 7 years ago

  • Status changed from New to In Progress
Actions #9

Updated by Eric Newberry about 7 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
Actions #10

Updated by Davide Pesavento about 7 years ago

Two design questions on https://gerrit.named-data.net/3809

  1. TcpFactory and UdpFactory ignore the LocalUri even if it's provided, i.e. they accept everything. Is that ok or do we want to log a warning? or throw an exception (thus failing the command)? The latter would allow clients to determine if LocalUri selection is actually supported by the forwarder they're talking to, without relying on version number checks. It would also help preserve backward compatibility when the factories will start checking if the provided LocalUri makes sense (commands that were accepted won't suddenly start failing on the new version).

  2. I guess we also need a way to tell the protocol factories whether the LocalUri was specified in the request or not. The current approach taken by Change 3809 is to pass a non-canonical FaceUri (null://). Alternatives are: use an "empty" FaceUri, use ndn::optional<FaceUri>, or introduce a new FaceUri scheme such as any:// that has the current semantics (the factory chooses a local endpoint).

Actions #11

Updated by Davide Pesavento about 7 years ago

  • Blocked by Feature #4014: ControlCommand: LocalUri in ControlParameters added
Actions #12

Updated by Junxiao Shi about 7 years ago

note-10 questions come from incomplete protocol definition. My recommendations for protocol are:

  • For now, protocol should require LocalUri only for Ethernet unicast faces, and forbid LocalUri for UDP and TCP faces.
  • In the near future, 409-conflict response should carry LocalUri field.
  • In the near future, Uri+LocalUri should be returned on successful face creation response, regardless of whether LocalUri was specified in the request. This would allow nfdc to display a good output without retrieving a faces/query dataset.
  • In the future, LocalUri can be allowed on UDP and TCP face creation. If so, socket binding should reflect the choice in LocalUri.
  • In the future, faces/create command can accept multicast face and NIC-associated permanent face creation. This would give more flexibility than through configuration.

Regarding implementation, ndn::optional<FaceUri> localUri should be passed to ProtocolFactory::createFace. TcpFactory and UdpFactory should throw an exception when localUri is supplied. EthernetFactory should throw an exception when localUri is missing.

Actions #13

Updated by Alex Afanasyev about 7 years ago

I agree with all what Junxiao said, just want to add specifics regarding "protocol forbids". Right now, the command should fail and return to client whatever error code and description. If we use in protocol factories exceptions for this, then exception should be perfect.

Optional for not specified local URI sounds good.

Actions #14

Updated by Eric Newberry about 7 years ago

I agree that LocalUri should be forbidden or UDP and TCP faces and that including the LocalUri with these faces should cause an exception and command failure.

ndn::optional sounds better than any:// as well.

Actions #15

Updated by Davide Pesavento about 7 years ago

Alex Afanasyev wrote:

If we use in protocol factories exceptions for this, then exception should be perfect.

An exception would do the job, meaning that it would fail the face create command. However the error returned to the client would be something like "internal server error", which is not really correct. On the other hand, triggering the FaceCreationFailedCallback from ProtocolFactory::createFace concrete implementations allows specifying a different status code, so that's probably better.

Actions #16

Updated by Eric Newberry about 7 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF