cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1244
Views
0
Helpful
5
Replies

predictor troubleshooting

Filip Talpa
Level 1
Level 1

Hi,

I am wondering is it possilble to determine to which server would a request go to when using destination address hash? or at least how does the mask work? I would have assumed that with mask 255.255.255.0 only last octet would be considered for the hash, but than with the default 255.255.255.255 no bits would be considered (e.g. everything would go to the same server regardeless of the DSTIP).

cheers.

1 Accepted Solution

Accepted Solutions

Hi  Filip,

The algorithm is something like this:

Here is the hash algorithm


((_key) + (_key >> 8) + (_key >> 16) + (_key >> 24))

The _key in this case is the source ip address has an unsigned 32 bits number.

You then do rserver_index = hash % number_of_rserver.

Source and/or Destination IP Hash (Subnet Mask Configurable)

Source or destination IP hash method maps the IP address in the request to a real in a server farm. The configuration options are shown below.

predictor hash address [source | destination] [netmask]         

!--- Source/Destination IP hash or predictor hash address.

The default (netmask) is 255.255.255.255. The hash value is produced with the following algorithm:

ip_addr = (Src_or_Dest_Ip_addr & Cfg_Netmask) hash_index = (ip_addr) + (ip_addr >> 8) + ip_addr >> 16) + (ip_addr >> 24);

Also for detail configuration examples for hash predictor kindly refer the below mentioned URL:

http://www.cisco.com/en/US/docs/interfaces_modules/services_modules/ace/v3.00_A1/configuration/slb/guide/fwldbal.html#wpxref70632

Kindly rate.

HTH

Sachin Garg

View solution in original post

5 Replies 5

litrenta
Level 3
Level 3

The entire address is hashed then a modulo operation is done with the modulo being the number of servers in the serverfarm. the modulo (remainder) is used as an index into the server in the farm.

thanks and the base of the modulo is determined by the mask? I am still confused by how the mask works, would you mind to elaborate?

Hi  Filip,

The algorithm is something like this:

Here is the hash algorithm


((_key) + (_key >> 8) + (_key >> 16) + (_key >> 24))

The _key in this case is the source ip address has an unsigned 32 bits number.

You then do rserver_index = hash % number_of_rserver.

Source and/or Destination IP Hash (Subnet Mask Configurable)

Source or destination IP hash method maps the IP address in the request to a real in a server farm. The configuration options are shown below.

predictor hash address [source | destination] [netmask]         

!--- Source/Destination IP hash or predictor hash address.

The default (netmask) is 255.255.255.255. The hash value is produced with the following algorithm:

ip_addr = (Src_or_Dest_Ip_addr & Cfg_Netmask) hash_index = (ip_addr) + (ip_addr >> 8) + ip_addr >> 16) + (ip_addr >> 24);

Also for detail configuration examples for hash predictor kindly refer the below mentioned URL:

http://www.cisco.com/en/US/docs/interfaces_modules/services_modules/ace/v3.00_A1/configuration/slb/guide/fwldbal.html#wpxref70632

Kindly rate.

HTH

Sachin Garg

Hi Sachin,

thanks a lot for the info! I've read the guide on predictor. but I couldn't figure out whether the mask determines the numbner of bits considered for the hash, because of the way it is configured. with 32 bit mask the ACE would consider the whole IP for the hash. with 24 bit mask does it only consider the last octet or is the last octet ignored for the hash?

cheers

filip

Hi

I have posted some detail information for selecting URL hash as a predictor,

Kindly find the link below.

https://supportforums.cisco.com/message/3251601#3251601

Sachin Garg

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: