blob: b9d04ee6dac142c73a2eb7efce741e59da005726 [file] [log] [blame]
Martin Varghese571912c2020-02-24 10:57:50 +05301.. SPDX-License-Identifier: GPL-2.0
2
3========================================
4Bare UDP Tunnelling Module Documentation
5========================================
6
7There are various L3 encapsulation standards using UDP being discussed to
8leverage the UDP based load balancing capability of different networks.
9MPLSoUDP (__ https://tools.ietf.org/html/rfc7510) is one among them.
10
Martin Varghese1ed06db2020-07-28 22:35:52 +053011The Bareudp tunnel module provides a generic L3 encapsulation support for
12tunnelling different L3 protocols like MPLS, IP, NSH etc. inside a UDP tunnel.
Martin Varghese571912c2020-02-24 10:57:50 +053013
Martin Varghese4b5f6722020-02-24 10:58:35 +053014Special Handling
15----------------
16The bareudp device supports special handling for MPLS & IP as they can have
17multiple ethertypes.
18MPLS procotcol can have ethertypes ETH_P_MPLS_UC (unicast) & ETH_P_MPLS_MC (multicast).
19IP protocol can have ethertypes ETH_P_IP (v4) & ETH_P_IPV6 (v6).
20This special handling can be enabled only for ethertypes ETH_P_IP & ETH_P_MPLS_UC
21with a flag called multiproto mode.
22
Martin Varghese571912c2020-02-24 10:57:50 +053023Usage
24------
25
261) Device creation & deletion
27
Guillaume Nault34b85ad2020-07-20 17:46:58 +020028 a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls_uc
Martin Varghese571912c2020-02-24 10:57:50 +053029
30 This creates a bareudp tunnel device which tunnels L3 traffic with ethertype
31 0x8847 (MPLS traffic). The destination port of the UDP header will be set to
32 6635.The device will listen on UDP port 6635 to receive traffic.
33
34 b) ip link delete bareudp0
35
Guillaume Nault34b85ad2020-07-20 17:46:58 +0200362) Device creation with multiproto mode enabled
Martin Varghese4b5f6722020-02-24 10:58:35 +053037
Guillaume Nault34b85ad2020-07-20 17:46:58 +020038The multiproto mode allows bareudp tunnels to handle several protocols of the
39same family. It is currently only available for IP and MPLS. This mode has to
40be enabled explicitly with the "multiproto" flag.
Martin Varghese4b5f6722020-02-24 10:58:35 +053041
Guillaume Nault34b85ad2020-07-20 17:46:58 +020042 a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype ipv4 multiproto
Martin Varghese4b5f6722020-02-24 10:58:35 +053043
Guillaume Nault34b85ad2020-07-20 17:46:58 +020044 For an IPv4 tunnel the multiproto mode allows the tunnel to also handle
45 IPv6.
46
47 b) ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls_uc multiproto
48
49 For MPLS, the multiproto mode allows the tunnel to handle both unicast
50 and multicast MPLS packets.
Martin Varghese4b5f6722020-02-24 10:58:35 +053051
523) Device Usage
Martin Varghese571912c2020-02-24 10:57:50 +053053
54The bareudp device could be used along with OVS or flower filter in TC.
55The OVS or TC flower layer must set the tunnel information in SKB dst field before
56sending packet buffer to the bareudp device for transmission. On reception the
57bareudp device extracts and stores the tunnel information in SKB dst field before
58passing the packet buffer to the network stack.