From d4264a38a83e18d7be76b3d80edc3b2118a5efcf Mon Sep 17 00:00:00 2001 From: blambert Date: Fri, 29 Aug 2014 09:03:36 +0000 Subject: Implement consistent host hashing for relayd, based on work done by andre@ Re-add a randomized hash seed (which had apparently gotten inadvertently removed in the past). Allows for multiple relayd instances to be configured to forward traffic to the same host, falling back to the random seed when not explicitly configured to do so. ok reyk@ --- usr.sbin/relayd/relayd.conf.5 | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'usr.sbin/relayd/relayd.conf.5') diff --git a/usr.sbin/relayd/relayd.conf.5 b/usr.sbin/relayd/relayd.conf.5 index 24f823fcd60..93800a18cb0 100644 --- a/usr.sbin/relayd/relayd.conf.5 +++ b/usr.sbin/relayd/relayd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: relayd.conf.5,v 1.147 2014/07/11 16:59:38 reyk Exp $ +.\" $OpenBSD: relayd.conf.5,v 1.148 2014/08/29 09:03:36 blambert Exp $ .\" .\" Copyright (c) 2006 - 2014 Reyk Floeter .\" Copyright (c) 2006, 2007 Pierre-Yves Ritschard @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 11 2014 $ +.Dd $Mdocdate: August 29 2014 $ .Dt RELAYD.CONF 5 .Os .Sh NAME @@ -390,7 +390,7 @@ This will override the global timeout, which is 200 milliseconds by default. The following options will set the scheduling algorithm to select a host from the specified table: .Bl -tag -width Ds -.It Ic mode hash +.It Ic mode hash Op Ic seed Ar string Balances the outgoing connections across the active hosts based on the hashed name of the relay, the hashed name of the table, and the IP address and port of the relay. @@ -406,7 +406,7 @@ active .Xr pf 4 states. This mode is only supported by redirections. -.It Ic mode loadbalance +.It Ic mode loadbalance Op Ic seed Ar string Balances the outgoing connections across the active hosts based on the hashed name of the relay, the hashed name of the table, the source IP address of the client, and the IP address and port of the relay. @@ -419,12 +419,24 @@ Distributes the outgoing connections using a round-robin scheduler through all active hosts. This is the default mode and will be used if no option has been specified. This mode is supported by redirections and relays. -.It Ic mode source-hash +.It Ic mode source-hash Op Ic seed Ar string Balances the outgoing connections across the active hosts based on the hashed name of the redirection or relay, the hashed name of the table, and the source IP address of the client. This mode is only supported by relays. .El +.Pp +For the +.Ic hash , +.Ic loadbalance , +and +.Ic source-hash +modes, a random 32-bit hash seed is chosen during configuration. +In order to facilitate consistent hashing between instances of +.Xr relayd 8 +operating on multiple hosts, an explicit +.Ic seed +string may be specified. .Sh REDIRECTIONS Redirections represent a .Xr pf 4 -- cgit v1.2.3-59-g8ed1b