ECMP hash keys?

Alexander V. Chernikov melifaro at FreeBSD.org
Wed Jan 15 09:21:45 UTC 2014


On 14.01.2014 23:15, Nikolay Denev wrote:
> Hi,
>
> Currently it's implemented using Modulo-N Hash (RFC2991), see
> radix_mpath.c:rtalloc_mpath_fib()
Yup. I'm going to change this to use flowid.
>
> 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
You can try http://static.ipfw.ru/patches/netisr_ip_flowid.diff to get 
flowid values generated by netisr.

> 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 <bra at fsn.hu> 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 at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-net
>> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>



More information about the freebsd-net mailing list