From owner-freebsd-net@FreeBSD.ORG Tue Jan 14 19:15:36 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7F595B8 for ; Tue, 14 Jan 2014 19:15:36 +0000 (UTC) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51E0815FC for ; Tue, 14 Jan 2014 19:15:36 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id c6so643273lan.24 for ; Tue, 14 Jan 2014 11:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7KQQs2Q7y7YRrMDtVGZSNhV5LmRePvla1YpRfizvLd8=; b=ZwAepN7LTU/Agc/jzYlgNZUFBGTHsGQBAlenWcTQOoiB5rSz8x028WbBWQfzXzgWNG ab7jKMnk0NZPMO7YTxaOXfqaPRGALEfzteu1AzkLBjQrO+B06PydiVliWBNa3FhmShzU nTZkCOQkePQD4/un9S+q/Q6/NF/mlp/hOLsxKUMiztp9u935LKcpQn05/pOum8sWJtCH 4I/+vQYs/WMBm0Ms1wZ6jb6BpOcRWKFjbhcFhPGlzMbgyXW/os6dNbqDavif2lI3JUXN +BrOufLEbu+L7Bd/4OFYl+cHfHK5nqrguXvI/z9Y8dBTkhgR+XsBRUc20z/XRadn/fcm aL6Q== MIME-Version: 1.0 X-Received: by 10.152.120.7 with SMTP id ky7mr278337lab.83.1389726934341; Tue, 14 Jan 2014 11:15:34 -0800 (PST) Sender: ndenev@gmail.com Received: by 10.114.242.33 with HTTP; Tue, 14 Jan 2014 11:15:34 -0800 (PST) In-Reply-To: <52D5138B.8050100@fsn.hu> References: <52D5138B.8050100@fsn.hu> Date: Tue, 14 Jan 2014 19:15:34 +0000 X-Google-Sender-Auth: zHvFZ89LZoWVX4n5jx7C88WHlFM Message-ID: Subject: Re: ECMP hash keys? From: Nikolay Denev To: Attila Nagy Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2014 19:15:36 -0000 Hi, Currently it's implemented using Modulo-N Hash (RFC2991), see radix_mpath.c:rtalloc_mpath_fib() And as hash the xor of source and destination IP is supplied, look for rtalloc_mpath_fib() in ip_output.c : ... #ifdef RADIX_MPATH rtalloc_mpath_fib(ro, ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); #else ... I've tried to hack this to use m_pkthdr.flowid if it exists, but in my case my network cards were not setting this (vr(4) on soekris) so I did not saw any change. Maybe my idea was completely wrong, but the XOR of src and dst IP is 4 bytes, and this is the size of the flowid as well. (haven't tried with FLOWTABLE enabled though). --Nikolay On Tue, Jan 14, 2014 at 10:38 AM, Attila Nagy wrote: > Hi, > > Does equal cost multipath take only the destination address into > consideration when choosing the route? (I've spent only about two minutes > reading radix_mpath.h, but I've got this impression) > > What would be needed to use src and dst addresses and ports -if appropriate? > > Thanks, > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"