ethface

package
v0.0.0-...-1e60831 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: NIST-PD-fallback Imports: 7 Imported by: 0

README

ndn-dpdk/iface/ethface

This package implements Ethernet-based faces using DPDK ethdev as transport. This includes Ethernet faces (with optional VLAN header), UDP faces, and VXLAN faces. See face creation "creating Ethernet-based face" section for locator syntax.

The underlying implementation is in package ethport.

Ethernet Face

Each port can have zero or one Ethernet face with multicast remote address, and zero or more Ethernet faces with unicast remote addresses. Faces on the same port can be created and destroyed individually.

Caveats and limitations:

  • It's possible to set a local MAC address that differs from the hardware MAC address. However, this may not work properly on certain hardware, and thus is not recommended.

  • It's possible to create both VLAN-tagged faces and faces without VLAN headers. However, this may not work properly on certain hardware, and thus is not recommended.

UDP and VXLAN Tunnel Face

UDP and VXLAN tunnels can coexist with Ethernet faces on the same port. Multiple UDP and VXLAN tunnels can coexist if any of the following is true:

  • One of vlan, localIP, and remoteIP is different.
  • Both are UDP tunnels, and one of localUDP and remoteUDP is different.
  • Between a UDP tunnel and a VXLAN tunnel, the UDP tunnel's localUDP is not 4789.
  • Both are VXLAN tunnels, and one of vxlan, innerLocal, and innerRemote is different.

Caveats and limitations:

  • NDN-DPDK does not respond to Address Resolution Protocol (ARP) or Neighbor Discovery Protocol (NDP) queries.

    • To allow incoming packets to reach NDN-DPDK, configure MAC-IP binding on the IP router.

      sudo ip neigh replace 192.0.2.1 lladdr 5e:c8:55:7a:c9:1f nud noarp dev eth1
      sudo ip neigh replace 2001:0db8::3cfe lladdr 5e:c8:55:7a:c9:1f nud noarp dev eth1
      
    • For mlx5 or XDP driver and IPv4: add the IP address to the kernel using ip addr command, but do not create the VXLAN interface. Even if DPDK is controlling the Ethernet adapter, the kernel can still receive broadcast frames such as ARP queries and respond to them. In this case, it is unnecessary to configure MAC-IP binding on the IP router.

  • NDN-DPDK does not lookup IP routing tables or send ARP queries. To allow outgoing packets to reach the IP router, the remote field of the locator should be the MAC address of the IP router.

  • IPv4 options and IPv6 extension headers are not allowed. Incoming packets with these are dropped.

  • IPv4 fragments are not accepted.

  • If a VXLAN face has multiple RX queues, NDNLPv2 reassembly works only if all fragments of a network layer packets are sent with the same UDP source port number. NDN-DPDK send path and the VXLAN driver in the Linux kernel both fulfill this requirement.

Documentation

Overview

Package ethface implements Ethernet-based faces.

Index

Constants

View Source
const (
	// MinVXLAN is the minimum VXLAN Network Identifier.
	MinVXLAN = 0

	// MaxVXLAN is the maximum VXLAN Network Identifier.
	MaxVXLAN = 1<<24 - 1
)

Variables

View Source
var (
	ErrIP        = errors.New("invalid IP address")
	ErrIPFamily  = errors.New("different address family in LocalIP and RemoteIP")
	ErrUnicastIP = errors.New("invalid unicast IP address")
	ErrUDPPort   = errors.New("invalid UDP port")
)

Error conditions.

View Source
var (
	ErrVXLAN = errors.New("invalid VXLAN Network Identifier")
)

Error conditions.

Functions

This section is empty.

Types

type EtherLocator

type EtherLocator struct {
	ethport.FaceConfig

	// packettransport.Locator contains MAC addresses.
	packettransport.Locator
}

EtherLocator describes an Ethernet face.

func (EtherLocator) CreateFace

func (loc EtherLocator) CreateFace() (face iface.Face, e error)

CreateFace creates an Ethernet face.

func (EtherLocator) EthLocatorC

func (loc EtherLocator) EthLocatorC() (c ethport.LocatorC)

EthLocatorC implements ethport.Locator interface.

func (EtherLocator) Scheme

func (EtherLocator) Scheme() string

Scheme returns "ether".

type IPLocator

type IPLocator struct {
	// EtherLocator contains MAC addresses and EthDev specification.
	// loc.Remote must be a unicast address.
	EtherLocator

	// LocalIP is the local IP address.
	// It may be either IPv4 or IPv6.
	LocalIP netip.Addr `json:"localIP"`

	// RemoteIP is the remote IP address.
	// It may be either IPv4 or IPv6.
	RemoteIP netip.Addr `json:"remoteIP"`
}

IPLocator describes an IP-based face.

func (IPLocator) Validate

func (loc IPLocator) Validate() error

Validate checks Locator fields.

type UDPLocator

type UDPLocator struct {
	IPLocator

	// LocalUDP is the local UDP port number.
	LocalUDP int `json:"localUDP"`

	// RemoteUDP is the remote UDP port number.
	RemoteUDP int `json:"remoteUDP"`
}

UDPLocator describes a UDP face.

func (UDPLocator) CreateFace

func (loc UDPLocator) CreateFace() (face iface.Face, e error)

CreateFace creates a UDP face.

func (UDPLocator) EthLocatorC

func (loc UDPLocator) EthLocatorC() (locC ethport.LocatorC)

EthLocatorC implements ethport.Locator interface.

func (UDPLocator) Scheme

func (UDPLocator) Scheme() string

Scheme returns "udpe".

func (UDPLocator) Validate

func (loc UDPLocator) Validate() error

Validate checks Locator fields.

type VxlanLocator

type VxlanLocator struct {
	IPLocator

	// VXLAN is the VXLAN virtual network identifier.
	// This must be between MinVXLAN and MaxVXLAN.
	VXLAN int `json:"vxlan"`

	// InnerLocal is the inner local MAC address.
	// This must be a 48-bit unicast address.
	InnerLocal macaddr.Flag `json:"innerLocal"`

	// InnerRemote is the inner remote MAC address.
	// This must be a 48-bit unicast address.
	InnerRemote macaddr.Flag `json:"innerRemote"`
}

VxlanLocator describes an Ethernet VXLAN face.

func (VxlanLocator) CreateFace

func (loc VxlanLocator) CreateFace() (face iface.Face, e error)

CreateFace creates a VXLAN face.

func (VxlanLocator) EthLocatorC

func (loc VxlanLocator) EthLocatorC() (locC ethport.LocatorC)

EthLocatorC implements ethport.Locator interface.

func (VxlanLocator) Scheme

func (VxlanLocator) Scheme() string

Scheme returns "vxlan".

func (VxlanLocator) Validate

func (loc VxlanLocator) Validate() error

Validate checks Locator fields.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL