The LAG hashing algorithm on SRX determines the member link to be used for an incoming packet. This article lists the default packet fields used by the hashing algorithm for a link aggregation group (LAG).
Junos OS uses flow-session based load balancing algorithm for load balancing across LAG interfaces.
The hash is based on:
SrcIP
DstIP
Protocol
SrcPort
DestPort
Incoming Interface index
Type of service(ToS)
The default option is to use Layer 3 header for load balancing hash.
The Layer 4 header can also be configured for load balancing hash with the command:
root@SRX-node0# set forwarding-options hash-key family inet ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups > layer-3 Include Layer 3 (IP) data in the hash key > layer-4 Include Layer 4 (TCP or UDP) data in the hash key
2020-10-15: Changed per-packet to flow-session based in the solution.