Lockless stateful network address translation
Abstract
Examples include a computing system having a plurality of processing cores and a memory coupled to the plurality of processing cores. The memory has instructions stored thereon that, in response to execution by a selected one of the plurality of processing cores, cause the following actions. The selected processing core to receive a packet and get an original tuple from the packet. When no state information for a packet flow of the packet exists in a state table, select a new network address as a new source address for the packet, get a reverse tuple for a reverse direction, select a port for the packet from an entry in a mapping table based on a hash procedure using the reverse tuple, and save the new network address and selected port. Translate the packet's network address and port and transmit the packet.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A computing system comprising:
a plurality of processing cores; and a memory coupled to the plurality of processing cores, the memory having instructions stored thereon that, in response to execution by a selected one of the plurality of processing cores, cause the selected processing core to: receive a packet; get an original tuple from the packet; when no state information for a packet flow of the packet exists in a state table, select a new network address as a new source address for the packet, get a reverse tuple for a reverse direction, select a port for the packet from an entry in a mapping table based on a hash procedure using the reverse tuple, and save the new network address and selected port; translate the packet's network address and port; and transmit the packet.
2 . The computing system of claim 1 , comprising when no state information for the packet flow exists in the state table, set a destination port in the reverse tuple to zero, compute a hash value of the reverse tuple, perform an exclusive-OR (XOR) operation on the hash value of the reverse tuple and a hash value of the original tuple, mask a plurality of the least significant bits (LSBs) of the XOR result to select a port for the packet from an entry in a mapping table based on the masked value, save the new network address and selected port into a state associated with a connection of the packet flow, and insert information describing the packet flow into the state table.
3 . The computing system of claim 2 , the memory having instructions stored thereon that, in response to execution by the processor, cause the processor to:
at initialization time, generate the mapping table, the mapping table comprising a plurality of entries, each entry associating a port with a hash value.
4 . The computing system of claim 2 , the memory having instructions stored thereon that, in response to execution by the processor, cause the processor to:
create a tuple having a zero value for a source address, a destination address, a source port, and a destination port, select a port, assign a destination port of the tuple to the selected port, compute a hash value of the tuple, mask the hash value with a least significant bits (LSB) mask, and store the port number into the mapping table entry for the selected port.
5 . The computing system of claim 2 , wherein the selected processing core to receive an original direction packet is the same processing core to transmit a reverse direction packet.
6 . The computing system of claim 2 , comprising a network input/output (I/O) device, the network I/O device comprising a hash filter redirection table (HFRT), wherein the masked hash value of an original tuple and the masked hash value of a reverse tuple point to a same entry in the HFRT.
7 . The computing system of claim 6 , the entry in the HFRT indicating a queue in the network I/O device.
8 . A method to be performed by a processor, comprising:
receiving a packet; getting an original tuple from the packet; when no state information for a packet flow of the packet exists in a state table, selecting a new network address as a new source address for the packet, getting a reverse tuple for a reverse direction, selecting a port for the packet from an entry in a mapping table based on a hash procedure using the reverse tuple, and saving the new network address and selected port; translating the packet's network address and port; and transmitting the packet.
9 . The method of claim 8 , comprising: when no state information for the packet flow exists in the state table, setting a destination port in the reverse tuple to zero, computing a hash value of the reverse tuple, performing an exclusive-OR (XOR) operation on the hash value of the reverse tuple and a hash value of the original tuple, masking a plurality of the least significant bits (LSBs) of the XOR result to select a port for the packet from an entry in a mapping table based on the masked value, saving the new network address and selected port into a state associated with a connection of the packet flow, and inserting information describing the packet flow into the state table.
10 . The method of claim 9 , comprising
at initialization time, generating the mapping table, the mapping table comprising a plurality of entries, each entry associating a port with a hash value.
11 . The method of claim 9 , comprising
creating a tuple having a zero value for a source address, a destination address, a source port, and a destination port, selecting a port, assigning a destination port of the tuple to the selected port, computing a hash value of the tuple, masking the hash value with a least significant bits (LSB) mask, and storing the port number into the mapping table entry for the selected port.
12 . The method of claim 9 , wherein a selected processing core of a computer system to receive an original direction packet is a same processing core to transmit a reverse direction packet.
13 . The method of claim 9 , wherein the masked hash value of an original tuple and the masked hash value of a reverse tuple point to a same entry in a hash filter redirection table (HFRT).
14 . The method of claim 13 , the entry in the HFRT indicating a queue in a network I/O device.
15 . At least one tangible machine-readable medium comprising a plurality of instructions that in response to being executed by a processor cause the processor to:
receive a packet; get an original tuple from the packet; when no state information for a packet flow of the packet exists in a state table, select a new network address as a new source address for the packet, get a reverse tuple for a reverse direction, select a port for the packet from an entry in a mapping table based on a hash procedure using the reverse tuple, and save the new network address and selected port; translate the packet's network address and port; and transmit the packet.
16 . The at least one tangible machine-readable medium of claim 15 , comprising a plurality of instructions that in response to being executed by a processor cause the processor to: when no state information for the packet flow exists in the state table, set a destination port in the reverse tuple to zero, compute a hash value of the reverse tuple, perform an exclusive-OR (XOR) operation on the hash value of the reverse tuple and a hash value of the original tuple, mask a plurality of the least significant bits (LSBs) of the XOR result to select a port for the packet from an entry in a mapping table based on the masked value, save the new network address and selected port into a state associated with a connection of the packet flow, and insert information describing the packet flow into the state table.
17 . The at least one tangible machine-readable medium of claim 16 , comprising a plurality of instructions that in response to being executed by a processor cause the processor to:
at initialization time, generate the mapping table, the mapping table comprising a plurality of entries, each entry associating a port with a hash value.
18 . The at least one tangible machine-readable medium of claim 16 comprising a plurality of instructions that in response to being executed by a processor, cause the processor to:
create a tuple having a zero value for a source address, a destination address, a source port, and a destination port, select a port, assign a destination port of the tuple to the selected port, compute a hash value of the tuple, mask the hash value with a least significant bits (LSB) mask, and store the port number into the mapping table entry for the selected port.
19 . The at least one tangible machine-readable medium of claim 16 , wherein a selected processing core to receive an original direction packet is a same processing core to transmit a reverse direction packet.
20 . The at least one tangible machine-readable medium of claim 16 , wherein the masked hash value of an original tuple and the masked hash value of a reverse tuple point to a same entry in a HFRT.
21 . The at least one tangible machine-readable medium of claim 20 , the entry in the HFRT indicating a queue in a network I/O device.Join the waitlist — get patent alerts
Track US2019334863A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.