Processes are disclosed in which an index value is generated for locating
a security association in a security association database, such as an
inbound SAD associated with the IPsec set of protocols. The index value
is specified for insertion into a Security Parameter Index (SPI) field of
a packet header, such as an IPsec header. For packets that are to be
secured according to the policies and protocols identified in the header
and the security association and that are transmitted to a particular
network device or host, the index value is inserted into the SPI field of
the packets by a packet sender. The packet is then parsed by a packet
receiver, the index value determined from the SPI and used to identify
the security association in the SAD, based solely on the index value
determined from the SPI. Hence, a simple and efficient mechanism is
provided for fast inbound security association lookups.