Back to The Libreswan Project
GSoC 2026

Optimising the lookup time for ACQUIRE messages sent by kernel

When an IPsec-encrypted packet matches a trap policy in the kernel, the kernel notifies IKE daemon (Pluto) via an ACQUIRE Netlink message. Then Pluto identifies that to which connection does this packet belong to by doing a lookup through all the loaded connections. Currently this is done in O(N) time (scanning through all the connections and the connection with highest priority is choosen). This Project aims to reduce this by using a hashtable to find the connection by using a unqiue id which is passed to the kernel while installing the policy. A complication arises with Opportunistic IPsec. Multiple clones of the same template connection would inherit the same reqid, causing collisions both in the hashtable and in the kernel's SA binding. This is addressed by a global counter that assigns a guaranteed unique reqid to each clone of the template connection. The deliverables would be the following , 1.Unique id placed in the policy before sending it to the kernel. 2.ACQUIRE lookup path using the hashtable 3.Guaranteed unique reqid for opportunistic connection clones via a global counter. 4.Display of the reqid in the status as well. 5. New Tests for functional testing and updating the current testsuites.c

Project details

Contributor

Vinayak Sandur

Mentors

Not available

Technologies

Not listed in the archive