Hash Key Masks

Napatech Link™ Capture Software Features

Platform
Napatech SmartNIC
Content Type
Feature Description
Capture Software Version
Link™ Capture Software 12.5

Hash key masks

The hash calculation can be controlled using hash key masks. Hash word bits that are masked out are set to 0. In this way certain parts of the input data can be disregarded from the hash calculation, so that frames with hash values that only differ due to, for instance, port numbers can be configured to end up in the same host buffer.
Note: For sorted hash keys the sorting takes place before the masking.

This figure illustrates hash calculation using hash key masks for predefined hash key types.

4GA New Hash-General-1 Sheet.1 Hash key data Hash key data Sheet.2 Word 0 Word 0 Sheet.3 Word 1 Word 1 Sheet.4 Word 2 Word 2 Sheet.5 0 0 Sheet.6 4 4 Sheet.7 8 8 45 degree single.60 Center drag circle.18 Hash algorithm Hash algorithm 45 degree single.62 Sheet.11 32-bit hash value 32-bit hash value Sheet.12 Word 8 Word 8 Sheet.13 Word 9 Word 9 Sheet.14 32 32 Sheet.15 36 36 Sheet.16 40 40 Sheet.17 Sheet.18 Sheet.19 Sheet.20 Hash mask data Hash mask data Sheet.21 Word 0 Word 0 Sheet.22 Word 1 Word 1 Sheet.23 Word 2 Word 2 Sheet.24 0 0 Sheet.25 4 4 Sheet.26 8 8 Sheet.27 Word 8 Word 8 Sheet.28 Word 9 Word 9 Sheet.29 32 32 Sheet.30 36 36 Sheet.31 40 40 Sheet.32 Sheet.33 Sheet.34 Center drag circle.35 AND AND 45 degree single.36 45 degree single.37 Sheet.38 328 bits 328 bits Sheet.39 328 bits 328 bits Sheet.40 328 bits 328 bits Sheet.41 32 bits 32 bits Sheet.42 Sheet.43

NTPL example 1

This NTPL example sets up a hash key mask to process RTP and RTCP traffic from a VoIP media stream in the same process/CPU. VoIP allocates an even port number for RTP traffic and the RTP port number + 1 for RTCP traffic. Configuring the mask 0xFFFE for the port number ensures that any set of RTP and RTCP traffic get the same hash value and ends up in the same host buffer:

DefineMacro("mHashMaskSrcPort", "HashWord8_Lo")
DefineMacro("mHashMaskDstPort", "HashWord8_Hi")
HashMask[mHashMaskSrcPort = 0xFFFE; mHashMaskDstPort = 0xFFFE] = Hash5Tuple
HashMode=Hash5Tuple
Assign[StreamId=(0..7)] = All

NTPL example 2

Hash key masks can also be specified using a hash mask number (MaskNo).

The hash mask must be defined before the hash mask number is referred in a HashMode command.

This NTPL example sets up 2-tuple hash keys and corresponding hash masks to ignore the least significant byte of the source and destination IPv4 addresses (using subnet mask FF.FF.FF.0) and to ignore the least significant bytes of the source and destination IPv6 addresses (using subnet mask FFFF:0:0:0:0:0:0:0):

HashMask[HashWord0=[FF.FF.FF.0]; HashWord4=[FF.FF.FF.0]] = MaskNo == 1
HashMode[Layer3Type=IPV4; MaskNo=1] = Hash2Tuple
HashMask[HashWord0_3=[FFFF:0:0:0:0:0:0:0]; HashWord4_7=[FFFF:0:0:0:0:0:0:0]] = MaskNo == 2
HashMode[Layer3Type=IPV6; MaskNo=2] = Hash2Tuple
Assign[StreamId=(0..7)] = All