linux-cp: Linux Control Plane Netlink Listener
[vpp.git] / src / plugins / linux-cp / lcp.rst
1 .. _Linux_control_plane:
2
3 .. toctree::
4
5 Linux Control Plane Integration
6 ===============================
7
8 Overview
9 ________
10
11 This plugin allows VPP to integrate with the Linux kernel. The
12 general model is that Linux is the network stack, i.e. it has the
13 control plane protocols, like ARP, IPv6 ND/MLD, ping, etc, and VPP
14 provides a SW based ASIC for forwarding.
15
16 Interfaces
17 __________
18
19 VPP owns the interfaces in the system; physical (.e.g PCI), quasi
20 physical (e.g. vhost), or virtual (e.g. tunnel). However,
21 for the Linux networking stack to function it needs a representation
22 of these interfaces; it needs a mirror image in the kernel. For this
23 mirror we use a TAP interface, if the VPP interface is multi-point, a
24 TUN if it's point-to-point. A physical and its mirror form an
25 interface 'pair'.
26
27 The host interface has two identities; the sw_if_index of the TAP and
28 the virtual interface index in the kernel. It may be in a Linux network
29 namespace.
30
31 The creation of the interface pairs is required from the control
32 plane. It can be statically configured in the VPP startup
33 configuration file. The intent here is to make the pair creation
34 explicit, rather than have VPP guess which of the interfaces it owns
35 require a mirror.
36
37 Configuration
38 _____________
39
40 Linux will send and receive packets on the mirrored tap/tun
41 interfaces. Any configuration that is made on these Linux interfaces,
42 also needs to be applied on the corresponding physical interface in
43 VPP.
44
45 This is functionality is provided by the "linux_nl" plugin.
46
47 Linux will own the [ARP/ND] neighbor tables (which will be copied via
48 netlink to VPP also). This means that Linux will send packets with the
49 peer's MAC address in the rewrite to VPP. The receiving TAP interface
50 must therefore be in promiscuous mode.
51
52 Forwarding
53 __________
54
55 The basic principle is to x-connect traffic from a Linux host interface
56 (received on the tap/tun) to its paired the physical, and vice-versa.
57
58 Host to Physical
59 ^^^^^^^^^^^^^^^^
60
61 All packets sent by the host, and received by VPP on a tap/tun should
62 be sent to its paired physical interface. However, they should be sent
63 with the same consequences as if they had originated from VPP,
64 i.e. they should be subject to all output features on the physical
65 interface. To achieve this there is a per-IP-address-family (AF) node
66 inserted in the per-AF input feature arc. The node must be per-AF,
67 since it must be a sibling of a start node for the ipX-output feature
68 arc. This node uses the packet's L2 rewrite to search for the
69 adjacency that VPP would have used to send this packet; this adjacency
70 is stored in the buffer's meta data so that it is available to all
71 output features. Then the packet is sent through the physical
72 interface's IP output feature arc.
73
74 All ARP packets are x-connected from the tap to the physical.
75
76 Physical to Host
77 ^^^^^^^^^^^^^^^^
78
79 All ARP packets received on the physical are sent to the paired
80 tap. This allows the Linux network stack to build the neighbor table.
81
82 IP packets that are punted are sent to the host. They are sent on the
83 tap that is paired with the physical on which they were originally
84 received. The packet is sent on the tap/tun 'exactly' as it was
85 received (i.e. with the L2 rewrite) but post any translations that
86 input features may have made.
87
88
89 Recommendations
90 ^^^^^^^^^^^^^^^
91
92 When using this plugin disable the ARP, ND, IGMP plugins; this is the
93 task for Linux.  Disable ping plugin, since Linux will now respond.