]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add GRE-in-UDP encapsulation support as defined in RFC8086.
authorae <ae@FreeBSD.org>
Wed, 24 Apr 2019 09:05:45 +0000 (09:05 +0000)
committerae <ae@FreeBSD.org>
Wed, 24 Apr 2019 09:05:45 +0000 (09:05 +0000)
commit97ddb4fef9603a0799d6c2981d8a1ccaf8a6db18
treeaab9aba7e5c57f39cbe97b4ff7284d86e68980e8
parentb58321507702a1125aed58ddc320b560b1bffc71
Add GRE-in-UDP encapsulation support as defined in RFC8086.

This GRE-in-UDP encapsulation allows the UDP source port field to be
used as an entropy field for load-balancing of GRE traffic in transit
networks. Also most of multiqueue network cards are able distribute
incoming UDP datagrams to different NIC queues, while very little are
able do this for GRE packets.

When an administrator enables UDP encapsulation with command
`ifconfig gre0 udpencap`, the driver creates kernel socket, that binds
to tunnel source address and after udp_set_kernel_tunneling() starts
receiving of all UDP packets destined to 4754 port. Each kernel socket
maintains list of tunnels with different destination addresses. Thus
when several tunnels use the same source address, they all handled by
single socket.  The IP[V6]_BINDANY socket option is used to be able bind
socket to source address even if it is not yet available in the system.
This may happen on system boot, when gre(4) interface is created before
source address become available. The encapsulation and sending of packets
is done directly from gre(4) into ip[6]_output() without using sockets.

Reviewed by: eugen
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D19921
sbin/ifconfig/ifgre.c
share/man/man4/gre.4
sys/modules/if_gre/Makefile
sys/net/if_gre.c
sys/net/if_gre.h
sys/netinet/ip_gre.c
sys/netinet6/ip6_gre.c