Hi,
looking at the code in ip_flow.c, i notice that the hash
function ipflow_hash() uses both the source and destination
address as parameters, and additionally, it never considers
the lower two bits of the destination addres. The code is below,
IPFLOW_HASHBITS is 6:

        unsigned hash = tos;
        int idx;
        for (idx = 0; idx < 32; idx += IPFLOW_HASHBITS)
                hash += (dst.s_addr >> (32 - idx)) + (src.s_addr >> idx);
        return hash & (IPFLOW_HASHSIZE-1);

Of course it is just an optimization, but shouldn't routing
decisions be based on the dst address only ?

Just using the dst address would slightly simplify the function,
and especially has the potential of collapsing a lot of information
in the ipflow cache -- consider the case of a router box in front
of a busy web server.

Comments ?

        cheers
        luigi


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to