Project

General

Profile

Actions

Feature #4021

closed

FaceSystem: use NetworkMonitor::listNetworkInterfaces()

Added by Junxiao Shi over 7 years ago. Updated about 7 years ago.

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

100%

Estimated time:
6.00 h

Description

In FaceSystem and ProtocolFactory subclasses, use NetworkMonitor::listNetworkInterfaces() instead of listNetworkInterfaces().
This issue also involves changing NetworkInterfacePredicate to accept ndn::util::NetworkInterface.


Related issues 7 (4 open3 closed)

Related to NFD - Feature #4189: Remove TcpFactory and UdpFactory prohibited endpoint setClosedJunxiao Shi07/17/2017

Actions
Blocked by ndn-cxx - Feature #3353: NetworkMonitor: emit fine-grained signals when the state of a network interface changesClosedDavide Pesavento

Actions
Blocks NFD - Feature #3521: Netdev-bound facesIn Progress

Actions
Blocks NFD - Feature #4026: FaceSystem: use fine-grained signals from NetworkMonitorNew

Actions
Blocked by ndn-cxx - Feature #4024: NetworkMonitor: stub implementationClosedJunxiao Shi

Actions
Blocks NFD - Feature #4113: Use auto-detected "ad hoc" attribute to create facesNew

Actions
Blocks NFD - Feature #3352: Set transport state UP/DOWN based on the state of the underlying network interfaceIn Progress

Actions
Actions #1

Updated by Junxiao Shi over 7 years ago

  • Blocked by Feature #3353: NetworkMonitor: emit fine-grained signals when the state of a network interface changes added
Actions #2

Updated by Junxiao Shi over 7 years ago

Actions #3

Updated by Junxiao Shi over 7 years ago

  • Status changed from New to In Progress
Actions #4

Updated by Junxiao Shi over 7 years ago

  • Blocks Feature #4026: FaceSystem: use fine-grained signals from NetworkMonitor added
Actions #5

Updated by Junxiao Shi over 7 years ago

  • Blocked by Feature #4024: NetworkMonitor: stub implementation added
Actions #6

Updated by Junxiao Shi over 7 years ago

  • Subject changed from FaceSystem: use fine-grained signals from NetworkMonitor to FaceSystem: use NetworkMonitor::listNetworkInterface()
  • Description updated (diff)
  • Status changed from In Progress to New
  • Start date deleted (03/27/2017)

I'm reducing the scope of this issue to only include usage of NetworkMonitor::listNetworkInterfaces().

Even through, this is blocked by #4024 because without a mock NetworkMonitor::Impl, it would be impossible to retain the unit tests that currently rely on setDebugNetworkInterfaces.
I'm stopping the work on this issue until #4024 is resolved.

Actions #7

Updated by Junxiao Shi over 7 years ago

  • Blocks Feature #4113: Use auto-detected "ad hoc" attribute to create faces added
Actions #8

Updated by Davide Pesavento over 7 years ago

  • Subject changed from FaceSystem: use NetworkMonitor::listNetworkInterface() to FaceSystem: use NetworkMonitor::listNetworkInterfaces()
Actions #9

Updated by Junxiao Shi over 7 years ago

  • Status changed from New to In Progress
Actions #10

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 0 to 10

https://gerrit.named-data.net/3992

A major different between nfd::listNetworkInterfaces() and NetworkMonitor::listNetworkInterfaces() is that the former always returns all netifs, while the latter returns all netifs only after onEnumerationCompleted is emitted.
My plan for this issue is to react to onInterfaceAdded signal and create faces there.
Reactions to other signals can be deferred to #4026.

Actions #11

Updated by Junxiao Shi over 7 years ago

To avoid a jumbo commit, I'll break down as much as possible.

https://gerrit.named-data.net/4003 extends NetworkInterfacePredicate to accept ndn::net::NetworkInterface in addition to NetworkInterfaceInfo. The latter will eventually be removed.

https://gerrit.named-data.net/4004 changes EthernetTransport and EthernetChannel constructors to use ndn::net::NetworkInterface instead of NetworkInterfaceInfo. The callers, including EthernetFactory and test suites, are still using nfd::listNetworkInterfaces() which returns NetworkInterfaceInfo, and need to do a conversion into ndn::net::NetworkInterface.

Actions #12

Updated by Junxiao Shi over 7 years ago

  • Blocks Feature #3352: Set transport state UP/DOWN based on the state of the underlying network interface added
Actions #13

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 10 to 40

https://gerrit.named-data.net/4009 updates face test suites to avoid listNetworkInterfaces().
A collectNetworkInterfaces() obtains netifs from NetworkMonitor synchronously, which is then used to initialize test cases.
Note that this function by default does not handle netif changes during the execution of the whole test binary, because that rarely happens.

