Project

General

Profile

Actions

Bug #1314

closed

Face::checkPitExpire should not close transport

Added by Junxiao Shi over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
High
Category:
-
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
2.00 h

Description

If the app isn't listening at any prefix, the transport is closed after all pending Interests are satisfied.

https://github.com/named-data/ndn-cpp-dev/blob/42c81850465c3db5ad68236afa308e89d3d383f9/src/face.cpp#L308

This behavior is undesirable for low traffic apps, such as ndn-tlv-ping who sends an Interest every 1 second and gets answered within 6 milliseconds.
The library closes the transport after each Interest is satisfied, which forces the forwarder to destroy and create face once per second, causing performance issues.

Actions #1

Updated by Alex Afanasyev over 11 years ago

I disagree (in general) with this. If application wants to keep transport open, it should do something to make it open. Right now it can be tricked by enabling listening on a specific prefix. I can add a separate method that allows transport to be persistent, but this definitely not the general case.

Btw. Which performance issues you're referring to? NFD performance or ping? It shouldn't be a big problem for NFD to create/destroy faces...

Actions #2

Updated by Junxiao Shi over 11 years ago

  • Tracker changed from Task to Bug

Face setup/teardown is an expensive task on forwarder (both NFD and ndnd-tlv), compared to Interest/Data processing. Keeping faces open is cheap.

Steps on face setup:

  • allocate Face object
  • assign FaceId
  • publish face create notification

Steps on face teardown:

  • delete nexthop records for failed face
  • publish face destroy notification
  • deallocate Face object
Actions #3

Updated by Alex Afanasyev over 11 years ago

I'm not going to change the default behavior, since it is desired to close face when operation on face finishes (=outstanding interest satisfied). This is used by both test cases and should be used by client apps.

ping is really a special case, which needs to be always connected. I will make a separate call to allow face to be persistent.

Actions #4

Updated by Alex Afanasyev over 11 years ago

I'll check the possibility of using socket::cancel instead of close for Face::checkPitExpire. This way we wouldn't need special handling for ping.

Actions #5

Updated by Alex Afanasyev over 11 years ago

  • Assignee set to Alex Afanasyev
Actions #6

Updated by Alex Afanasyev over 11 years ago

  • Status changed from New to Code review
Actions #7

Updated by Junxiao Shi over 11 years ago

  • Status changed from Code review to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF