blob: 8a6e726eba4f83a084bdba73133d2b880fba1825 [file] [log] [blame]
Ole Troan298c6952018-03-08 12:30:43 +01001/*
2 * Copyright (c) 2018 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
Ole Troand57f6362018-05-24 13:21:43 +020016/**
17 * The IPIP module implements IP{v4,v6} over IP{v4,v6} tunnelling as
18 * described in RFC2473 and to some extent the largely historical
19 * RFC1853. The module also supports an IPv4 over IPv6 automatic
20 * tunnelling mechanism called 6RD (RFC5969).
21 *
22 * The IPIP API module supports a CRD model for adding, deleting and
23 * listing tunnels. A tunnel is represented as an interface in
24 * VPP. The "handle" representing a tunnel is the sw_if_index. As any
25 * interface, the user must configure an IPv4 and/or IPv6 address on
26 * the interface. This is the inner or payload protocol.
27 *
28 * Tunnel MTU: The tunnel MTU (the payload MTU) is configurable per
29 * protocol. If a tunnel MTU is larger than the path MTU, the outer
30 * packet will be fragmented. Fragmentation support is configurable,
31 * as it can have severe performance issues, and might be used as an
32 * attack vector (the remote side must reassemble.)
33 *
34 * Traffic class / TOS field can either be configured to a fixed
35 * value, or can be copied from the inner to the outer header.
36 * (For now we have stolen ~0 to indicate copy).
37 *
38 * Note:
39 *
40 * - The Tunnel encapsulation limit described in RFC2473 is not
41 * implemented.
42 *
43 * - ICMP proxying, as in a tunnel head-end receiving ICMP erors on
44 * the outer packet is currently not relayed to the original source
45 * of the packet.
46 *
47 * - PMTUD / MTU probing and tunnel keepalives are not yet implemented.
48 *
49 */
Ole Troan298c6952018-03-08 12:30:43 +010050
Neale Rannscbd08242019-05-26 11:34:27 -070051option version = "1.2.0";
Ole Troan53fffa12018-11-13 12:36:56 +010052import "vnet/interface_types.api";
Neale Rannscbd08242019-05-26 11:34:27 -070053import "vnet/ip/ip_types.api";
54
55/**
56 * An IP{v4,v6} over IP{v4,v6} tunnel.
57 */
58typedef ipip_tunnel
59{
Ole Troan288e0932019-05-29 12:30:05 +020060 u32 instance; /* If non-~0, specifies a custom dev instance */
Neale Rannscbd08242019-05-26 11:34:27 -070061 vl_api_address_t src;
62 vl_api_address_t dst;
Ole Troan288e0932019-05-29 12:30:05 +020063 vl_api_interface_index_t sw_if_index; /* ignored on create, set in
64 details/dump */
65 u32 table_id;
66 u8 tc_tos; /* If ~0, the TOS/TC value is copied from
67 inner packet, otherwise set to value */
Neale Rannscbd08242019-05-26 11:34:27 -070068};
Ole Troand57f6362018-05-24 13:21:43 +020069
70/**
71 * Create an IP{v4,v6} over IP{v4,v6} tunnel.
72 */
Ole Troan298c6952018-03-08 12:30:43 +010073define ipip_add_tunnel
74{
75 u32 client_index;
76 u32 context;
Neale Rannscbd08242019-05-26 11:34:27 -070077 vl_api_ipip_tunnel_t tunnel;
Ole Troan298c6952018-03-08 12:30:43 +010078};
79
80define ipip_add_tunnel_reply
81{
82 u32 context;
83 i32 retval;
Ole Troan53fffa12018-11-13 12:36:56 +010084 vl_api_interface_index_t sw_if_index;
Ole Troan298c6952018-03-08 12:30:43 +010085};
86
Ole Troand57f6362018-05-24 13:21:43 +020087/**
88 * Delete an IP{v4,v6} over IP{v4,v6} tunnel.
89 */
Ole Troan298c6952018-03-08 12:30:43 +010090autoreply define ipip_del_tunnel
91{
92 u32 client_index;
93 u32 context;
Ole Troan53fffa12018-11-13 12:36:56 +010094 vl_api_interface_index_t sw_if_index;
Ole Troan298c6952018-03-08 12:30:43 +010095};
96
Ole Troand57f6362018-05-24 13:21:43 +020097/**
98 * Create an IPv4 over IPv6 automatic tunnel (6RD)
99 */
Ole Troan298c6952018-03-08 12:30:43 +0100100define ipip_6rd_add_tunnel
101{
102 u32 client_index;
103 u32 context;
Neale Ranns61502112018-08-22 00:21:14 -0700104 u32 ip6_table_id;
105 u32 ip4_table_id;
Ole Troan288e0932019-05-29 12:30:05 +0200106 vl_api_ip6_prefix_t ip6_prefix;
107 vl_api_ip4_prefix_t ip4_prefix;
108 vl_api_ip4_address_t ip4_src;
109 bool security_check;
110 u8 tc_tos; /* If ~0, the TOS/TC value is copied from
111 inner packet, otherwise set to value */
Ole Troan298c6952018-03-08 12:30:43 +0100112};
113
114define ipip_6rd_add_tunnel_reply
115{
116 u32 context;
117 i32 retval;
Ole Troan53fffa12018-11-13 12:36:56 +0100118 vl_api_interface_index_t sw_if_index;
Ole Troan298c6952018-03-08 12:30:43 +0100119};
120
Ole Troand57f6362018-05-24 13:21:43 +0200121/**
122 * Delete an IPv4 over IPv6 automatic tunnel (6RD)
123 */
Ole Troan298c6952018-03-08 12:30:43 +0100124autoreply define ipip_6rd_del_tunnel
125{
126 u32 client_index;
127 u32 context;
Ole Troan53fffa12018-11-13 12:36:56 +0100128 vl_api_interface_index_t sw_if_index;
Ole Troan298c6952018-03-08 12:30:43 +0100129};
130
Ole Troand57f6362018-05-24 13:21:43 +0200131/**
132 * List all IPIP tunnels
133 */
Ole Troan298c6952018-03-08 12:30:43 +0100134define ipip_tunnel_dump
135{
136 u32 client_index;
137 u32 context;
Ole Troan53fffa12018-11-13 12:36:56 +0100138 vl_api_interface_index_t sw_if_index;
Ole Troan298c6952018-03-08 12:30:43 +0100139};
140
141define ipip_tunnel_details
142{
143 u32 context;
Neale Rannscbd08242019-05-26 11:34:27 -0700144 vl_api_ipip_tunnel_t tunnel;
Ole Troan298c6952018-03-08 12:30:43 +0100145};