Skip to content

Refactor Linux Interfaces

Ondrej Fabry edited this page Jul 24, 2019 · 21 revisions

This document contains information related to refactor of the linux interfaces (ifplugin) in vpp-agent.

⚠️ NOTE: This document is work in progress!

Motivation

TAP

Currently it's not possible to manage TAP interfaces in linux. The vpp-agent recognizes only special TAP interfaces that get created by VPP.

The current linux interface API contains uses interface type TAP_TO_VPP for these special TAP interfaces. This often confuses users and also couples linux and VPP plugins.

The linux interface API defines TapLink used with TAP_TO_VPP type as: https://github.com/ligato/vpp-agent/blob/58f912a19e8362cb3b2f8a33402ff4b035cf8b98/api/models/linux/interfaces/interface.proto#L49-L51

Use Cases

  1. Allow managing any linux interfaces (like VETH, TAP..) by agent that already existed in system.
  2. Create TAP interface in linux (without VPP) from agent.
  3. Avoid auto-deletion of linux interfaces that were not created by agent.

Proposal Overview

The proposal is to define a generic interface type for linux TAP interfaces and look into other ways to keep information for the special linux TAP interfaces that get created by VPP.

API

Current Linux Interface API

message Interface {
    enum Type {
        UNDEFINED = 0;
        VETH = 1;
        TAP_TO_VPP = 2;                 /* TAP created by VPP to have the Linux-side further configured */
        LOOPBACK = 3;
    };

    string name = 1;                    /* Logical interface name unique across all configured interfaces (mandatory) */
    Type type = 2;                      /* Interface type (mandatory) */

    linux.namespace.NetNamespace namespace = 3;
    string host_if_name = 4;            /* Name of the interface in the host OS. If not set, the host name
                                           is the same as the interface logical name. */
    bool enabled = 5;
    repeated string ip_addresses = 6;   /* IP addresses in the format <ipAddress>/<ipPrefix> */
    string phys_address = 7;            /* MAC address */
    uint32 mtu = 8;                     /* Maximum transmission unit value */

    oneof link {
        VethLink veth = 20;             /* VETH-specific configuration */
        TapLink tap = 21;               /* TAP_TO_VPP-specific configuration */
    };
};

message VethLink {
    string peer_if_name = 1;        /* Name of the VETH peer, i.e. other end of the linux veth (mandatory for VETH) */

    enum ChecksumOffloading {
        CHKSM_OFFLOAD_DEFAULT = 0;
        CHKSM_OFFLOAD_ENABLED = 1;
        CHKSM_OFFLOAD_DISABLED = 2;
    }
    ChecksumOffloading rx_checksum_offloading = 2; /* checksum offloading - Rx side (enabled by default) */
    ChecksumOffloading tx_checksum_offloading = 3; /* checksum offloading - Tx side (enabled by default) */
};

message TapLink {
    string vpp_tap_if_name = 1;     /* Logical name of the VPP TAP interface (mandatory for TAP_TO_VPP) */
};

source: https://github.com/ligato/vpp-agent/blob/master/api/models/linux/interfaces/interface.proto#L12-L51

  1. Deprecate linux interface type TAP_TO_VPP (?)
  2. Define a generic linux interface type TAP
  3. ?

// TBD

Clone this wiki locally