Project

General

Profile

Actions

Feature #3170

closed

EthernetTransport

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

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

100%

Estimated time:
3.00 h

Description

Implement EthernetTransport for use with LinkService.

The EthernetTransport is a subclass of Transport that communicates with an Ethernet multicast group using libpcap.

  • EthernetTransport is always non-local.
  • EthernetTransport is always permanent.

After implementing EthernetTransport:

  • change EthernetFactory to initialize an LpFace(GenericLinkService+EthernetTransport) in place of EthernetFace
  • delete old EthernetFace

Files

20151118145536.tgz (162 KB) 20151118145536.tgz integ 2496,16 Junxiao Shi, 11/19/2015 09:33 AM

Related issues 7 (0 open7 closed)

Blocked by NFD - Task #3088: Refactor Face as LinkService+TransportClosedEric Newberry

Actions
Blocks NFD - Task #3172: Refactor Face: completionClosedJunxiao Shi

Actions
Blocked by NFD - Feature #3179: EndpointIdClosedJunxiao Shi

Actions
Blocked by NFD - Task #3178: Release 0.4.0-beta1ClosedAlex Afanasyev09/21/2015

Actions
Blocked by NFD - Bug #3249: GenericLinkService performs insufficient validation before calling lp::Packet::get<lp::FragmentField>()ClosedEric Newberry

Actions
Blocked by NFD - Feature #3253: Transport::getMtuClosedJunxiao Shi

Actions
Blocks NFD - Feature #3344: EthernetTransport: 802.1Q VLAN taggingRejected

Actions
Actions #1

Updated by Junxiao Shi over 8 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.

Actions #2

Updated by Junxiao Shi over 8 years ago

  • Blocked by Task #3088: Refactor Face as LinkService+Transport added
Actions #3

Updated by Junxiao Shi over 8 years ago

  • Description updated (diff)
Actions #4

Updated by Junxiao Shi over 8 years ago

  • Blocks Task #3172: Refactor Face: completion added
Actions #5

Updated by Yukai Tu over 8 years ago

Do we need an Error class in transport.hpp? I don't find the Error in both lp-face and transport.

Actions #6

Updated by Junxiao Shi over 8 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.

Actions #7

Updated by Junxiao Shi over 8 years ago

Actions #8

Updated by Yukai Tu over 8 years ago

  • Status changed from New to In Progress
  • Estimated time changed from 3.00 h to 1.00 h
Actions #9

Updated by Junxiao Shi over 8 years ago

  • Blocked by Task #3178: Release 0.4.0-beta1 added
Actions #10

Updated by Junxiao Shi over 8 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.

Actions #11

Updated by Davide Pesavento over 8 years ago

  • Status changed from New to In Progress
  • Assignee changed from Yukai Tu to Davide Pesavento
Actions #12

Updated by Davide Pesavento over 8 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?

Actions #13

Updated by Junxiao Shi over 8 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.

Actions #14

Updated by Davide Pesavento over 8 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 90
Actions #15

Updated by Junxiao Shi over 8 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;
Actions #16

Updated by Eric Newberry over 8 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 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;

I agree with putting this in the Transport class. It will help with fragmentation.

Actions #17

Updated by Davide Pesavento over 8 years ago

Junxiao Shi wrote:

EthernetTransport should 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.

Actions #18

Updated by Davide Pesavento over 8 years ago

wrt getMtu, do we want to handle dynamic-MTU links (i.e. the MTU changes during the lifetime of the Transport)?

Actions #19

Updated by Junxiao Shi over 8 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:

  1. still mark the transport as permanent
  2. 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.

Actions #20

Updated by Davide Pesavento over 8 years ago

Junxiao Shi wrote:

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.

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.

Actions #21

Updated by Junxiao Shi over 8 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.

Actions #22

Updated by Davide Pesavento over 8 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.

Actions #23

Updated by Davide Pesavento over 8 years ago

  • Blocked by Bug #3249: GenericLinkService performs insufficient validation before calling lp::Packet::get<lp::FragmentField>() added
Actions #24

Updated by Davide Pesavento over 8 years ago

  • % Done changed from 90 to 100
Actions #25

Updated by Junxiao Shi over 8 years ago

Actions #27

Updated by Junxiao Shi over 8 years ago

  • Blocks Feature #3344: EthernetTransport: 802.1Q VLAN tagging added
Actions #28

Updated by Junxiao Shi over 8 years ago

  • Status changed from Code review to Feedback

Breaking change notice is sent to nfd-dev.
Deadline is Nov 27 12:00 UTC.

Actions #29

Updated by Davide Pesavento over 8 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF