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] FIG. 1 shows a camera and a computing device that can be used in exemplary embodiments of the method according to the invention.

    [0034] FIG. 2 schematically shows a pseudo-randomly distributed network stream in a prior art method.

    [0035] FIG. 3 shows a flow chart of a method according to an exemplary embodiment of the invention.

    [0036] FIG. 4 schematically shows a step of a method according to an exemplary embodiment of the invention.

    [0037] FIG. 5 schematically shows a further step of a method according to an exemplary embodiment of the invention.

    [0038] FIG. 6 schematically shows yet a further step of a method according to an exemplary embodiment of the invention.

    [0039] FIG. 7 schematically shows yet a further step of a method according to an exemplary embodiment of the invention.

    [0040] FIG. 8 schematically shows yet a further step of a method according to an exemplary embodiment of the invention.

    [0041] FIG. 9 shows a deterministic distribution of a plurality of network streams in an exemplary embodiment of the method according to the invention.

    [0042] FIG. 10 shows a deterministic distribution of a network stream in an exemplary embodiment of the method according to the invention.

    [0043] FIG. 11 shows another deterministic distribution of a network stream in an exemplary embodiment of the method according to the invention.

    EXEMPLARY EMBODIMENTS OF THE INVENTION

    [0044] FIG. 1 shows a data source, which in the present exemplary embodiment is a GigE Vision® industrial camera 10 of the type mvBlue COUGAR-XT with a data transmission rate of 10 gigabits per second. It is controlled by a computing device 11 running the software package mvIMPACT Acquire. The camera 10 is connected to the computing device 11 by means of a data connection 12 in the form of an Ethernet cable.

    [0045] In a conventional operating mode using RSS, the camera 10 sends data packets 20a to the computing device 11 as shown in FIG. 2. Using their source IP address and source port, these are subjected to a hash function 21, which uses a hash key 22. The hash key 22 is read from a driver of a network card of the computing device 11. This generates a hash value 23 which, in addition to the hash key 22, the source IP address and the source port, also includes the destination IP address and the destination port of the computing device 11. The LSB bits 24 of the hash value 23 are used as an index in an RSS indirection table 25 to allocate the entire data packet 20a to a processor core of the computing device 11. In the present exemplary embodiment, the computing device 11 has four processor cores K0-K3. All data packets 20a sent from the camera 10 to the computing device 11 are sent from the same source IP address and the same source port to the same destination IP address and the same destination port, and therefore have the same hash value 23. They are therefore all forwarded to the same processor core. In the present example, this is processor core K3.

    [0046] In an exemplary embodiment of the method according to the invention, the sequence of which is shown in FIG. 3, a deterministic assignment of different data packets to different processor cores K0-K3 is made possible. After the start 30 of the method, a check 31 is first carried out to determine whether the firmware of the camera 10 is set up for the method according to the invention. For this purpose, a question is sent from the computing device 11 to the camera 10. Subsequently, a further check 32 is carried out as to whether the RSS indirection table 25 can be read out from the network card of the computing device 11. This only works if the network card supports RSS and RSS is activated on the network card. If one of the conditions checked in the two tests 31, 32 is not fulfilled, the method is aborted 40 and a message is displayed on a user interface of the computing device 11, indicating that the method according to the invention cannot be performed. The camera 10 is then operated by means of a conventional method. Otherwise, a list of processor cores K0-K3 is read from the RSS indirection table 25 and a user is prompted via the user interface to select 33 at least one of the processor cores K0-K3. In another exemplary embodiment of the invention, this selection is performed automatically by a computer program. After the user has specified 34 at least one processor or processor core K0-K3 by his selection, a first UDP port of the camera 10 is selected 35. In the present exemplary embodiment, this is the UDP port 1000, wherein the source IP address is for example 192.168.0.1. A data set 20 assigned to the selected UDP port is then generated 36 in the computing device 11.

    [0047] As shown in FIG. 4, the data set 20 is subjected in the known manner to the hash function 21, which uses the hash key 22 to generate the hash value 23. Its LSB bits 24 are used to select an entry in the RSS indirection table 25. The entry specifies the processor core that would process a data packet with the previously selected source and the previously selected destination. When sending a data packet via the UDP port 1000, the processor core K3 would be addressed. For example, if the user selected processor cores K0 and K1, this will not match a selected processor core. If a check 38 shows that a matching UDP port could not yet be determined for each selected processor core, a next UDP port of the camera 10 is then selected 35. For this purpose, the port number is increased by 1, so that the UDP port 1001 is used in the following. As shown in FIG. 5, this results in a data set 20 being assigned to processor core K0 and thus to one of the two selected processor cores. This means that a UDP port is now known for one but not yet for both of the selected processor cores. The method is therefore continued. The UDP port number is again increased by one to 1002. As shown in FIG. 6, this leads to the addressing of the processor core K2, which, however, has not been selected. The use of the next UDP port 1003, as shown in FIG. 7, leads to the re-addressing of processor core K0. Since a UDP port matching the processor core K0 has already been determined, this further matching UDP port number is discarded. FIG. 8 shows that setting the UDP port number to 1004 again now leads to addressing of the second selected processor core K1. The next check 38 thus shows that a UDP port number could be assigned to each selected processor core, whereupon a sending 39 of data packets via the UDP ports of the specified processor cores K0 and K1 could be started.

    [0048] As shown in FIG. 9, for example data packets 20a sent via UDP port 1004 can now be forwarded to processor core K1, and data packets 20b sent via UDP port 1001 can be forwarded to processor core K0.

    [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 FIG. 10. After the time interval has expired, the further data packets 20a are to be processed on the processor core K1. For this purpose, they are sent via the UDP port 1004. This is shown in FIG. 11. After the time interval has elapsed again, it is possible to return to data processing in the processor core K0 by changing the UDP port used from 1004 to 1001 again.