Project

General

Profile

Actions

Task #1191

closed

EthernetFace implementation

Added by Alex Afanasyev about 10 years ago. Updated about 10 years ago.

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

100%

Estimated time:
12.00 h

Description

Implement EthernetChannelFactory, EthernetChannel, and EthernetFace.

EthernetChannelFactory can

  • create an EthernetChannel for communication on a local MAC address via a local NIC
    If an EthernetChannel with the same local MAC address and local NIC exists, that one should be returned. ethertype is defined as a constant.

EthernetChannel represents a local MAC address and a local NIC. It can

  • create an EthernetFace for multicast communication with one multicast group
    If a multicast-EthernetFace with the same multicast group exists, that one should be returned.

EthernetFace represents a broadcast tunnel (multicast).

A multicast-EthernetFace should have a libpcap session
to receive packets sent to the specific multicast group via the specific local NIC,
and to send packets to the specific multicast group via the specific local NIC.

The libpcap session SHOULD NOT be placed into promiscuous mode.


Related issues 2 (0 open2 closed)

Related to NFD - Task #1209: NDNLP fragmentation and reassembly on Ethernet multicast faceClosedMatteo Sammarco

Actions
Precedes NFD - Task #1278: EthernetFace without promiscuous modeClosedDavide Pesavento

Actions
Actions #1

Updated by Junxiao Shi about 10 years ago

  • Category set to Faces
  • Target version set to v0.1
  • Start date deleted (01/31/2014)
Actions #2

Updated by Davide Pesavento about 10 years ago

  • Assignee set to Davide Pesavento
Actions #3

Updated by Junxiao Shi about 10 years ago

  • Description updated (diff)
  • Estimated time set to 12.00 h

Ethernet is multicast-only.

On Wed, Jan 22, 2014 at 11:25 AM, Beichuan Zhang wrote:

The local multicast face doesn't run the above face registration protocol.
It is created on each physical interface at start time of the forwarder.
I'd put Ethernet under this category too, which means we don't support point-to-point Ethernet communication as for now.


What default multicast group and ethertype should we use?

NDNFD has 01:00:5E:00:17:AA and 0x8624.

Actions #4

Updated by Davide Pesavento about 10 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I'm probably missing some context here... what are the use cases for the Ethernet face/channel?

Actions #5

Updated by Junxiao Shi about 10 years ago

Use case: to communicate directly over Ethernet in an IP-free network.

Actions #6

Updated by Davide Pesavento about 10 years ago

Can you be a bit more specific please? How's the face supposed to be used by nfd itself? What identifies a "local NIC" (mac address, interface name, something else...)? Why only multicast?

Actions #7

Updated by Junxiao Shi about 10 years ago

How's the face supposed to be used by nfd itself?

NFD uses an EthernetFace like any other face: send and receive Interest and Data.

What identifies a "local NIC" (mac address, interface name, something else...)?

A local NIC is identified by its interface name, such as eth1 on linux or en1 on OS X.

Why only multicast?

To have unicast, the channel must receive the packet, and perform an exact match of the source address to find the face, and dispatch the packet to that face.

Supporting only multicast eliminates the need for this dispatching mechanism.

Imagine a NIC that understands NDN Names in the hardware: unicast is not necessary in this device.

Actions #8

Updated by Davide Pesavento about 10 years ago

Junxiao Shi wrote:

What identifies a "local NIC" (mac address, interface name, something else...)?

A local NIC is identified by its interface name, such as eth1 on linux or en1 on OS X.

This means that the "type" of a local endpoint (iface name) is different from the "type" of a remote endpoint (multicast address), so I'm not sure if it makes sense to define the usual ethernet::Endpoint type alias...
In either case, it would just be an alias for std::string.

Why only multicast?

To have unicast, the channel must receive the packet, and perform an exact match of the source address to find the face, and dispatch the packet to that face.

Supporting only multicast eliminates the need for this dispatching mechanism.

Imagine a NIC that understands NDN Names in the hardware: unicast is not necessary in this device.

Understood.

What's the semantics of EthernetChannel::listen() then? Should it open a promiscuous-mode pcap session on the local NIC and spawn a new EthernetFace whenever it receives an NDN packet (i.e. one with the correct ethertype) from a new (i.e. never seen before) multicast group (or in other words, when a face for that multicast group isn't already present in the ChannelFaceMap)?

Actions #9

Updated by Junxiao Shi about 10 years ago

the "type" of a local endpoint (iface name) is different from the "type" of a remote endpoint (multicast address)

A local NIC can be uniquely identified by an interface name or by a MAC address, so endpoint type should be uint8_t[6] or equivalent.

What's the semantics of EthernetChannel::listen() then?

Channel::listen is only applicable to unicast.

Actions #10

Updated by Davide Pesavento about 10 years ago

Junxiao Shi wrote:

the "type" of a local endpoint (iface name) is different from the "type" of a remote endpoint (multicast address)

A local NIC can be uniquely identified by an interface name or by a MAC address, so endpoint type should be uint8_t[6] or equivalent.

Wrong. A mac address may not be unique in the presence of virtual interfaces (e.g. think about VLAN interfaces). The name is the only way to identify it uniquely.

What's the semantics of EthernetChannel::listen() then?

Channel::listen is only applicable to unicast.

OK, makes sense. I asked only because I saw listen() in the UML diagram of EthernetChannel...

Actions #11

Updated by Davide Pesavento about 10 years ago

  • % Done changed from 10 to 60
Actions #12

Updated by Junxiao Shi about 10 years ago

hint on how to listen on multicast Ethernet address without putting NIC into promiscuous mode

  1. require multicast Ethernet address to be in the range for IPv4 multicast
  2. create libpcap session without promisc
  3. calculate an IPv4 multicast address whose mapped Ethernet address happens to be the multicast Ethernet address, create a UDP socket and join IP multicast using the calculated IPv4 multicast address
  4. process libpcap captured packets normally; there’s no need to process packets on the UDP socket
  5. close the UDP socket when libpcap session is closing

NDNFD face/ether.cc contains code that illustrates this idea.
It works on linux but seems to have problem on OS X.

Actions #13

Updated by Davide Pesavento about 10 years ago

Doesn't this procedure require the local network interface to have an IP address?

Actions #14

Updated by Alex Afanasyev about 10 years ago

Junxiao, I would suggest that we move this optimization to a separate issue. For now we just need basic things to work in any way possible (either promiscuous mode or simply broadcast mode). This also for version 1 release, but after basic things are working and tested.

Actions #15

Updated by Junxiao Shi about 10 years ago

  • Description updated (diff)
  • Priority changed from Normal to High

I agree that avoiding promisc can be a separate task. It's written as #1278.

Avoiding promisc is a RECOMMENDED level requirement in this task, instead of REQUIRED.

Actions #16

Updated by Davide Pesavento about 10 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 60 to 90
Actions #17

Updated by Davide Pesavento about 10 years ago

  • % Done changed from 90 to 100
Actions #18

Updated by Davide Pesavento about 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF