Feature #3170
closedEthernetTransport
100%
Description
Implement EthernetTransport for use with LinkService.
The EthernetTransport is a subclass of Transport that communicates with an Ethernet multicast group using libpcap.
EthernetTransportis always non-local.EthernetTransportis always permanent.
After implementing EthernetTransport:
- change 
EthernetFactoryto initialize anLpFace(GenericLinkService+EthernetTransport)in place ofEthernetFace - delete old 
EthernetFace 
Files
      
      Updated by Junxiao Shi about 10 years ago
      
    
    - Assignee set to Yukai Tu
 
Changes for this issue should be uploaded to feature-lp branch.
Most code can be adapted from old EthernetFace.
Initialization logic is partially designed in #3088 note-20.
      
      Updated by Junxiao Shi about 10 years ago
      
    
    - Blocked by Task #3088: Refactor Face as LinkService+Transport added
 
      
      Updated by Junxiao Shi about 10 years ago
      
    
    - Blocks Task #3172: Refactor Face: completion added
 
      
      Updated by Yukai Tu about 10 years ago
      
    
    Do we need an Error class in transport.hpp? I don't find the Error in both lp-face and transport.
      
      Updated by Junxiao Shi about 10 years ago
      
    
    Answer to note-5:
If Transport::Error is needed, it can be added at the first commit that requires it.
We don't have to add everything in #3088.
      
      Updated by Junxiao Shi about 10 years ago
      
    
    - Blocked by Feature #3179: EndpointId added
 
      
      Updated by Yukai Tu about 10 years ago
      
    
    - Status changed from New to In Progress
 - Estimated time changed from 3.00 h to 1.00 h
 
      
      Updated by Junxiao Shi about 10 years ago
      
    
    - Blocked by Task #3178: Release 0.4.0-beta1 added
 
      
      Updated by Junxiao Shi about 10 years ago
      
    
    - Status changed from In Progress to New
 - Estimated time changed from 1.00 h to 3.00 h
 
This should not start until after 0.4.0-beta1 release.
      
      Updated by Davide Pesavento about 10 years ago
      
    
    - Status changed from New to In Progress
 - Assignee changed from Yukai Tu to Davide Pesavento
 
      
      Updated by Davide Pesavento about 10 years ago
      
    
    feature-lp branch is gone, should I push to master?
MulticastUdpTransport has been made always permanent, should I do the same for EthernetTransport?
      
      Updated by Junxiao Shi about 10 years ago
      
    
    20151006 conference call decides: Change for this issue should be uploaded to master branch.
This is a breaking change, so a 5-day notice on nfd-dev will be needed before merging.
EthernetTransport should be permanent because of its semantics.
      
      Updated by Davide Pesavento about 10 years ago
      
    
    - Status changed from In Progress to Code review
 - % Done changed from 0 to 90
 
      
      Updated by Junxiao Shi about 10 years ago
      
    
    how can the link service slicer know the MTU of the underlying interface/transport?
I'm thinking about adding a getter to Transport class:
/** \return maximum payload size
 *  \retval -1 transport has no limit on payload size
 *
 *  The maximum payload size is usually the Maximum Transmission Unit (MTU) of a datagram-based transport, and unlimited (-1) for a stream-based transport.
 *  Blocks larger than this size may be dropped when attempting to send through this transport.
 *
 *  The return value should account for any overhead introduced by the transport.
 *  For example, total length of an IPv4 packet is limited to 65535 octets, but the IPv4 header and UDP header should be deducted from this size.
 */
ssize_t getMtu() const;
      
      Updated by Eric Newberry about 10 years ago
      
    
    Junxiao Shi wrote:
how can the link service slicer know the MTU of the underlying interface/transport?
I'm thinking about adding a getter to
Transportclass:/** \return maximum payload size * \retval -1 transport has no limit on payload size * * The maximum payload size is usually the Maximum Transmission Unit (MTU) of a datagram-based transport, and unlimited (-1) for a stream-based transport. * Blocks larger than this size may be dropped when attempting to send through this transport. * * The return value should account for any overhead introduced by the transport. * For example, total length of an IPv4 packet is limited to 65535 octets, but the IPv4 header and UDP header should be deducted from this size. */ ssize_t getMtu() const;
I agree with putting this in the Transport class. It will help with fragmentation.
      
      Updated by Davide Pesavento about 10 years ago
      
    
    Junxiao Shi wrote:
