netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 net-next 0/2] ipv4: Hash-based multipath routing
@ 2015-09-23 19:49 Peter Nørlund
  2015-09-23 19:49 ` [PATCH v4 net-next 1/2] ipv4: L3 hash-based multipath Peter Nørlund
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Peter Nørlund @ 2015-09-23 19:49 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, Peter Nørlund

When the routing cache was removed in 3.6, the IPv4 multipath algorithm changed
from more or less being destination-based into being quasi-random per-packet
scheduling. This increases the risk of out-of-order packets and makes it
impossible to use multipath together with anycast services.

This patch series replaces the old implementation with flow-based load
balancing based on a hash over the source and destination addresses.

Distribution of the hash is done with thresholds as described in RFC 2992.
This reduces the disruption when a path is added/remove when having more than
two paths.

To futher the chance of successful usage in conjuction with anycast, ICMP
error packets are hashed over the inner IP addresses. This ensures that PMTU
will work together with anycast or load-balancers such as IPVS.

Port numbers are not considered since fragments could cause problems with
anycast and IPVS. Relying on the DF-flag for TCP packets is also insufficient,
since ICMP inspection effectively extracts information from the opposite
flow which might have a different state of the DF-flag. This is also why the
RSS hash is not used. These are typically based on the NDIS RSS spec which
mandates TCP support.

Measurements of the additional overhead of a two-path multipath
(p_mkroute_input excl. __mkroute_input) on a Xeon X3550 (4 cores, 2.66GHz):

Original per-packet: ~394 cycles/packet
L3 hash:              ~76 cycles/packet

Changes in v4:
- Functions take hash directly instead of func ptr
- Added inline hash function
- Added dummy macros to minimize ifdefs
- Use upper 31 bits of hash instead of lower

Changes in v3:
- Multipath algorithm is no longer configurable (always L3)
- Added random seed to hash
- Moved ICMP inspection to isolated function
- Ignore source quench packets (deprecated as per RFC 6633)

Changes in v2:
- Replaced 8-bit xor hash with 31-bit jenkins hash
- Don't scale weights (since 31-bit)
- Avoided unnecesary renaming of variables
- Rely on DF-bit instead of fragment offset when checking for fragmentation
- upper_bound is now inclusive to avoid overflow
- Use a callback to postpone extracting flow information until necessary
- Skipped ICMP inspection entirely with L4 hashing
- Handle newly added sysctl ignore_routes_with_linkdown

Best Regards
 Peter Nørlund


Peter Nørlund (2):
      ipv4: L3 hash-based multipath
      ipv4: ICMP packet inspection for multipath

 include/net/ip_fib.h     |   14 ++++-
 include/net/route.h      |   11 +++-
 net/ipv4/fib_semantics.c |  140 ++++++++++++++++++++++--------------------
 net/ipv4/icmp.c          |   19 +++++-
 net/ipv4/route.c         |   63 +++++++++++++++++--
 5 files changed, 172 insertions(+), 75 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-09-29 12:40 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-23 19:49 [PATCH v4 net-next 0/2] ipv4: Hash-based multipath routing Peter Nørlund
2015-09-23 19:49 ` [PATCH v4 net-next 1/2] ipv4: L3 hash-based multipath Peter Nørlund
2015-09-23 21:00   ` Tom Herbert
2015-09-23 21:43     ` Peter Nørlund
2015-09-23 23:12       ` Tom Herbert
2015-09-23 23:38         ` Peter Nørlund
2015-09-23 23:09     ` Peter Nørlund
2015-09-23 23:37       ` Tom Herbert
2015-09-23 21:55   ` David Miller
2015-09-23 19:49 ` [PATCH v4 net-next 2/2] ipv4: ICMP packet inspection for multipath Peter Nørlund
2015-09-23 21:01   ` Tom Herbert
2015-09-23 22:07     ` Peter Nørlund
2015-09-29  2:33 ` [PATCH v4 net-next 0/2] ipv4: Hash-based multipath routing David Miller
2015-09-29  2:55   ` David Miller
2015-09-29 11:29     ` Peter Nørlund
2015-09-29 12:38       ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).