Actions #14

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 40 to 50

https://gerrit.named-data.net/3992 patchset3 adds NetworkMonitor and moves addFace (from FaceSystem::ConfigContext) to ProtocolFactory base class. They are assigned in ProtocolFactory::create to avoid pass-along requirements on ProtocolFactory subclass constructors.
ProtocolFactory::netmon is not yet utilized, but they will be needed in the next commit to create channels and multicast faces in the factory as network interfaces are enumerated.

Actions #15

Updated by Junxiao Shi over 7 years ago

https://gerrit.named-data.net/4036 changes TcpFactory prohibited endpoint set to use NetworkMonitor instead of nfd::listNetworkInterfaces().
If a local channel listens on an ANY address, the expected behavior is to prohibit face creation toward any of the local addresses.
Previous implementation achieves this by enumerating all local IP addresses during channel creation, and adding multiple entries into the container.
New implementation only adds a single entry with ANY address into the container, while the enumeration result from NetworkMonitor is used when determining whether a remote endpoint would be prohibited.

Actions #16

Updated by Davide Pesavento over 7 years ago

What was the original motivation behind these "prohibited endpoints" anyway? That logic was introduced in commit ca53ac6b003ef1d0bd630fd3074fe3ef38967c07, which references #1414 and #1427, but neither explains why we can't allow NFD to connect to itself.

Actions #17

Updated by Junxiao Shi over 7 years ago

  • Related to Feature #4189: Remove TcpFactory and UdpFactory prohibited endpoint set added
Actions #18

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 50 to 60

https://gerrit.named-data.net/4086 UdpFactory
Original test cases provide partial test coverage. Additional tests will be added in #4026.

Actions #19

Updated by Junxiao Shi over 7 years ago

ProtocolFactory subclass instances in test suites have been changed to be constructed with NetworkMonitorStub rather than NetworkMonitor. However, existing test cases for UdpFactory were relying on real network interfaces. https://gerrit.named-data.net/4086 patchset3 adopts a temporary solution which copies real network interfaces into NetworkMonitorStub. I choose copying rather than constructing UdpFactory from a real NetworkMonitor because in #4026, this test suite will be expanded to consider interactions between NetworkMonitor and multicast configuraton changes. By that time, an uncontrollable NetworkMonitor is almost useless. I understand that a multicast UDP face can only be created on a real netif, and the plan for #4026 is to populate NetworkMonitorStub with a mix of MulticastUdpTransport-capable real netifs and other fake netifs that are either incapable or rejected by configuration.

Actions #20

Updated by Junxiao Shi over 7 years ago

https://gerrit.named-data.net/4088 EthernetFactory

NFD start log indicates UDP multicast faces, Ethernet channels, and Ethernet multicast faces are created:

vagrant@m0212:~/NFD$ sudo build/bin/nfd --config ../nfd.conf 
1502061291.014864 INFO: [EthernetFactory] enabling unicast channels
1502061291.014901 INFO: [EthernetFactory] enabling multicast on 01:00:5e:00:17:aa
1502061291.015418 INFO: [UdpFactory] enabling multicast on 224.0.23.170:56363
1502061291.016957 DEBUG: [EthernetFactory] Not creating channel on lo: netif is loopback
1502061291.016989 DEBUG: [EthernetFactory] Not creating multicast face on lo: netif cannot multicast
1502061291.016996 DEBUG: [UdpFactory] Not creating multicast face on lo: netif cannot multicast
1502061291.017006 DEBUG: [EthernetFactory] Creating channel on eth0
1502061291.051164 DEBUG: [EthernetFactory] Creating multicast face on eth0
1502061291.081208 DEBUG: [UdpFactory] Not creating multicast face on eth0: no IPv4 address
1502061291.083808 DEBUG: [UdpFactory] Creating multicast face on eth0

https://gerrit.named-data.net/4089 deletes NetworkInterfaceInfo which is no longer needed.

Actions #21

Updated by Junxiao Shi over 7 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 60 to 100

This issue is complete given the API it intends to stop using is now deleted.

Actions #22

Updated by Davide Pesavento over 7 years ago

1-argument constructor of FaceSystem was marked DEPRECATED, but was not removed. During code review, Junxiao said:

This is still used in FaceManager test suite, which I'll get to in another commit. I mark DEPRECATED as a reminder.

When do you intend to do this?

Actions #23

Updated by Junxiao Shi about 7 years ago

Reply to note-22:

This is noted in #3377. Unfortunately I do not have the resource to perform that task.

Actions

Also available in: Atom PDF