A forward and reverse message tracing method and related equipment for container network on cloud
By using dyed marks to trigger forward and reverse message tracking in the container network, the problem of reverse message cannot be tracked independently in the container network is solved, and efficient message tracking and full-link analysis are achieved.
Patent Information
- Application Number
- CN202411535589.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-31
AI Technical Summary
In the container network scenario, reverse messages cannot be tracked independently, resulting in low packet tracking efficiency and the traditional network message tracking solution cannot be directly applied.
When the host of the container network receives a forward message, it is determined whether the dyeing mark is carried. If it is carried, the forward message tracking is performed and the reverse message tracking rules are generated, and the reverse message tracking rules are matched and tracked, and the reverse message is stained.
It realizes automatic synchronous tracking of forward and reverse packets in the container network, reduces the performance overhead of message tracking, and supports end-to-end full-link analysis.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of communication technology, and in particular to a forward and reverse message tracing method and related devices for a container network on a cloud. Background Art
[0002] With the widespread application of container network technology, the usage scenarios of container networks are increasing, and along with it comes the problem of container network failure. Therefore, how to efficiently troubleshoot container network problems is one of the key directions of container network technology.
[0003] A common solution is to directly apply traditional network packet tracking technology to container network scenarios. However, since container networks consume client host resources and are very sensitive to resource consumption, traditional network packet tracking solutions have too high an overhead and cannot be directly applied to container networks. In addition, traditional network packet tracking solutions are designed for relay nodes, but container networks are the terminal nodes of packets, and the number of packets entering the container network varies. Therefore, they cannot be applied to container network nodes.
[0004] Therefore, providing a forward and reverse message tracing method for container scenarios to reduce message tracing overhead and improve message tracing efficiency is a technical problem that needs to be urgently solved in the development of container networks. Summary of the invention
[0005] The embodiments of the present disclosure provide a forward and reverse message tracing method and related devices for a container network on a cloud, so as to overcome the problems of high message tracing overhead and low message tracing efficiency in a container scenario.
[0006] In a first aspect, an embodiment of the present disclosure provides a forward and reverse message tracing method for a container network on a cloud, including:
[0007] When a host machine of a container network receives a forward message, it is determined whether the forward message carries a coloring mark, and the coloring mark is used to indicate that forward message tracing is performed based on a pre-configured forward message tracing rule and triggers reverse message tracing; when it is determined that the forward message carries a coloring mark, forward message tracing is performed on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it, and a reverse message tracing rule is generated according to the message header information of the forward message, and the reverse message tracing rule is used to match the reverse message to be traced that is related to the forward message; business logic processing is performed on the forward message to generate a corresponding reverse message; when a host machine of a container network receives a reverse message, the reverse message is matched based on the reverse message tracing rule, and when a match is hit, reverse message tracing is performed on the reverse message to generate a reverse message tracing log and report it, and a coloring mark is added to the reverse message.
[0008] In a second aspect, an embodiment of the present disclosure provides a forward and reverse message tracking device for a container network on a cloud, including:
[0009] A first processing module is used to determine whether the forward message carries a coloring mark when the host machine of the container network receives the forward message, and the coloring mark is used to indicate that the forward message tracing is performed based on the pre-configured forward message tracing rule and trigger the reverse message tracing;
[0010] The second processing module is used to perform forward message tracing on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it when it is determined that the forward message carries a dyeing mark, and to generate a reverse message tracing rule according to the message header information of the forward message, wherein the reverse message tracing rule is used to match the reverse message to be traced that is related to the forward message;
[0011] A third processing module, used to perform business logic processing on the forward message to generate a corresponding reverse message;
[0012] The coloring module is used to match the reverse message based on the reverse message tracing rule, perform reverse message tracing on the reverse message when a match is hit, generate a reverse message tracing log and report it, and mark the reverse message with a coloring mark.
[0013] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0014] The memory stores computer-executable instructions;
[0015] The processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the forward and reverse message tracing method for the cloud container network as described in the first aspect and various possible designs of the first aspect.
[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the forward and reverse message tracking method of the cloud container network as described in the first aspect and various possible designs of the first aspect is implemented.
[0017] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the forward and reverse message tracing method for a container network on a cloud as described in the first aspect and various possible designs of the first aspect.
[0018] The present embodiment provides a forward and reverse message tracing method and related equipment for a container network on a cloud. When a host machine of the container network receives a forward message, it is determined whether the forward message carries a coloring mark, and the coloring mark is used to indicate that forward message tracing is performed based on a pre-configured forward message tracing rule and triggers the execution of reverse message tracing; when it is determined that the forward message carries the coloring mark, forward message tracing is performed on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it, and reverse message tracing rules are generated according to message header information of the forward message, and the reverse message tracing rules are used to match reverse messages to be traced that are related to the forward message; business logic processing is performed on the forward message to generate a corresponding reverse message; when the host machine of the container network receives a reverse message, the reverse message is matched based on the reverse message tracing rule, and reverse message tracing is performed on the reverse message to generate a reverse message tracing log and report it when a match is hit, and a coloring mark is added to the reverse message. The container network is triggered to automatically track forward and reverse messages through dyeing technology. After the container network device receives the forward message with the dyeing mark, the reverse tracking rule is automatically determined according to the message header information of the forward message. After the container network device generates a reverse message, the reverse message is identified and dyed based on the reverse tracking rule, thereby realizing the dyeing and tracking of forward and reverse messages at the container network location, solving the problem that reverse messages cannot be tracked independently in the container network scenario in the prior art, realizing automatic synchronous tracking of forward and reverse messages, and reducing the performance overhead of container network message tracking. In addition, the container network message tracking results can reuse the analysis solution of intermediate network element devices, which is conducive to end-to-end full-link analysis and convenient deployment and implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0020] Figure 1 An application scenario diagram of the forward and reverse message tracing method of a container network on a cloud provided by an embodiment of the present disclosure;
[0021] Figure 2 Schematic diagram of the process of the forward and reverse message tracing method of the cloud container network provided by the embodiment of the present disclosure Figure 1 ;
[0022] Figure 3 for Figure 2A schematic diagram of a specific implementation method of step S101 in the illustrated embodiment;
[0023] Figure 4 A schematic diagram of a specific process of generating a reverse message tracing rule provided by an embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of a process for generating a reverse staining message provided in an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of a process for marking a reverse message with a color mark provided in an embodiment of the present disclosure;
[0026] Figure 7 A schematic diagram of a reverse message tracing rule determined based on quintuple information provided in an embodiment of the present disclosure;
[0027] Figure 8 A schematic diagram of the steps of generating a tracking log in a unified target format and reporting it to a cloud network control plane device provided by an embodiment of the present disclosure;
[0028] Fig. 9 A structural block diagram of a forward and reverse message tracing device for a container network on a cloud provided by an embodiment of the present disclosure;
[0029] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0030] Fig.11 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0033] The application scenarios of the embodiments of the present disclosure are explained below:
[0034] Figure 1 This is an application scenario diagram of the forward and reverse message tracing method of the cloud container network provided by the embodiment of the present disclosure. The forward and reverse message tracing method of the cloud container network provided by the embodiment of the present disclosure can be applied to the application scenarios of message tracing and anomaly detection for the container network. The execution subject of this embodiment can be the host machine of the container network.
[0035] Among them, in some embodiments, the above-mentioned electronic device can implement the forward and reverse message tracking method of the cloud container network provided in the embodiment of the present application by running various computer executable instructions or computer programs. For example, the computer executable instructions can be program-level commands, machine instructions or software instructions. The computer program can be a native program or software module in the operating system; it can be a local application, that is, a program that needs to be installed in the operating system to run, or it can be a small program embedded in any APP, that is, a program running based on a browser environment. In summary, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form, and the specific implementation form can be configured as needed. Further, in some embodiments, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud storage, cloud communication, cloud database, cloud computing, cloud functions, network services, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms, wherein the cloud service can be an interactive processing service for terminal devices to call.
[0036] refer to Figure 1 As shown in , the host machine of the container network is used as the execution subject for explanation. In the process of using the container network to process messages in the cloud network, the cloud network includes at least one load balancer and at least one container network corresponding to the load balancer. The container network is the end node deployed by the cloud network and is used to consume network messages transmitted through the cloud network; the load balancer is used to distribute the forward message (request message) to the matching container network to achieve high availability and load balancing; as shown in Figure 1As shown, the load balancer corresponds to container network A_1, container network A_2 and container network A_3, and then the load balancer distributes the forward message to container network A_1, container network A_2 and container network A_3. After that, the container networks A_1, A_2 and A_3 consume the forward message, execute the corresponding business logic, generate the corresponding reverse message (response message) and send the reverse message to the load balancer, and then return to the corresponding message sender to complete the message transmission process. In this process, the message is tracked and based on the message tracking situation (message status), functions such as data packet loss detection and abnormal network device positioning are realized.
[0037] In the prior art, the coloring and tracking scheme for network messages is designed based on cloud network relay nodes, that is, the network device, as an intermediate node on the message transmission path, is only responsible for forwarding forward request messages and reverse messages. Therefore, the number of messages entering the network device and the number of messages leaving the network device should be consistent. Based on this principle, the status detection of the network device as an intermediate node can be achieved; however, for the container network, since the container network is the end node on the message transmission path, it is used to consume forward request messages and generate reverse messages for reverse transmission. Therefore, the number of request messages entering the container network and the number of response messages sent from the container network are not necessarily consistent, and the response message sent by the container network is determined based on the user process of the container network, rather than completely determined by the request message entering the container network, which leads to the problem that it is difficult to color the reverse message at the location of the container network in the prior art, thereby affecting the accuracy of message tracking and abnormal device detection based on reverse colored messages.
[0038] The disclosed embodiments provide a forward and reverse message tracing method for a container network on a cloud to solve the above-mentioned problem.
[0039] refer to Figure 2 , Figure 2 Schematic diagram of the process of the forward and reverse message tracing method of the cloud container network provided by the embodiment of the present disclosure Figure 1 The method of this embodiment can be applied in a container network. The forward and reverse message tracing method of the container network on the cloud includes:
[0040] Step S101: When the host machine of the container network receives a forward message, it is determined whether the forward message carries a coloring mark, where the coloring mark is used to indicate that forward message tracing is performed based on a pre-configured forward message tracing rule and that reverse message tracing is triggered.
[0041] Step S102: When it is determined that the forward message carries a dye mark, forward message tracing is performed on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it, and reverse message tracing rules are generated according to the message header information of the forward message. The reverse message tracing rules are used to match reverse messages to be traced that are related to the forward message. Figure 1 In the application scenario diagram shown in FIG. 1 , the host machine of the container network is used as the execution subject to introduce the forward and reverse message tracing method of the cloud container network provided by the embodiment, wherein the forward message corresponds to Figure 1 The forward message (request message) in the embodiment shown, the reverse message corresponds to Figure 1 Reverse message (response message) in the illustrated embodiment. Exemplarily, the container network is an end node in the cloud network for implementing the target business function. The container network is used, for example, to receive a forward message sent by a load balancer, process the forward message based on the user process, and return the processing result, i.e., the reverse message, to the load balancer located upstream in the data transmission path.
[0042] Specifically, when the host of the container network receives a forward message, it first determines whether the forward message carries a coloring mark. The coloring mark is used to indicate that forward message tracing is performed based on the pre-configured forward message tracing rules and triggers the reverse message tracing. That is, after the container network receives the forward message sent by the load balancer, the forward message is identified. In a possible implementation, Figure 3 for Figure 2 The schematic diagram of the specific implementation method of step S101 in the embodiment shown is as follows: Figure 3 As shown, the specific implementation of step S101 includes:
[0043] Step S1011: When the host machine of the container network receives the forward message, the forward message is parsed and a message header in the forward message is read to determine whether a coloring flag is configured in the message header;
[0044] Step S1012: If a coloring flag is configured in the message header, it is determined that the forward message carries the coloring flag;
[0045] Step S1013: If the coloring flag is not configured in the message header, it is determined that the forward message does not carry the coloring flag.
[0046] Exemplarily, when the host machine of the container network receives a forward message, it parses the forward message and reads the message header in the forward message. If a coloring flag is configured in the message header of the forward message, the forward message is determined to be a forward colored message, that is, it is judged that the forward message carries a coloring flag; if the coloring flag is not configured in the message header, it is judged that the forward message does not carry a coloring flag, that is, the forward message is determined to be a non-colored message.
[0047] Afterwards, after detecting that the forward message is a forward colored message, on the one hand, forward message tracking is performed on the forward message based on the pre-configured forward message tracking rules to generate a forward message tracking log and report it. On the other hand, a reverse message tracking rule is generated according to the message header information of the forward message. The reverse message tracking rule is used to match the reverse message to be tracked related to the forward message. Among them, the content of the message header information includes, for example, the message characteristics of the forward colored message corresponding to the forward colored message, the transmission path of the forward colored message, and the transmission status of the forward colored message at each data transmission node during the transmission process. Afterwards, the container network performs business logic processing on the forward message based on the preset business logic to generate the corresponding reverse message. In another case, when it is determined that the forward message does not carry a coloring identifier, the business logic processing of the forward message is directly executed to generate the corresponding reverse message, which will not be repeated. Furthermore, in a possible implementation, the container network is implemented based on an extended Berkeley Packet Filter (eBPF) program, and a dye detection management function is configured in the logical starting point of the eBPF program in the host of the container network. The dye detection management function is used to detect whether the forward message contains a dye mark, and then determine whether it is a forward dye message. In a possible implementation, the specific implementation steps of determining whether the forward message carries a dye mark include:
[0048] After the container network receives the forward message, the forward message is detected through the logical starting point of the eBPF program to obtain a detection result; according to the detection result, it is determined that the forward message is a forward colored message carrying a coloring identifier.
[0049] Exemplarily, the container network is implemented based on the eBPF program. At the logical starting point of the eBPF program, i.e., the starting point of the eBPF program, a dye detection node with a dye detection management function is arranged at the logical starting point. The dye detection node is used to detect whether the forward message is a forward dyed message. Among them, the eBPF program is a lightweight virtual machine program running in the Linux kernel. It allows users to write custom bytecodes for various data packet processing, kernel probing, performance monitoring and other tasks without modifying the kernel code or loading kernel modules.
[0050] Specifically, in one possible implementation method, the implementation principle of the coloring detection management function is: to detect whether the forward message carries a preset coloring field. If the forward message does not include the preset coloring field, a detection result is generated that the forward message is not a forward colored message. If the forward message includes the preset coloring field, a detection result is generated that the forward message is a forward colored message. That is, based on the detection result generated by the coloring detection node, it is determined whether the forward message is a forward colored message.
[0051] In a possible implementation, by reading the first header field of the forward message, the first header field is determined based on the network protocol applied in the container network; according to the field value of the first header field, a detection result is obtained; and then, based on the detection result, it is determined that the forward message is a forward colored message. Exemplarily, the first header field of the forward message is a field used to transmit message-related information in protocols such as HTTP. The network protocol terminology applied in the container network implements the underlying mechanism for communication between container networks or between the container network and the external network. Furthermore, when the first header field of the forward message is determined based on the network protocol applied in the container network, the corresponding relationship between the forward message and the container network can be obtained; further, the first header field of the forward message is read by the dyeing detection node to obtain the field value of the corresponding first header field, and then the container network compares the field value of the first header field with the preset dyeing identifier to determine whether the field value is the dyeing identifier, thereby obtaining the corresponding detection result, that is, if the field value of the first header field is the same as or matches the dyeing identifier, it indicates that the first header field of the forward message is a dyeing field (that is, the forward message contains a dyeing identifier), so the forward message is determined to be a forward dyeing message, and if the detection result is that the field values of the two are not the same or do not match, it indicates that the first header field of the forward message is not a dyeing field (that is, the forward message does not contain a dyeing identifier), so the forward message is not a forward dyeing message.
[0052] Furthermore, the dyeing detection management function supports dynamic loading and unloading of forward message tracing logic and reverse message tracing logic; wherein, the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing. After the forward message is determined to be a forward dyed message, the disclosed embodiment also includes: judging whether the forward message tracing logic and the reverse message tracing logic have been loaded; wherein, the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing; if loaded, forward message tracing is performed on the forward message based on the forward message tracing rules to generate a forward message tracing log and report it; if not loaded, the forward message tracing logic and the reverse message tracing logic are loaded. Specifically, Figure 4 A schematic diagram of a specific process of generating a reverse message tracing rule provided by an embodiment of the present disclosure, such as Figure 4As shown, the forward message tracing logic is used to perform forward message tracing processing on the forward colored message, and the container network is detected to determine whether the forward message tracing logic is loaded in the container network; if the forward message tracing logic is loaded in the container network, the forward message is processed based on the forward message tracing logic in the container network, and the reverse message tracing rules are generated according to the message header information of the forward message; if the forward message tracing logic is not loaded in the container network, the forward message tracing logic is loaded first, and then the reverse message tracing rules are obtained based on the forward message tracing logic. Similarly, it also includes determining whether the reverse message tracing logic has been loaded. The container network is detected to determine whether the reverse message tracing logic is loaded in the container network; if the reverse message tracing logic is loaded in the container network, after the reverse message is generated, the reverse message is processed based on the reverse message tracing logic and reverse message tracing rules in the container network, and a reverse message tracing log is generated and reported; if the reverse message tracing logic is not loaded in the container network, the reverse message tracing logic is loaded first, and then the reverse message is tracked based on the reverse message tracing logic and a reverse message tracing log is generated.
[0053] On this basis, the steps of this embodiment also include: dynamically unloading the forward message tracking logic and the reverse message tracking logic by updating the dyeing aging time, wherein the dyeing aging time is used to characterize the duration of time during which the forward message carrying the dyeing identifier is not received; specifically, when it is determined that the forward message does not carry the dyeing identifier, the dyeing aging time is updated, that is, the duration corresponding to the dyeing aging time is increased; on the other hand, when the dyeing aging time is greater than the preset duration, the currently maintained forward message tracking logic and reverse message tracking logic are uninstalled. That is, in one possible implementation, the duration threshold is time_1, and the timing is restarted from the last time the container network receives a forward dyeing message, that is, the first cumulative duration is refreshed, and then the container network updates the first cumulative duration in real time, and compares the first cumulative duration with the duration threshold time_1. When the first cumulative duration is less than or equal to the duration threshold time_1, the container network receives the forward dyeing message again, and the first cumulative duration is refreshed, that is, the timing is restarted from 0, and the message header information is obtained based on the forward tracking node; when the first cumulative duration is greater than the duration threshold time_1, the container network unloads the forward message tracking logic and the reverse message tracking logic, and then when the container network receives the forward dyeing message, the forward message tracking logic and the reverse message tracking logic are first loaded, and then the subsequent processing steps are performed based on the forward message tracking logic and the reverse message tracking logic.
[0054] In the steps of this embodiment, by monitoring the time interval for the container network to receive the forward dyeing message, the dyeing aging time is judged. When the dyeing aging time is greater than the preset time, the forward message tracking logic and the reverse message tracking logic corresponding to the forward dyeing message are uninstalled to reduce the resource consumption of the container network and improve the resource utilization of the container network.
[0055] Step S103: Perform business logic processing on the forward message to generate a corresponding reverse message.
[0056] Step S104: matching the reverse message based on the reverse message tracing rule, performing reverse message tracing on the reverse message when a match is hit, generating and reporting a reverse message tracing log, and marking the reverse message with a coloring mark.
[0057] Exemplarily, after the container network receives a forward colored message carrying a coloring identifier, based on the message identifier of the forward colored message, the corresponding target business node that implements the target business logic is matched, and then based on the processing of the forward colored message through the target business node, the user process of the target business node of the container network is called, and then a reverse message is generated, that is, the process of performing business logic processing on the forward message to generate the corresponding reverse message. Afterwards, for example, the reverse message generated by the container network is sent to the load balancer. Specifically, when the forward colored message is received by the container network, the container network matches the corresponding target business node based on the message identifier of the forward colored message, and then processes the forward colored message by running the target business node to wake up and run the corresponding user process, thereby completing the target business function and generating a reverse message, wherein, since the forward colored message is terminated by the target business node in the container network, the reverse message is generated based on the corresponding user process, which includes the IP header information of the reverse message determined based on the IP header information of the forward colored message, but does not include the coloring field.
[0058] Afterwards, the reverse message is matched based on the reverse message tracing rules. When a match is hit, reverse message tracing is performed on the reverse message to generate and report the reverse message tracing log, and a coloring mark is added to the reverse message to implement the reverse message tracing and coloring process. Specifically, the container network determines the reverse message tracing rules based on the message header information of the forward colored message, that is, the message identification rules. Through the reverse message tracing rules, a part of the reverse messages generated by the container network are marked with a coloring mark, and another part of the reverse messages are not marked with a coloring mark. In one possible implementation, Figure 5 A schematic diagram of a process for generating a reverse dyeing message provided in an embodiment of the present disclosure, such as Figure 5As shown in the figure, the forward colored packets received by the container network include forward colored packets text_1, forward colored packets text_2, and forward colored packets text_3. The reverse tracing rule generated based on the packet header information of the forward colored packet text_1 is rule_1, the reverse tracing rule generated based on the packet header information of the forward colored packet text_2 is rule_2, and the reverse tracing rule generated based on the packet header information of the forward colored packet text_3 is rule_3. The forward colored packet text_1 corresponds to the IP header information info_1, and the forward colored packet text_2 corresponds to the IP header information info_2. nfo_2, the forward colored message text_3 corresponds to the IP header information info_3, the reverse message text_0 has the IP header information info_0. Since the IP header information info_0 corresponds to the IP header information info_2, the reverse tracing rule of the reverse message text_0 is the reverse tracing rule rule_2 generated based on the message header information of the forward colored message text_2. Therefore, the container network dyes the reverse message text_0 through the reverse tracing rule rule_2 (adding the preset network identifier corresponding to the forward colored message text_2 entering the container network), that is, generating a reverse colored message.
[0059] Furthermore, in a possible implementation, Figure 6 A schematic diagram of a process for marking a reverse message with a color mark is provided in an embodiment of the present disclosure. Figure 6 The specific implementation method of marking the reverse message with a dye mark and generating the reverse dye message is introduced. For example, Figure 6As shown in the figure, the load balancer sends the forward message text_A to the container network. After receiving the forward message text_A, the container network detects whether the forward message text_A is a forward colored message through the coloring detection node. If the forward message text_A is a forward colored message, the forward tracing node loaded by the container network processes the forward message text_A (i.e., the forward colored message). On the one hand, the message header information is generated, and the forward message tracing is performed on the forward message based on the forward message tracing rule to generate the forward message tracing log and report it; on the other hand, based on the target business logic in the container network, the target business logic is generated. The service node processes the forward message text_A, calls the corresponding user process, and generates the corresponding reverse message text_B; then, based on the five-tuple information and message identification number included in the message header information of the forward colored message text_A, it generates the reverse message tracing rule of the reverse message text_B, performs reverse message tracing on the reverse message when a match is hit, generates a reverse message tracing log and reports it, and marks the reverse message text_B with a coloring mark, so that the reverse message text_B can be colored based on the reverse message tracing rule to obtain the colored reverse message text_B (i.e., the reverse colored message). On this basis, the forward message tracking log of the forward message text_A is sent to the proxy container deployed in the host bypass. The message tracking log is processed by the proxy container to generate diagnostic data data_1 related to the forward message text_A, and then the control plane device can display the abnormal network devices related to the positive message text_A in the cloud network according to the diagnostic data data_1; the message tracking log of the colored reverse message text_B is sent to the proxy container. The message log is processed by the proxy container to generate diagnostic data data_2 related to the colored reverse message text_B, and then the control plane device can display the abnormal network devices related to the colored reverse message text_B in the cloud network according to the diagnostic data data_2.
[0060] In this embodiment, when the host machine of the container network receives a forward message, it is determined whether the forward message carries a coloring mark, and the coloring mark is used to indicate that forward message tracing is performed based on a pre-configured forward message tracing rule and triggers the execution of reverse message tracing; when it is determined that the forward message carries a coloring mark, forward message tracing is performed on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it, and reverse message tracing rules are generated according to the message header information of the forward message, and the reverse message tracing rules are used to match the reverse message to be traced related to the forward message; business logic processing is performed on the forward message to generate a corresponding reverse message; when the host machine of the container network receives a reverse message, the reverse message is matched based on the reverse message tracing rule, and when a match is hit, reverse message tracing is performed on the reverse message to generate a reverse message tracing log and report it, and a coloring mark end node is marked for the reverse message. By identifying the coloring mark of the forward message and generating the reverse message tracing rule based on the message header information of the forward message, the reverse message tracing rule is then used to match the reverse message and perform message coloring, thus solving the problem of being unable to implement reverse message coloring in the container network.
[0061] Further, the message header information of the forward message includes quintuple information and a message identification number. In a possible implementation, a specific implementation of step S104 includes:
[0062] Step S1041: Determine the source socket address and the destination socket address of the forward message based on the five-tuple information;
[0063] Step S1042: swapping the source and destination ports of the source socket address and the destination socket address of the forward message to generate the destination socket address and the source socket address of the reverse message;
[0064] Step S1043: Generate a reverse message tracing rule according to the destination socket address and source socket address of the reverse message and the message identification number.
[0065] Exemplarily, the message header information of the forward colored message includes five-tuple information and a message identification number, wherein the five-tuple information is used to indicate the message network information such as the source address and destination address of the forward colored message, and then based on the five-tuple information, the source socket address and destination socket address of the forward colored message can be obtained, and the socket address includes a network address and an interface number; further, since the forward colored message corresponds to the reverse message, the destination socket address of the reverse message is obtained based on the source socket address of the forward colored message, and the source socket address of the reverse message is obtained based on the destination socket address of the forward colored message, and the source socket address of the forward message is swapped for the source and destination ports to generate the destination socket address and source socket address of the reverse message; thereafter, further combined with the message identification number, a reverse tracking rule can be generated. In one possible implementation, Figure 7 A schematic diagram of a reverse message tracing rule determined based on quintuple information provided in an embodiment of the present disclosure, such as Figure 7 As shown, based on the five-tuple information of the forward colored message, it can be known that the source socket address of the forward colored message includes the source IP address add_A and the source port number port_A, the destination socket address of the forward colored message includes the destination IP address add_B and the destination port number port_B, and the communication protocol type corresponding to the forward colored message: the forwarding surface reports the original protocol type; further, based on the correspondence between the forward colored message and the reverse message, the source socket address and the destination socket address of the reverse message are obtained, the source socket address of the reverse message includes the source IP address add_B and the source port number port_B, the destination socket address of the reverse message includes the destination IP address add_A and the destination port number port_A, and the communication protocol type corresponding to the reverse message: the forwarding surface reports the original protocol type; further, based on the message identification number vni_0 of the forward colored message, the message identification number vni_0 of the reverse message is determined, and then the message identification number vni_0 of the reverse message is obtained. Figure 7 Reverse message tracing rules for the reverse message shown.
[0066] Furthermore, the method further comprises:
[0067] The forward message tracking log and the reverse message tracking log are reported to the proxy container deployed in the host bypass; the forward message tracking log and the reverse message tracking log are formatted by the proxy container to generate tracking logs in a unified target format and reported to the cloud network control plane device; wherein the unified target format is the log format of the full-link message tracking control plane supported by the cloud network control plane device.
[0068] After obtaining the reverse-dyed message, the reverse-dyed message is tracked through the container network to obtain a reverse message tracking log, which records, for example, the message characteristics of the reverse-dyed message corresponding to the reverse-dyed message, the transmission path of the reverse-dyed message, the transmission status of the reverse-dyed message at each data transmission node during the transmission process, and other information, that is, the message tracking log (reverse message tracking log) of the reverse-dyed message is obtained; then, the forward message tracking log and the reverse message tracking log are sent to the proxy container deployed in the host bypass; the forward message tracking log and the reverse message tracking log are format-converted by the proxy container to generate a tracking log in a unified target format and report it to the cloud network control plane device, for example, the message tracking log is processed by the proxy container to generate diagnostic data in the target format, and the diagnostic data is sent to the cloud network control plane device to display abnormal network devices in the cloud network. In one possible implementation, after the container network obtains the message tracking log of the reverse-dyed message, the container network sends the message tracking log to the proxy container to implement the data processing process of the message tracking log in the proxy container; since the content recorded in the message tracking log includes the time when the reverse-dyed message enters each network device in the cloud network, the time when it is sent from each network device, and the changes in the data packets in each network device, the proxy container converts the format of the message tracking log to generate diagnostic data in a target format that can be recognized and read by the cloud network control plane device, and then the cloud network control plane device draws a network device topology map based on the diagnostic data sent by the received proxy device, that is, the network devices in the cloud network, and further, based on the abnormal state of the reverse-dyed message reflected in the diagnostic data when the network device is transmitted, the abnormal network devices in the cloud network are determined.
[0069] Further, Figure 8 A schematic diagram of the steps of generating a tracking log in a unified target format and reporting it to a cloud network control plane device provided by an embodiment of the present disclosure, such as Figure 8 As shown, the specific implementation steps of converting the format of the forward message tracking log and the reverse message tracking log through the proxy container to generate a tracking log in a unified target format and reporting it to the cloud network control plane device include:
[0070] Step S104A: The forward message tracing log and the reverse message tracing log are respectively copied through the proxy container.
[0071] Step S104B: For the copy of the forward message tracking log and the copy of the reverse message tracking log, respectively, modify the input log identifier into the output log identifier to generate the corresponding tracking log in the unified target format and report it to the cloud network control plane device.
[0072] Exemplarily, after the forward message tracing log and the reverse message tracing log are sent to the proxy container, the proxy container processes the forward message tracing log and the reverse message tracing log respectively, copies the log contents of the forward message tracing log and the reverse message tracing log, and generates a corresponding copy of the forward message tracing log and a copy of the reverse message tracing log; then, the input log identifier of the copy of the forward message tracing log and the copy of the reverse message tracing log are modified to an output log identifier, respectively, to generate a corresponding tracking log in a unified target format and report it to the cloud network control plane device. In the steps of this embodiment, since the container network, as the end node on the data transmission path, consumes the forward message and generates a new reverse message, the forward message tracking log generated by it only contains the log describing the message entry state (i.e., the message tracking log containing the input log identifier), but does not contain the log describing the message output state (i.e., the message tracking log containing the output log identifier). In the technology of message tracking and analysis based on the intermediate node on the data transmission path, the message tracking log formed contains two paired logs (i.e., the message tracking log containing the input log identifier and the message tracking log containing the output log identifier). Message tracking log), in order to achieve matching and compatibility with the technology of message tracking and analysis based on the intermediate nodes on the data transmission path, in the steps of this embodiment, the log identifier of the copy of the forward message tracking log is modified (the input log identifier is changed to the output log identifier) to generate a corresponding tracking log in a unified target format and report it to the cloud network control plane device, thereby achieving compatibility with the technology of message tracking and analysis based on the intermediate nodes on the data transmission path, so that the cloud network control plane device can simultaneously perform message tracking and abnormal device analysis through the network devices of the intermediate nodes and the container network of the end nodes.
[0073] Corresponding to the forward and reverse message tracing method of the cloud container network in the above embodiment, Fig. 9 A structural block diagram of a forward and reverse message tracking device for a container network on the cloud provided by an embodiment of the present disclosure. The method described in the above embodiment can be executed by the forward and reverse message tracking device for the container network on the cloud, which can be implemented by software and / or hardware, and can be integrated in an electronic device with certain data processing functions. Among them, the electronic device can include but is not limited to mobile terminals with big data processing capabilities, as well as fixed terminals with big data processing capabilities such as desktop computers and supercomputers.
[0074] For the sake of convenience, only the parts related to the embodiments of the present disclosure are shown. Fig. 9 , the forward and reverse message tracking device 3 of the container network on the cloud includes:
[0075] The first processing module 31 is used to determine whether the forward message carries a coloring mark when the host machine of the container network receives the forward message, and the coloring mark is used to indicate that the forward message tracing is executed based on the pre-configured forward message tracing rule and trigger the reverse message tracing;
[0076] The second processing module 32 is used to perform forward message tracing on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it when it is determined that the forward message carries a dyeing mark, and to generate a reverse message tracing rule according to the message header information of the forward message, wherein the reverse message tracing rule is used to match the reverse message to be traced that is related to the forward message;
[0077] The third processing module 33 is used to perform business logic processing on the forward message to generate a corresponding reverse message;
[0078] The coloring module 34 is used to match the reverse message based on the reverse message tracing rule, perform reverse message tracing on the reverse message when a match is hit, generate a reverse message tracing log and report it, and mark the reverse message with a coloring mark.
[0079] According to one or more embodiments of the present disclosure, a dye detection management function is configured in the logical starting point of eBPF in the host machine of the container network, and the dye detection management function supports dynamic loading and unloading of forward message tracing logic and reverse message tracing logic; wherein, the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing.
[0080] According to one or more embodiments of the present disclosure, when it is determined that the forward message carries a dyeing mark, the first processing module 31 is also used to: determine whether the forward message tracing logic and the reverse message tracing logic have been loaded; wherein the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing; if loaded, forward message tracing is performed on the forward message based on the forward message tracing rules to generate a forward message tracing log and report it; if not loaded, the forward message tracing logic and the reverse message tracing logic are loaded.
[0081] According to one or more embodiments of the present disclosure, the first processing module 31 is also used to: when it is determined that the forward message does not carry the coloring mark, update the coloring aging time, the coloring aging time is used to characterize the duration of time that the forward message carrying the coloring mark is not received; when the coloring aging time is greater than the preset duration, uninstall the currently maintained forward message tracking logic and reverse message tracking logic.
[0082] According to one or more embodiments of the present disclosure, the message header information of the forward message includes five-tuple information and a message identification number; when the second processing module 32 generates a reverse message tracing rule based on the message header information of the forward message, it is specifically used to: determine the source socket address and the destination socket address of the forward message based on the five-tuple information; swap the source and destination ports of the source socket address and the destination socket address of the forward message to generate the destination socket address and the source socket address of the reverse message; generate a reverse message tracing rule based on the destination socket address and the source socket address of the reverse message and the message identification number.
[0083] According to one or more embodiments of the present disclosure, the second processing module 32 is also used to: report the forward message tracing log and the reverse message tracing log to the proxy container deployed in the host bypass; perform format conversion on the forward message tracing log and the reverse message tracing log through the proxy container to generate a tracing log in a unified target format and report it to the cloud network control plane device; wherein the unified target format is the log format of the full-link message tracing control plane supported by the cloud network control plane device.
[0084] According to one or more embodiments of the present disclosure, when the second processing module 32 performs format conversion on the forward message tracing log and the reverse message tracing log through the proxy container to generate a tracing log in a unified target format and reports it to the cloud network control plane device, it is specifically used to: respectively copy the forward message tracing log and the reverse message tracing log through the proxy container; respectively modify the input log identifier of the copy of the forward message tracing log and the copy of the reverse message tracing log to the output log identifier to generate a corresponding tracing log in a unified target format and report it to the cloud network control plane device.
[0085] According to one or more embodiments of the present disclosure, when the host machine of the container network receives a forward message, the first processing module 31 determines whether the forward message carries a coloring identifier. Specifically, when the host machine of the container network receives a forward message, the first processing module 31 parses the forward message and reads the message header in the forward message to determine whether the message header is configured with a coloring identifier; if the message header is configured with a coloring identifier, it is determined that the forward message carries a coloring identifier; if the message header is not configured with a coloring identifier, it is determined that the forward message does not carry a coloring identifier.
[0086] According to one or more embodiments of the present disclosure, the first processing module 31 is further used to: when it is determined that the forward message does not carry a coloring mark, directly perform business logic processing on the forward message to generate a corresponding reverse message.
[0087] Among them, the first processing module 31, the second processing module 32, the third processing module 33 and the dyeing module 34 are connected in sequence. The forward and reverse message tracking device 3 for the container network on the cloud provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.
[0088] In order to implement the above embodiment, the embodiment of the present disclosure also provides an electronic device.
[0089] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown in FIG. Fig.10 As shown, the electronic device 4 includes:
[0090] A processor 41, and a memory 42 communicatively connected to the processor 41;
[0091] The memory 42 stores computer executable instructions;
[0092] The processor 41 executes the computer execution instructions stored in the memory 42 to implement the following Figure 2-Figure 8 The forward and reverse message tracing method of the cloud container network in the illustrated embodiment.
[0093] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .
[0094] For related instructions, please refer to Figure 2-Figure 8 The relevant descriptions and effects corresponding to the steps in the corresponding embodiments can be understood, and no further elaboration is made here.
[0095] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are used to implement the present invention when executed by a processor. Figure 2-Figure 8 A forward and reverse message tracing method for a container network on a cloud provided by any one of the corresponding embodiments.
[0096] The present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the present invention is realized. Figure 2-Figure 8 A forward and reverse message tracing method for a container network on a cloud provided by any one of the corresponding embodiments.
[0097] The present disclosure also provides an electronic device. Fig.11 , Fig.11A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure shows a schematic diagram of the structure of an electronic device 900 suitable for implementing an embodiment of the present disclosure, and the electronic device 900 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0098] like Fig.11 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0099] Typically, the following devices may be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.11 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0100] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0101] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0102] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0103] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0104] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0106] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit or module does not, in some cases, constitute a limitation on the unit itself.
[0107] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0108] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0109] In a first aspect, according to one or more embodiments of the present disclosure, a method for tracing forward and reverse messages of a container network on a cloud is provided, comprising:
[0110] When a host machine of a container network receives a forward message, it is determined whether the forward message carries a coloring mark, and the coloring mark is used to indicate that forward message tracing is performed based on a pre-configured forward message tracing rule and triggers reverse message tracing; when it is determined that the forward message carries a coloring mark, forward message tracing is performed on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it, and reverse message tracing rules are generated according to message header information of the forward message, and the reverse message tracing rules are used to match reverse messages to be traced that are related to the forward message; business logic processing is performed on the forward message to generate a corresponding reverse message; the reverse message is matched based on the reverse message tracing rule, and reverse message tracing is performed on the reverse message to generate a reverse message tracing log and report it when a match is hit, and a coloring mark is marked on the reverse message.
[0111] According to one or more embodiments of the present disclosure, a dye detection management function is configured in the logical starting point of the extended Berkeley packet filter eBPF in the host machine of the container network, and the dye detection management function supports dynamic loading and unloading of forward message tracing logic and reverse message tracing logic; wherein, the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing.
[0112] According to one or more embodiments of the present disclosure, when determining that the forward message carries a dyeing identifier, the method also includes: determining whether the forward message tracing logic and the reverse message tracing logic have been loaded; wherein the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing; if loaded, then executing the forward message tracing based on the forward message tracing rules to generate a forward message tracing log and report it; if not loaded, then loading the forward message tracing logic and the reverse message tracing logic.
[0113] According to one or more embodiments of the present disclosure, the method also includes: when it is determined that the forward message does not carry a coloring mark, updating the coloring aging time, the coloring aging time is used to characterize the duration of time that the forward message carrying the coloring mark is not received; when the coloring aging time is greater than a preset duration, uninstalling the currently maintained forward message tracking logic and reverse message tracking logic.
[0114] According to one or more embodiments of the present disclosure, the message header information of the forward message includes five-tuple information and a message identification number; the reverse message tracing rules are generated based on the message header information of the forward message, including: determining the source socket address and the destination socket address of the forward message based on the five-tuple information; swapping the source and destination ports of the source socket address and the destination socket address of the forward message to generate the destination socket address and the source socket address of the reverse message; and generating the reverse message tracing rules based on the destination socket address and the source socket address of the reverse message and the message identification number.
[0115] According to one or more embodiments of the present disclosure, the method also includes: reporting the forward message tracing log and the reverse message tracing log to a proxy container deployed in the host machine bypass; performing format conversion on the forward message tracing log and the reverse message tracing log by the proxy container to generate tracing logs in a unified target format and reporting them to a cloud network control plane device; wherein the unified target format is a log format of a full-link message tracing control plane supported by the cloud network control plane device.
[0116] According to one or more embodiments of the present disclosure, the format conversion of the forward message tracing log and the reverse message tracing log by the proxy container to generate a tracing log in a unified target format and report it to the cloud network control plane device includes: respectively copying the forward message tracing log and the reverse message tracing log by the proxy container; respectively modifying the input log identifier of the copy of the forward message tracing log and the copy of the reverse message tracing log to an output log identifier to generate a corresponding tracing log in a unified target format and report it to the cloud network control plane device.
[0117] According to one or more embodiments of the present disclosure, when a host machine of a container network receives a forward message, determining whether the forward message carries a coloring identifier includes: when the host machine of the container network receives the forward message, parsing the forward message and reading a message header in the forward message, and determining whether a coloring identifier is configured in the message header; if a coloring identifier is configured in the message header, determining that the forward message carries a coloring identifier; if a coloring identifier is not configured in the message header, determining that the forward message does not carry a coloring identifier.
[0118] According to one or more embodiments of the present disclosure, the method further includes: when it is determined that the forward message does not carry a coloring mark, directly performing business logic processing on the forward message to generate a corresponding reverse message.
[0119] In a second aspect, according to one or more embodiments of the present disclosure, a forward and reverse message tracing device for a container network on a cloud is provided, comprising:
[0120] A first processing module is used to determine whether the forward message carries a coloring mark when the host machine of the container network receives the forward message, and the coloring mark is used to indicate that the forward message tracing is performed based on the pre-configured forward message tracing rule and trigger the reverse message tracing;
[0121] The second processing module is used to perform forward message tracing on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it when it is determined that the forward message carries a dyeing mark, and to generate a reverse message tracing rule according to the message header information of the forward message, wherein the reverse message tracing rule is used to match the reverse message to be traced that is related to the forward message;
[0122] A third processing module, used to perform business logic processing on the forward message to generate a corresponding reverse message;
[0123] The coloring module is used to match the reverse message based on the reverse message tracing rule, perform reverse message tracing on the reverse message when a match is hit, generate a reverse message tracing log and report it, and mark the reverse message with a coloring mark.
[0124] According to one or more embodiments of the present disclosure, according to one or more embodiments of the present disclosure, a dye detection management function is configured in the logical starting point of eBPF in the host machine of the container network, and the dye detection management function supports dynamic loading and unloading of forward message tracing logic and reverse message tracing logic; wherein, the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing.
[0125] According to one or more embodiments of the present disclosure, when it is determined that the forward message carries a dyeing identifier, the first processing module is also used to: determine whether the forward message tracing logic and the reverse message tracing logic have been loaded; wherein the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing; if loaded, forward message tracing is performed on the forward message based on the forward message tracing rules to generate a forward message tracing log and report it; if not loaded, the forward message tracing logic and the reverse message tracing logic are loaded.
[0126] According to one or more embodiments of the present disclosure, the first processing module is also used to: when it is determined that the forward message does not carry the coloring mark, update the coloring aging time, the coloring aging time is used to characterize the duration of time that the forward message carrying the coloring mark is not received; when the coloring aging time is greater than the preset duration, uninstall the currently maintained forward message tracking logic and reverse message tracking logic.
[0127] According to one or more embodiments of the present disclosure, the message header information of the forward message includes five-tuple information and a message identification number; when the second processing module generates a reverse message tracing rule based on the message header information of the forward message, it is specifically used to: determine the source socket address and the destination socket address of the forward message based on the five-tuple information; swap the source and destination ports of the source socket address and the destination socket address of the forward message to generate the destination socket address and the source socket address of the reverse message; generate a reverse message tracing rule based on the destination socket address and the source socket address of the reverse message and the message identification number.
[0128] According to one or more embodiments of the present disclosure, the second processing module is also used to: report the forward message tracing log and the reverse message tracing log to the proxy container deployed in the host bypass; perform format conversion on the forward message tracing log and the reverse message tracing log through the proxy container to generate a tracing log in a unified target format and report it to the cloud network control plane device; wherein the unified target format is the log format of the full-link message tracing control plane supported by the cloud network control plane device.
[0129] According to one or more embodiments of the present disclosure, when the second processing module performs format conversion on the forward message tracing log and the reverse message tracing log through the proxy container to generate a tracing log in a unified target format and report it to the cloud network control plane device, it is specifically used to: respectively copy the forward message tracing log and the reverse message tracing log through the proxy container; respectively modify the input log identifier of the copy of the forward message tracing log and the copy of the reverse message tracing log to the output log identifier to generate a corresponding tracing log in a unified target format and report it to the cloud network control plane device.
[0130] According to one or more embodiments of the present disclosure, when the host machine of the container network receives a forward message, the first processing module determines whether the forward message carries a coloring identifier. The first processing module is specifically used to: when the host machine of the container network receives the forward message, parse the forward message and read the message header in the forward message to determine whether the message header is configured with a coloring identifier; if the message header is configured with a coloring identifier, determine that the forward message carries the coloring identifier; if the message header is not configured with a coloring identifier, determine that the forward message does not carry the coloring identifier.
[0131] According to one or more embodiments of the present disclosure, the first processing module is further used to: when it is determined that the forward message does not carry a coloring mark, directly perform business logic processing on the forward message to generate a corresponding reverse message.
[0132] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0133] The memory stores computer-executable instructions;
[0134] The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the forward and reverse message tracing method for the cloud container network as described in the first aspect and various possible designs of the first aspect.
[0135] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the forward and reverse message tracking method of the cloud container network as described in the first aspect and various possible designs of the first aspect is implemented.
[0136] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the forward and reverse message tracing method for a cloud container network as described in the first aspect and various possible designs of the first aspect.
[0137] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0138] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0139] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A forward and reverse message tracing method for a container network on a cloud, characterized in that: include: When a host machine of the container network receives a forward message, it is determined whether the forward message carries a coloring mark, where the coloring mark is used to indicate that forward message tracing is performed based on a pre-configured forward message tracing rule and that reverse message tracing is triggered; When it is determined that the forward message carries a dye mark, forward message tracing is performed on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it, and reverse message tracing rules are generated according to message header information of the forward message, wherein the reverse message tracing rules are used to match reverse messages to be traced that are related to the forward message; Performing business logic processing on the forward message to generate a corresponding reverse message; The reverse message is matched based on the reverse message tracing rule, and when a match is hit, reverse message tracing is performed on the reverse message to generate and report a reverse message tracing log, and a coloring mark is added to the reverse message.
2. The forward and reverse message tracing method of a container network on a cloud according to claim 1 is characterized in that: A dye detection management function is configured in the logical starting point of the extended Berkeley packet filter eBPF in the host machine of the container network, and the dye detection management function supports dynamic loading and unloading of forward message tracing logic and reverse message tracing logic; wherein, the forward message tracing logic is used to trigger the execution of forward message tracing processing, and the reverse message tracing logic is used to trigger the execution of reverse message tracing processing.
3. The forward and reverse message tracing method of a container network on a cloud according to claim 2 is characterized in that: When determining that the forward message carries a coloring identifier, the method further includes: Determine whether the forward message tracing logic and the reverse message tracing logic have been loaded; wherein the forward message tracing logic is used to trigger the execution of the forward message tracing process, and the reverse message tracing logic is used to trigger the execution of the reverse message tracing process; If it has been loaded, executing the forward message tracing based on the forward message tracing rule to generate a forward message tracing log and report it; If not loaded, load the forward message tracing logic and the reverse message tracing logic.
4. The forward and reverse message tracing method of a container network on a cloud according to claim 2 is characterized in that: The method further comprises: When it is determined that the forward message does not carry the coloring mark, the coloring aging time is updated, and the coloring aging time is used to represent the duration of not receiving the forward message carrying the coloring mark; When the dyeing aging time is greater than a preset time, the currently maintained forward message tracking logic and reverse message tracking logic are uninstalled.
5. The forward and reverse message tracing method of a container network on a cloud according to claim 1, characterized in that: The message header information of the forward message includes five-tuple information and a message identification number; the generating of the reverse message tracing rule according to the message header information of the forward message includes: Determine the source socket address and the destination socket address of the forward message based on the five-tuple information; Swapping the source and destination ports of the source socket address and the destination socket address of the forward message to generate the destination socket address and the source socket address of the reverse message; A reverse message tracing rule is generated according to the destination socket address and source socket address of the reverse message and the message identification number.
6. The forward and reverse message tracing method of a container network on a cloud according to claim 1, characterized in that: The method further comprises: Reporting the forward message tracking log and the reverse message tracking log to a proxy container deployed in a bypass of the host machine; The forward message tracking log and the reverse message tracking log are format-converted through the proxy container to generate tracking logs in a unified target format and report them to the cloud network control plane device; wherein the unified target format is the log format of the full-link message tracking control plane supported by the cloud network control plane device.
7. The forward and reverse message tracing method of a container network on a cloud according to claim 6 is characterized in that: The step of converting the format of the forward message tracking log and the reverse message tracking log by the proxy container to generate a tracking log in a unified target format and reporting the converted log to the cloud network control plane device includes: Respectively copying the forward message tracking log and the reverse message tracking log through the proxy container; For the copy of the forward message tracking log and the copy of the reverse message tracking log, respectively, the input log identifier is modified into the output log identifier to generate a corresponding tracking log in a unified target format and report it to the cloud network control plane device.
8. The forward and reverse message tracing method of a container network on a cloud according to claim 1, characterized in that: When the host machine of the container network receives the forward message, determining whether the forward message carries the coloring mark includes: When a host machine of the container network receives a forward message, the forward message is parsed and a message header in the forward message is read to determine whether a coloring flag is configured in the message header; If a coloring flag is configured in the message header, it is determined that the forward message carries a coloring flag; If the coloring flag is not configured in the message header, it is determined that the forward message does not carry the coloring flag.
9. The forward and reverse message tracing method of a container network on a cloud according to claim 1, characterized in that: The method further comprises: When it is determined that the forward message does not carry the coloring mark, the business logic processing of the forward message is directly performed to generate a corresponding reverse message.
10. A forward and reverse message tracking device for a container network on a cloud, characterized in that: include: A first processing module is used to determine whether the forward message carries a coloring mark when the host machine of the container network receives the forward message, and the coloring mark is used to indicate that the forward message tracing is performed based on the pre-configured forward message tracing rule and trigger the reverse message tracing; The second processing module is used to perform forward message tracing on the forward message based on the forward message tracing rule to generate a forward message tracing log and report it when it is determined that the forward message carries a dyeing mark, and to generate a reverse message tracing rule according to the message header information of the forward message, wherein the reverse message tracing rule is used to match the reverse message to be traced that is related to the forward message; A third processing module, used to perform business logic processing on the forward message to generate a corresponding reverse message; The coloring module is used to match the reverse message based on the reverse message tracing rule, perform reverse message tracing on the reverse message when a match is hit, generate a reverse message tracing log and report it, and mark the reverse message with a coloring mark.
11. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer execution instructions stored in the memory, so that the processor executes the forward and reverse message tracing method for a cloud container network as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the forward and reverse message tracing method for a cloud container network as described in any one of claims 1 to 9 is implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the forward and reverse message tracing method of a cloud container network as described in any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Method and apparatus for container network communication
CN116567082A
Container network supervision control method and device
CN117255033A