A method and system are disclosed for efficiently matching incoming
packets to previously forwarded outgoing packets within a network node to
ensure a response received by a network node corresponds to a previously
forwarded request. The network node receives an outgoing packet including
state information and computes a mapping (e.g., hash) function value
based upon the state information. Thereafter, the network node sets and
entry within a bitmap at a position corresponding to the mapping function
value. The network node also receives an incoming packet purportedly
responsive to an earlier outgoing packet and includes state information
of a type corresponding to the state information of an outgoing packet.
The network node computes a mapping function value based upon the state
information in the incoming packet. The network node then tests an entry
corresponding to the mapping function value within one or more bitmaps
including bits set at positions corresponding to previously forwarded
outgoing packets. If the corresponding bit is not set within at least one
of the bitmaps, then the network node discards the corresponding packet.
Finally, in order to maintain a relative sparse bitmap, the entries are
reset after detecting a clearance threshold event.