Processor allocation for multi-core architectures
View Patent ↗Methods, computing devices, and computer readable storage media for testing network connections are disclosed. A first processor of a plurality of processors may define a new TCP connection. The first processor may apply a hash function to determine an appropriate one of the plurality of processors to open the new TCP connection. The first processor may write data defining the new TCP connection to a queue associated with the appropriate processor. The appropriate processor may retrieve the data defining the new TCP connection from the queue and open the new TCP connection.
1. A method performed by a test system to test network connections, comprising:
a first processor of a plurality of processors defining a new TCP connection;
the first processor applying a hash function to determine a second processor of the plurality of processors to open the new TCP connection;
the first processor writing data defining the new TCP connection to a queue associated with the second processor, the queue one of an N×N array of queues, where N is a number of processors in the plurality of processors; and
the second processor retrieving the data defining the new TCP connection from the queue and transmitting a TCP SYN packet to initiate opening the new TCP connection in accordance with the retrieved data.
2. The method of claim 1 , wherein
each row of the N×N array of queues is uniquely associated with a corresponding one of the plurality of processors that writes data to the queues in the row, and
each column of the N×N array of queues is uniquely associated with a corresponding one of the plurality of processors that retrieves data from the queues in the column.
3. The method of claim 1 , wherein defining a new TCP connection includes defining at least a source IP address, a destination IP address, a source TCP port, and a destination TCP port.
4. The method of claim 3 , wherein applying the hash function comprises applying the hash function to the source IP address, the destination IP address, the source TCP port, and the destination TCP port to generate a hash value indicative of the second processor.
5. The method of claim 4 , further comprising:
receiving at least one packet from a remote device via the new TCP connection; and
applying the hash function to a source IP address, a destination IP address, a source TCP port, and a destination TCP port extracted from a header of the received packet to generate the hash value indicative of the second processor.
6. The method of claim 5 , further comprising:
the second processor processing the received packet through a TCP/IP protocol stack.
7. A computing device, comprising:
a plurality of processors; and
a memory shared by the plurality of processors;
wherein a first processor of the plurality of processors executes stored instruction causing the first processor to perform actions comprising:
defining a new TCP connection,
applying a hash function to determine a second processor of the plurality of processors to open the new TCP connection, and
writing data defining the new TCP connection to a queue associated with the second processor within the shared memory, the queue one of an N×N array of queues, where N is a number of processors in the plurality of processors;
wherein the second processor executes stored instructions causing the second processor to perform actions comprising:
retrieving the data defining the new TCP connection from the queue and transmitting a TCP SYN packet to initiate opening the new TCP connection in accordance with the retrieved data.
8. The computing device of claim 7 , wherein
each row of the N×N array of queues is uniquely associated with a corresponding one of the plurality of processors that writes data to the queues in the row, and
each column of the N×N array of queues is uniquely associated with a corresponding one of the plurality of processors that retrieves data from the queues in the column.
9. The computing device of claim 7 , wherein defining a new TCP connection includes defining at least a source IP address, a destination IP address, a source TCP port, and a destination TCP port.
10. The computing device of claim 9 , wherein applying the hash function comprises applying the hash function to the source IP address, the destination IP address, the source TCP port, and the destination TCP port to generate a hash value indicative of the second processor.
11. The computing device of claim 10 , further comprising:
network interface hardware to transmit and receive packets via a network, the network interface hardware configured to:
receive a packet from a remote device via the new TCP connection,
apply the hash function to a source IP address, a destination IP address, a source TCP port, and a destination TCP port extracted from a header of the received packet to generate the hash value indicative of the second processor, and
write the received packet to a receive buffer associated with the second processor within the shared memory.
12. The computing device of claim 11 , the actions performed by the second processor further comprising:
retrieving the received packet from the receive buffer associated with the second processor; and
processing the received packet through a TCP/IP protocol stack.
13. A machine-readable storage medium storing instructions that, when executed by a computing device having a plurality of processors, causes actions including:
a first processor of the plurality of processors performing actions including:
defining a new TCP connection,
applying a hash function to determine a second processor of the plurality of processors to open the new TCP connection, and
writing data defining the new TCP connection to a queue associated with the second processor, the queue one of an N×N array of queues, where N is a number of processors in the plurality of processors; and
the second processor performing actions including:
retrieving the data defining the new TCP connection from the queue and transmitting a TCP SYN packet to initiate opening the new TCP connection in accordance with the retrieved data.
14. The machine-readable storage medium of claim 13 , wherein
each row of the N×N array of queues is uniquely associated with a corresponding one of the plurality of processors that writes data to the queues in the row, and
each column of the N×N array of queues is uniquely associated with a corresponding one of the plurality of processors that retrieves data from the queues in the column.
15. The machine-readable storage medium of claim 13 , wherein defining a new TCP connection includes defining at least a source IP address, a destination IP address, a source TCP port, and a destination TCP port.
16. The machine-readable storage medium of claim 15 , wherein applying the hash function comprises applying the hash function to the source IP address, the destination IP address, the source TCP port, and the destination TCP port to generate a hash value indicative of the second processor.