This topic describes hashing for load balancing on the Cisco 8000 Series Router, a technique that distributes traffic flows or packets efficiently across multiple available paths, links, or resources.
Hashing is a technique used by network devices such as routers and switches to distribute traffic flows or packets efficiently across multiple available paths, links, or resources. Hashing
-
ensures all packets from the same traffic flow (for example, TCP connection) follow the same path, avoiding out-of-order delivery
-
distributes multiple traffic flows across all paths, thus preventing overload of any single path, and
-
works automatically as paths or links are added or removed.
The hashing process involves these steps:
-
Field extraction: The device extracts certain fields from the packet header, such as source and destination IP addresses, ports, and protocol.
-
Hash function: These fields are combined and fed into a mathematical function called a hash function. This function produces a fixed-size output known as the hash value.
-
Path selection: The resulting hash value is used to select one of several possible paths, links, or next hops. For example, if there are four links in a bundle, the device might use
path = hash_value % 4, where%indicates the modulus operation.
If multiple routers use the same hash algorithm and field selection, the same flows might be mapped to the same paths on each router, resulting in polarization. This can lead to uneven traffic distribution and underused network capacity.
By increasing the variety of hash profiles using extended entropy profiles, each router hashes differently, thus reducing the chance of polarization while improving the overall load balancing. For more information, see Hashing functions for load balancing.