Multicast routing method based on two-layer network, storage medium and intelligent equipment
By establishing TCP transmission channels in the Layer 2 network and using multicast domain division rules, dynamic multicast routing is realized, which solves the flooding problem of multicast routing in the Layer 2 network and improves network stability and security.
Patent Information
- Application Number
- CN202410942322.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-15
AI Technical Summary
In a Layer 2 network environment, traditional multicast routing methods cannot implement dynamic routing, resulting in waste of bandwidth and network instability.
By establishing a TCP transmission channel between the sender and the receiver, and obtaining the multicast domain according to the preset multicast domain division rules, dynamic routing of multicast data is achieved, avoiding reliance on layer 3 network equipment.
It realizes high-precision and dynamic multicast routing in the second-layer network, solves the flooding problem, saves bandwidth, and improves network stability and security.
Smart Images

Figure CN118784545A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a multicast routing method, storage medium and intelligent device based on a layer 2 network. Background Art
[0002] With the increasing development of advanced driver assistance system functions, the demand for multiple message sending and receiving scenarios between multiple SOCs (System on Chip) has become increasingly prominent. The use of multicast communication is the most traffic and CPU resource-saving solution. However, in a two-layer network, multicast will flood by default, wasting bandwidth, which requires the implementation of multicast routing in the two-layer network. Prior to this, traditional multicast routing methods were all based on three-layer network devices (requiring routers or three-layer switches), which could not be implemented in a two-layer network environment; and the two-layer switch ATU (Address Translation Unit) configuration method only supports filtering IP addresses on ports, which can only achieve static configuration and cannot achieve the effect of dynamic routing.
[0003] Accordingly, the art needs a new multicast routing solution for Layer 2 networks to solve the above problems. Summary of the invention
[0004] In order to overcome the above-mentioned defects, the present application is proposed to solve or at least partially solve the technical problem of how to implement dynamic multicast routing in a layer 2 network without relying on layer 3 network devices.
[0005] In a first aspect, a multicast routing method is provided, the method being applied to a sending end, the sending end and the receiving end both being located in a layer 2 network; the method comprising:
[0006] Acquire receiving end information of a receiving end corresponding to the transmitting end;
[0007] Establishing a TCP transmission channel with the receiving end according to the receiving end information;
[0008] According to a preset multicast domain division rule and the TCP transmission channel, a multicast domain corresponding to the sender and the receiver is obtained; wherein the multicast domain division rule includes a correspondence between different multicast domains and the sender and the receiver; each of the multicast domains corresponds to a sender and at least one receiver;
[0009] The multicast data is sent to the multicast domain through the multicast transmission channel of the sending end, so that the receiving end receives the multicast data.
[0010] In a technical solution of the multicast routing method, before acquiring the receiving end information of the receiving end corresponding to the sending end, the method further includes:
[0011] The network address and port information of the sending end are acquired through the service discovery function of the sending end, and the network address and port information of the sending end are sent to the receiving end corresponding to the sending end.
[0012] In a technical solution of the above multicast routing method, sending multicast data to the multicast domain through the multicast transmission channel of the sending end includes:
[0013] The multicast data is sent to the multicast domain through the multicast transmission channel of the sending end and the port information.
[0014] In a technical solution of the multicast routing method, the step of obtaining a multicast domain corresponding to the sending end and the receiving end according to a preset multicast domain division rule and the TCP transmission channel includes:
[0015] Determine the network addresses of the sending end and the receiving end according to the TCP transmission channel;
[0016] The multicast domain is determined according to the network addresses of the sending end and the receiving end and based on the multicast domain division rule.
[0017] In a technical solution of the above multicast routing method, the method further includes:
[0018] The topology change of the receiving end is acquired through the TCP transmission channel, and in response to the topology change, the multicast domain is updated according to the multicast domain division rule.
[0019] In a technical solution of the multicast routing method, the step of obtaining the receiving end information of the receiving end corresponding to the sending end includes:
[0020] Obtaining the data subject of the sending end;
[0021] According to the data subject, a receiving end having the same data subject as the sending end is determined, and the receiving end information of the receiving end is acquired.
[0022] In a second aspect, a multicast routing method is provided, the method being applied to a receiving end, wherein both the receiving end and the sending end are located in a layer 2 network; the method comprising:
[0023] Acquire the sending end information of the sending end corresponding to the receiving end;
[0024] According to the sending end information, establishing a TCP transmission channel with the sending end;
[0025] According to a preset multicast domain division rule and the TCP transmission channel, at least one multicast domain including the sender and the receiver is obtained; wherein the multicast domain division rule includes a correspondence between different multicast domains and the sender and the receiver; each of the multicast domains corresponds to a sender and at least one receiver;
[0026] The multicast data sent by the sending end is received from one of the multicast domains acquired by the receiving end through the multicast transmission channel of the receiving end.
[0027] In a technical solution of the multicast routing method, before acquiring the sender information of the sender corresponding to the receiving end, the method further includes:
[0028] Obtain the network address and port information of the sending end sent by the sending end.
[0029] In a technical solution of the multicast routing method, receiving the multicast data sent by the sending end from one of the multicast domains obtained by the receiving end through the multicast transmission channel of the receiving end includes:
[0030] The multicast data sent by the sending end is received through the multicast transmission channel of the receiving end and the port information.
[0031] In a technical solution of the multicast routing method, the step of obtaining at least one multicast domain including the sending end and the receiving end according to a preset multicast domain division rule and the TCP transmission channel includes:
[0032] Determine the network addresses of the sending end and the receiving end according to the TCP transmission channel;
[0033] According to the network addresses of the sending end and the receiving end, based on the multicast domain division rule, all multicast domains including the sending end and the receiving end are determined.
[0034] In a technical solution of the above multicast routing method, the method further includes:
[0035] The topology change of the sending end is obtained through the TCP transmission channel, and in response to the topology change, the multicast domain is updated according to the multicast domain division rule.
[0036] In a technical solution of the multicast routing method, the acquiring the sender information of the sender corresponding to the receiving end includes:
[0037] Acquire the data subject of the receiving end;
[0038] According to the data subject, a sender having the same data subject as the receiving end is determined, and the sender information of the sender is obtained.
[0039] In a third aspect, a multicast routing method is provided, the method comprising:
[0040] Obtain a corresponding sending end and receiving end; wherein the sending end and the receiving end are both located in a layer 2 network;
[0041] Establishing a TCP transmission channel between the sending end and the receiving end according to the sending end information of the sending end and the receiving end information of the receiving end;
[0042] The sending end obtains a multicast domain corresponding to the sending end and the receiving end according to a preset multicast domain division rule and the TCP transmission channel; wherein the multicast domain division rule includes a correspondence between different multicast domains and the sending end and the receiving end; each of the multicast domains corresponds to a sending end and at least one receiving end;
[0043] The receiving end acquires at least one multicast domain including the sending end and the receiving end according to the multicast domain division rule and the TCP transmission channel;
[0044] The sending end sends multicast data to the multicast domain obtained by the sending end through the multicast transmission channel of the sending end;
[0045] The receiving end receives the multicast data sent by the sending end from one of the multicast domains acquired by the receiving end through the multicast transmission channel of the receiving end.
[0046] In a fourth aspect, a smart device is provided, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method described in any one of the technical solutions of the above-mentioned multicast routing method is implemented.
[0047] In a fifth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, wherein the program codes are suitable for being loaded and run by a processor to execute the method described in any one of the technical solutions of the above-mentioned multicast routing method.
[0048] Solution 1. A multicast routing method, characterized in that the method is applied to a sending end, and the sending end and the receiving end are both located in a layer 2 network; the method comprises:
[0049] Acquire receiving end information of a receiving end corresponding to the transmitting end;
[0050] Establishing a TCP transmission channel with the receiving end according to the receiving end information;
[0051] According to a preset multicast domain division rule and the TCP transmission channel, a multicast domain corresponding to the sender and the receiver is obtained; wherein the multicast domain division rule includes a correspondence between different multicast domains and the sender and the receiver; each of the multicast domains corresponds to a sender and at least one receiver;
[0052] The multicast data is sent to the multicast domain through the multicast transmission channel of the sending end, so that the receiving end receives the multicast data.
[0053] Solution 2. The multicast routing method according to Solution 1 is characterized in that, before obtaining the receiving end information of the receiving end corresponding to the sending end, the method further includes:
[0054] The network address and port information of the sending end are acquired through the service discovery function of the sending end, and the network address and port information of the sending end are sent to the receiving end corresponding to the sending end.
[0055] Solution 3. The multicast routing method according to Solution 2 is characterized in that:
[0056] The sending of multicast data to the multicast domain through the multicast transmission channel of the sending end includes:
[0057] The multicast data is sent to the multicast domain through the multicast transmission channel of the sending end and the port information.
[0058] Solution 4. The multicast routing method according to Solution 1 is characterized in that:
[0059] The acquiring a multicast domain corresponding to the sending end and the receiving end according to a preset multicast domain division rule and the TCP transmission channel includes:
[0060] Determine the network addresses of the sending end and the receiving end according to the TCP transmission channel;
[0061] The multicast domain is determined according to the network addresses of the sending end and the receiving end and based on the multicast domain division rule.
[0062] Solution 5. The multicast routing method according to Solution 4, characterized in that the method further comprises:
[0063] The topology change of the receiving end is acquired through the TCP transmission channel, and in response to the topology change, the multicast domain is updated according to the multicast domain division rule.
[0064] Solution 6. The multicast routing method according to any one of Solutions 1 to 5, characterized in that:
[0065] The acquiring receiving end information of the receiving end corresponding to the transmitting end includes:
[0066] Obtaining the data subject of the sending end;
[0067] According to the data subject, a receiving end having the same data subject as the sending end is determined, and the receiving end information of the receiving end is acquired.
[0068] Solution 7. A multicast routing method, characterized in that the method is applied to a receiving end, and the receiving end and the sending end are both located in a layer 2 network; the method comprises:
[0069] Acquire the sending end information of the sending end corresponding to the receiving end;
[0070] According to the sending end information, establishing a TCP transmission channel with the sending end;
[0071] According to a preset multicast domain division rule and the TCP transmission channel, at least one multicast domain including the sender and the receiver is obtained; wherein the multicast domain division rule includes a correspondence between different multicast domains and the sender and the receiver; each of the multicast domains corresponds to a sender and at least one receiver;
[0072] The multicast data sent by the sending end is received from one of the multicast domains acquired by the receiving end through the multicast transmission channel of the receiving end.
[0073] Solution 8. The multicast routing method according to Solution 7 is characterized in that before obtaining the sender information of the sender corresponding to the receiving end, the method further includes:
[0074] Obtain the network address and port information of the sending end sent by the sending end.
[0075] Solution 9. The multicast routing method according to Solution 8 is characterized in that:
[0076] The receiving, through the multicast transmission channel of the receiving end, one of the multicast domains acquired from the receiving end, the multicast data sent by the sending end comprises:
[0077] The multicast data sent by the sending end is received through the multicast transmission channel of the receiving end and the port information.
[0078] Solution 10. The multicast routing method according to Solution 9 is characterized in that:
[0079] The acquiring, according to the preset multicast domain division rule and the TCP transmission channel, at least one multicast domain including the sending end and the receiving end comprises:
[0080] Determine the network addresses of the sending end and the receiving end according to the TCP transmission channel;
[0081] According to the network addresses of the sending end and the receiving end, based on the multicast domain division rule, all multicast domains including the sending end and the receiving end are determined.
[0082] Solution 11. The multicast routing method according to Solution 10, characterized in that the method further comprises:
[0083] The topology change of the sending end is obtained through the TCP transmission channel, and in response to the topology change, the multicast domain is updated according to the multicast domain division rule.
[0084] Solution 12. The multicast routing method according to any one of Solutions 7 to 11, characterized in that:
[0085] The acquiring the sending end information of the sending end corresponding to the receiving end includes:
[0086] Acquire the data subject of the receiving end;
[0087] According to the data subject, a sender having the same data subject as the receiving end is determined, and the sender information of the sender is obtained.
[0088] Solution 13. A multicast routing method, characterized in that the method comprises:
[0089] Obtain a corresponding sending end and receiving end; wherein the sending end and the receiving end are both located in a layer 2 network;
[0090] Establishing a TCP transmission channel between the sending end and the receiving end according to the sending end information of the sending end and the receiving end information of the receiving end;
[0091] The sending end obtains a multicast domain corresponding to the sending end and the receiving end according to a preset multicast domain division rule and the TCP transmission channel; wherein the multicast domain division rule includes a correspondence between different multicast domains and the sending end and the receiving end; each of the multicast domains corresponds to a sending end and at least one receiving end;
[0092] The receiving end acquires at least one multicast domain including the sending end and the receiving end according to the multicast domain division rule and the TCP transmission channel;
[0093] The sending end sends multicast data to the multicast domain obtained by the sending end through the multicast transmission channel of the sending end;
[0094] The receiving end receives the multicast data sent by the sending end from one of the multicast domains acquired by the receiving end through the multicast transmission channel of the receiving end.
[0095] Solution 14. A smart device, comprising:
[0096] at least one processor;
[0097] and, a memory communicatively coupled to the at least one processor;
[0098] The memory stores a computer program, and when the computer program is executed by the at least one processor, the multicast routing method described in any one of Schemes 1 to 13 is implemented.
[0099] Solution 15. A computer-readable storage medium storing a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the multicast routing method described in any one of Solutions 1 to 13.
[0100] The above one or more technical solutions of the present application have at least one or more of the following beneficial effects:
[0101] In implementing the technical solution of the multicast routing method provided by the present application, the present application obtains a sender and a receiver located in the second layer network, and establishes a TCP transmission channel between the sender and the receiver according to the sender information and the receiver information; the sender obtains a multicast domain corresponding to the sender and the receiver according to the multicast domain division rule and the TCP transmission channel; the receiver obtains at least one multicast domain including the sender and the receiver according to the multicast division rule and the TCP transmission channel; the sender sends multicast data to the multicast domain obtained by the sender through the multicast transmission channel of the sender; the receiver receives the multicast data sent by the sender from one of the multicast domains obtained by the receiver through the multicast transmission channel of the receiver. Through the above configuration method, the present application realizes the sending and receiving relationship of exhaustive multicast routing through the multicast domain division rule, and the multicast domain division process is simpler and has a lower configuration cost. Obtaining the multicast domain through the TCP transmission channel and the multicast domain division rule can enable multicast routing to realize the function of service discovery, achieve higher accuracy than traditional multicast routing, and achieve higher dynamics of multicast routing. In addition, both the sender and the receiver are located in the Layer 2 network, so the routing of multicast data in the Layer 2 network can be realized without relying on Layer 3 network devices. At the same time, since the sender only sends multicast data to one multicast domain, it can effectively solve the flooding problem of Layer 2 network multicast, save network bandwidth, and improve network stability and security. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] The disclosure of the present application will become easier to understand with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. Among them:
[0103] Figure 1 It is a schematic flow chart of main steps of a multicast routing method according to an embodiment of the present application;
[0104] Figure 2 It is a simplified schematic diagram of the network topology connection relationship between four SOCs according to one implementation of an embodiment of the present application;
[0105] Figure 3 It is a schematic diagram of the main steps of establishing a connection and communication between a sending end and a receiving end according to an implementation method of an embodiment of the present application;
[0106] Figure 4 is a schematic diagram of a multicast domain selection process according to an example of an embodiment of the present application;
[0107] Figure 5 It is a schematic diagram of the main structure of a smart device according to an embodiment of the present application.
[0108] Reference numerals:
[0109] 11: memory; 12: processor; 21: transmitter; 22: receiver. DETAILED DESCRIPTION
[0110] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.
[0111] In the description of the present application, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program code, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B or A and B. The singular terms "one" and "the" may also include plural forms.
[0112] The relevant user personal information that may be involved in the various embodiments of this application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, based on the reasonable purposes of business scenarios, to process the personal information that users actively provide during the use of products / services or generated due to the use of products / services, as well as the personal information obtained with the user's authorization.
[0113] The user personal information processed by this application will vary depending on the specific product / service scenario, and shall be based on the specific scenario in which the user uses the product / service, and may involve the user's account information, device information, driving information, vehicle information or other related information. This application will treat the user's personal information and its processing with a high degree of diligence.
[0114] This application attaches great importance to the security of user personal information and has taken reasonable and feasible security protection measures that meet industry standards to protect user information and prevent personal information from being accessed, disclosed, used, modified, damaged or lost without authorization.
[0115] Here we first explain some terms involved in this application.
[0116] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
[0117] User Datagram Protocol (UDP) provides a method for applications to send encapsulated IP data packets without establishing a connection. UDP transmission includes three transmission modes: unicast, broadcast and multicast.
[0118] Among them, multicast is a one-to-one communication mode, and only the receiving ends added to the same group can receive all the data in the group.
[0119] A multicast domain is a region that defines the scope of a multicast network. Only resources within the multicast domain can send and receive multicast data. Resources outside the multicast domain cannot send and receive multicast data.
[0120] Layer 2 switches work at the second layer (data link layer) of the OSI model, so they are called layer 2 switches. The development of layer 2 switching technology has been relatively mature. Layer 2 switches belong to data link layer devices and can identify MAC (Media Access Control) address information in data frames, forward according to MAC addresses, and record these MAC addresses and corresponding ports in an internal address table.
[0121] Layer 2 network mainly refers to the network that operates at the data link layer in the OSI (Open System Interconnection) model. This layer is mainly responsible for encapsulating data into frames and transmitting them on the physical network.
[0122] Flooding: It can be understood as blind forwarding by the switch, which means that the switch does not know which port to forward the data frame from, and can only forward it through other interfaces except the interface that enters the switch.
[0123] Data topics are the fundamental means of interaction between publisher and subscriber applications. Each data topic has a unique name in the domain and a data type it publishes. When publishing a data type, the publishing process always specifies a topic. Subscribers can request data through data topics.
[0124] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of a multicast routing method according to an embodiment of the present application. Figure 1 As shown, the multicast routing method in the embodiment of the present application mainly includes the following steps S101 to S106.
[0125] Step S101: Obtain a corresponding sending end and receiving end; wherein the sending end and the receiving end are both located in a layer 2 network.
[0126] In this embodiment, the corresponding sending end and receiving end can be obtained, and both the sending end and the receiving end are in the layer 2 network.
[0127] Among them, the sending end and the receiving end can be various processors with data processing functions, such as CPU (Central Processing Unit), GPU (Graphics Processing Unit), NPU (Network Processing Unit), DPU (Data Processing Unit), SOC, etc.
[0128] In one embodiment, please refer to the attached Figure 2 , Figure 2 FIG. 1 is a simplified schematic diagram of the network topology connection relationship between four SOCs according to an implementation of an embodiment of the present application. Figure 2 As shown, the transmitting end and the receiving end can be different SOCs (System of Chip, system-level chip), Figure 2 The figure shows that four SOCs are connected through a switch, which is a typical LAN topology located in a layer 2 network.
[0129] In one implementation, the corresponding sender and receiver can be determined based on the data topics of the sender and receiver, that is, the sender and receiver with the same data topic are the corresponding sender and receiver.
[0130] In one embodiment, please refer to the attached Figure 3 , Figure 3 FIG. 1 is a flow chart of the main steps for establishing a connection and communication between a transmitting end and a receiving end according to an implementation method of an embodiment of the present application. Figure 3 As shown, for the case where both the sending end 21 and the receiving end 22 are SOCs, there may be multiple MulticastPubs (multicast publishing programs) and MulticastSubs (multicast subscription programs) on each SOC, which subscribe to and publish different data topics. Each MulticastPub and MulticastSub includes three modules:
[0131] 1. MulticastChannel (multicast transmission channel): used for sending and receiving multicast data between MulticastPub and MulticastSub.
[0132] 2. TCPChannel (TCP transmission channel) establishment module: used to establish a TCP transmission channel to maintain the connection relationship between MulticastPub and MulticastSub through the TCP transmission channel and sense the online and offline status of the other end.
[0133] 3. MulticastIpSelector: It is used to select the appropriate multicast IP address, that is, the multicast domain, to provide the multicast target IP to MulticastPub and the multicast source IP to MulticastSub.
[0134] Step S102: establishing a TCP transmission channel between the sending end and the receiving end according to the sending end information of the sending end and the receiving end information of the receiving end.
[0135] In this embodiment, a TCP transmission channel between the sender and the receiver may be established based on the sender information and the receiver information.
[0136] In one embodiment, the sender information may include the network address and port information of the sender. The network address and port information of the sender can be obtained through the service discovery function of the sender, and the network address and port information of the sender can be sent to the receiving end corresponding to the sender.
[0137] For details, please refer to the attached Figure 3 , when the MulticastPub in the sending end SOC1 goes online, the IP and port information (i.e., network address and port information) can be registered with the Discovery module. The Disvovery module sends the network address and port information of the MulticastPub with the same Topic name to the corresponding MulticastSub. Among them, the Discovery module implements the service discovery function. The service discovery function can be deployed at the sending end, that is, SOC1; it can also be deployed at both the sending end and the receiving end, that is, SOC1 and SOC2. Among them, the network address and port information are both the network address and port information that the TCPChannel establishment module listens to (listen), and the port information is also the target port for the multicast transmission channel of the sending end to send multicast data, or the target port for the multicast transmission channel of the receiving end to receive multicast data.
[0138] In one embodiment, continue to refer to the attached Figure 2 , MulticastSub can establish a connection with the receiver through the TCPChannel establishment module according to the network address and port information sent by the sender, that is, establish a TCP transmission channel between the sender and the receiver. The connection relationship between the sender and the receiver can be maintained through the TCP transmission channel. At the same time, the sender and the receiver can perceive the topology changes of the other end through the TCP transmission channel, such as the offline of the other end or the connection update, so as to ensure the dynamic switching of the multicast domain and realize dynamic multicast routing.
[0139] Step S103: The sender obtains a multicast domain corresponding to the sender and the receiver according to a preset multicast domain division rule and a TCP transmission channel; wherein the preset multicast domain division rule includes a correspondence between different multicast domains and the sender and the receiver; each multicast domain corresponds to a sender and at least one receiver.
[0140] In this embodiment, the sender can obtain a multicast domain corresponding to the sender and the receiver based on the multicast domain division rule and the TCP transmission channel. Specifically, the sender can perceive the network addresses (IP) of the local end and the opposite end according to the TCP transmission channel. The network address of the local end determines itself as the sender; the network address of the opposite end determines the corresponding receiver. The multicast domain division rule can be queried based on the network addresses of the sender and the receiver, thereby determining a multicast domain corresponding to the sender and the receiver.
[0141] Step S104: The receiving end obtains at least one multicast domain including the sending end and the receiving end according to the multicast domain division rule and the TCP transmission channel.
[0142] In this embodiment, the receiving end can obtain all multicast domains including the sending end and the receiving end according to the multicast division rule and the TCP transmission channel. Specifically, the receiving end can perceive the network addresses (IP) of the local end and the opposite end according to the TCP transmission channel. Since the current receiving end does not know whether there are other receiving ends corresponding to the sending end, it is necessary to obtain all multicast domains including the sending end and the receiving end.
[0143] In one embodiment, continue to refer to the attached Figure 3 , the multicast domain can be obtained through the MulticastIPselector module of the sender and the receiver. The sender (MulticastPub) can send multicast data to the IP and Port of the corresponding multicast domain through the MulticastChannel (multicast transmission channel).
[0144] In one implementation, you can refer to Table 1, which is a table of multicast domain division rules. Taking the sender and the receiver as SOC1-SOC4 as an example, the multicast network IP can be divided based on the sending and receiving data flow of the multicast data. It can be seen from Table 1 that except for the first multicast domain 239.255.0.1, which reserves the flooding between the four SOCs, the other multicast domains all represent the sending and receiving relationship between a sender and one or more receivers, that is, which SOC sends to which or which SOCs. The ATU (Address Translation Unit) address filtering rules of the switch can be generated according to the multicast domain division rules, so as to achieve the purpose of forwarding the multicast data of the sender to the receiver. For example, multicast data with a multicast domain address of 239.255.0.2 can only be forwarded to SOC2, and any other ports cannot be forwarded. Among them, the first multicast domain is set to realize functions such as service discovery and testing.
[0145] Similar to the above method, 2 SOCs, 3 SOCs or even more SOCs can use a similar exhaustive method to specify the appropriate multicast domain for ATU configuration. Theoretically, the number of multicast domains between N SOCs is 1+N*(2 N-1 -1). This configuration process can more easily and conveniently realize the division of multicast domains, which is actually to exhaust all the sending and receiving relationships, and is easier to understand. At the same time, since the hardware models and network topologies of the sender and the receiver are generally difficult to modify once they are determined, the multicast domain division rules can be used to configure the switch address filtering rules at one time according to the hardware topology relationship between the sender and the receiver, which can be compatible with all upper-layer software changes and has a lower configuration cost.
[0146] Table 1 Multicast domain division rules Multicast Domain Sending Side Receiver 239.255.0.1 SOC1-SOC4 SOC1-SOC4 239.255.0.2 SOC1 SOC2 239.255.0.3 SOC1 SOC3 239.255.0.4 SOC1 SOC4 239.255.0.5 SOC1 SOC2, SOC3 239.255.0.6 SOC1 SOC2, SOC4 239.255.0.7 SOC1 SOC3, SOC4 239.255.0.8 SOC1 SOC2, SOC3, SOC4 239.255.0.9 SOC2 SOC1 239.255.0.10 SOC2 SOC3 239.255.0.11 SOC2 SOC4 239.255.0.12 SOC2 SOC1, SOC3 239.255.0.13 SOC2 SOC1, SOC4 239.255.0.14 SOC2 SOC3, SOC4 239.255.0.15 SOC2 SOC1, SOC3, SOC4 239.255.0.16 SOC3 SOC1 239.255.0.17 SOC3 SOC2 239.255.0.18 SOC3 SOC4 239.255.0.19 SOC3 SOC1, SOC2 239.255.0.20 SOC3 SOC1, SOC4 239.255.0.21 SOC3 SOC2, SOC4 239.255.0.22 SOC3 SOC1, SOC2, SOC4 239.255.0.23 SOC4 SOC1 239.255.0.24 SOC4 SOC2 239.255.0.25 SOC4 SOC3 239.255.0.26 SOC4 SOC1, SOC2 239.255.0.27 SOC4 SOC1, SOC3 239.255.0.28 SOC4 SOC2, SOC3 239.255.0.29 SOC4 SOC1, SOC2, SOC3
[0147] Step S105: the sender sends the multicast data to the multicast domain acquired by the sender through the multicast transmission channel of the sender.
[0148] In this embodiment, after the sending end obtains the multicast domain, the multicast transmission channel can send multicast data to the multicast domain.
[0149] In one implementation, the sender can reuse the port information of the sender to send multicast data to the multicast domain. That is, the port information requested by the sender to the service discovery function can also be used for multicast data transmission of the multicast transmission channel, without the need to separately register and manage port information (Port) for the multicast transmission channel. At the same time, since the port information is the port information monitored by the TCP transmission channel generation module, this port information is randomly assigned by the service discovery function, which can ensure that the assigned port information will not be repeated with the port information monitored by other TCP transmission channel generation modules, and can also effectively avoid the problem of possible duplication of multicast ports.
[0150] Step S106: The receiving end receives the multicast data sent by the sending end from one of the multicast domains obtained by the receiving end through the multicast transmission channel of the receiving end.
[0151] In this embodiment, the receiving end may receive the multicast data sent by the sending end from one of the multicast domains obtained by the receiving end through the multicast transmission channel.
[0152] In one implementation, similar to the sending end, the receiving end may also reuse the port information registered for the sending end by the service discovery function, and receive the multicast data sent by the sending end according to the multicast transmission channel and the port information.
[0153] Based on the method described in steps S101 to S106 above, the embodiment of the present application obtains the sender and the receiver located in the layer 2 network, and establishes a TCP transmission channel between the sender and the receiver according to the sender information and the receiver information; the sender obtains a multicast domain corresponding to the sender and the receiver according to the multicast domain division rule and the TCP transmission channel; the receiver obtains at least one multicast domain including the sender and the receiver according to the multicast division rule and the TCP transmission channel; the sender sends multicast data to the multicast domain obtained by the sender through the multicast transmission channel of the sender; the receiver receives the multicast data sent by the sender from one of the multicast domains obtained by the receiver through the multicast transmission channel of the receiver. Through the above configuration method, the embodiment of the present application realizes the sending and receiving relationship of exhaustive multicast routing through the multicast domain division rule, and the multicast domain division process is simpler and has a lower configuration cost. Obtaining the multicast domain through the TCP transmission channel and the multicast domain division rule can enable multicast routing to realize the function of service discovery, achieve higher accuracy than traditional multicast routing, and achieve higher dynamics of multicast routing. In addition, both the sender and the receiver are located in the Layer 2 network, so the routing of multicast data in the Layer 2 network can be realized without relying on Layer 3 network devices. At the same time, since the sender only sends multicast data to one multicast domain, it can effectively solve the flooding problem of Layer 2 network multicast, save network bandwidth, and improve network stability and security.
[0154] For an example, see the attached Figure 4, Figure 4 is a schematic diagram of a multicast domain selection process according to an example of an embodiment of the present application, based on Figure 2 The network topology connection relationship between the four SOCs in Table 1 and the multicast domain division rules in Table 1 are used to illustrate the multicast routing method of the present application by taking SOC1 as the sending end 21 and SOC2 and SOC3 as the receiving ends 22 as examples.
[0155] like Figure 4 As shown in the figure, there is a MulticastPub (multicast publishing program) in SOC1, a MulticastSub (multicast subscription program) on SOC2, and two MulticastSubs on SOC3. In this case, SOC1 senses the IP (network address) of the other end through TCPChannel (TCP transmission channel) and determines that the receiving end of the multicast data is SOC2 and SOC3. The MulticastIPSelector module can find the corresponding multicast domain as 239.255.0.5 from the multicast domain division rules in Table 1, which represents SOC1 sending and SOC2 and SOC3 receiving. The port used for multicast is the port of the local end of TCPChannel.
[0156] MulticastSub on SOC2 can sense the IP of the peer SOC1 and its own SOC2 through TCPChannel. Since it cannot sense whether other SOCs accept it, it will join multiple multicast domains that meet the conditions (i.e., SOC1 sends, SOC2 receives, and other SOCs can also receive), namely 239.255.0.2, 239.255.0.5, 239.255.0.6, and 239.255.0.8. Similarly, SOC3 can also sense the IP of the peer SOC1 and its own SOC3 through TCPChannel, and join 239.255.0.3, 239.255.0.5, 239.255.0.7, and 239.255.0.8. The multicast port is the port of the peer end of the TCPChannel.
[0157] In this way, SOC1's MulticastPub sends multicast data to 239.255.0.5 through MulticastChannel. SOC2 and SOC3's MulticastSub will subscribe to this multicast IP and use the same Port. Therefore, MulticastSub can receive multicast data. When SOC2's subscription program goes offline, SOC1's publishing program will immediately sense it, and MulticastIPSelector will immediately switch to 239.255.0.3 (representing SOC1 sending and SOC3 receiving). At this time, SOC3 can still receive the message because it is still in the multicast domain of 239.255.0.3 and will not be affected by SOC2's Sub going offline.
[0158] An example of an application scenario according to an embodiment of the present application is an autonomous driving application scenario. In an autonomous driving application scenario, there are usually only a few SOCs, but the number of Topics often reaches hundreds. If each Topic is configured with a multicast IP, a large number of multicast addresses will be occupied and maintenance will be very difficult. However, SOC has powerful hardware resources, which provides unique conditions for the multicast routing method.
[0159] According to the multicast routing method embodiment of the present application, based on Figure 2 The four SOCs shown publish and subscribe to the same Topic. No matter how the number of Pub (Publisher) and Sub (Subscriber) in the SOC is changed, the multicast routing can ensure that the correct multicast domain IP is selected within milliseconds to ensure the normal sending and receiving of multicast data.
[0160] The multicast routing method embodiment of the present application was applied and tested in a HIL simulation environment. The network communications of TCP and the solution of the embodiment of the present application were compared. Under the same test scenario, the embodiment of the present application can significantly reduce cross-board traffic. The average sending traffic of the four SOCs decreased by 2.6MB / s, and the average receiving traffic decreased by 1.4MB / s. Among them, in the nop (Navigate onPilot, navigation assistance function) mode, the sending traffic optimization of S1 was the most obvious, with a direct decrease of 9.6MB / S.
[0161] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These adjusted schemes are equivalent to the technical schemes described in this application, and therefore will also fall within the scope of protection of this application.
[0162] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above-mentioned embodiment of the present application can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.
[0163] Another aspect of the present application also provides a computer-readable storage medium.
[0164] In an embodiment of a computer-readable storage medium according to the present application, the computer-readable storage medium may be configured to store a program for executing the multicast routing method of the above method embodiment, and the program may be loaded and run by a processor to implement the above multicast routing method. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium may be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.
[0165] Another aspect of the present application also provides a smart device.
[0166] In an embodiment of an intelligent device according to the present application, the intelligent device may include at least one processor; and a memory connected to the at least one processor in communication; wherein a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method described in any of the above embodiments is implemented. The intelligent device described in the present application may include a driving device, a smart car, a robot, and the like. Figure 5 , Figure 5 FIG. 4 exemplarily shows that the memory 11 and the processor 12 are communicatively connected via a bus.
[0167] In some embodiments of the present application, the smart device may further include at least one sensor for sensing information. The sensor is communicatively connected to any type of processor mentioned in the present application. Optionally, the smart device may further include an autonomous driving system for guiding the smart device to drive itself or assist in driving. The processor communicates with the sensor and / or the autonomous driving system to complete the method described in any of the above embodiments.
[0168] So far, the technical solution of the present application has been described in conjunction with an embodiment shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.
Claims
1. A multicast routing method, characterized in that: The method is applied to a sending end, where both the sending end and the receiving end are located in a layer 2 network; the method comprises: Acquire receiving end information of a receiving end corresponding to the transmitting end; Establishing a TCP transmission channel with the receiving end according to the receiving end information; According to a preset multicast domain division rule and the TCP transmission channel, a multicast domain corresponding to the sender and the receiver is obtained; wherein the multicast domain division rule includes a correspondence between different multicast domains and the sender and the receiver; each of the multicast domains corresponds to a sender and at least one receiver; The multicast data is sent to the multicast domain through the multicast transmission channel of the sending end, so that the receiving end receives the multicast data.
2. The multicast routing method according to claim 1, characterized in that: Before acquiring the receiving end information of the receiving end corresponding to the transmitting end, the method further includes: The network address and port information of the sending end are acquired through the service discovery function of the sending end, and the network address and port information of the sending end are sent to the receiving end corresponding to the sending end.
3. The multicast routing method according to claim 2, characterized in that: The sending of multicast data to the multicast domain through the multicast transmission channel of the sending end includes: The multicast data is sent to the multicast domain through the multicast transmission channel of the sending end and the port information.
4. The multicast routing method according to claim 1, characterized in that: The acquiring a multicast domain corresponding to the sending end and the receiving end according to a preset multicast domain division rule and the TCP transmission channel includes: Determine the network addresses of the sending end and the receiving end according to the TCP transmission channel; The multicast domain is determined according to the network addresses of the sending end and the receiving end and based on the multicast domain division rule.
5. The multicast routing method according to claim 4, characterized in that: The method further comprises: The topology change of the receiving end is acquired through the TCP transmission channel, and in response to the topology change, the multicast domain is updated according to the multicast domain division rule.
6. The multicast routing method according to any one of claims 1 to 5, characterized in that: The acquiring receiving end information of the receiving end corresponding to the transmitting end includes: Obtaining the data subject of the sending end; According to the data subject, a receiving end having the same data subject as the sending end is determined, and the receiving end information of the receiving end is acquired.
7. A multicast routing method, characterized in that: The method is applied to a receiving end, where both the receiving end and the sending end are located in a layer 2 network; the method comprises: Acquire the sending end information of the sending end corresponding to the receiving end; According to the sending end information, establishing a TCP transmission channel with the sending end; According to a preset multicast domain division rule and the TCP transmission channel, at least one multicast domain including the sender and the receiver is obtained; wherein the multicast domain division rule includes a correspondence between different multicast domains and the sender and the receiver; each of the multicast domains corresponds to a sender and at least one receiver; The multicast data sent by the sending end is received from one of the multicast domains acquired by the receiving end through the multicast transmission channel of the receiving end.
8. The multicast routing method according to claim 7, characterized in that: Before acquiring the sending end information of the sending end corresponding to the receiving end, the method further includes: Obtain the network address and port information of the sending end sent by the sending end.
9. The multicast routing method according to claim 8, characterized in that: The receiving, through the multicast transmission channel of the receiving end, one of the multicast domains acquired from the receiving end, the multicast data sent by the sending end comprises: The multicast data sent by the sending end is received through the multicast transmission channel of the receiving end and the port information.
10. The multicast routing method according to claim 9, characterized in that: The acquiring, according to the preset multicast domain division rule and the TCP transmission channel, at least one multicast domain including the sending end and the receiving end comprises: Determine the network addresses of the sending end and the receiving end according to the TCP transmission channel; According to the network addresses of the sending end and the receiving end, based on the multicast domain division rule, all multicast domains including the sending end and the receiving end are determined.
