This feature can detect IP fragments in the incoming datastream, with an aim of distributing fragments of one IP packet to the same host buffer for easier software reassembly.
When a first fragment is found, an entry will be stored in the fragment table with information about the destination stream. This allows the adapter to seamlessly forward subsequent fragments to the same stream. A number of scenarios can result in incoming fragments that do not match any fragments recorded in the fragment table. One possibility could be if the first fragment arrives out-of-order, meaning that a later fragment could arrive before the first fragment. This would result in a so-called 'unmatched' fragment, which needs to be handled separately.
Note: The feature is mostly relevant for filtering on fields beyond OSI layer 3 (e.g. 5-tuple filtering), as these headers are only present in the first fragment. For 2-tuple filtering, one could just as well employ standard non-fragment aware filtering.
The syntax for the IPFMode NTPL command is shown below.
<IPFModeAction> ::= 'IPFMode' '[' <IPFModeOptionSpec> ']''=' <PortTest> <IPFModeOptionsSpec> ::= <IPFModeOption> [ ';' <IPFModeOptionSpec> ] <IPFModeOption> ::= ( 'StreamId' '=' <StreamIdSpec> ) | ( 'Timeout' '=' <TimeoutSpec> ) | ( 'TablePersist' '=' <TablePersistSpec> ) | ( 'ClassifyUnmatched' '=' <ClassifyUnmatchedSpec> ) | ( 'ColorInherit' '=' <TrueFalseValue> ) | ( 'Tag' '=' <Identifier> ) <TimeoutSpec> ::= '0' | '1' | '2' | ... | '100000' | '0x0' | '0x1' | '0x2' | ... | '0x186A0' <TablePersistSpec> ::= 'TimeoutOnly' | 'LastFragment' <ClassifyUnmatchedSpec> ::= 'None' | 'Outer' | 'All'
Each <IPFModeAction> command enables IPF and configures how to handle unmatched fragments from one or more ports. You can only issue one IPFMode command at a time, so if you want to change the behavior, you will have to delete the old command first.
When an IP fragment has not been received for a period equal to 'Timeout', the table entry associated with the datagram is de-allocated from the table. The unit for 'Timeout' is 100 us.
The 'StreamId' option is mandatory, and sets one or more streams as destination for unmatched fragments.
If 'TablePersist' is set to 'LastFragment', the associated table entry will be de-allocated when the last fragment for an IP datagram is received (irrespective of whether all fragments for the datagram have been received), or when the entry reaches its timeout limit.
If 'TablePersist' is set to 'TimeoutOnly', the associated table entry is only de-allocated when the entry reaches its timeout limit, reception of the last fragment will not de-allocate the entry.
The 'ClassifyUnmatched' option determines which fragments are sent to the unmatched queue, controlled by the three different parameter values below:
None (Default): Only unmatched segments are sent to the unmatched queue
All: IP packets fragmented at the outer level, or inside a tunnel are sent to the unmatched queue
Outer: IP packets fragmented at the outer level are sent to the unmatched queue
Thus, when setting 'ClassifyUnmatched' to anything different than 'None', the fragment handling is effectively disabled, as all incoming fragments are sent to the unmatched streams, determined by the 'StreamId' option. In this scenario, neither 'ColorInherit', 'TablePersist' nor 'Timeout' has any effect.
The 'ColorInherit' option controls whether the coloring applied to the first fragment should be inherited by the following fragments. When set to 'True' (default), all fragments will receive the same color as the first fragment. When set to 'False', fragments will be colored individually.
For a description of the 'Tag' option please refer to Tag Option.
Note 1: The ports specified in the Port Tests"<PortTest>" must include all ports on the adapters that are involved.
Note 2: IP packets that are not fragmented are not affected by the 'ClassifyUnmatched' option.
This section describes some examples of using the IPFMode command.
The following command enables the IP fragment handling for ports 0 to 3 and sends all matched fragments to streams 0 and 1, and unmatched fragments to streams 2 and 3. The timeout for the datagram lookup table is set to 10000 us and the datagram lookup table will be cleaned when last fragments are received.
The IPFMode NTPL example is shown below.
Assign[StreamId=(0..1)] = port == (0..3) IPFMode[StreamId=(2..3); Timeout=100; TablePersist=LastFragment] = port == (0..3)
The following NTPL command disables IP fragment handling in the adapter and causes the adapter to send IP packets that are fragmented at the outermost network layer to streams 0 and 1. The fragments will be load distributed between the configured streams based on the IP ID field, such that fragments of the same IP packet will end up in the same stream.
An application can use this setup to receive fragments on the same stream, which enables each thread to receive fragments that belong together.
IPFMode[StreamId=(0..1); ClassifyUnmatched=Outer] = port==(0..3)