Project

General

Profile

Actions

Task #1250

closed

Face close method

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

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

100%

Estimated time:
3.00 h

Description

Add a void Face::close() method to Face class.

When close is invoked, the Face

  • deregisters itself from Forwarder class
  • stops receiving packets
  • stops accepting new packets for transmission
  • continues to send packets already scheduled for transmission

After all packets scheduled for transmission are sent (or are failed to send), the Face

  • deregisters itself from the channel
  • cleans up kernel resources (such as file descriptor)

Related issues 1 (0 open1 closed)

Blocks NFD - Task #1195: FaceManagerClosed

Actions
Actions #1

Updated by Alex Afanasyev almost 11 years ago

Does it mean face should have another event emitter, which will be used for clean up or we will rename/abuse onFail?

Actions #2

Updated by Junxiao Shi almost 11 years ago

Problem in current spec: FaceManager may request to create the same face when an existing face is closing.

This problem mainly affects unicast UDP face:

  1. FaceManager create face udp4://192.0.2.1:6363/ as face X
  2. FaceManager destroy face X
  3. during the period [ face(X).close() has been invoked, but some packets scheduled for transmission are not sent yet ], face X exists in the channel;
    FaceManager create face udp4://192.0.2.1:6363/ would return face X, but it will be destroyed shortly

Further discussion is required before implementation.

Actions #3

Updated by Alex Afanasyev almost 11 years ago

  • Assignee set to Alex Afanasyev
Actions #4

Updated by Junxiao Shi almost 11 years ago

Problem in current spec: FaceManager may request to create the same face when an existing face is closing.

20140216 conference call decides that the second creation request should fail.

This is similar to TCP CLOSE_WAIT state.

Actions #5

Updated by Alex Afanasyev almost 11 years ago

I suppose this is just a matter of setting a timeout event for the deletion of the Face from Channel's map (can be deleted from all other places immediately).

Just in case. The problem is not only what you mentioned, but also with the fact that neighbor is unaware of the fact of "closing" of the UDP face. It really annoys me in ndnx, making it basically impossible to delete UDP face... Should we have an explicit closing notification for UDP face? Something like "FIN" interest?

Actions #6

Updated by Junxiao Shi almost 11 years ago

Problem mentioned in note-4 says that nfdc or another tool may use FaceMgmt to create the same face.

During closing period, packets from that remote end are ignored.
After Face is closed, a packet from the same remote end creates a new Face.

Telling remote end to destroy face is part of Face Authentication protocol.

Actions #7

Updated by Alex Afanasyev almost 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

I believe this task is done.

Actions #8

Updated by Alex Afanasyev almost 11 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF