Feature #4021
closedFaceSystem: use NetworkMonitor::listNetworkInterfaces()
100%
Description
In FaceSystem
and ProtocolFactory
subclasses, use NetworkMonitor::listNetworkInterfaces()
instead of listNetworkInterfaces()
.
This issue also involves changing NetworkInterfacePredicate
to accept ndn::util::NetworkInterface
.
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
Updated by Junxiao Shi over 7 years ago
- Blocks Feature #3521: Netdev-bound faces added
Updated by Junxiao Shi over 7 years ago
- Blocks Feature #4026: FaceSystem: use fine-grained signals from NetworkMonitor added
Updated by Junxiao Shi over 7 years ago
- Blocked by Feature #4024: NetworkMonitor: stub implementation added
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.
Updated by Junxiao Shi over 7 years ago
- Blocks Feature #4113: Use auto-detected "ad hoc" attribute to create faces added
Updated by Davide Pesavento over 7 years ago
- Subject changed from FaceSystem: use NetworkMonitor::listNetworkInterface() to FaceSystem: use NetworkMonitor::listNetworkInterfaces()
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.
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
.
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
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.
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.
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.
Updated by Davide Pesavento over 7 years ago
Updated by Junxiao Shi over 7 years ago
- Related to Feature #4189: Remove TcpFactory and UdpFactory prohibited endpoint set added
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.
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.
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.
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.
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?
Updated by Junxiao Shi over 7 years ago
Reply to note-22:
This is noted in #3377. Unfortunately I do not have the resource to perform that task.