Juniper EX Series – Understanding Hashing algorithm for Link Aggregation

By | August 30, 2013

A link aggregation group (LAG) increases the uplink bandwidth proportional to the number of member interfaces. Another advantage of link aggregation is increased availability, because the LAG is composed of multiple member links. If one member link fails, the LAG continues to carry traffic over the remaining links.

In order to effectively increase the bandwidth of the LAG, traffic needs to be balanced across the member links. The balancing is done by the LAG hashing algorithm, which is designed to have the member links used increasingly equally as the traffic profile gets more diverse. The LAG hashing algorithm on EX Series Switches determines the member link to be used for an incoming frame/packet depending on a subset of the below values in the frame/packet header:

  • Source MAC address
  • Destination MAC address
  • Source IP address
  • Destination IP address
  • Source Port
  • Destination Port
  • IPv6 Flow Label
  • MPLS Label(s)

The hashing algorithm also takes into account the type of the frame/packet in determining the outgoing member link. There are three different types of frames/packets for platforms EX2200/EX3200/EX4200/EX4500 as far as the algorithm is concerned. For the EX8200 platform there is the additional MPLS frame type. The different types are as follows:

  • Non-IP frame: A layer 2 frame with no layer 3 information
  • IPv4 packet
  • IPv6 packet
  • MPLS frame

The difference in the chipsets usedby these different platforms different algorithms for EX2200/EX3200/EX4200/EX4500 and EX8200. Below tables show the values used in determining the member link to be used per platform, per frame/packet type.

  • For EX2200/EX3200/EX4200/EX4500 platforms, the following values are taken into account when calculating the hash:

  • For the EX8200 platform, the following values are taken into account when calculating the hash:

Now few key things to remember are –

  • LAG Hashing algorithm on EX Series Switches is not user configurable.
  • The algorithm is utilization agnostic. In other words, the algorithm will not switch links in the event a link is overutilized due to a given traffic profile.
  • EX8200 Virtual Chassis/XRE200 platforms have a feature known as ‘link-local’, where the hashing algorithm favors a member link on the same chassis as the incoming interface of the frame/packet. Other EX Virtual Chassis platforms (i.e. EX4200/EX4500) do not currently have this feature and the member link is purely determined by the hash calculated using above values. This feature is in the implementation stage for EX4200/EX4500 Virtual Chassis platforms at the time of this writing.