Forum Discussion

uni's avatar
uni
Icon for Altostratus rankAltostratus
Oct 07, 2012

Does CARP include the node's port in the hash?

I have implemented load-balancing across proxy servers using the F5 CARP implementation. We would like to implement a bias to some of the proxies, but the F5 implementation does not currently support this. It occurred to me we could work around this by adding the same node more than once. We have a couple of ports to work with (8080, 3182, 80). However, this will only work if the CARP hash algorithm includes the port in the hash calculation. Does anyone know if this is the case?

 

5 Replies

  • Based on the information about the Proxy Array Membership Table here: http://tools.ietf.org/html/draft-vinod-carp-v1-03 I'd say yes, this would work.
  • uni's avatar
    uni
    Icon for Altostratus rankAltostratus

    Thanks for your reply. I had read the document, which says the hash is computed from each character of the MemberName, and although there is no definition of MemberName in the document, it does define the Name entry in the Member table as the FQDN, rather than the IP and port, and would produce an identical hash for two entries with the same FQDN and differing ports. However, the F5 implementation only has the pool to use as the member table, which means they will use the IP address, but not necessarily the port.

     

    That said, I did a test after my post yesterday, and it does seem to include the port in the hash.

     

    Of course, the primary reason for doing this was to try and put some bias towards some of the proxies. It would be nice if the ratio field in the pool member table could be incorporated into the hash calculation.

     

  • Thanks for the information Stephen. It's not the best document and is full of spelling mistakes plus it's expired so it probably wasn't the best place to point you to. Worth noting from the TMOS release notes: "...the hash persistence profile can now perform a pool member selection using a stateless hash algorithm based on the Cache Array Routing Protocol..." which would suggest that F5's implementation is all their own but still implements the core feature. That being the case, it's possible they do consider the port and also that Pool Member ratio could be built in to the calculation.

     

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    Carp computes an index into a table... So it should evenly balance across all poolmembers.
  • Hi Stephen,

     

     

    F5's implementation of CARP definitely includes the pool member IP and port. So you could use multiple ports on the same IP to implement "ratio" now.

     

     

    There's a fix which supports pool member ratios. You can open a Support case and ask about "ID386769 - Modify CARP persistence to utilize any pool mbr ratio/bias". I'm not sure when it will be added to released versions though.

     

     

    Aaron