bareudp.rst 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ========================================
  3. Bare UDP Tunnelling Module Documentation
  4. ========================================
  5. There are various L3 encapsulation standards using UDP being discussed to
  6. leverage the UDP based load balancing capability of different networks.
  7. MPLSoUDP (__ https://tools.ietf.org/html/rfc7510) is one among them.
  8. The Bareudp tunnel module provides a generic L3 encapsulation support for
  9. tunnelling different L3 protocols like MPLS, IP, NSH etc. inside a UDP tunnel.
  10. Special Handling
  11. ----------------
  12. The bareudp device supports special handling for MPLS & IP as they can have
  13. multiple ethertypes.
  14. MPLS procotcol can have ethertypes ETH_P_MPLS_UC (unicast) & ETH_P_MPLS_MC (multicast).
  15. IP protocol can have ethertypes ETH_P_IP (v4) & ETH_P_IPV6 (v6).
  16. This special handling can be enabled only for ethertypes ETH_P_IP & ETH_P_MPLS_UC
  17. with a flag called multiproto mode.
  18. Usage
  19. ------
  20. 1) Device creation & deletion
  21. a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls_uc
  22. This creates a bareudp tunnel device which tunnels L3 traffic with ethertype
  23. 0x8847 (MPLS traffic). The destination port of the UDP header will be set to
  24. 6635.The device will listen on UDP port 6635 to receive traffic.
  25. b) ip link delete bareudp0
  26. 2) Device creation with multiproto mode enabled
  27. The multiproto mode allows bareudp tunnels to handle several protocols of the
  28. same family. It is currently only available for IP and MPLS. This mode has to
  29. be enabled explicitly with the "multiproto" flag.
  30. a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype ipv4 multiproto
  31. For an IPv4 tunnel the multiproto mode allows the tunnel to also handle
  32. IPv6.
  33. b) ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls_uc multiproto
  34. For MPLS, the multiproto mode allows the tunnel to handle both unicast
  35. and multicast MPLS packets.
  36. 3) Device Usage
  37. The bareudp device could be used along with OVS or flower filter in TC.
  38. The OVS or TC flower layer must set the tunnel information in SKB dst field before
  39. sending packet buffer to the bareudp device for transmission. On reception the
  40. bareudp device extracts and stores the tunnel information in SKB dst field before
  41. passing the packet buffer to the network stack.