EthernetTransportshould be permanent because of its semantics.
This is actually much less trivial than I thought. In gerrit/2496 I ignored some of the easily ignorable errors, but there are some cases in which it is not so simple to decide what to do, and could require some design discussion. Moreover, extensive testing would be needed and I don't have so much free time right now. So, to avoid any risk of delaying the 0.4.0 release, I recommend to split "permanent EthernetTransport" into a separate task to be done after the release, and keep the current "persistent" implementation for now.
      
      Updated by Davide Pesavento about 10 years ago
      
    
    wrt getMtu, do we want to handle dynamic-MTU links (i.e. the MTU changes during the lifetime of the Transport)?
      
      Updated by Junxiao Shi about 10 years ago
      
    
    - Description updated (diff)
 
I ignored some of the easily ignorable errors, but there are some cases in which it is not so simple to decide what to do, and could require some design discussion.
I recommend to split "permanent EthernetTransport" into a separate task to be done after the release, and keep the current "persistent" implementation for now.
No. Semantically, all multi-access face should be permanent. I have updated issue description for this.
If you are unable to make the implemention recover from all errors for now:
- still mark the transport as permanent
 - report a Bug "EthernetTransport: cannot recover from all errors", with details on what errors it cannot recover from; set target version to v0.5
 
wrt
getMtu, do we want to handle dynamic-MTU links (i.e. the MTU changes during the lifetime of the Transport)?
See #2222 note-33.
LinkService should call Transport::getMtu every time it performs fragmentation or otherwise needs to know MTU, and should not store this return value.
However, there's no signal to indicate a change in MTU.
      
      Updated by Davide Pesavento about 10 years ago
      
    
    Junxiao Shi wrote:
LinkServiceshould callTransport::getMtuevery time it performs fragmentation or otherwise needs to know MTU, and should not store this return value.
However, there's no signal to indicate a change in MTU.
Polling a network interface for its MTU (using ioctl) every time a packet needs to be sent would be horribly inefficient.
A better solution (although Linux-only, as usual I don't know and don't care about OS X) would be to subscribe to rtnetlink notifications for link MTU changes. However this should be considered a new feature, and it would complicate the transport implementation a bit.
      
      Updated by Junxiao Shi about 10 years ago
      
    
    Polling a network interface for its MTU (using
ioctl) every time a packet needs to be sent would be horribly inefficient.
No, EthernetTransport::getMtu should not call ioctl every time.
For now, it only needs to call ioctl during initialization, and store the result in a member variable; then getMtu can just return this variable.
Subscribing to rtnetlink can be considered in the future.
      
      Updated by Davide Pesavento about 10 years ago
      
    
    Ok so the answer to my question in note-18 is "no (for now)". It definitely seemed like the opposite from what you said initially.
      
      Updated by Davide Pesavento about 10 years ago
      
    
    - Blocked by Bug #3249: GenericLinkService performs insufficient validation before calling lp::Packet::get<lp::FragmentField>() added
 
      
      Updated by Junxiao Shi about 10 years ago
      
    
    - Blocked by Feature #3253: Transport::getMtu added
 
      
      Updated by Junxiao Shi almost 10 years ago
      
    
    - File 20151118145536.tgz 20151118145536.tgz added
 
      
      Updated by Junxiao Shi almost 10 years ago
      
    
    - Blocks Feature #3344: EthernetTransport: 802.1Q VLAN tagging added
 
      
      Updated by Junxiao Shi almost 10 years ago
      
    
    - Status changed from Code review to Feedback
 
Breaking change notice is sent to nfd-dev.
Deadline is Nov 27 12:00 UTC.
      
      Updated by Davide Pesavento almost 10 years ago
      
    
    - Status changed from Feedback to Closed