Method for Distributing a Network Stream
20220358056 · 2022-11-10
Inventors
Cpc classification
International classification
Abstract
The invention relates to a method for distributing a network stream from at least one data source to a plurality of processors or processor cores of a computing device. The computing device has a network card which supports the receive side scaling (RSS) function, wherein, when this function is activated, the network card or its device driver generates an RSS indirection table (25) in which there is stored, for each index, the number of a processor or processor core, which will process an incoming data packet assigned to this index, and subsequently the network card calculates a hash value for each incoming data packet and maps the hash value to an index in precisely this table, wherein the hash value is formed via the combination of source and destination IP addresses and ports and is thus static for the duration of the connection. The method comprises the steps of specifying (34) at least one processor or processor core of the computing device, selecting (35) a port of the at least one data source, generating (36) a data set assigned to the selected port, determining (37) the processor or processor core assigned to the data set, repeating the steps of selection (35), generation (36) and determination (37) until a port has been determined for each specified processor or processor core, and sending (39) data packets via the ports determined for the specified processors or processor cores.
Claims
1. Method for distributing a network stream from at least one data source to processors or processor cores (K0-K3) of a computing device (11) having a network card which supports the receiver side scaling (RSS) function, wherein, when this function is activated, the network card or its device driver generates an RSS indication table (25) in which there is stored, for each index, the number of a processor or processor core (K0-K3), which will process an incoming data packet assigned to this index, and subsequently the network card calculates a hash value (23) for each incoming data packet and maps the hash value (23) to an index in precisely this table, wherein the hash value is formed via the combination of source and destination IP addresses and ports and is thus static for the duration of the connection, the method comprising the following steps: a) specifying (34) at least one processor or processor core (K0-K3) of the computing device (11), b) selecting (35) a port of the at least one data source, c) generating (36) a data set (20) assigned to the selected port, d) determining (37) the processor or processor core (K0-K3) assigned to the data set (20), e) repeating steps b to d until a port has been determined for each specified processor or processor core (K0-K3), and f) sending (39) data packets (20a, 20b) via the ports determined for the specified processors or processor cores (K0-K3).
2. Method according to claim 1, characterised in that the data source is a camera (10).
3. Method according to claim 1 or 2, characterised in that a list of processors or processor cores (K0-K3) is read from the RSS indirection table (25) of the computing device (11) and is provided (33) to a user via a user interface in step a for specifying the at least one processor or processor core (K0-K3).
4. Method according to one of claims 1 to 3, characterised in that the port is selected (35) by selecting a port with a specified port number in a first execution of step b and by increasing the port number by one with each repetition of step b.
5. Method according to one of claims 1 to 4, characterised in that when generating (36) the data set in step c, a hash value (23) is generated and some bits (24) of the hash value (23) are used to select an entry in the RSS indirection table (25) of the computing device (11).
6. Method according to one of claims 1 to 5, characterised in that the processor or processor core (K0-K3) is determined (37) in step d by reading the RSS indirection table (25) of the computing device (11).
7. Method according to one of claims 1 to 6, characterised in that during the sending (39) in step f, if a plurality of ports have been determined for a specified processor or processor core (K0-K3), data packets (20a, 20b) are sent to only one of these ports.
8. Method according to one of claims 1 to 7, characterised in that a plurality of processors or processor cores (K0-K3) are specified and image data packets are sent to one or more first processors or processor cores (K0-K3) and image processing is performed in one or more second processors or processor cores (K0-K3).
9. Method according to one of claims 1 to 7, characterised in that a plurality of processors or processor cores (K0-K3) are specified and, in each case after a predefined switching interval, a change is made from sending (39) to one processor or processor core (K0-K3) to sending (39) to another processor or processor core (K0-K3).
10. Method according to one of claims 1 to 7, characterised in that a plurality of processors or processor cores (K0-K3) are specified and, in the case of a plurality of data streams flowing from the at least one data source to the computing device (11), all data packets (20a, 20b) of a data stream are sent to one processor or processor core (K0-K3) assigned to the data stream in each case.
11. Two computer programs which are designed to jointly perform each step of a method according to one of claims 1 to 10.
12. Machine-readable storage medium on which at least one of the computer programs according to claim 11 is stored.
13. Camera (10) designed, by means of a method according to one of claims 1 to 10, to distribute a network stream to processors or processor cores (K0-K3) of a computing device (11) having a network card supporting the receive side scaling (RSS) function.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Exemplary embodiments of the invention are shown in the drawings and will be explained in more detail in the following description.
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
EXEMPLARY EMBODIMENTS OF THE INVENTION
[0044]
[0045] In a conventional operating mode using RSS, the camera 10 sends data packets 20a to the computing device 11 as shown in
[0046] In an exemplary embodiment of the method according to the invention, the sequence of which is shown in
[0047] As shown in
[0048] As shown in
[0049] When a termination 41 of the method occurs by switching off the camera 10 and the computing device 11, the associations between processor core and UDP ports are deleted and determined again when the method is restarted 30.
[0050] In another exemplary embodiment of the method, it is not intended to distribute different data packets 20a, 20b simultaneously to the two specified processor cores K0, K1. Instead, only data packets 20b that are to be processed by processor core K0 for a specified time interval are sent. For this purpose, they are sent via the UDP port 1001. This is shown in