HashDestination
Display Hash Destination
- HashDestination
Shortest form:
hd.Hash-destination tools, usually abbreviated
hd.hd dest getasks which ECMP member, LAG member or Higig-trunk member a packet with the given header fields would be sent to.hd ethertypemanages which EtherTypes take part in ECMP and trunk hashing.Type the keywords in full.
ethalso works forethertype,infofordest, andcalcforget.Group=takesECMP,LAG,HGTor, forhd dest get,ANY. The built-in help writesModule=<modid>forhd dest get, but the shell acceptsModid=and rejectsModule=.hd dest getandhd ethertype showare read-only.hd ethertype mode,addanddeletechange ECMP and LAG hashing behind SONiC’s back.- HashDestination dest get [Group=<ECMP|LAG|HGT|ANY>] [GID=<id>] [Port=<port>] [Modid=<modid>] [Untagged=<T|F>] [DestMac=<mac>] [SrcMac=<mac>] [Vlan=<vid>] [EtherType=<0xHHHH>] [SrcIp=<ip4>] [DestIp=<ip4>] [SIp6=<ip6>] [DIp6=<ip6>] [PROTocol=<pid>] [L4SrcPort=<n>] [L4DstPort=<n>] [FwdReason=<Unicast|Ipmc|L2mc|Bcast|Dlf>] [CalcInfo=<UDP_SOURCE_PORT|LBID>]
Describe a packet by its ingress port and header fields. The shell prints the flags it used and, for each group, the member the packet would go to: an ECMP egress object ID, or a trunk member as
0x<gport> (tp[<i>]=<port>,tmod[<i>]=<mod>).CalcInfoprints the computed UDP source port or LBID instead. The answer is calculated by the SDK; no packet is sent. Read-only.Port=takes a port number, as the built-in help’s<port#>says; with a port name such asPort=ce0the shell only prints the usage, as the first example shows. On a SONiC switch,trunk showgives the trunk ID of a PortChannel to use asGIDwithGroup=LAG.Hardware-validated — Which ECMP member would a TCP flow from ce0 use?
drivshell> hd dest get Group=ECMP Port=ce0 SrcIp=192.0.2.1 DestIp=198.51.100.1 PROTocol=6 L4SrcPort=1234 L4DstPort=80 Usage (HashDestination): Usages: hd ethertype mode [Group=ECMP|LAG|HGT] [Eligible=T|F] [Inner=T|F] hd ethertype add [Group=ECMP|LAG|HGT] [EtherType=<0xHHHH>] hd ethertype delete [Group=ECMP|LAG|HGT] [EtherType=<0xHHHH>] hd ethertype show [Group=ECMP|LAG|HGT] hd dest get [Group=ECMP|LAG|HGT|ANY] [GID=<id>] [Port=<port#>] [Module=<modid>] [Untagged=T|F] [DestMac=<mac>] [SrcMac=<mac>] [Vlan=<vid>] [EtherType=<0xHHHH>] [SrcIp=<ip4>] [DestIp=<ip4>] [SIp6=<ip6>] [DIp6=<ip6>] [PROTocol=<Pid>] [L4SrcPort=<num>] [L4DstPort=<num>] [FwdReason=Unicast|Ipmc|L2mc|Bcast|Dlf] [CalcInfo=UDP_SOURCE_PORT|LBID]
Hardware-validated — A trunk query that the SDK rejects
drivshell> hd dest get Group=LAG GID=1 Port=1 SrcIp=192.0.2.1 DestIp=198.51.100.1 PROTocol=6 L4SrcPort=1234 L4DstPort=80 HashDestination: Invalid parameter
With
Port=given as a number the command is parsed, but the SDK rejects the query withInvalid parametereven for an existing trunk (trunk 1 is SONiC’s PortChannel onxe0–xe2). A form thathd dest getaccepts on Trident 3 has not been found.
- HashDestination ethertype show [Group=<ECMP|LAG|HGT>]
For each group (or the one given), print whether the listed EtherTypes are eligible or ineligible for hashing, the EtherTypes, and their count. Read-only.
On a SONiC switch every list is empty (
OUTER Ineligible Cnt:0). WithoutGroup=, Trident 3 prints all three groups and then fails withHashDestination: Invalid parameter; the lines above the error are still valid.Hardware-validated
drivshell> hd ethertype show ECMP: EtherType: OUTER Ineligible Cnt:0 LAG: EtherType: OUTER Ineligible Cnt:0 HGT: EtherType: OUTER Ineligible Cnt:0 HashDestination: Invalid parameter Failed to execute the diagnostic command. Error: Operation failed.
Hardware-validated — One group only
drivshell> hd ethertype show Group=ECMP ECMP: EtherType: OUTER Ineligible Cnt:0
- HashDestination ethertype mode [Group=<ECMP|LAG|HGT>] [Eligible=<T|F>] [Inner=<T|F>]
Choose whether the listed EtherTypes are the ones that are hashed (
Eligible=T) or the ones that are not, and whether inner headers are used. Changes the ASIC.Unvalidated
drivshell> hd ethertype mode Group=LAG Eligible=T
- HashDestination ethertype add [Group=<ECMP|LAG|HGT>] [EtherType=<0xHHHH>]
Add an EtherType to a group’s list. Changes the ASIC.
Unvalidated
drivshell> hd ethertype add Group=ECMP EtherType=0x8847
- HashDestination ethertype delete [Group=<ECMP|LAG|HGT>] [EtherType=<0xHHHH>]
Remove an EtherType from a group’s list. Changes the ASIC.
Unvalidated
drivshell> hd ethertype delete Group=ECMP EtherType=0x8847
Built-in help
Usages: hd ethertype mode [Group=ECMP|LAG|HGT] [Eligible=T|F] [Inner=T|F] hd ethertype add [Group=ECMP|LAG|HGT] [EtherType=<0xHHHH>] hd ethertype delete [Group=ECMP|LAG|HGT] [EtherType=<0xHHHH>] hd ethertype show [Group=ECMP|LAG|HGT] hd dest get [Group=ECMP|LAG|HGT|ANY] [GID=<id>] [Port=<port#>] [Module=<modid>] [Untagged=T|F] [DestMac=<mac>] [SrcMac=<mac>] [Vlan=<vid>] [EtherType=<0xHHHH>] [SrcIp=<ip4>] [DestIp=<ip4>] [SIp6=<ip6>] [DIp6=<ip6>] [PROTocol=<Pid>] [L4SrcPort=<num>] [L4DstPort=<num>] [FwdReason=Unicast|Ipmc|L2mc|Bcast|Dlf] [CalcInfo=UDP_SOURCE_PORT|LBID]