11-30-2010 02:09 PM
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.Solved! Go to Solution.
12-03-2010 01:45 PM
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 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:
Kindly rate.
HTH
Sachin Garg
11-30-2010 05:13 PM
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.
11-30-2010 11:59 PM
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?
12-03-2010 01:45 PM
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 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:
Kindly rate.
HTH
Sachin Garg
12-06-2010 03:48 AM
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
12-17-2010 12:00 PM
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
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: