linux/drivers/net
Matteo Croce 58deb77cc5 bonding: balance ICMP echoes in layer3+4 mode
The bonding uses the L4 ports to balance flows between slaves. As the ICMP
protocol has no ports, those packets are sent all to the same device:

    # tcpdump -qltnni veth0 ip |sed 's/^/0: /' &
    # tcpdump -qltnni veth1 ip |sed 's/^/1: /' &
    # ping -qc1 192.168.0.2
    1: IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 315, seq 1, length 64
    1: IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 315, seq 1, length 64
    # ping -qc1 192.168.0.2
    1: IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 316, seq 1, length 64
    1: IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 316, seq 1, length 64
    # ping -qc1 192.168.0.2
    1: IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 317, seq 1, length 64
    1: IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 317, seq 1, length 64

But some ICMP packets have an Identifier field which is
used to match packets within sessions, let's use this value in the hash
function to balance these packets between bond slaves:

    # ping -qc1 192.168.0.2
    0: IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 303, seq 1, length 64
    0: IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 303, seq 1, length 64
    # ping -qc1 192.168.0.2
    1: IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 304, seq 1, length 64
    1: IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 304, seq 1, length 64

Aso, let's use a flow_dissector_key which defines FLOW_DISSECTOR_KEY_ICMP,
so we can balance pings encapsulated in a tunnel when using mode encap3+4:

    # ping -q 192.168.1.2 -c1
    0: IP 192.168.0.1 > 192.168.0.2: GREv0, length 102: IP 192.168.1.1 > 192.168.1.2: ICMP echo request, id 585, seq 1, length 64
    0: IP 192.168.0.2 > 192.168.0.1: GREv0, length 102: IP 192.168.1.2 > 192.168.1.1: ICMP echo reply, id 585, seq 1, length 64
    # ping -q 192.168.1.2 -c1
    1: IP 192.168.0.1 > 192.168.0.2: GREv0, length 102: IP 192.168.1.1 > 192.168.1.2: ICMP echo request, id 586, seq 1, length 64
    1: IP 192.168.0.2 > 192.168.0.1: GREv0, length 102: IP 192.168.1.2 > 192.168.1.1: ICMP echo reply, id 586, seq 1, length 64

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-10-30 17:21:35 -07:00
..
appletalk
arcnet drivers: net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
bonding bonding: balance ICMP echoes in layer3+4 mode 2019-10-30 17:21:35 -07:00
caif Minor fixes to the CAIF Transport drivers Kconfig file 2019-10-02 14:47:51 -07:00
can drivers: net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
dsa net: dsa: LAN9303: select REGMAP when LAN9303 enable 2019-10-29 16:17:02 -07:00
ethernet mlxsw: Enforce firmware version for Spectrum-2 2019-10-30 12:07:05 -07:00
fddi
fjes
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-09-15 14:17:27 +02:00
hippi
hyperv hv_netvsc: Sync offloading features to VF NIC 2019-09-07 17:42:52 +02:00
ieee802154 Merge tag 'ieee802154-for-davem-2019-09-28' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan 2019-09-30 17:14:45 -07:00
ipvlan ipvlan: consolidate TSO flags using NETIF_F_ALL_TSO 2019-10-10 18:03:29 -07:00
netdevsim netdevsim: Fix error handling in nsim_fib_init and nsim_fib_exit 2019-10-13 11:30:14 -07:00
phy net: phy: marvell: add PHY tunable support for more PHY versions 2019-10-29 17:50:10 -07:00
plip
ppp netfilter: drop bridge nf reset from nf_reset 2019-10-01 18:42:15 +02:00
slip
team team: call RCU read lock when walking the port_list 2019-10-09 21:13:59 -07:00
usb r8152: check the pointer rtl_fw->fw before using it 2019-10-25 17:03:19 -07:00
vmxnet3
wan net/wan: dscc4: remove broken dscc4 driver 2019-09-16 09:14:41 +02:00
wimax net: Fix various misspellings of "connect" 2019-10-28 13:41:59 -07:00
wireless net: Fix various misspellings of "connect" 2019-10-28 13:41:59 -07:00
xen-netback xen/netback: cleanup init and deinit code 2019-10-22 09:52:04 -07:00
dummy.c
eql.c
geneve.c Convert usage of IN_MULTICAST to ipv4_is_multicast 2019-09-05 09:38:32 +02:00
gtp.c
ifb.c
Kconfig drivers: net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
LICENSE.SRC
loopback.c
macsec.c macsec: drop skb sk before calling gro_cells_receive 2019-09-26 09:25:03 +02:00
macvlan.c
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: tap: clean up an indentation issue 2019-09-27 20:58:35 +02:00
thunderbolt.c
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
veth.c
virtio_net.c netfilter: drop bridge nf reset from nf_reset 2019-10-01 18:42:15 +02:00
vrf.c netfilter: drop bridge nf reset from nf_reset 2019-10-01 18:42:15 +02:00
vsockmon.c
vxlan.c
xen-netfront.c xen-netfront: do not use ~0U as error return value for xennet_fill_frags() 2019-10-01 21:49:51 -04:00