A method for secure fast table lookups performed on a first one of a pair of network elements (110, 120), comprising: establishing a plurality of connections of a protocol, wherein establishing each connection includes exchanging locally selected identifiers between the first one and a second one of the pair of network elements (110, 120), wherein the protocol is Layer 2 Tunneling Protocol (L2TP), and wherein the following is performed for each connection establishment: allocating connection data in a memory of the first one of the pair of network elements (110, 120), generating a local identifier that is a pointer to the allocated connection data, applying a mathematical transformation to the generated local identifier, including a value representing the generated local identifier and a result of the mathematical transformation of the generated local identifier in a first portion and a second portion of a connection establishment packet respectively, wherein the first portion of the connection establishment packet corresponds with a session ID field of an L2TP header and the second portion of the connection establishment packet corresponds with a cookie field of the L2TP header, and transmitting the connection establishment packet to the second one of the pair of network elements (110, 120); and responsive to receiving a first data packet of the protocol from the second one of the pair of network elements (110, 120), performing the following: extracting data from a first portion and a second portion of the first data packet, applying the mathematical transformation to the data extracted from the first portion, determining that a result of the mathematical transformation of the data extracted from the first portion matches the data extracted from the second portion of the first data packet, and dereferencing the data extracted from the first portion to locate the allocated connection data for the first data packet. establishing a plurality of connections of a protocol, wherein establishing each connection includes exchanging locally selected identifiers between the first one and a second one of the pair of network elements (110, 120), wherein the protocol is Layer 2 Tunneling Protocol (L2TP), and wherein the following is performed for each connection establishment: allocating connection data in a memory of the first one of the pair of network elements (110, 120), generating a local identifier that is a pointer to the allocated connection data, applying a mathematical transformation to the generated local identifier, including a value representing the generated local identifier and a result of the mathematical transformation of the generated local identifier in a first portion and a second portion of a connection establishment packet respectively, wherein the first portion of the connection establishment packet corresponds with a session ID field of an L2TP header and the second portion of the connection establishment packet corresponds with a cookie field of the L2TP header, and transmitting the connection establishment packet to the second one of the pair of network elements (110, 120); and allocating connection data in a memory of the first one of the pair of network elements (110, 120), generating a local identifier that is a pointer to the allocated connection data, applying a mathematical transformation to the generated local identifier, including a value representing the generated local identifier and a result of the mathematical transformation of the generated local identifier in a first portion and a second portion of a connection establishment packet respectively, wherein the first portion of the connection establishment packet corresponds with a session ID field of an L2TP header and the second portion of the connection establishment packet corresponds with a cookie field of the L2TP header, and transmitting the connection establishment packet to the second one of the pair of network elements (110, 120); and responsive to receiving a first data packet of the protocol from the second one of the pair of network elements (110, 120), performing the following: extracting data from a first portion and a second portion of the first data packet, applying the mathematical transformation to the data extracted from the first portion, determining that a result of the mathematical transformation of the data extracted from the first portion matches the data extracted from the second portion of the first data packet, and dereferencing the data extracted from the first portion to locate the allocated connection data for the first data packet. extracting data from a first portion and a second portion of the first data packet, applying the mathematical transformation to the data extracted from the first portion, determining that a result of the mathematical transformation of the data extracted from the first portion matches the data extracted from the second portion of the first data packet, and dereferencing the data extracted from the first portion to locate the allocated connection data for the first data packet.