Message processing methods, apparatus, related equipment, storage media and program products
By using master-slave gateway collaborative analysis, and by mirroring and analyzing data packets of specified domain names using the master gateway device, the problem of insufficient CPU performance of home gateways was solved, and effective monitoring of DPI information of slave gateways and improvement of network stability were achieved.
Patent Information
- Application Number
- CN202410295287.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-03-14
AI Technical Summary
Insufficient CPU performance in home gateways, especially during high-bandwidth Wi-Fi forwarding, makes it impossible to effectively monitor DPI data from the gateway, resulting in poor home network connection stability and insufficient bandwidth, which affects the stable transmission of services such as augmented reality and virtual reality.
By mirroring data packets with a specified domain name through the master gateway device and conducting collaborative analysis between the master and slave gateway devices, the CPU computing resources of the master and slave gateways are utilized to reduce the dependence on the slave gateway's CPU and realize the monitoring of the slave gateway's DPI information.
Effective monitoring of DPI information from the gateway saves CPU resources from the gateway, improves the stability and bandwidth of the home network, and ensures stable transmission of services such as augmented reality and virtual reality.
Smart Images

Figure CN118802614B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a message processing method, apparatus, related equipment, storage medium and program product. Background Technology
[0002] Deep Packet Inspection (DPI) is a packet-based deep inspection technology, and it is an important tool for operators to analyze weak coverage in homes. Among related technologies, there are two main approaches to DPI analysis on home gateways: the first approach is to filter data packets and forward them to the central processing unit (CPU) of the local home gateway (e.g., the main gateway or a slave gateway) for analysis; the second approach is to mirror the data packets from the home gateway to a designated server, such as a DPI server, for analysis.
[0003] However, the second approach is less commonly used because it requires high network connection stability and bandwidth. As for the first approach, when the filtered data packets are forwarded to the CPU of the gateway for analysis, the CPU performance of the gateway is generally very weak, especially in scenarios such as high-volume forwarding of Wi-Fi and high CPU utilization, making it impossible to effectively monitor the DPI data of the gateway. Summary of the Invention
[0004] To address the technical problems existing in related technologies, embodiments of this application provide a message processing method, apparatus, related equipment, storage medium, and program product.
[0005] To achieve the above objectives, the technical solution of this application embodiment is implemented as follows:
[0006] In a first aspect, embodiments of this application provide a message processing method applied to a first gateway device, wherein the first gateway device is a main gateway device, the method comprising:
[0007] Send a first request to the second gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet is a data packet with a specified domain name, and the second gateway device is a slave gateway device;
[0008] Receive a second data packet sent by the second gateway device; the second data packet is generated by the second gateway device based on a mirrored packet of the first data packet;
[0009] The third data packet on the first gateway device is mirrored to obtain a mirrored packet of the third data packet; the domain name of the third data packet is the same as the domain name of the first data packet.
[0010] Based on the mirrored message of the second data packet and the third data packet, the DPI information of the second gateway device is determined.
[0011] Secondly, this application also provides another message processing method applied to a second gateway device, wherein the second gateway device is a slave gateway device, the method comprising:
[0012] Receive a first request sent by a first gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet is a data packet with a specified domain name, and the first gateway device is a master gateway device;
[0013] A second data packet is generated based on the mirror image of the first data packet;
[0014] The second data packet is sent to the first gateway device so that the first gateway device can determine the DPI information of the second gateway device based on the mirrored packet of the second data packet and the third data packet;
[0015] The mirrored message of the third data packet is obtained by the first gateway device mirroring the third data packet on the first gateway device, and the domain name of the third data packet is the same as the domain name of the first data packet.
[0016] Thirdly, embodiments of this application provide a message processing apparatus applied to a first gateway device, wherein the first gateway device is a main gateway device, and the apparatus includes:
[0017] The first sending unit is configured to send a first request to the second gateway device; the first request is configured to request the second gateway device to mirror a first data packet on the second gateway device, wherein the first data packet is a data packet with a specified domain name, and the second gateway device is a slave gateway device.
[0018] The first receiving unit is configured to receive a second data packet sent by the second gateway device; the second data packet is generated by the second gateway device based on a mirrored packet of the first data packet;
[0019] The mirroring unit is used to mirror the third data packet on the first gateway device to obtain a mirrored packet of the third data packet; the domain name of the third data packet is the same as the domain name of the first data packet.
[0020] The first determining unit is used to determine the DPI information of the second gateway device based on the mirror message of the second data packet and the third data packet.
[0021] Fourthly, embodiments of this application also provide another message processing apparatus, applied to a second gateway device, wherein the second gateway device is a slave gateway device, the apparatus comprising:
[0022] The second receiving unit is configured to receive a first request sent by the first gateway device; the first request is configured to request the second gateway device to mirror a first data packet on the second gateway device, wherein the first data packet is a data packet with a specified domain name, and the first gateway device is a master gateway device.
[0023] The generation unit is used to generate a second data packet based on the mirror image of the first data packet;
[0024] The second sending unit is used to send the second data packet to the first gateway device, so that the first gateway device can determine the DPI information of the second gateway device based on the mirrored packet of the second data packet and the third data packet;
[0025] The mirrored message of the third data packet is obtained by the first gateway device mirroring the third data packet on the first gateway device, and the domain name of the third data packet is the same as the domain name of the first data packet.
[0026] Fifthly, embodiments of this application also provide a first gateway device, including: a first processor and a first memory for storing a computer program capable of running on the first processor;
[0027] Wherein, when the first processor is used to run the computer program, it executes the steps of the message processing method on the first gateway device side as described in the embodiments of this application.
[0028] Sixthly, embodiments of this application also provide a second gateway device, including: a second processor and a second memory for storing a computer program capable of running on the second processor;
[0029] Wherein, when the second processor is used to run the computer program, it executes the steps of the message processing method on the second gateway device side as described in the embodiments of this application.
[0030] In a seventh aspect, embodiments of this application also provide a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the message processing method on the first gateway device side as described in embodiments of this application, or implements the steps of the message processing method on the second gateway device side as described in embodiments of this application.
[0031] Eighthly, embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the message processing method on the first gateway device side as described in embodiments of this application, or implements the steps of the message processing method on the second gateway device side as described in embodiments of this application.
[0032] The message processing method, apparatus, related devices, storage medium, and program products provided in this application embodiment involve a first gateway device sending a first request to a second gateway device. Upon receiving the first request, the second gateway device generates a second data packet based on a mirrored packet of a first data packet on the second gateway device and sends the second data packet to the first gateway device. Thus, the first gateway device determines its DPI information based on the second data packet and a mirrored packet of a third data packet on the first gateway device. The first data packet is a data packet with a specified domain name. The first gateway device is the master gateway device, and the second gateway device is the slave gateway device. The mirrored packet of the third data packet is obtained by the first gateway device mirroring the third data packet on the first gateway device, and the domain name of the third data packet is the same as that of the first data packet. Using the method of this application embodiment, the first gateway device (i.e., the master gateway device) mirrors the third data packet, which has the same domain name as the first data packet, and analyzes the data packets with the same domain name mirrored by the master gateway device and the second gateway device (i.e., the slave gateway device) to obtain the DPI information of the slave gateway. It can be seen that this application embodiment uses the master gateway device to determine the DPI information of the slave gateway device. It does not require the slave gateway's CPU to be fully used for slave gateway DPI analysis. Instead, it can effectively monitor the slave gateway's DPI information based on the cooperation of the CPU computing resources of the master and slave gateways, which can save the slave gateway's CPU resources. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of the structure of FTTR home networking in related technologies;
[0034] Figure 2 This is a schematic diagram illustrating two methods for analyzing the DPI of home gateways in related technologies;
[0035] Figure 3 This is a schematic diagram illustrating the implementation principle of the first home gateway DPI analysis method in related technologies.
[0036] Figure 4 This is a flowchart illustrating the message processing method of an embodiment of this application. Figure 1 ;
[0037] Figure 5 This is a schematic diagram illustrating the method for representing transmission delay between master and slave gateways in an embodiment of this application;
[0038] Figure 6 This is a schematic diagram of the FTTR gateway quality monitoring architecture according to an embodiment of this application;
[0039] Figure 7 This is a schematic diagram of the TCP three-way handshake interaction according to an embodiment of this application;
[0040] Figure 8 This is a flowchart illustrating the message processing method of an embodiment of this application. Figure 2 ;
[0041] Figure 9 This is a flowchart illustrating the message processing method of an embodiment of this application. Figure 3 ;
[0042] Figure 10 This is a schematic diagram of the composition structure of the message processing apparatus according to an embodiment of this application. Figure 1 ;
[0043] Figure 11 This is a schematic diagram of the composition structure of the message processing apparatus according to an embodiment of this application. Figure 2 ;
[0044] Figure 12 This is a schematic diagram of the hardware composition structure of the first gateway device according to an embodiment of this application;
[0045] Figure 13 This is a schematic diagram of the hardware composition structure of the second gateway device according to an embodiment of this application;
[0046] Figure 14 This is a schematic diagram of the composition structure of the message processing system according to an embodiment of this application. Detailed Implementation
[0047] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.
[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0049] To address the issues of poor stability and low bandwidth in home network connections such as Wi-Fi and wired connections, and to ensure stable transmission of services like Augmented Reality (AR) and Virtual Reality (VR), Fiber to the Room (FTTR) home networking technology has developed rapidly in recent years. Figure 1 This is a schematic diagram of the structure of FTTR home networking in related technologies, such as... Figure 1 As shown, an FTTR home network includes an Optical Line Terminal (OLT), optical routers (including Fiber To The Home (FTTH) optical network routers and FTTR optical network routers), a main gateway, secondary gateways, and terminals. The OLT connects to the FTTH optical network router via a Passive Optical Network (PON) interface. The FTTH optical network router connects to the main gateway, which includes uplink and downlink optical ports. The main gateway connects to the FTTR optical network router via an FTTR network interface. The FTTR optical network router connects to multiple secondary gateways, which in turn connect to multiple terminals (e.g., mobile phones, laptops, desktop computers) via user-side interfaces. Each terminal corresponds to a room. Specifically, optical signals are transmitted to each room via optical fiber, achieving wired and wireless gigabit network coverage for all rooms in the home.
[0050] FTTR home networking is a recently developed technology. FTTR quality monitoring technology largely follows that of traditional gateways, including DPI (Distributed Point of Interest) technology on smart home gateways. DPI technology is a crucial tool for traditional gateways to identify weak coverage in homes. Two methods for analyzing home gateway DPI have been proposed in related technologies. Figure 2 The diagram illustrates two methods for analyzing the DPI of home gateways in related technologies, as shown below. Figure 2 As shown, Option 1 filters data packets first, and then mirrors the filtered packets to the CPU of the local home gateway (e.g., the main gateway or a secondary gateway) for analysis using the Internet Protocol (IP) 5-tuple (including source IP address, destination IP address, source port number, destination port number, and transport protocol number). Option 2 mirrors data packets to a designated server, such as a remote server (DPI server), for analysis using the IP 5-tuple. However, Option 2 is less commonly used in the industry because it requires higher network connection stability and bandwidth.
[0051] Figure 3 This is a schematic diagram illustrating the implementation principle of the first home gateway DPI analysis method in related technologies, such as... Figure 3As shown, the Content Delivery Network (CDN) sends the Transmission Control Protocol (TCP) packets that need to be mirrored to the CPU of the smart gateway through the gateway forwarding hardware module. After receiving the TCP packets to be mirrored, the CPU mirrors the TCP packets and then encapsulates the mirrored TCP packets into User Datagram Protocol (UDP) packets according to the specification. The UDP packets are then forwarded to a designated port through port 18888. The soft probe receives the UDP packets on the designated port, parses them to obtain the mirrored TCP packets, analyzes them to obtain the analysis results, and sets the domain name to be mirrored. The soft probe sends the analysis results to the gateway forwarding hardware module through the packet forwarding control module via the mirroring interface, and then the gateway forwarding hardware module sends the analysis results to the user. However, in practical applications, in the first home gateway DPI analysis scheme, when the filtered data packets are forwarded to the CPU of the secondary gateway for analysis, the CPU performance of the secondary gateway is generally very weak, especially in scenarios such as high-volume WIFI forwarding and high CPU utilization, making it impossible to effectively monitor the DPI data of the secondary gateway.
[0052] Based on this, this application proposes a message processing method. In various embodiments of this application, the main gateway device mirrors the message with the same domain name as the first data message, i.e., the third data message, and analyzes the message with the same domain name mirrored by both the main gateway device and the slave gateway device to obtain the DPI information of the slave gateway. It can be seen that this application uses the main gateway device to determine the DPI information of the slave gateway device. It does not require the slave gateway's CPU to be fully used for slave gateway DPI analysis. Instead, it can effectively monitor the slave gateway's DPI information based on the cooperation of the CPU computing resources of the main and slave gateways, which can save the slave gateway's CPU resources.
[0053] This application provides a message processing method, which is applied to a first gateway device, wherein the first gateway device is a main gateway device. Figure 4 This is a flowchart illustrating the message processing method of an embodiment of this application. Figure 1 ;like Figure 4 As shown, the method includes:
[0054] Step 401: Send a first request to the second gateway device; the first request is used to request the second gateway device to mirror the first data packet on the second gateway device.
[0055] In this embodiment of the application, the first data packet is a data packet with a specified domain name, the first gateway device can be the master gateway device in the FTTR home network, and the second gateway device can be the slave gateway device in the FTTR home network.
[0056] In practical applications, before the first gateway device sends the first request (i.e., the mirroring command) to the second gateway device, it needs to determine whether the first gateway device meets the first condition. When the first gateway device meets the first condition, the first gateway device sends the mirroring command to the second gateway device.
[0057] Based on this, in one embodiment, sending the first request to the second gateway device includes:
[0058] Determine whether the first gateway device meets the first condition; if the first gateway device meets the first condition, send a first request to the second gateway device;
[0059] Determining whether the first gateway device meets the first condition includes:
[0060] If it is determined that the first gateway device has received the second request sent by the gateway probe, it is determined that the first gateway device satisfies the first condition; wherein, the second request is used to request the first gateway device to control the second gateway device to mirror data packets of a specified domain name.
[0061] In this embodiment, the gateway probe can be a soft probe of the gateway, specifically a soft probe of the first gateway device. In practical applications, the soft probe plugin of the first gateway device sends a second request to the first gateway device. Specifically, the soft probe plugin of the first gateway device sends the second request to the first gateway device through a first interface to request the first gateway device to control the second gateway device to mirror data packets of a specified domain name. That is, when the first gateway device receives the second request sent by the gateway probe, it determines that the first gateway device meets the first condition. The first interface includes an Application Programming Interface (API).
[0062] In one embodiment, after receiving the first request, the second gateway device mirrors the first data packet on the second gateway device based on the first request. That is, the first gateway device can control the second gateway device to mirror the first data packet on the second gateway device. Specifically, the first gateway device can control the second gateway device to mirror the first data packet to a designated port of the first gateway device through the Hypertext Transfer Protocol (HTTP) to obtain the mirrored packet of the first data packet.
[0063] Since the data collection frequency of network quality monitoring applications is low and the real-time performance is poor, this application embodiment uses HTTP short connections to realize communication between master and slave gateway devices. The slave gateway device is an HTTP server and the master gateway device is an HTTP client. However, since the IP addresses of the master and slave gateway devices in FTTR are dynamic and cannot be used as unique identifiers, this application embodiment uses the serial number (SN) of the second gateway device, i.e., the slave gateway device, as a unique identifier in the communication process for communication between the master and slave gateway devices.
[0064] Based on this, in one embodiment, sending the first request to the second gateway device includes:
[0065] Based on the mapping relationship between the SN and IP address of the second gateway device, determine the IP address of the second gateway device corresponding to the SN of the second gateway device;
[0066] Based on the IP address of the second gateway device, a first request is sent to the corresponding second gateway device.
[0067] Here, the first gateway device pre-stores a mapping table between the IP address and SN of the second gateway device. This mapping table includes the mapping relationship between the SN and IP address of the second gateway device. When the first and second gateway devices communicate, based on the pre-stored mapping relationship, the SN of the second gateway device is converted into its IP address. The first gateway device then sends a first request to the second gateway device using the second gateway device's IP address. The second gateway device records the IP address of the first gateway device according to Dynamic Host Configuration Protocol (DHCP) information, and the mapping table between the IP address and SN of the second gateway device can be updated according to the DHCP information.
[0068] In this embodiment of the application, the first gateway device, i.e., the FTTR master gateway device, can send a first request to the second gateway device, i.e., the FTTR slave gateway device, through an interaction interface, requesting the FTTR master gateway device to control the FTTR slave gateway device to mirror the first data packet. The interaction interface through which the FTTR master gateway device controls the FTTR slave device to perform packet mirroring is shown in Table 1:
[0069]
[0070]
[0071]
[0072] Table 1
[0073] Step 402: Receive the second data packet sent by the second gateway device; the second data packet is generated by the second gateway device based on the mirrored packet of the first data packet.
[0074] In practical applications, since the IP addresses of FTTR master and slave gateway devices are dynamic and cannot serve as unique identifiers, this application embodiment uses the SN of the second gateway device, i.e. the slave gateway device, as a unique identifier in the communication process for communication between the master and slave gateway devices.
[0075] Based on this, in one embodiment, receiving the second data packet sent by the second gateway device includes: determining the IP address of the second gateway device corresponding to the SN of the second gateway device based on the mapping relationship between the SN of the second gateway device and the IP address of the second gateway device; and receiving the second data packet sent by the second gateway device based on the IP address of the second gateway device.
[0076] In this embodiment of the application, the second data packet includes a mirror image of the first data packet and a timestamp, wherein the timestamp is set at the end of the mirror image of the first data packet.
[0077] Here, when the first gateway device communicates with the second gateway device, based on the pre-stored mapping table between the IP address and SN of the second gateway device, the SN of the second gateway device is converted into the IP address of the second gateway device, and the first gateway device receives the second data packet sent by the second gateway device through the IP address of the second gateway device.
[0078] Step 403: Mirror the third data packet on the first gateway device to obtain the mirrored packet of the third data packet.
[0079] In this embodiment of the application, the first gateway device uses the existing mirroring function in related technologies to mirror packets of the same domain name, that is, the domain name of the third data packet is the same as the domain name of the first data packet.
[0080] Step 404: Determine the DPI information of the second gateway device based on the mirrored message of the second data packet and the third data packet.
[0081] Here, after receiving the mirrored packets of the second and third data packets, the first gateway device analyzes the received mirrored packets of the second and third data packets to obtain the DPI information of the second gateway device.
[0082] In practical applications, the CPU performance of home gateways is generally weak, especially in scenarios with high-volume Wi-Fi forwarding and high CPU utilization. Both packet mirroring methods mentioned above will be affected, causing severe distortion in the time interval between two data packets (i.e., there is a difference between the TCP handshake delay obtained by the soft probe and the actual delay for the user). As a result, it is impossible to accurately determine the transmission delay between the FTTR master and slave gateways, nor can it accurately reflect the network connection quality between the FTTR master and slave gateways. Furthermore, a large amount of distorted packet delay data will also pose challenges to the subsequent evaluation of network connection quality.
[0083] In order to accurately determine the transmission delay between FTTR master and slave gateways, this application proposes a new method for calculating the transmission delay between FTTR master and slave gateways. Specifically, the transmission delay between FTTR master and slave gateways is determined based on the time points of the first and second handshake messages in the TCP three-way handshake delay.
[0084] Based on this, in one embodiment, the method further includes: determining a first time point and a second time point; the first time point represents the time point at which the first gateway device receives the data packet corresponding to the first handshake in the TCP three-way handshake, and the second time point represents the time point at which the second gateway device receives the data packet corresponding to the second handshake in the TCP three-way handshake; and determining the transmission delay between the first gateway device and the second gateway device based on the first time point and the second time point.
[0085] Here, the data packets corresponding to the first handshake are uplink packets, and the data packets corresponding to the second handshake are downlink packets.
[0086] Figure 5 This is a schematic diagram illustrating the method for representing transmission delay between master and slave gateways according to an embodiment of this application, as shown below. Figure 5As shown, in the first handshake of the TCP three-way handshake, the terminal reports data packet 1 (hereinafter referred to as packet 1) to the second gateway device (i.e., the slave gateway device). The slave gateway forwards packet 1 to the first gateway device (i.e., the master gateway device). Packet 1 is an uplink packet, the timestamp of packet 1 is S1, the uplink transmission delay between the master and slave gateways is t1, and the time point when the first gateway device receives packet 1 is M1. In the second handshake of the TCP three-way handshake, the master gateway sends data packet 2 (hereinafter referred to as packet 2) to the slave gateway. Message 2), the gateway sends message 2 to the terminal. Message 2 is a downlink message. The timestamp of message 2 is S2. The downlink transmission delay between the master and slave gateways is t2. The time point when the second gateway device receives message 2 is M2. During the third handshake of the TCP three-way handshake, the terminal reports data message 3 (which can be simply referred to as message 3) to the slave gateway. The slave gateway forwards message 3 to the master gateway. The timestamp of message 3 is S3. The uplink delay between the master and slave gateways is t3. The time point when the first gateway device receives message 3 is M3.
[0087] The following is combined Figure 5 The calculation process for the transmission delay between the first gateway device and the second gateway device, i.e. the transmission delay between the master and slave gateways, is explained in detail.
[0088] Assuming the actual forwarding time of the primary gateway packet is m, the actual forwarding time of the secondary gateway packet is s, the primary gateway packet probe capture time is M, the timestamp of the secondary gateway packet is S, the time difference between the primary and secondary gateways is Δt, the primary gateway packet processing delay is Δm, and the secondary gateway packet processing delay is Δs, then the time point M2 of downlink packet 2 can be obtained through the following formulas:
[0089] m=M-Δm
[0090] s=S-Δs
[0091] s+Δt=m+t
[0092] S2-Δs2+Δt=M2-Δm2+t2; where Δs2 represents the delay in the gateway message processing during the second handshake of the TCP three-way handshake, and Δm2 represents the delay in the master gateway message processing during the second handshake of the TCP three-way handshake.
[0093] The time point M1 of uplink message 1 can be obtained using the following formulas:
[0094] s+t1+Δt=m
[0095] S1-Δs1+t1+Δt=M1-Δm1; where Δs1 represents the delay in the gateway message processing during the first handshake of the TCP three-way handshake, and Δm1 represents the delay in the master gateway message processing during the first handshake of the TCP three-way handshake.
[0096] In other words, in practical applications, based on the actual arrival time of the message, the following formula can be derived:
[0097] S1-Δs1+t1+Δt=M1-Δm1
[0098] S2-Δs2+Δt=M2-Δm2+t2.
[0099] By converting these two formulas, we can derive the formula for calculating the uplink and downlink transmission latency of the master and slave gateways:
[0100] t1=M1-Δm1-S1+Δs1-Δt
[0101] t2=S2-Δs2+Δt-M2+Δm2.
[0102] However, the actual uplink and downlink transmission latency of the master and slave gateway devices is constrained by the physical channel, and the uplink and downlink transmission latency of the master and slave gateway devices are basically the same. Therefore, it can be concluded that:
[0103] S2-Δs2+Δt-M2+Δm2=M1-Δm1-S1+Δs1-Δt
[0104] Δt=(M1-S1-S2+M2) / 2+(Δs2-Δm2+Δs1-Δm1) / 2.
[0105] The average of multiple data sets can be expressed by the following formula:
[0106]
[0107] Therefore, the uplink transmission delay t1 between the master and slave gateway devices can be expressed as:
[0108] t1=M1-Δm1-S1+Δs1-Δt,
[0109] Expressing Δt-Δs1+Δm1 as the average value, the uplink transmission delay t1 between the master and slave gateway devices can also be expressed as:
[0110]
[0111] Similarly, the downlink transmission delay t2 between the master and slave gateway devices can be expressed as:
[0112]
[0113] Based on the above deduction process, and considering the time points at which the master and slave gateway devices receive data packets in the first and second handshakes of multiple TCP three-way handshake messages, the transmission delay between the master and slave gateway devices for a single packet can be accurately calculated.
[0114] In practical applications, after calculating the transmission delay between the master and slave gateway devices, the first gateway device can also determine the network connection quality between the master and slave gateway devices based on the magnitude of the transmission delay.
[0115] Based on this, in one embodiment, after determining the transmission delay between the first gateway device and the second gateway device, the method further includes: evaluating the network connection quality between the first gateway device and the second gateway device based on the transmission delay between the first gateway device and the second gateway device.
[0116] Here, when the transmission delay between the first gateway device and the second gateway device is greater than a set threshold, the network connection quality between the first gateway device and the second gateway device is determined to be a first quality; when the transmission delay between the first gateway device and the second gateway device is less than or equal to the set threshold, the network connection quality between the first gateway device and the second gateway device is determined to be a second quality, wherein the second quality is better than the first quality.
[0117] Figure 6 This is a schematic diagram of the FTTR gateway quality monitoring architecture according to an embodiment of this application, as shown below. Figure 6As shown, the FTTR gateway quality monitoring architecture includes a provincial digital home management platform, an FTTR master gateway, FTTR slave gateways, and terminals. The provincial digital home management platform is connected to the FTTR master gateway via the transmission and bearer network. The provincial digital home management platform includes gateway functions (including API permissions), plug-in management, and software probes. Plug-in management includes the management of multiple plug-ins, such as plug-ins A, B, C, and D. The FTTR master gateway includes access functions, networking functions, and the Open Service Gateway Initiative (OSGI) specification of the open platform. The FTTR master gateway is connected to the FTTR slave gateways via the OSGI API interface. The FTTR slave gateways are connected to the terminals via Ethernet / WIFI. The terminals include cameras, set-top boxes, computers, mobile phones, or tablets. The FTTR master gateway sends a mirroring command to the FTTR slave gateway via its gateway IP address, controlling the slave gateway to mirror specified packets to a designated port of the FTTR master gateway. Upon receiving the mirroring command, the slave gateway mirrors the required packets to its CPU. The slave gateway's CPU adds a timestamp to the end of the packet (i.e., fills in a single-packet timestamp) and performs UDP encapsulation. The encapsulated packet is then sent to the designated port of the FTTR master gateway via UDP. Simultaneously, the FTTR master gateway uses its existing mirroring function to mirror packets of the same domain name. The master gateway analyzes the packets of the same domain name mirrored by both the master and slave gateways to obtain the slave gateway's DPI information. The master gateway then determines the transmission delay between the master and slave gateways and uses the transmission delay magnitude to judge the network connection quality between them.
[0118] In practical applications, when the CPU load is too high instantaneously, the transmission delay of the collected messages becomes significantly distorted. Related technologies cannot solve the problem of message transmission delay errors caused by excessive CPU load. Therefore, this application proposes a method for correcting the transmission delay distortion of collected messages caused by excessive CPU load on the slave gateway, using a master-slave gateway working together.
[0119] Based on this, in one embodiment, after determining the transmission delay between the first gateway device and the second gateway device, the method further includes:
[0120] For the same data packet, a third time point and a fourth time point are determined; the third time point represents the time point at which the first gateway device corresponding to the target second handshake in the TCP three-way handshake receives the data packet, and the fourth time point represents the time point at which the second gateway device corresponding to the target second handshake in the TCP three-way handshake receives the data packet.
[0121] A fifth time point is determined based on the fourth time point and the transmission delay between the first gateway device and the second gateway device; the fifth time point represents the time point at which the fourth time point is updated.
[0122] Based on the minimum value between the third time point and the fifth time point, the corrected delay value corresponding to the target handshake in the TCP three-way handshake is determined.
[0123] Figure 7 This is a schematic diagram of the TCP three-way handshake interaction in an embodiment of this application, as shown below. Figure 7 As shown, a TCP three-way handshake process is implemented between the terminal (i.e., the PC), the gateway (including the FTTR master gateway and the FTTR slave gateway), and the server. In the method for determining the DPI information of the FTTR slave gateway in this application embodiment, the main indicators obtained include: the delay of the first and second handshakes in the TCP three-way handshake, the delay of the second and third handshakes in the TCP three-way handshake, the retransmission rate, jitter, etc., wherein the delay of the first and second handshakes in the TCP three-way handshake represents the transmission quality outside the access network of a single service, and the delay of the second and third handshakes in the TCP three-way handshake represents the transmission quality of the home intranet.
[0124] Based on experience with the latency of TCP packet processing in typical home gateways, most gateways have a latency of less than 1 millisecond. In rare extreme cases, the latency of packet processing can reach more than 500 milliseconds, especially for gateways with MIPS architecture chips.
[0125] This application proposes a method for simultaneously collecting TCP latency data of the same data packet on both the FTTR master gateway and the FTTR slave gateway, and correcting the packet's timing by selecting the minimum timing point between the two timing points of a single packet on the master gateway. The specific algorithm is as follows:
[0126] 1. Calculate the packet time point corresponding to the first handshake in the TCP handshake information on the main gateway.
[0127] Assuming the time point of the message corresponding to the first handshake collected by the master gateway is M1 (corresponding to the time point when the first gateway device receives the data packet in the first handshake of the aforementioned TCP three-way handshake), and the time point of the message corresponding to the first handshake collected by the slave gateway is S1 (corresponding to the time point when the second gateway device receives the data packet in the first handshake of the aforementioned TCP three-way handshake), and the transmission delay between the master and slave gateways during the first handshake is t1, then the corrected first handshake delay is: min(M1, S1+t1).
[0128] 2. Calculate the message time point corresponding to the second handshake in the TCP handshake information on the main gateway.
[0129] Assuming the time point of the message corresponding to the second handshake collected by the master gateway is M2 (corresponding to the time point when the first gateway device receives the data packet in the second handshake of the aforementioned TCP three-way handshake), and the time point of the message corresponding to the second handshake collected by the slave gateway is S2 (corresponding to the time point when the second gateway device receives the data packet in the second handshake of the aforementioned TCP three-way handshake), and the transmission delay between the master and slave gateways during the second handshake is t2, then the corrected second handshake delay is: min(M2, S2-t2).
[0130] 3. Calculate the message time point corresponding to the third handshake in the TCP handshake information on the main gateway.
[0131] Assuming the time point of the message corresponding to the third handshake collected by the master gateway is M3 (corresponding to the time point when the first gateway device receives the data packet in the aforementioned TCP three-way handshake), and the time point of the message corresponding to the third handshake collected by the slave gateway is S3 (corresponding to the time point when the second gateway device receives the data packet in the aforementioned TCP three-way handshake), and the transmission delay between the master and slave gateways during the third handshake is t3, then the corrected third handshake delay is: min(M3, S3+t3).
[0132] Based on this, the TCP first and second handshake delay values are M2-M1 = min(M2, S2-t2)-min(M1, S1+t1); the TCP second and third handshake delay values are M3-M2 = min(M3, S3+t3)-min(M2, S2-t2).
[0133] Therefore, it can be seen that the embodiments of this application can compensate for the delay error caused by excessive CPU load of the master or slave gateway by taking the minimum value of the time points of the same message passing through the FTTR master / slave gateway as the corrected message time point.
[0134] This application also provides another message processing method, which is applied to a second gateway device, wherein the second gateway device is a slave gateway device. Figure 8 This is a flowchart illustrating the message processing method of an embodiment of this application. Figure 2 ;like Figure 8 As shown, the method includes:
[0135] Step 801: Receive a first request sent by the first gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, wherein the first data packet is a data packet with a specified domain name.
[0136] Here, after receiving the first request, the second gateway device mirrors the first data packet based on the first request. That is, the first gateway device can control the second gateway device to mirror the first data packet. Specifically, the first gateway device can control the second gateway device to mirror the first data packet to a specified port of the first gateway device via the HTTP protocol, thereby obtaining the mirrored packet of the first data packet. The first gateway device is the main gateway device.
[0137] Step 802: Generate a second data packet based on the mirror image of the first data packet.
[0138] In one embodiment, generating a second data packet based on a mirrored packet of the first data packet includes:
[0139] A timestamp is added to the target location of the mirror image of the first data packet to obtain the second data packet; wherein the target location includes the tail of the mirror image of the first data packet.
[0140] Step 803: Send the second data packet to the first gateway device so that the first gateway device can determine the DPI information of the second gateway device based on the mirrored packets of the second data packet and the third data packet.
[0141] The mirrored message of the third data packet is obtained by the first gateway device mirroring the third data packet on the first gateway device, and the domain name of the third data packet is the same as the domain name of the first data packet.
[0142] Here, the second gateway device sends the second data packet to the first gateway device. Specifically, the second data packet can be sent to a designated port of the first gateway device via the UDP protocol.
[0143] In this embodiment, the main gateway device mirrors the third data packet, which has the same domain name as the first data packet. The main gateway device and the slave gateway device simultaneously mirror the data packet with the same domain name to obtain the DPI information of the slave gateway. It can be seen that this embodiment uses the main gateway device to determine the DPI information of the slave gateway device. It does not require the slave gateway's CPU to be fully used for slave gateway DPI analysis. Instead, it can effectively monitor the slave gateway's DPI information based on the cooperation of the CPU computing resources of the main and slave gateways, which can save the slave gateway's CPU resources.
[0144] This application also provides another message processing method. Figure 9 This is a flowchart illustrating the message processing method of an embodiment of this application. Figure 3 ;like Figure 9 As shown, the method includes:
[0145] Step 901: The first gateway device sends a first request to the second gateway device.
[0146] Here, the first request is used to request the second gateway device to mirror a first data packet on the second gateway device. The first data packet is a data packet with a specified domain name. The first gateway device is the master gateway device, and the second gateway device is the slave gateway device.
[0147] Step 902: After receiving the first request, the second gateway device mirrors the first data packet on the second gateway device based on the first request to obtain the mirrored packet of the first data packet.
[0148] Step 903: The second gateway device generates a second data packet based on the mirrored packet of the first data packet, and sends the second data packet to the first gateway device.
[0149] Step 904: The first gateway device receives the second data packet sent by the second gateway device.
[0150] Step 905: The first gateway device mirrors the third data packet on the first gateway device to obtain a mirrored packet of the third data packet.
[0151] Here, the domain name of the third data packet is the same as the domain name of the first data packet.
[0152] Step 906: The first gateway device determines the DPI information of the second gateway device based on the mirrored message of the second and third data packets.
[0153] It should be noted that the specific processing procedures for the first and second gateway devices to process the packets have been detailed above and will not be repeated here.
[0154] To implement the message processing method on the first gateway device side of this application embodiment, this application embodiment also provides a message processing apparatus, which is applied to the first gateway device, wherein the first gateway device is a main gateway device. Figure 10 This is a schematic diagram of the composition structure of the message processing apparatus according to an embodiment of this application. Figure 1 ;like Figure 10 As shown, the message processing device includes:
[0155] The first sending unit 1001 is used to send a first request to the second gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet is a data packet with a specified domain name, and the second gateway device is a slave gateway device.
[0156] The first receiving unit 1002 is configured to receive a second data packet sent by the second gateway device; the second data packet is generated by the second gateway device based on a mirrored packet of the first data packet;
[0157] The mirroring unit 1003 is used to mirror the third data packet on the first gateway device to obtain a mirrored packet of the third data packet; the domain name of the third data packet is the same as the domain name of the first data packet.
[0158] The first determining unit 1004 is used to determine the DPI information of the second gateway device based on the mirror message of the second data packet and the third data packet.
[0159] In one embodiment, the first transmitting unit 1001 includes a determining subunit and a transmitting subunit; wherein,
[0160] The determining subunit is used to determine whether the first gateway device meets the first condition;
[0161] The sending subunit is configured to send a first request to the second gateway device when the determining subunit determines that the first gateway device meets the first condition;
[0162] The determining subunit is specifically used for:
[0163] If it is determined that the first gateway device has received the second request sent by the gateway probe, it is determined that the first gateway device satisfies the first condition;
[0164] The second request is used to request the first gateway device to control the second gateway device to mirror data packets of a specified domain name.
[0165] In another embodiment, the first transmitting unit 1001 is specifically used for:
[0166] Based on the mapping relationship between the SN and IP address of the second gateway device, determine the IP address of the second gateway device corresponding to the SN of the second gateway device;
[0167] Based on the IP address of the second gateway device, a first request is sent to the corresponding second gateway device.
[0168] In this embodiment of the application, the second data packet includes a mirror image of the first data packet and a timestamp, wherein the timestamp is set at the end of the mirror image of the first data packet.
[0169] In one embodiment, the device further includes: a second determining unit and a third determining unit; wherein,
[0170] The second determining unit is used to determine a first time point and a second time point; the first time point represents the time point at which the first gateway device receives the data packet corresponding to the first handshake in the TCP three-way handshake, and the second time point represents the time point at which the second gateway device receives the data packet corresponding to the second handshake in the TCP three-way handshake;
[0171] The third determining unit is used to determine the transmission delay between the first gateway device and the second gateway device based on the first time point and the second time point.
[0172] In one embodiment, the apparatus further includes: an evaluation unit; wherein,
[0173] The evaluation unit is used to evaluate the network connection quality between the first gateway device and the second gateway device based on the transmission delay between the first gateway device and the second gateway device after the third determining unit determines the transmission delay between the first gateway device and the second gateway device.
[0174] In one embodiment, the device further includes: a fourth determining unit, a fifth determining unit, and a sixth determining unit; wherein,
[0175] The fourth determining unit is used to determine a third time point and a fourth time point for the same data packet after the third determining unit determines the transmission delay between the first gateway device and the second gateway device; the third time point represents the time point at which the first gateway device receives the data packet corresponding to the target second handshake in the TCP three-way handshake, and the fourth time point represents the time point at which the second gateway device receives the data packet corresponding to the target second handshake in the TCP three-way handshake.
[0176] The fifth determining unit is used to determine a fifth time point based on the fourth time point and the transmission delay between the first gateway device and the second gateway device; the fifth time point represents the time point at which the fourth time point is updated;
[0177] The sixth determining unit is used to determine the corrected delay value corresponding to the target handshake in the TCP three-way handshake based on the minimum value between the third time point and the fifth time point.
[0178] In practical applications, the first sending unit 1001 and the first receiving unit 1002 can be implemented by the communication interface in the message processing device, and the mirroring unit 1003 and the first determining unit 1004 can be implemented by the processor in the message processing device.
[0179] It should be noted that the message processing device provided in the above embodiments is only illustrated by the division of the above program modules. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the message processing device provided in the above embodiments and the message processing method embodiment on the first gateway device side belong to the same concept. For details of its specific implementation process, please refer to the message processing method embodiment on the first gateway device side, which will not be repeated here.
[0180] In order to implement the message processing method on the second gateway device side of the present application embodiment, the present application embodiment also provides another message processing apparatus, which is applied to the second gateway device, and the second gateway device is a slave gateway device; Figure 11 This is a schematic diagram of the composition structure of the message processing apparatus according to an embodiment of this application. Figure 2 ;like Figure 11 As shown, the message processing device includes:
[0181] The second receiving unit 1101 is used to receive a first request sent by the first gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet is a data packet with a specified domain name, and the first gateway device is a main gateway device.
[0182] The generation unit 1102 is used to generate a second data packet based on the mirrored packet of the first data packet;
[0183] The second sending unit 1103 is used to send the second data packet to the first gateway device so that the first gateway device can determine the DPI information of the second gateway device based on the mirrored packet of the second data packet and the third data packet;
[0184] The mirrored message of the third data packet is obtained by the first gateway device mirroring the third data packet on the first gateway device, and the domain name of the third data packet is the same as the domain name of the first data packet.
[0185] In one embodiment, the generation unit 1102 is specifically used for:
[0186] Add a timestamp at the target location of the mirror image of the first data packet to obtain the second data packet;
[0187] The target location includes the tail of the mirror image of the first data packet.
[0188] In practical applications, the second receiving unit 1101 and the second sending unit 1103 can be implemented by the communication interface in the message processing device; the generating unit 1102 can be implemented by the processor in the message processing device.
[0189] It should be noted that the message processing device provided in the above embodiments is only illustrated by the division of the above program modules. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the message processing device provided in the above embodiments and the message processing method embodiment on the second gateway device side belong to the same concept. For details of its specific implementation process, please refer to the message processing method embodiment on the second gateway device side, which will not be repeated here.
[0190] Based on the hardware implementation of the above program modules, and in order to implement the message processing method on the first gateway device side of this application embodiment, this application embodiment also provides a first gateway device, wherein the first gateway device is a main gateway device. Figure 12 This is a schematic diagram of the hardware structure of the first gateway device according to an embodiment of this application; as shown Figure 12 As shown, the first gateway device 1200 includes:
[0191] The first communication interface 1201 is capable of exchanging information with the second gateway device;
[0192] The first processor 1202 is connected to the first communication interface 1201 to enable information interaction with the second gateway device. When running a computer program, it executes the message processing method provided on the first gateway device side. The computer program is stored in the first memory 1203.
[0193] Specifically, the first communication interface 1201 is used to send a first request to the second gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet being a data packet with a specified domain name, and the second gateway device being a slave gateway device;
[0194] The first communication interface 1201 is also used to receive a second data packet sent by the second gateway device; the second data packet is generated by the second gateway device based on a mirrored packet of the first data packet;
[0195] The first processor 1202 is configured to mirror a third data packet on the first gateway device to obtain a mirrored packet of the third data packet; the domain name of the third data packet is the same as the domain name of the first data packet.
[0196] The first processor 1202 is further configured to determine the DPI information of the second gateway device based on the mirror message of the second data packet and the third data packet.
[0197] In one embodiment, the first processor 1202 is further configured to determine whether the first gateway device meets the first condition;
[0198] The first communication interface 1201 is specifically used to: send a first request to the second gateway device when the first processor 1202 determines that the first gateway device meets the first condition;
[0199] The first processor 1202 is specifically used for:
[0200] If it is determined that the first gateway device has received the second request sent by the gateway probe, it is determined that the first gateway device satisfies the first condition;
[0201] The second request is used to request the first gateway device to control the second gateway device to mirror data packets of a specified domain name.
[0202] In one embodiment, the first communication interface 1201 is specifically used for:
[0203] Based on the mapping relationship between the SN and IP address of the second gateway device, determine the IP address of the second gateway device corresponding to the SN of the second gateway device;
[0204] Based on the IP address of the second gateway device, a first request is sent to the corresponding second gateway device.
[0205] In this embodiment of the application, the second data packet includes a mirror image of the first data packet and a timestamp, wherein the timestamp is set at the end of the mirror image of the first data packet.
[0206] In one embodiment, the first processor 1202 is further configured to determine a first time point and a second time point; the first time point represents the time point at which the first gateway device receives the data packet corresponding to the first handshake in the TCP three-way handshake, and the second time point represents the time point at which the second gateway device receives the data packet corresponding to the second handshake in the TCP three-way handshake;
[0207] The first processor 1202 is further configured to determine the transmission delay between the first gateway device and the second gateway device based on the first time point and the second time point.
[0208] In one embodiment, the first processor 1202 is further configured to, after determining the transmission delay between the first gateway device and the second gateway device, evaluate the network connection quality between the first gateway device and the second gateway device based on the transmission delay between the first gateway device and the second gateway device.
[0209] In one embodiment, the first processor 1202 is further configured to, after determining the transmission delay between the first gateway device and the second gateway device, determine a third time point and a fourth time point for the same data packet; the third time point represents the time point at which the first gateway device receives the data packet corresponding to the target second handshake in the TCP three-way handshake, and the fourth time point represents the time point at which the second gateway device receives the data packet corresponding to the target second handshake in the TCP three-way handshake.
[0210] The first processor 1202 is further configured to determine a fifth time point based on the fourth time point and the transmission delay between the first gateway device and the second gateway device; the fifth time point represents the time point at which the fourth time point is updated;
[0211] The first processor 1202 is further configured to determine the corrected delay value corresponding to the target handshake in the TCP three-way handshake based on the minimum value between the third time point and the fifth time point.
[0212] It should be noted that the specific processing procedures of the first communication interface 1201 and the first processor 1202 can be understood by referring to the message processing method on the first gateway device side described above.
[0213] Of course, in practical applications, the various components in the first gateway device 1200 are coupled together through the first bus system 1204. It can be understood that the first bus system 1204 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 1204 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 12 The general designated all buses as the first bus system 1204.
[0214] The first memory 1203 in this embodiment is used to store various types of data to support the operation of the first gateway device 1200. Examples of such data include any computer program used to operate on the first gateway device 1200.
[0215] The message processing method for the first gateway device side disclosed in the above embodiments of this application can be applied to the first processor 1202, or implemented by the first processor 1202. The first processor 1202 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the message processing method for the first gateway device side can be completed by the integrated logic circuit of the hardware or the instructions in the software form in the first processor 1202. The first processor 1202 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 1202 can implement or execute the message processing methods, steps and logic block diagrams for the first gateway device side disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the message processing method for the first gateway device side disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the first memory 1203. The first processor 1202 reads the information in the first memory 1203 and, in conjunction with its hardware, completes the steps of the aforementioned message processing method on the first gateway device side.
[0216] In an exemplary embodiment, the first gateway device 1200 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned message processing method on the first gateway device side.
[0217] Based on the hardware implementation of the above program modules, and in order to implement the message processing method on the second gateway device side of this application embodiment, this application embodiment also provides a second gateway device, which is a slave gateway device. Figure 13 This is a schematic diagram of the hardware structure of the second gateway device according to an embodiment of this application; as shown Figure 13 As shown, the second gateway device 1300 includes:
[0218] The second communication interface 1301 is capable of exchanging information with the first gateway device;
[0219] The second processor 1302 is connected to the second communication interface 1301 to enable information interaction with the first gateway device. When running a computer program, it executes the message processing method provided on the second gateway device side. The computer program is stored in the second memory 1303.
[0220] Specifically, the second communication interface 1301 is used to receive a first request sent by the first gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet being a data packet with a specified domain name, and the first gateway device being the main gateway device;
[0221] The second processor 1302 is used to generate a second data packet based on a mirror image of the first data packet;
[0222] The second communication interface 1301 is also used to send the second data packet to the first gateway device, so that the first gateway device can determine the DPI information of the second gateway device based on the mirrored packet of the second data packet and the third data packet;
[0223] The mirrored message of the third data packet is obtained by the first gateway device mirroring the third data packet on the first gateway device, and the domain name of the third data packet is the same as the domain name of the first data packet.
[0224] In one embodiment, the second processor 1302 is specifically used for:
[0225] Add a timestamp at the target location of the mirror image of the first data packet to obtain the second data packet;
[0226] The target location includes the tail of the mirror image of the first data packet.
[0227] It should be noted that the specific processing procedures of the second communication interface 1301 and the second processor 1302 can be understood by referring to the message processing method on the second gateway device side described above.
[0228] Of course, in practical applications, the various components in the second gateway device 1300 are coupled together through the second bus system 1304. It can be understood that the second bus system 1304 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 1304 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 13 The general designated all buses as the second bus system 1304.
[0229] The second memory 1303 in this embodiment is used to store various types of data to support the operation of the second gateway device 1300. Examples of such data include any computer program used to operate on the second gateway device 1300.
[0230] The message processing method for the second gateway device side disclosed in the above embodiments of this application can be applied to the second processor 1302, or implemented by the second processor 1302. The second processor 1302 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the message processing method for the second gateway device side can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the second processor 1302. The second processor 1302 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The second processor 1302 can implement or execute the message processing methods, steps, and logic block diagrams for the second gateway device side disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the message processing method for the second gateway device side disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the second memory 1303. The second processor 1302 reads the information in the second memory 1303 and, in conjunction with its hardware, completes the steps of the aforementioned message processing method on the second gateway device side.
[0231] In an exemplary embodiment, the second gateway device 1300 may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs (Micro Controller Units), microprocessors, or other electronic components to execute the aforementioned message processing method on the second gateway device side.
[0232] It is understood that the memory (including the first memory 1203 and the second memory 1303) in the embodiments of this application can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application (including the first memory 1203 and the second memory 1303) are intended to include, but are not limited to, these and any other suitable types of memories.
[0233] To implement the message processing method of this application embodiment, this application embodiment also provides a message processing system. Figure 14 This is a schematic diagram of the composition structure of the message processing system according to an embodiment of this application, as shown below. Figure 14 As shown, the message processing system includes: a first gateway device 1200 and a second gateway device 1300; the first gateway device 1200 is the master gateway device, and the second gateway device 1300 is the slave gateway device; wherein,
[0234] The first gateway device 1200 is configured to send a first request to the second gateway device; receive a second data packet sent by the second gateway device; and mirror a third data packet on the first gateway device to obtain a mirrored packet of the third data packet.
[0235] The second gateway device 1300 is configured to receive a first request sent by the first gateway device; generate a second data packet based on a mirrored packet of the first data packet; and send the second data packet to the first gateway device.
[0236] The first gateway device 1200 is further configured to determine the DPI information of the second gateway device based on the mirrored message of the second data packet and the third data packet.
[0237] Wherein, the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet being a data packet with a specified domain name; the second data packet is generated by the second gateway device based on the mirrored packet of the first data packet; the domain name of the third data packet is the same as the domain name of the first data packet.
[0238] It should be noted that the specific processing procedures of the first gateway device 1200 and the second gateway device 1300 have been detailed above and will not be repeated here.
[0239] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a first memory 1203 storing a computer program, which can be executed by a first processor 1202 in a first gateway device 1200 to complete the steps of the message processing method on the first gateway device side described in the aforementioned embodiment. Alternatively, it may include a second memory 1303 storing a computer program, which can be executed by a second processor 1302 in a second gateway device 1300 to complete the steps of the message processing method on the second gateway device side described in the aforementioned embodiment. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0240] In an exemplary embodiment, this application also provides a computer program product, including a computer program that can be executed by a first processor 1202 in a first gateway device 1200 to complete the steps of the message processing method on the first gateway device side described in the aforementioned embodiment, or can be executed by a second processor 1302 in a second gateway device 1300 to complete the steps of the message processing method on the second gateway device side described in the aforementioned embodiment.
[0241] It should be noted that terms such as "first," "second," and "third" are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0242] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0243] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method of processing a packet, the method comprising: The method is applied to a first gateway device, the first gateway device is a master gateway device, and the method comprises: sending a first request to a second gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet is a data packet of a specified domain name, and the second gateway device is a slave gateway device; receiving a second data packet sent by the second gateway device; the second data packet is generated by the second gateway device based on a mirror packet of the first data packet; mirroring a third data packet on the first gateway device to obtain a mirror packet of the third data packet; the domain name of the third data packet is the same as that of the first data packet; determining deep packet inspection (DPI) information of the second gateway device based on the second data packet and the mirror packet of the third data packet; The method further comprises: determining a transmission delay between the first gateway device and the second gateway device; determining a third time point and a fourth time point for the same data packet; the third time point represents a time point at which the first gateway device receives a data packet corresponding to a target second handshake in a TCP three-way handshake, and the fourth time point represents a time point at which the second gateway device receives a data packet corresponding to the target second handshake in the TCP three-way handshake; determining a fifth time point based on the fourth time point and the transmission delay between the first gateway device and the second gateway device; the fifth time point represents a time point at which the fourth time point is updated; determining a corrected delay value corresponding to the target second handshake in the TCP three-way handshake based on the minimum value of the third time point and the fifth time point; When the target second handshake is the first handshake or the third handshake, the third time point is a time point at which the first gateway device receives a data packet sent by the second gateway device, and the fourth time point is a time point at which the second gateway device receives a data packet sent by a terminal; when the target second handshake is the second handshake, the third time point is a time point at which the first gateway device receives a data packet sent by the second gateway device, and the fourth time point is a time point at which the second gateway device receives a data packet sent by the first gateway device.
2. The method of claim 1, wherein, The first request sent to the second gateway device comprises: determining whether the first gateway device meets a first condition; when it is determined that the first gateway device meets the first condition, sending a first request to a second gateway device; The determination of whether the first gateway device meets the first condition comprises: when it is determined that the first gateway device receives a second request sent by a gateway probe, it is determined that the first gateway device meets the first condition; The second request is used to request the first gateway device to control the second gateway device to mirror a data packet of a specified domain name.
3. The method of claim 1, wherein, The first request sent to the second gateway device comprises: determine, based on a mapping relationship between a serial number (SN) of the second gateway device and an Internet Protocol (IP) address of the second gateway device, an IP address of the second gateway device corresponding to the SN of the second gateway device; send, based on the IP address of the second gateway device, a first request to the corresponding second gateway device.
4. The method of claim 1, wherein, The second data packet includes a mirror packet of the first data packet and a timestamp, and the timestamp is arranged at the tail of the mirror packet of the first data packet.
5. The method of claim 1, wherein, The determination of the transmission delay between the first gateway device and the second gateway device comprises: determining a first time point and a second time point; the first time point represents a time point at which the first gateway device receives a data packet sent by the second gateway device in the first handshake of a Transmission Control Protocol (TCP) three-way handshake, and the data packet is sent by a terminal to the second gateway device; the second time point represents a time point at which the second gateway device receives a data packet sent by the first gateway device in the second handshake of the TCP three-way handshake; determine, based on the first time point and the second time point, the transmission delay between the first gateway device and the second gateway device.
6. The method of claim 5, wherein, After determining the transmission delay between the first gateway device and the second gateway device, the method further comprises: based on the transmission delay between the first gateway device and the second gateway device, evaluating the network connection quality between the first gateway device and the second gateway device.
7. A method of processing a packet, the method comprising: The method is applied to a second gateway device, which is a slave gateway device, and comprises: receiving a first request sent by a first gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet is a data packet of a specified domain name, and the first gateway device is a master gateway device; generating a second data packet based on a mirror packet of the first data packet; sending the second data packet to the first gateway device, so that the first gateway device determines Deep Packet Inspection (DPI) information of the second gateway device and determines a transmission delay between the first gateway device and the second gateway device based on the second data packet and a mirror packet of a third data packet; for the same data packet, a third time point and a fourth time point are determined; the third time point represents a time point at which the first gateway device receives a data packet in a target handshake of a TCP three-way handshake, and the fourth time point represents a time point at which the second gateway device receives a data packet in the target handshake of the TCP three-way handshake; a fifth time point is determined based on the fourth time point and the transmission delay between the first gateway device and the second gateway device; the fifth time point represents a time point at which the fourth time point is updated; a corrected delay value corresponding to the target handshake of the TCP three-way handshake is determined based on the minimum value of the third time point and the fifth time point. The mirror packet of the third data packet is obtained by mirroring the third data packet on the first gateway device, and the domain name of the third data packet is the same as the domain name of the first data packet; when the target secondary handshake is the first handshake or the third handshake, the third time point is a time point at which the first gateway device receives the data packet sent by the second gateway device, and the fourth time point is a time point at which the second gateway device receives the data packet sent by the terminal; when the target secondary handshake is the second handshake, the third time point is a time point at which the first gateway device receives the data packet sent by the second gateway device, and the fourth time point is a time point at which the second gateway device receives the data packet sent by the first gateway device.
8. The method of claim 7, wherein, The mirror packet of the first data packet is used to generate a second data packet, including: A timestamp is added at a target position of the mirror packet of the first data packet to obtain the second data packet; The target position includes a tail of the mirror packet of the first data packet.
9. A packet processing device, characterized by The device is applied to a first gateway device, the first gateway device is a master gateway device, and the device includes: A first sending unit configured to send a first request to a second gateway device; the first request is used to request the second gateway device to mirror a first data packet on the second gateway device, the first data packet is a data packet of a specified domain name, and the second gateway device is a slave gateway device; A first receiving unit configured to receive a second data packet sent by the second gateway device; the second data packet is generated by the second gateway device based on a mirror packet of the first data packet; A mirroring unit configured to mirror a third data packet on the first gateway device to obtain a mirror packet of the third data packet; the domain name of the third data packet is the same as the domain name of the first data packet; A first determining unit configured to determine deep packet inspection (DPI) information of the second gateway device based on the second data packet and the mirror packet of the third data packet; The device further includes: A third determining unit configured to determine a transmission delay between the first gateway device and the second gateway device; A fourth determining unit configured to, after the third determining unit determines the transmission delay between the first gateway device and the second gateway device, determine a third time point and a fourth time point for the same data packet; the third time point represents a time point at which the first gateway device receives a data packet corresponding to a target secondary handshake in a TCP three-way handshake, and the fourth time point represents a time point at which the second gateway device receives a data packet corresponding to the target secondary handshake in the TCP three-way handshake; A fifth determining unit configured to determine a fifth time point based on the fourth time point and the transmission delay between the first gateway device and the second gateway device; the fifth time point represents a time point at which the fourth time point is updated. The sixth determining unit is configured to determine a corrected time delay value corresponding to a target second handshake in the TCP three-way handshake based on a minimum value of the third time point and the fifth time point. In a case where the target second handshake is the first handshake or the third handshake, the third time point is a time point at which the first gateway device receives a data packet sent by the second gateway device, and the fourth time point is a time point at which the second gateway device receives a data packet sent by a terminal. In a case where the target second handshake is the second handshake, the third time point is a time point at which the first gateway device receives a data packet sent by the second gateway device, and the fourth time point is a time point at which the second gateway device receives a data packet sent by the first gateway device.
10. A packet processing device, characterized by, The application is applied to a second gateway device, which is a slave gateway device. The apparatus comprises: The second receiving unit is configured to receive a first request sent by a first gateway device. The first request is used to request the second gateway device to mirror a first data packet on the second gateway device. The first data packet is a data packet of a specified domain name. The first gateway device is a master gateway device. The generating unit is configured to generate a second data packet based on a mirrored packet of the first data packet. The second sending unit is configured to send the second data packet to the first gateway device, so that the first gateway device determines deep packet inspection (DPI) information of the second gateway device and determines a transmission time delay between the first gateway device and the second gateway device based on the second data packet and a mirrored packet of a third data packet. A third time point and a fourth time point are determined for the same data packet. The third time point represents a time point at which the first gateway device receives a data packet corresponding to a target second handshake in a TCP three-way handshake. The fourth time point represents a time point at which the second gateway device receives a data packet corresponding to the target second handshake in the TCP three-way handshake. A fifth time point is determined based on the fourth time point and the transmission time delay between the first gateway device and the second gateway device. The fifth time point represents a time point at which the fourth time point is updated. A corrected time delay value corresponding to the target second handshake in the TCP three-way handshake is determined based on a minimum value of the third time point and the fifth time point. The third data message is mirrored by the first gateway device from a third data message on the first gateway device, and a domain name of the third data message is the same as a domain name of the first data message; when the target secondary handshake is a first handshake or a third handshake, the third time point is a time point at which the first gateway device receives a data message sent by the second gateway device, and the fourth time point is a time point at which the second gateway device receives a data message sent by a terminal; when the target secondary handshake is a second handshake, the third time point is a time point at which the first gateway device receives a data message sent by the second gateway device, and the fourth time point is a time point at which the second gateway device receives a data message sent by the first gateway device.
11. A first gateway device, comprising: Comprising: a first processor and a first memory for storing a computer program capable of running on the first processor; wherein the first processor, when running the computer program, executes the steps of the method of any one of claims 1 to 6.
12. A second gateway device, comprising: Comprising: a second processor and a second memory for storing a computer program capable of running on the second processor; wherein the second processor, when running the computer program, executes the steps of the method of claim 7 or 8.
13. A storage medium having stored thereon a computer program, characterized in that The computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 6, or implements the steps of the method of claim 7 or 8.
14. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 6, or implements the steps of the method of claim 7 or 8.
Citation Information
Patent Citations
Gateway AP transmitting power adaptive adjustment method, storage medium and gateway equipment
CN112804743A
Information statistical system and method
CN116781796A